summaryrefslogtreecommitdiff
path: root/sql/sql_show.cc
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2021-05-03 23:26:30 +0200
committerOleksandr Byelkin <sanja@mariadb.com>2021-05-04 16:55:45 +0200
commita20195bba5ff695b8c00b8b3f57edced3c1108a6 (patch)
tree296ee6334ab5ea39513f4d7580a4a6fe25ced37e /sql/sql_show.cc
parent72fa9dabadb4b0011f483ccbf1ef59e62d0ef1e0 (diff)
downloadmariadb-git-a20195bba5ff695b8c00b8b3f57edced3c1108a6.tar.gz
MDEV-21603 Crashing SHOW TABLES with derived table in WHERE conditionmariadb-10.2.38
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_show.cc')
-rw-r--r--sql/sql_show.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index 7023e5fe9ea..b5622497a06 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -1528,7 +1528,7 @@ mysqld_list_fields(THD *thd, TABLE_LIST *table_list, const char *wild)
if (open_normal_and_derived_tables(thd, table_list,
MYSQL_OPEN_FORCE_SHARED_HIGH_PRIO_MDL,
- DT_INIT | DT_PREPARE | DT_CREATE))
+ DT_INIT | DT_PREPARE))
DBUG_VOID_RETURN;
table= table_list->table;
@@ -4414,7 +4414,7 @@ fill_schema_table_by_open(THD *thd, bool is_show_fields_or_keys,
MYSQL_OPEN_FORCE_SHARED_HIGH_PRIO_MDL |
(can_deadlock ?
MYSQL_OPEN_FAIL_ON_MDL_CONFLICT : 0)),
- DT_INIT | DT_PREPARE | DT_CREATE));
+ DT_INIT | DT_PREPARE));
/*
Restore old value of sql_command back as it is being looked at in