From 45d59063cb5c835c01d4744ad3b3b4c141a639a2 Mon Sep 17 00:00:00 2001 From: Sergey Glukhov Date: Fri, 3 Jul 2009 13:22:06 +0500 Subject: Bug#42364 SHOW ERRORS returns empty resultset after dropping non existent table enabled message storing into error message list for 'drop table' command mysql-test/r/warnings.result: test result mysql-test/t/warnings.test: test case sql/sql_table.cc: We should skip error sending then we should return warnings to client as some functions may send its own errors, so we should set no_warnings_for_error= 0 only in case of warning. The fix is to enable message storing into error message list for 'drop table' command(only for error case). tests/mysql_client_test.c: test fix --- sql/sql_table.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sql/sql_table.cc') diff --git a/sql/sql_table.cc b/sql/sql_table.cc index e752421223a..813a0472b76 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -1995,6 +1995,7 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists, pthread_mutex_unlock(&LOCK_open); thd->thread_specific_used|= tmp_table_deleted; error= 0; + thd->no_warnings_for_error= 0; if (wrong_tables.length()) { if (!foreign_key_error) @@ -2056,7 +2057,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); } -- cgit v1.2.1