summaryrefslogtreecommitdiff
path: root/sql/sql_admin.cc
diff options
context:
space:
mode:
authorMonty <monty@mariadb.org>2018-05-24 11:08:02 +0300
committerMonty <monty@mariadb.org>2018-05-24 11:08:02 +0300
commite744c687ca2c2523b63d5ac0066276a6cb3e932f (patch)
tree7d3fbd9457d9a6f074d4c8dbb925fcb65730e135 /sql/sql_admin.cc
parent5797cbaf4ab93cdae191486c6c82be79b83c56d2 (diff)
parenta816aa066e5c879a92819d694a93d245e6ec6e47 (diff)
downloadmariadb-git-e744c687ca2c2523b63d5ac0066276a6cb3e932f.tar.gz
Merge remote-tracking branch 'origin/10.0' into 10.1
Diffstat (limited to 'sql/sql_admin.cc')
-rw-r--r--sql/sql_admin.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/sql/sql_admin.cc b/sql/sql_admin.cc
index ef7a2e82338..be23cd3341b 100644
--- a/sql/sql_admin.cc
+++ b/sql/sql_admin.cc
@@ -302,7 +302,7 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
HA_CHECK_OPT* check_opt,
const char *operator_name,
thr_lock_type lock_type,
- bool open_for_modify,
+ bool org_open_for_modify,
bool repair_table_use_frm,
uint extra_open_options,
int (*prepare_func)(THD *, TABLE_LIST *,
@@ -365,10 +365,11 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
for (table= tables; table; table= table->next_local)
{
char table_name[SAFE_NAME_LEN*2+2];
- char* db = table->db;
+ char *db= table->db;
bool fatal_error=0;
bool open_error;
bool collect_eis= FALSE;
+ bool open_for_modify= org_open_for_modify;
DBUG_PRINT("admin", ("table: '%s'.'%s'", table->db, table->table_name));
strxmov(table_name, db, ".", table->table_name, NullS);
@@ -406,8 +407,8 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
/*
CHECK TABLE command is allowed for views as well. Check on alter flags
- to differentiate from ALTER TABLE...CHECK PARTITION on which view is not
- allowed.
+ to differentiate from ALTER TABLE...CHECK PARTITION on which view is
+ not allowed.
*/
if (lex->alter_info.flags & Alter_info::ALTER_ADMIN_PARTITION ||
view_operator_func == NULL)
@@ -1102,7 +1103,7 @@ send_result_message:
}
}
/* Error path, a admin command failed. */
- if (thd->transaction_rollback_request)
+ if (thd->transaction_rollback_request || fatal_error)
{
/*
Unlikely, but transaction rollback was requested by one of storage