diff --git a/mysql-test/main/global_temporary_table.result b/mysql-test/main/global_temporary_table.result index 2fcbaccec1047..3e27eef5d784c 100644 --- a/mysql-test/main/global_temporary_table.result +++ b/mysql-test/main/global_temporary_table.result @@ -1008,6 +1008,7 @@ set max_session_mem_used= 8192; insert t values (0); ERROR HY000: The MariaDB server is running with the --max-session-mem-used=8192 option so it cannot execute this statement lock table t write; +ERROR HY000: The MariaDB server is running with the --max-session-mem-used=8192 option so it cannot execute this statement alter table t add z int; ERROR HY000: The MariaDB server is running with the --max-session-mem-used=8192 option so it cannot execute this statement set max_session_mem_used= default; diff --git a/mysql-test/main/global_temporary_table.test b/mysql-test/main/global_temporary_table.test index 96d3aa6fe1ed2..d2427a46561b7 100644 --- a/mysql-test/main/global_temporary_table.test +++ b/mysql-test/main/global_temporary_table.test @@ -877,9 +877,11 @@ create global temporary table t (t text); set max_session_mem_used= 8192; --error ER_OPTION_PREVENTS_STATEMENT insert t values (0); +--error ER_OPTION_PREVENTS_STATEMENT lock table t write; --error ER_OPTION_PREVENTS_STATEMENT alter table t add z int; +--error 0, ER_OPTION_PREVENTS_STATEMENT set max_session_mem_used= default; drop table t; unlock tables; diff --git a/mysql-test/suite/binlog/r/global_temporary_table.result b/mysql-test/suite/binlog/r/global_temporary_table.result index 5b50d474c5de6..59536715a9124 100644 --- a/mysql-test/suite/binlog/r/global_temporary_table.result +++ b/mysql-test/suite/binlog/r/global_temporary_table.result @@ -1011,6 +1011,7 @@ set max_session_mem_used= 8192; insert t values (0); ERROR HY000: The MariaDB server is running with the --max-session-mem-used=8192 option so it cannot execute this statement lock table t write; +ERROR HY000: The MariaDB server is running with the --max-session-mem-used=8192 option so it cannot execute this statement alter table t add z int; ERROR HY000: The MariaDB server is running with the --max-session-mem-used=8192 option so it cannot execute this statement set max_session_mem_used= default; diff --git a/mysql-test/suite/rpl/r/global_temporary_table.result b/mysql-test/suite/rpl/r/global_temporary_table.result index 084c1be619dd9..dd322a4a47b1d 100644 --- a/mysql-test/suite/rpl/r/global_temporary_table.result +++ b/mysql-test/suite/rpl/r/global_temporary_table.result @@ -1011,6 +1011,7 @@ set max_session_mem_used= 8192; insert t values (0); ERROR HY000: The MariaDB server is running with the --max-session-mem-used=8192 option so it cannot execute this statement lock table t write; +ERROR HY000: The MariaDB server is running with the --max-session-mem-used=8192 option so it cannot execute this statement alter table t add z int; ERROR HY000: The MariaDB server is running with the --max-session-mem-used=8192 option so it cannot execute this statement set max_session_mem_used= default; diff --git a/sql/handler.cc b/sql/handler.cc index e0b7e4269f084..355aaf463fe8c 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -6748,7 +6748,7 @@ int ha_create_table(THD *thd, const char *path, const char *db, // open an frm file share.db_plugin= ha_lock_engine(thd, create_info->db_type); - if (open_table_def(thd, &share)) + if (open_table_def(thd, &share) || thd->killed) goto err; } diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 1360ea369fc6f..ffb1ceffd15b5 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -2672,7 +2672,7 @@ Locked_tables_list::init_locked_tables(THD *thd) &db.str, (size_t) db.length + 1, &table_name.str, (size_t) table_name.length + 1, &alias.str, (size_t) alias.length + 1, - NullS)) + NullS) || thd->killed) { reset(); return TRUE;