mirror of
https://github.com/MariaDB/server.git
synced 2025-01-29 10:14:19 +01:00
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
This commit is contained in:
parent
61488d2abb
commit
45d59063cb
4 changed files with 15 additions and 1 deletions
|
@ -313,4 +313,9 @@ ERROR 22001: Data too long for column 'c_tinytext' at row 1
|
|||
insert into t2 values(@q);
|
||||
ERROR 22001: Data too long for column 'c_tinyblob' at row 1
|
||||
drop table t1, t2;
|
||||
DROP TABLE t1;
|
||||
ERROR 42S02: Unknown table 't1'
|
||||
SHOW ERRORS;
|
||||
Level Code Message
|
||||
Error 1051 Unknown table 't1'
|
||||
End of 5.0 tests
|
||||
|
|
|
@ -225,4 +225,11 @@ insert into t2 values(@q);
|
|||
|
||||
drop table t1, t2;
|
||||
|
||||
#
|
||||
# Bug#42364 SHOW ERRORS returns empty resultset after dropping non existent table
|
||||
#
|
||||
--error ER_BAD_TABLE_ERROR
|
||||
DROP TABLE t1;
|
||||
SHOW ERRORS;
|
||||
|
||||
--echo End of 5.0 tests
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -4769,6 +4769,8 @@ static void test_errors()
|
|||
result= mysql_store_result(mysql);
|
||||
mytest(result);
|
||||
|
||||
DIE_UNLESS(mysql_num_rows(result) == 1);
|
||||
|
||||
(void) my_process_result_set(result);
|
||||
mysql_free_result(result);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue