mirror of
https://github.com/MariaDB/server.git
synced 2026-04-23 00:35:32 +02:00
Merge.
This commit is contained in:
commit
c1ebb566b3
16 changed files with 177 additions and 41 deletions
|
|
@ -1792,7 +1792,7 @@ Item *Item_in_optimizer::transform(Item_transformer transformer, uchar *argument
|
|||
if (!new_item)
|
||||
return 0;
|
||||
if (args[1] != new_item)
|
||||
current_thd->change_item_tree(args, new_item);
|
||||
current_thd->change_item_tree(args + 1, new_item);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1698,7 +1698,7 @@ bool Item_allany_subselect::transform_into_max_min(JOIN *join)
|
|||
The swap is needed for expressions of type 'f1 < ALL ( SELECT ....)'
|
||||
where we want to evaluate the sub query even if f1 would be null.
|
||||
*/
|
||||
subs= func->create_swap(left_expr, subs);
|
||||
subs= func->create_swap(*(optimizer->get_cache()), subs);
|
||||
thd->change_item_tree(place, subs);
|
||||
if (subs->fix_fields(thd, &subs))
|
||||
DBUG_RETURN(true);
|
||||
|
|
|
|||
|
|
@ -354,6 +354,12 @@ public:
|
|||
Table record buffer used by this quick select.
|
||||
*/
|
||||
uchar *record;
|
||||
|
||||
virtual void replace_handler(handler *new_file)
|
||||
{
|
||||
DBUG_ASSERT(0); /* Only supported in QUICK_RANGE_SELECT */
|
||||
}
|
||||
|
||||
#ifndef DBUG_OFF
|
||||
/*
|
||||
Print quick select information to DBUG_FILE. Caller is responsible
|
||||
|
|
@ -449,6 +455,7 @@ public:
|
|||
#ifndef DBUG_OFF
|
||||
void dbug_dump(int indent, bool verbose);
|
||||
#endif
|
||||
virtual void replace_handler(handler *new_file) { file= new_file; }
|
||||
private:
|
||||
/* Default copy ctor used by QUICK_SELECT_DESC */
|
||||
friend class TRP_ROR_INTERSECT;
|
||||
|
|
|
|||
|
|
@ -588,10 +588,8 @@ void eliminate_tables(JOIN *join)
|
|||
if (!join->outer_join)
|
||||
DBUG_VOID_RETURN;
|
||||
|
||||
#ifndef DBUG_OFF
|
||||
if (!optimizer_flag(thd, OPTIMIZER_SWITCH_TABLE_ELIMINATION))
|
||||
DBUG_VOID_RETURN; /* purecov: inspected */
|
||||
#endif
|
||||
|
||||
/* Find the tables that are referred to from WHERE/HAVING */
|
||||
used_tables= (join->conds? join->conds->used_tables() : 0) |
|
||||
|
|
|
|||
|
|
@ -9701,6 +9701,8 @@ bool JOIN_TAB::preread_init()
|
|||
derived, DT_CREATE | DT_FILL))
|
||||
return TRUE;
|
||||
preread_init_done= TRUE;
|
||||
if (select && select->quick)
|
||||
select->quick->replace_handler(table->file);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue