summaryrefslogtreecommitdiff
path: root/sql/sql_show.cc
diff options
context:
space:
mode:
authorGeorgi Kodinov <joro@sun.com>2009-12-03 14:07:46 +0200
committerGeorgi Kodinov <joro@sun.com>2009-12-03 14:07:46 +0200
commit9091535c5fc914aecaa51acf6e558ccd9800fd88 (patch)
tree05e1b50d13cd309dfc81bea28417c8ce580d7293 /sql/sql_show.cc
parent7622134333ef91e5e88e981288aaf09f7202d54a (diff)
downloadmariadb-git-9091535c5fc914aecaa51acf6e558ccd9800fd88.tar.gz
Bug #48985: show create table crashes if previous access to the table was killed
When checking for an error after removing the special view error handler the code was not taking into account that open_tables() may fail because of the current statement being killed. Added a check for thd->killed. Added a client program to test it.
Diffstat (limited to 'sql/sql_show.cc')
-rw-r--r--sql/sql_show.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index 2c1f360104b..e55000c0f65 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -719,7 +719,7 @@ mysqld_show_create(THD *thd, TABLE_LIST *table_list)
thd->push_internal_handler(&view_error_suppressor);
bool error= open_normal_and_derived_tables(thd, table_list, 0);
thd->pop_internal_handler();
- if (error && thd->main_da.is_error())
+ if (error && (thd->killed || thd->main_da.is_error()))
DBUG_RETURN(TRUE);
}