summaryrefslogtreecommitdiff
path: root/sql/sql_parse.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2019-06-20 09:22:10 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2019-06-20 09:22:10 +0300
commit49e5323dbd8a0ab074abdaeb16fe42aa47f4e6b6 (patch)
tree3d55494498a695d00f7b2807db5a7718a1204d6f /sql/sql_parse.cc
parent16ac8404ac4a0b7a7bc260200204e3373476a020 (diff)
parentcfbd714868d6af284f1acfff361c098cbc525fff (diff)
downloadmariadb-git-49e5323dbd8a0ab074abdaeb16fe42aa47f4e6b6.tar.gz
Merge 10.4 into 10.5
Diffstat (limited to 'sql/sql_parse.cc')
-rw-r--r--sql/sql_parse.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 770791a67e4..54a41adbf68 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -794,8 +794,6 @@ void init_update_queries(void)
Note that SQLCOM_RENAME_TABLE should not be in this list!
*/
sql_command_flags[SQLCOM_CREATE_TABLE]|= CF_PREOPEN_TMP_TABLES;
- sql_command_flags[SQLCOM_DROP_TABLE]|= CF_PREOPEN_TMP_TABLES;
- sql_command_flags[SQLCOM_DROP_SEQUENCE]|= CF_PREOPEN_TMP_TABLES;
sql_command_flags[SQLCOM_CREATE_INDEX]|= CF_PREOPEN_TMP_TABLES;
sql_command_flags[SQLCOM_ALTER_TABLE]|= CF_PREOPEN_TMP_TABLES;
sql_command_flags[SQLCOM_TRUNCATE]|= CF_PREOPEN_TMP_TABLES;
@@ -4799,7 +4797,14 @@ mysql_execute_command(THD *thd)
case SQLCOM_DROP_SEQUENCE:
case SQLCOM_DROP_TABLE:
{
+ int result;
DBUG_ASSERT(first_table == all_tables && first_table != 0);
+
+ thd->open_options|= HA_OPEN_FOR_REPAIR;
+ result= thd->open_temporary_tables(all_tables);
+ thd->open_options&= ~HA_OPEN_FOR_REPAIR;
+ if (result)
+ goto error;
if (!lex->tmp_table())
{
if (check_table_access(thd, DROP_ACL, all_tables, FALSE, UINT_MAX, FALSE))