summaryrefslogtreecommitdiff
path: root/sql/item.cc
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2023-01-23 15:54:49 -0800
committerIgor Babaev <igor@askmonty.org>2023-01-24 08:46:41 -0800
commitf513d715382a63415c9342f1cae75be75b441f98 (patch)
tree86cf43a22f8868f6bbdfe7e54886aa381879ea15 /sql/item.cc
parentd69e835787f9ce9848cb6c2a5343887dd0eec2ce (diff)
downloadmariadb-git-f513d715382a63415c9342f1cae75be75b441f98.tar.gz
MDEV-30081 Crash with splitting from constant mergeable derived table
This bug manifested itself in very rare situations when splitting optimization was applied to a materialized derived table with group clause by key over a constant meargeable derived table that was in inner part of an outer join. In this case the used tables for the key to access the split table incorrectly was evaluated to a not empty table map. Approved by Oleksandr Byelkin <sanja@mariadb.com>
Diffstat (limited to 'sql/item.cc')
-rw-r--r--sql/item.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/item.cc b/sql/item.cc
index 02220fd56bd..9ecbefaafb9 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -10838,7 +10838,7 @@ table_map Item_direct_view_ref::used_tables() const
table_map used= (*ref)->used_tables();
return (used ?
used :
- ((null_ref_table != NO_NULL_TABLE) ?
+ (null_ref_table != NO_NULL_TABLE && !null_ref_table->const_table ?
null_ref_table->map :
(table_map)0 ));
}