From ab1c228836b81659e859298096ef163dca8117b5 Mon Sep 17 00:00:00 2001 From: Michael Widenius Date: Tue, 5 Mar 2013 20:15:36 +0200 Subject: [PATCH] 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. --- sql/sql_table.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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;