summaryrefslogtreecommitdiff
path: root/sql/sql_table.cc
diff options
context:
space:
mode:
authorSergey Glukhov <Sergey.Glukhov@sun.com>2009-09-10 13:49:49 +0500
committerSergey Glukhov <Sergey.Glukhov@sun.com>2009-09-10 13:49:49 +0500
commit104d9ce76a68fd3da2f9217514a4c61454802c1d (patch)
treebbe365958d3199002ab64e3e0cc3bf268c10f1fb /sql/sql_table.cc
parent6d3e743d5b0fefecde02417c6902267766413fab (diff)
downloadmariadb-git-104d9ce76a68fd3da2f9217514a4c61454802c1d.tar.gz
Bug#42364 SHOW ERRORS returns empty resultset after dropping non existent table
partial backport of bug43138 fix mysql-test/r/warnings.result: test result mysql-test/t/warnings.test: test case sql/sql_class.cc: partial backport of bug43138 fix sql/sql_class.h: partial backport of bug43138 fix sql/sql_table.cc: partial backport of bug43138 fix
Diffstat (limited to 'sql/sql_table.cc')
-rw-r--r--sql/sql_table.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 89a84ebc1fe..41e76211dd8 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -1772,6 +1772,7 @@ bool mysql_rm_table(THD *thd,TABLE_LIST *tables, my_bool if_exists,
my_bool drop_temporary)
{
bool error= FALSE, need_start_waiters= FALSE;
+ Drop_table_error_handler err_handler(thd->get_internal_handler());
DBUG_ENTER("mysql_rm_table");
/* mark for close and remove all cached entries */
@@ -1792,7 +1793,10 @@ bool mysql_rm_table(THD *thd,TABLE_LIST *tables, my_bool if_exists,
LOCK_open during wait_if_global_read_lock(), other threads could not
close their tables. This would make a pretty deadlock.
*/
+ thd->push_internal_handler(&err_handler);
error= mysql_rm_table_part2(thd, tables, if_exists, drop_temporary, 0, 0);
+ thd->pop_internal_handler();
+
if (need_start_waiters)
start_waiting_global_read_lock(thd);
@@ -1894,9 +1898,6 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
DBUG_RETURN(1);
}
- /* Don't give warnings for not found errors, as we already generate notes */
- thd->no_warnings_for_error= 1;
-
for (table= tables; table; table= table->next_local)
{
char *db=table->db;
@@ -2145,7 +2146,6 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
err_with_placeholders:
unlock_table_names(thd, tables, (TABLE_LIST*) 0);
pthread_mutex_unlock(&LOCK_open);
- thd->no_warnings_for_error= 0;
DBUG_RETURN(error);
}