summaryrefslogtreecommitdiff
path: root/sql/item.h
diff options
context:
space:
mode:
Diffstat (limited to 'sql/item.h')
-rw-r--r--sql/item.h18
1 files changed, 11 insertions, 7 deletions
diff --git a/sql/item.h b/sql/item.h
index 115e9426691..fc36148e443 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -43,7 +43,6 @@ public:
uint8 marker,decimals;
my_bool maybe_null; /* If item may be null */
my_bool null_value; /* if item is null */
- my_bool binary;
my_bool unsigned_flag;
my_bool with_sum_func;
@@ -71,6 +70,7 @@ public:
virtual double val_result() { return val(); }
virtual longlong val_int_result() { return val_int(); }
virtual String *str_result(String* tmp) { return val_str(tmp); }
+ virtual bool is_null_result() { return is_null(); }
virtual table_map used_tables() const { return (table_map) 0L; }
virtual bool basic_const_item() const { return 0; }
virtual Item *new_item() { return 0; } /* Only for const items */
@@ -83,7 +83,10 @@ public:
virtual void split_sum_func(List<Item> &fields) {}
virtual bool get_date(TIME *ltime,bool fuzzydate);
virtual bool get_time(TIME *ltime);
- virtual bool is_null() { return 0; }
+ virtual bool is_null() { return 0; };
+ virtual CHARSET_INFO *charset() const { return str_value.charset(); };
+ virtual bool binary() const { return str_value.charset()->state & MY_CS_BINSORT ? 1 : 0 ; }
+ virtual void set_charset(CHARSET_INFO *cs) { str_value.set_charset(cs); }
};
@@ -124,6 +127,7 @@ public:
double val_result();
longlong val_int_result();
String *str_result(String* tmp);
+ bool is_null_result() { return result_field->is_null(); }
bool send(THD *thd, String *str_arg)
{
return result_field->send(thd,str_arg);
@@ -359,7 +363,7 @@ public:
class Item_varbinary :public Item
{
public:
- Item_varbinary(const char *str,uint str_length,CHARSET_INFO *cs);
+ Item_varbinary(const char *str,uint str_length);
~Item_varbinary() {}
enum Type type() const { return VARBIN_ITEM; }
double val() { return (double) Item_varbinary::val_int(); }
@@ -398,25 +402,25 @@ public:
double val()
{
double tmp=(*ref)->val_result();
- null_value=(*ref)->null_value;
+ null_value=(*ref)->is_null_result();
return tmp;
}
longlong val_int()
{
longlong tmp=(*ref)->val_int_result();
- null_value=(*ref)->null_value;
+ null_value=(*ref)->is_null_result();
return tmp;
}
String *val_str(String* tmp)
{
tmp=(*ref)->str_result(tmp);
- null_value=(*ref)->null_value;
+ null_value=(*ref)->is_null_result();
return tmp;
}
bool is_null()
{
(void) (*ref)->val_int_result();
- return (*ref)->null_value;
+ return (*ref)->is_null_result();
}
bool get_date(TIME *ltime,bool fuzzydate)
{