mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Eliminated the member original_cond from the class SQL_SELECT
introduced at the latest merge 5.1->5.2->5.3. It is basically not needed since if SQL_SELECT::pre_idx_push_select_cond is not NULL then SQL_SELECT::original_cond would point to the same condition as SQL_SELECT::pre_idx_push_select_cond. Otherwise SQL_SELECT::original_cond would be equal to SQL_SELECT::cond.
This commit is contained in:
@ -1665,7 +1665,7 @@ SQL_SELECT *make_select(TABLE *head, table_map const_tables,
|
||||
select->read_tables=read_tables;
|
||||
select->const_tables=const_tables;
|
||||
select->head=head;
|
||||
select->cond= select->original_cond= conds;
|
||||
select->cond= conds;
|
||||
|
||||
if (head->sort.io_cache)
|
||||
{
|
||||
|
@ -883,11 +883,6 @@ class SQL_SELECT :public Sql_alloc {
|
||||
public:
|
||||
QUICK_SELECT_I *quick; // If quick-select used
|
||||
COND *cond; // where condition
|
||||
/*
|
||||
Original WHERE condition (before anything was removed as part of index
|
||||
condition pushdown.
|
||||
*/
|
||||
COND *original_cond;
|
||||
|
||||
/*
|
||||
When using Index Condition Pushdown: condition that we've had before
|
||||
|
@ -7423,7 +7423,7 @@ make_join_select(JOIN *join,SQL_SELECT *select,COND *cond)
|
||||
*/
|
||||
if (!(tmp= add_found_match_trig_cond(first_inner_tab, tmp, 0)))
|
||||
DBUG_RETURN(1);
|
||||
sel->cond= sel->original_cond= tmp;
|
||||
sel->cond= tmp;
|
||||
tab->set_select_cond(tmp, __LINE__);
|
||||
/* Push condition to storage engine if this is enabled
|
||||
and the condition is not guarded */
|
||||
@ -16432,7 +16432,8 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit_arg,
|
||||
/* Reset quick; This will be restored in 'use_filesort' if needed */
|
||||
select->quick= 0;
|
||||
save_cond= select->cond;
|
||||
select->cond= select->original_cond;
|
||||
if (select->pre_idx_push_select_cond)
|
||||
select->cond= select->pre_idx_push_select_cond;
|
||||
res= select->test_quick_select(tab->join->thd, new_ref_key_map, 0,
|
||||
(tab->join->select_options &
|
||||
OPTION_FOUND_ROWS) ?
|
||||
@ -16816,8 +16817,8 @@ check_reverse_order:
|
||||
Restore the original condition as changes done by pushdown
|
||||
condition are not relevant anymore
|
||||
*/
|
||||
if (tab->select)
|
||||
tab->set_cond(tab->select->original_cond);
|
||||
if (tab->select && tab->select->pre_idx_push_select_cond)
|
||||
tab->set_cond(tab->select->pre_idx_push_select_cond);
|
||||
|
||||
/*
|
||||
TODO: update the number of records in join->best_positions[tablenr]
|
||||
@ -18820,7 +18821,9 @@ static bool add_ref_to_table_cond(THD *thd, JOIN_TAB *join_tab)
|
||||
{
|
||||
if (join_tab->select->cond)
|
||||
error=(int) cond->add(join_tab->select->cond);
|
||||
join_tab->select->cond= join_tab->select->original_cond= cond;
|
||||
join_tab->select->cond= cond;
|
||||
if (join_tab->select->pre_idx_push_select_cond)
|
||||
join_tab->select->pre_idx_push_select_cond= cond;
|
||||
join_tab->set_select_cond(cond, __LINE__);
|
||||
}
|
||||
else if ((join_tab->select= make_select(join_tab->table, 0, 0, cond, 0,
|
||||
|
Reference in New Issue
Block a user