From 8c54182ec4d8f00a164530d35c9769ccb5267bcb Mon Sep 17 00:00:00 2001 From: Alexey Botchkov Date: Tue, 12 May 2015 15:09:28 +0500 Subject: [PATCH] MDEV-7926 Server crashes in get_geometry_column_record on concurrent SELECT FROM I_S.GEOMETRY_COLUMNS with join and DDL. The bug was that open_tables() returned error in case of thd->killed() without properly calling thd->send_kill_message() to set the correct error. This was fixed already in get_schema_column_record, so the code was just copied to get_geometry_column_record. --- sql/sql_show.cc | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/sql/sql_show.cc b/sql/sql_show.cc index c9271309d6b..d4d259be6bb 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -373,6 +373,23 @@ static int get_geometry_column_record(THD *thd, TABLE_LIST *tables, Field **ptr, *field; DBUG_ENTER("get_geometry_column_record"); + if (res) + { + if (thd->lex->sql_command != SQLCOM_SHOW_FIELDS) + { + /* + I.e. we are in SELECT FROM INFORMATION_SCHEMA.COLUMS + rather than in SHOW COLUMNS + */ + push_warning(thd, Sql_condition::WARN_LEVEL_WARN, + thd->get_stmt_da()->sql_errno(), + thd->get_stmt_da()->message()); + thd->clear_error(); + res= 0; + } + DBUG_RETURN(res); + } + if (tables->schema_table) goto exit; show_table= tables->table;