summaryrefslogtreecommitdiff
path: root/sql/sql_parse.cc
diff options
context:
space:
mode:
authorMonty <monty@mariadb.org>2018-05-16 21:51:46 +0300
committerMonty <monty@mariadb.org>2018-05-16 21:51:46 +0300
commitef295c31e3d50a99a90beccfb4deb9d9d36ac1e3 (patch)
treee504c310e3f0829c2041e65e1e9cbfe7ac5fc99d /sql/sql_parse.cc
parentd703e09cd6706673fbb127f540d3917068b40755 (diff)
downloadmariadb-git-ef295c31e3d50a99a90beccfb4deb9d9d36ac1e3.tar.gz
MDEV-11129 CREATE OR REPLACE TABLE t1 AS SELECT spfunc() crashes if spfunc() references t1
Fixed by extending unique_table() with a flag to not allow usage of the replaced table. I also cleaned up find_dup_table() to not use goto next. I also added more comments to the code in find_dup_table()
Diffstat (limited to 'sql/sql_parse.cc')
-rw-r--r--sql/sql_parse.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 87edf93bb4a..1162aa901d1 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -2970,7 +2970,7 @@ case SQLCOM_PREPARE:
TABLE_LIST *duplicate;
if ((duplicate= unique_table(thd, lex->query_tables,
lex->query_tables->next_global,
- 0)))
+ CHECK_DUP_FOR_CREATE)))
{
update_non_unique_table_error(lex->query_tables, "CREATE",
duplicate);