mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
BUG#34656 - KILL a query = Assertion failed: m_status == DA_ERROR ||
m_status == DA_OK Reading from information_scema.tables or information_schema.columns may cause assertion failure in debug builds. This may happen under rare circumstances when information_schema fails to get information about a table (e.g. when a connection is killed). This happens because open_normal_and_derived_tables() can return an error without setting an error message in THD. But information_schema attempts to get an error message from THD unconditionally. With this fix information_schema attempts to get an error message from THD only in case error message is set in THD.
This commit is contained in:
@ -3430,7 +3430,7 @@ static int get_schema_tables_record(THD *thd, TABLE_LIST *tables,
|
||||
/*
|
||||
there was errors during opening tables
|
||||
*/
|
||||
const char *error= thd->main_da.message();
|
||||
const char *error= thd->is_error() ? thd->main_da.message() : "";
|
||||
if (tables->view)
|
||||
table->field[3]->store(STRING_WITH_LEN("VIEW"), cs);
|
||||
else if (tables->schema_table)
|
||||
@ -3631,8 +3631,9 @@ static int get_schema_column_record(THD *thd, TABLE_LIST *tables,
|
||||
I.e. we are in SELECT FROM INFORMATION_SCHEMA.COLUMS
|
||||
rather than in SHOW COLUMNS
|
||||
*/
|
||||
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
|
||||
thd->main_da.sql_errno(), thd->main_da.message());
|
||||
if (thd->is_error())
|
||||
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
|
||||
thd->main_da.sql_errno(), thd->main_da.message());
|
||||
thd->clear_error();
|
||||
res= 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user