Commit 129626f1 authored by Varun Gupta's avatar Varun Gupta

Added get_item() to Cached_item_item and get_value to the Cached_item

parent 280945bf
...@@ -5303,6 +5303,8 @@ class Cached_item :public Sql_alloc ...@@ -5303,6 +5303,8 @@ class Cached_item :public Sql_alloc
/* Compare the cached value with the source value, without copying */ /* Compare the cached value with the source value, without copying */
virtual int cmp_read_only()=0; virtual int cmp_read_only()=0;
virtual void clear()=0;
virtual ~Cached_item(); /*line -e1509 */ virtual ~Cached_item(); /*line -e1509 */
}; };
...@@ -5320,6 +5322,14 @@ class Cached_item_item : public Cached_item ...@@ -5320,6 +5322,14 @@ class Cached_item_item : public Cached_item
cmp(); cmp();
item= save; item= save;
} }
Item* get_item()
{
return item;
}
void clear()
{
null_value= false;
}
}; };
class Cached_item_str :public Cached_item_item class Cached_item_str :public Cached_item_item
...@@ -5330,6 +5340,10 @@ class Cached_item_str :public Cached_item_item ...@@ -5330,6 +5340,10 @@ class Cached_item_str :public Cached_item_item
Cached_item_str(THD *thd, Item *arg); Cached_item_str(THD *thd, Item *arg);
bool cmp(void); bool cmp(void);
int cmp_read_only(); int cmp_read_only();
void clear()
{
null_value= false;
}
~Cached_item_str(); // Deallocate String:s ~Cached_item_str(); // Deallocate String:s
}; };
...@@ -5341,6 +5355,12 @@ class Cached_item_real :public Cached_item_item ...@@ -5341,6 +5355,12 @@ class Cached_item_real :public Cached_item_item
Cached_item_real(Item *item_par) :Cached_item_item(item_par),value(0.0) {} Cached_item_real(Item *item_par) :Cached_item_item(item_par),value(0.0) {}
bool cmp(void); bool cmp(void);
int cmp_read_only(); int cmp_read_only();
double get_value(){ return value;}
void clear()
{
value=0.0;
null_value= false;
}
}; };
class Cached_item_int :public Cached_item_item class Cached_item_int :public Cached_item_item
...@@ -5350,6 +5370,12 @@ class Cached_item_int :public Cached_item_item ...@@ -5350,6 +5370,12 @@ class Cached_item_int :public Cached_item_item
Cached_item_int(Item *item_par) :Cached_item_item(item_par),value(0) {} Cached_item_int(Item *item_par) :Cached_item_item(item_par),value(0) {}
bool cmp(void); bool cmp(void);
int cmp_read_only(); int cmp_read_only();
longlong get_value(){ return value;}
void clear()
{
value=0.0;
null_value= false;
}
}; };
...@@ -5360,6 +5386,12 @@ class Cached_item_decimal :public Cached_item_item ...@@ -5360,6 +5386,12 @@ class Cached_item_decimal :public Cached_item_item
Cached_item_decimal(Item *item_par); Cached_item_decimal(Item *item_par);
bool cmp(void); bool cmp(void);
int cmp_read_only(); int cmp_read_only();
my_decimal get_value(){ return value;};
void clear()
{
null_value= false;
my_decimal_set_zero(&value);
}
}; };
class Cached_item_field :public Cached_item class Cached_item_field :public Cached_item
...@@ -5377,6 +5409,10 @@ class Cached_item_field :public Cached_item ...@@ -5377,6 +5409,10 @@ class Cached_item_field :public Cached_item
} }
bool cmp(void); bool cmp(void);
int cmp_read_only(); int cmp_read_only();
void clear()
{
null_value= false;
}
}; };
class Item_default_value : public Item_field class Item_default_value : public Item_field
......
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