summaryrefslogtreecommitdiff
path: root/sql/sql_insert.cc
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@mariadb.com>2021-07-31 23:19:51 +0200
committerOleksandr Byelkin <sanja@mariadb.com>2021-07-31 23:19:51 +0200
commitae6bdc6769646a09a8d4d08a42a69174ea677768 (patch)
treec80afdd0e3238dc5092fdcb1439f1390f9a9040b /sql/sql_insert.cc
parenta49f5525bbe1bb1f4320bd0db066068a81af62d9 (diff)
parent7841a7eb09208f52fcbab7e80e38c7ca29b1339e (diff)
downloadmariadb-git-ae6bdc6769646a09a8d4d08a42a69174ea677768.tar.gz
Merge branch '10.4' into 10.5
Diffstat (limited to 'sql/sql_insert.cc')
-rw-r--r--sql/sql_insert.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index 9d3444a5ac6..c1cb45d5d69 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -4680,8 +4680,17 @@ select_create::prepare(List<Item> &_values, SELECT_LEX_UNIT *u)
}
if (!(table= create_table_from_items(thd, &values, &extra_lock, hook_ptr)))
+ {
+ if (create_info->or_replace())
+ {
+ /* Original table was deleted. We have to log it */
+ log_drop_table(thd, &create_table->db, &create_table->table_name,
+ thd->lex->tmp_table());
+ }
+
/* abort() deletes table */
DBUG_RETURN(-1);
+ }
if (create_info->tmp_table())
{