summaryrefslogtreecommitdiff
path: root/sql/sql_select.cc
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2018-01-18 09:20:55 -0800
committerIgor Babaev <igor@askmonty.org>2018-01-18 09:57:25 -0800
commit4f96b401d9dd9f876c2d3e6e266e8670d30ca2c8 (patch)
tree335a4d4c9b8023cac033853a43d7fc9528a582a4 /sql/sql_select.cc
parentfafdac3365f4943e73bcefd0e0d07d69997a9724 (diff)
downloadmariadb-git-4f96b401d9dd9f876c2d3e6e266e8670d30ca2c8.tar.gz
Fixed mdev-14960 [ERROR] mysqld got signal 11 with join_buffer and join_cache
In the function JOIN::shrink_join_buffers the iteration over joined tables was organized in a wrong way. This could cause a crash if the optimizer chose to materialize a semi-join that used join caches for which the sizes must be adjusted.
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r--sql/sql_select.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 9f89a261540..42b3420a9b6 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -2085,8 +2085,11 @@ bool JOIN::shrink_join_buffers(JOIN_TAB *jt,
ulonglong curr_space,
ulonglong needed_space)
{
+ JOIN_TAB *tab;
JOIN_CACHE *cache;
- for (JOIN_TAB *tab= join_tab+const_tables; tab < jt; tab++)
+ for (tab= first_linear_tab(this, WITHOUT_BUSH_ROOTS, WITHOUT_CONST_TABLES);
+ tab != jt;
+ tab= next_linear_tab(this, tab, WITHOUT_BUSH_ROOTS))
{
cache= tab->cache;
if (cache)