summaryrefslogtreecommitdiff
path: root/sql/sql_base.cc
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2021-05-03 23:26:30 +0200
committerSergei Golubchik <serg@mariadb.org>2021-05-04 09:01:55 +0200
commit5ad7f52558cb283c685322df1fcdbd10daf3c3ae (patch)
treedf71238c727173fa80e3c18f909800e52ea95e1d /sql/sql_base.cc
parent1ae7673aae7f82c4e659b1337177f2696c8e45ba (diff)
downloadmariadb-git-5ad7f52558cb283c685322df1fcdbd10daf3c3ae.tar.gz
MDEV-21603 Crashing SHOW TABLES with derived table in WHERE condition
When you only need view structure, don't call handle_derived with DT_CREATE and rely on its internal hackish check to skip DT_CREATE. Because handle_derived is called from many different places, and this internal hackish check is indiscriminative. Instead, just don't ask handle_derived to do DT_CREATE if you don't want it to do DT_CREATE.
Diffstat (limited to 'sql/sql_base.cc')
-rw-r--r--sql/sql_base.cc1
1 files changed, 0 insertions, 1 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 3403f9e03ff..16689f86c4e 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -4939,7 +4939,6 @@ bool open_normal_and_derived_tables(THD *thd, TABLE_LIST *tables, uint flags,
uint counter;
MDL_savepoint mdl_savepoint= thd->mdl_context.mdl_savepoint();
DBUG_ENTER("open_normal_and_derived_tables");
- DBUG_ASSERT(!thd->fill_derived_tables());
if (open_tables(thd, &tables, &counter, flags, &prelocking_strategy) ||
mysql_handle_derived(thd->lex, dt_phases))
goto end;