mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
Fixed bug mdev-6071.
The method JOIN_CACHE::init may fail (return 1) if some conditions on the used join buffer is not satisfied. For example it fails if join_buffer_size is greater than join_buffer_space_limit. The conditions should be checked when running the EXPLAIN command for the query. That's why the method JOIN_CACHE::init has to be called for EXPLAIN commands as well.
This commit is contained in:
@@ -10541,7 +10541,7 @@ uint check_join_cache_usage(JOIN_TAB *tab,
|
||||
if (cache_level == 1)
|
||||
prev_cache= 0;
|
||||
if ((tab->cache= new JOIN_CACHE_BNL(join, tab, prev_cache)) &&
|
||||
((options & SELECT_DESCRIBE) || !tab->cache->init()))
|
||||
!tab->cache->init(options & SELECT_DESCRIBE))
|
||||
{
|
||||
tab->icp_other_tables_ok= FALSE;
|
||||
return (2 - MY_TEST(!prev_cache));
|
||||
@@ -10576,7 +10576,7 @@ uint check_join_cache_usage(JOIN_TAB *tab,
|
||||
if (cache_level == 3)
|
||||
prev_cache= 0;
|
||||
if ((tab->cache= new JOIN_CACHE_BNLH(join, tab, prev_cache)) &&
|
||||
((options & SELECT_DESCRIBE) || !tab->cache->init()))
|
||||
!tab->cache->init(options & SELECT_DESCRIBE))
|
||||
{
|
||||
tab->icp_other_tables_ok= FALSE;
|
||||
return (4 - MY_TEST(!prev_cache));
|
||||
@@ -10597,7 +10597,7 @@ uint check_join_cache_usage(JOIN_TAB *tab,
|
||||
if (cache_level == 5)
|
||||
prev_cache= 0;
|
||||
if ((tab->cache= new JOIN_CACHE_BKA(join, tab, flags, prev_cache)) &&
|
||||
((options & SELECT_DESCRIBE) || !tab->cache->init()))
|
||||
!tab->cache->init(options & SELECT_DESCRIBE))
|
||||
return (6 - MY_TEST(!prev_cache));
|
||||
goto no_join_cache;
|
||||
}
|
||||
@@ -10606,7 +10606,7 @@ uint check_join_cache_usage(JOIN_TAB *tab,
|
||||
if (cache_level == 7)
|
||||
prev_cache= 0;
|
||||
if ((tab->cache= new JOIN_CACHE_BKAH(join, tab, flags, prev_cache)) &&
|
||||
((options & SELECT_DESCRIBE) || !tab->cache->init()))
|
||||
!tab->cache->init(options & SELECT_DESCRIBE))
|
||||
{
|
||||
tab->idx_cond_fact_out= FALSE;
|
||||
return (8 - MY_TEST(!prev_cache));
|
||||
|
||||
Reference in New Issue
Block a user