summaryrefslogtreecommitdiff
path: root/sql/sql_cte.cc
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2020-12-04 14:20:52 -0800
committerIgor Babaev <igor@askmonty.org>2020-12-07 09:26:40 -0800
commit2db6eb142956cd1744cf5c452bca66b20067d73e (patch)
tree04f922d78a9541f8ebd61ccde024a0dc972bf293 /sql/sql_cte.cc
parentf924a3bd6cd70c140f00d162ad18da003cc87a89 (diff)
downloadmariadb-git-2db6eb142956cd1744cf5c452bca66b20067d73e.tar.gz
MDEV-22781 CREATE VIEW containing WITH clause Signal 11
For table references to CTEs the field TABLE_LIST::db must be set to an empty string as it's done for table references to derived tables in order CTEs to be processed similar to how derived tables are processed. Approved by Oleksandr Byelkin <sanja@mariadb.com>
Diffstat (limited to 'sql/sql_cte.cc')
-rw-r--r--sql/sql_cte.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/sql/sql_cte.cc b/sql/sql_cte.cc
index fe8e0de71b4..a8bccf0c1dd 100644
--- a/sql/sql_cte.cc
+++ b/sql/sql_cte.cc
@@ -227,6 +227,7 @@ With_element *With_clause::find_table_def(TABLE_LIST *table,
!table->is_fqtn)
{
table->set_derived();
+ table->db= empty_c_string;
return with_elem;
}
}