summaryrefslogtreecommitdiff
path: root/sql/sql_table.cc
diff options
context:
space:
mode:
authorMichael Widenius <monty@askmonty.org>2013-03-05 20:15:36 +0200
committerMichael Widenius <monty@askmonty.org>2013-03-05 20:15:36 +0200
commitab1c228836b81659e859298096ef163dca8117b5 (patch)
tree3c0b1bf276475f877d56862026b3eacd62ac30ab /sql/sql_table.cc
parente2a72fefb4b3e528562bc11ef917da0d77be73b9 (diff)
downloadmariadb-git-ab1c228836b81659e859298096ef163dca8117b5.tar.gz
Fix for assert found by mysql-test-run
sql/sql_table.cc: Don't call allow_access_to_protected_table() if we haven't protected table against usage. Table is mainly protected against usage when one disables keys with alter table.
Diffstat (limited to 'sql/sql_table.cc')
-rw-r--r--sql/sql_table.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index ff0684a9ba4..0effe2a7351 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -6814,7 +6814,11 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
error= trans_commit_stmt(thd);
if (trans_commit_implicit(thd))
error= 1;
- table->s->allow_access_to_protected_table();
+ /*
+ If the table was locked, allow one to still run SHOW commands against it
+ */
+ if (table->s->protected_against_usage())
+ table->s->allow_access_to_protected_table();
}
thd->count_cuted_fields= CHECK_FIELD_IGNORE;