summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorgi Kodinov <joro@sun.com>2009-12-15 11:03:24 +0200
committerGeorgi Kodinov <joro@sun.com>2009-12-15 11:03:24 +0200
commitd2e723bf53dd081fe6098feac66bf8934643a278 (patch)
tree0b0c03eb80469219fffc0b9ea6887006b4668695
parent838adcf2ff68464a7817d9cadf2fc8f6cbe95beb (diff)
downloadmariadb-git-d2e723bf53dd081fe6098feac66bf8934643a278.tar.gz
Bug #48985: show create table crashes if previous access to the table
was killed Merge the fix from 5.1-bugteam to 5.1-main
-rw-r--r--mysql-test/r/show_check.result6
-rw-r--r--mysql-test/t/show_check.test22
-rw-r--r--sql/sql_show.cc2
3 files changed, 29 insertions, 1 deletions
diff --git a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result
index e6550bee954..ec0a70ff581 100644
--- a/mysql-test/r/show_check.result
+++ b/mysql-test/r/show_check.result
@@ -1454,4 +1454,10 @@ GRANT PROCESS ON *.* TO test_u@localhost;
SHOW ENGINE MYISAM MUTEX;
SHOW ENGINE MYISAM STATUS;
DROP USER test_u@localhost;
+#
+# Bug #48985: show create table crashes if previous access to the table
+# was killed
+#
+SHOW CREATE TABLE non_existent;
+ERROR 70100: Query execution was interrupted
End of 5.1 tests
diff --git a/mysql-test/t/show_check.test b/mysql-test/t/show_check.test
index 0ce807ae73e..d46261f38d2 100644
--- a/mysql-test/t/show_check.test
+++ b/mysql-test/t/show_check.test
@@ -1207,6 +1207,28 @@ connection default;
DROP USER test_u@localhost;
+--echo #
+--echo # Bug #48985: show create table crashes if previous access to the table
+--echo # was killed
+--echo #
+
+connect(con1,localhost,root,,);
+CONNECTION con1;
+LET $ID= `SELECT connection_id()`;
+
+CONNECTION default;
+--disable_query_log
+eval KILL QUERY $ID;
+--enable_query_log
+
+CONNECTION con1;
+--error ER_QUERY_INTERRUPTED
+SHOW CREATE TABLE non_existent;
+
+CONNECTION default;
+DISCONNECT con1;
+
+
--echo End of 5.1 tests
# Wait till all disconnects are completed
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);
}