mirror of
https://github.com/MariaDB/server.git
synced 2025-01-29 02:05:57 +01:00
Fix bug lp:889744
MariaDB 5.5 merges changes from MySQL 5.5 where all constant expressions are wrapped into an Item_cache. As a result, constant single-row subqueries were also wrapped in an Item_cache. When analyzing the where clause for constant expressions that can be evaluated during optimization, subqueries wrapped into an Item_cache did not appear as expensive, and were therefore evaluated during optimization. Such evaluation is against the current architecture of MariaDB 5.3 where subquries are executed during the execute phase. The patch adds the is_expensive() predicate to Item_cache. This makes Item_cache consistent with other wrapping Item classes that need to look at the properties of the wrapped object.
This commit is contained in:
parent
c25f472599
commit
147721bbb6
1 changed files with 14 additions and 0 deletions
14
sql/item.h
14
sql/item.h
|
@ -3637,6 +3637,20 @@ public:
|
|||
virtual void store(Item *item);
|
||||
virtual bool cache_value()= 0;
|
||||
bool is_null() { return null_value; }
|
||||
virtual bool is_expensive()
|
||||
{
|
||||
DBUG_ASSERT(example);
|
||||
if (value_cached)
|
||||
return false;
|
||||
return example->is_expensive();
|
||||
}
|
||||
bool is_expensive_processor(uchar *arg)
|
||||
{
|
||||
DBUG_ASSERT(example);
|
||||
if (value_cached)
|
||||
return false;
|
||||
return example->is_expensive_processor(arg);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue