Commit 2e593af6 authored by Sergey Petrunya's avatar Sergey Petrunya

Subquery optimizations: backport

- Fix valgrind failure: do initialize Item::is_expensive_cache.
parent d10ca84f
...@@ -373,8 +373,8 @@ int Item::save_str_value_in_field(Field *field, String *result) ...@@ -373,8 +373,8 @@ int Item::save_str_value_in_field(Field *field, String *result)
Item::Item(): Item::Item():
rsize(0), name(0), orig_name(0), name_length(0), fixed(0), is_expensive_cache(-1), rsize(0), name(0), orig_name(0), name_length(0),
is_autogenerated_name(TRUE), fixed(0), is_autogenerated_name(TRUE),
collation(&my_charset_bin, DERIVATION_COERCIBLE) collation(&my_charset_bin, DERIVATION_COERCIBLE)
{ {
marker= 0; marker= 0;
...@@ -410,6 +410,7 @@ Item::Item(): ...@@ -410,6 +410,7 @@ Item::Item():
tables. tables.
*/ */
Item::Item(THD *thd, Item *item): Item::Item(THD *thd, Item *item):
is_expensive_cache(-1),
rsize(0), rsize(0),
str_value(item->str_value), str_value(item->str_value),
name(item->name), name(item->name),
......
...@@ -513,6 +513,9 @@ class Item { ...@@ -513,6 +513,9 @@ class Item {
enum traverse_order { POSTFIX, PREFIX }; enum traverse_order { POSTFIX, PREFIX };
/* Cache of the result of is_expensive(). */
int8 is_expensive_cache;
/* Reuse size, only used by SP local variable assignment, otherwize 0 */ /* Reuse size, only used by SP local variable assignment, otherwize 0 */
uint rsize; uint rsize;
...@@ -878,9 +881,6 @@ class Item { ...@@ -878,9 +881,6 @@ class Item {
static CHARSET_INFO *default_charset(); static CHARSET_INFO *default_charset();
virtual CHARSET_INFO *compare_collation() { return NULL; } virtual CHARSET_INFO *compare_collation() { return NULL; }
/* Cache of the result of is_expensive(). */
int8 is_expensive_cache;
virtual bool walk(Item_processor processor, bool walk_subquery, uchar *arg) virtual bool walk(Item_processor processor, bool walk_subquery, uchar *arg)
{ {
return (this->*processor)(arg); return (this->*processor)(arg);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment