summaryrefslogtreecommitdiff
path: root/sql/sql_select.cc
diff options
context:
space:
mode:
authorKentoku SHIBA <kentokushiba@gmail.com>2019-04-12 22:47:29 +0900
committerGitHub <noreply@github.com>2019-04-12 22:47:29 +0900
commitdf2d376eca665e26845d8e6c636bf9f6c1714b1b (patch)
tree77472ce6fdb212e7cadb9fe1ccd351bab193797a /sql/sql_select.cc
parentf0509afa1b635cd7c091f349a3b8dd72b4b92b94 (diff)
parent7896503686477cce55d058d071d2858a8abf4b04 (diff)
downloadmariadb-git-bb-10.4-MDEV-16530.tar.gz
Merge branch '10.4' into bb-10.4-MDEV-16530bb-10.4-MDEV-16530
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r--sql/sql_select.cc16
1 files changed, 13 insertions, 3 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 676a73d5958..f96b3409578 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -1621,12 +1621,22 @@ bool JOIN::make_range_rowid_filters()
filter_map.merge(tab->table->with_impossible_ranges);
bool force_index_save= tab->table->force_index;
tab->table->force_index= true;
- (void) sel->test_quick_select(thd, filter_map, (table_map) 0,
- (ha_rows) HA_POS_ERROR,
- true, false, true, true);
+ int rc= sel->test_quick_select(thd, filter_map, (table_map) 0,
+ (ha_rows) HA_POS_ERROR,
+ true, false, true, true);
tab->table->force_index= force_index_save;
if (thd->is_error())
goto no_filter;
+ /*
+ If SUBS_IN_TO_EXISTS strtrategy is chosen for the subquery then
+ additional conditions are injected into WHERE/ON/HAVING and it may
+ happen that the call of test_quick_select() discovers impossible range.
+ */
+ if (rc == -1)
+ {
+ const_table_map|= tab->table->map;
+ goto no_filter;
+ }
DBUG_ASSERT(sel->quick);
filter_container=
tab->range_rowid_filter_info->create_container();