diff options
author | Sergei Golubchik <serg@mariadb.org> | 2018-09-23 20:26:35 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2018-09-24 11:46:08 +0200 |
commit | 5ae8fce50bb5cbd7916acd6b03bd699f79c10616 (patch) | |
tree | 6291ec25e408ea225531e8b79a4f4fd7f3a81329 /sql/sql_select.cc | |
parent | 76098f45b8b1f2224eb25cf5d94450c6f4a1414c (diff) | |
parent | 1fc5a6f30c3a9c047dcf9a36b00026d98f286f6b (diff) | |
download | mariadb-git-5ae8fce50bb5cbd7916acd6b03bd699f79c10616.tar.gz |
Merge branch '10.1' into 10.2
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r-- | sql/sql_select.cc | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 3ec1a1b6e04..a27053314bd 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -21561,11 +21561,30 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit, tmp_map.clear_all(); // Force the creation of quick select tmp_map.set_bit(best_key); // only best_key. select->quick= 0; + + bool cond_saved= false; + Item *saved_cond; + + /* + Index Condition Pushdown may have removed parts of the condition for + this table. Temporarily put them back because we want the whole + condition for the range analysis. + */ + if (select->pre_idx_push_select_cond) + { + saved_cond= select->cond; + select->cond= select->pre_idx_push_select_cond; + cond_saved= true; + } + select->test_quick_select(join->thd, tmp_map, 0, join->select_options & OPTION_FOUND_ROWS ? HA_POS_ERROR : join->unit->select_limit_cnt, TRUE, FALSE, FALSE); + + if (cond_saved) + select->cond= saved_cond; } order_direction= best_key_direction; /* |