diff options
Diffstat (limited to 'sql/item.h')
-rw-r--r-- | sql/item.h | 48 |
1 files changed, 37 insertions, 11 deletions
diff --git a/sql/item.h b/sql/item.h index 05e35e97e04..2158206441e 100644 --- a/sql/item.h +++ b/sql/item.h @@ -539,17 +539,17 @@ public: uint name_length; /* Length of name */ int8 marker; uint8 decimals; - my_bool maybe_null; /* If item may be null */ - my_bool null_value; /* if item is null */ - my_bool unsigned_flag; - my_bool with_sum_func; - my_bool fixed; /* If item fixed with fix_fields */ - my_bool is_autogenerated_name; /* indicate was name of this Item + bool maybe_null; /* If item may be null */ + bool null_value; /* if item is null */ + bool unsigned_flag; + bool with_sum_func; + bool fixed; /* If item fixed with fix_fields */ + bool is_autogenerated_name; /* indicate was name of this Item autogenerated or set by user */ - DTCollation collation; - my_bool with_subselect; /* If this item is a subselect or some + bool with_subselect; /* If this item is a subselect or some of its arguments is or contains a subselect */ + DTCollation collation; Item_result cmp_context; /* Comparison context */ // alloc & destruct is done as start of select using sql_alloc Item(); @@ -890,6 +890,7 @@ public: set value of aggregate function in case of no rows for grouping were found */ virtual void no_rows_in_result() {} + virtual void restore_to_before_no_rows_in_result() {} virtual Item *copy_or_same(THD *thd) { return this; } virtual Item *copy_andor_structure(THD *thd) { return this; } virtual Item *real_item() { return this; } @@ -947,6 +948,21 @@ public: virtual bool register_field_in_read_map(uchar *arg) { return 0; } virtual bool enumerate_field_refs_processor(uchar *arg) { return 0; } virtual bool mark_as_eliminated_processor(uchar *arg) { return 0; } + + /* To call bool function for all arguments */ + struct bool_func_call_args + { + Item *original_func_item; + void (Item::*bool_function)(); + }; + bool call_bool_func_processor(uchar *org_item) + { + bool_func_call_args *info= (bool_func_call_args*) org_item; + /* Avoid recursion, as walk also calls for original item */ + if (info->original_func_item != this) + (this->*(info->bool_function))(); + return FALSE; + } /* The next function differs from the previous one that a bitmap to be updated is passed as uchar *arg. @@ -1938,7 +1954,7 @@ public: { return (uint)(max_length - test(value < 0)); } bool eq(const Item *, bool binary_cmp) const; bool check_partition_func_processor(uchar *bool_arg) { return FALSE;} - bool check_vcol_func_processor(uchar arg) { return FALSE;} + bool check_vcol_func_processor(uchar *arg) { return FALSE;} }; @@ -2477,6 +2493,14 @@ public: } bool enumerate_field_refs_processor(uchar *arg) { return (*ref)->enumerate_field_refs_processor(arg); } + void no_rows_in_result() + { + (*ref)->no_rows_in_result(); + } + void restore_to_before_no_rows_in_result() + { + (*ref)->restore_to_before_no_rows_in_result(); + } virtual void print(String *str, enum_query_type query_type); bool result_as_longlong() { @@ -2767,6 +2791,7 @@ public: { return (*ref)->const_item() ? 0 : OUTER_REF_TABLE_BIT; } + table_map not_null_tables() const { return 0; } virtual Ref_Type ref_type() { return OUTER_REF; } bool check_inner_refs_processor(uchar * arg); }; @@ -2826,7 +2851,7 @@ class Item_int_with_ref :public Item_int { Item *ref; public: - Item_int_with_ref(longlong i, Item *ref_arg, my_bool unsigned_arg) : + Item_int_with_ref(longlong i, Item *ref_arg, bool unsigned_arg) : Item_int(i), ref(ref_arg) { unsigned_flag= unsigned_arg; @@ -3071,7 +3096,7 @@ public: class Cached_item :public Sql_alloc { public: - my_bool null_value; + bool null_value; Cached_item() :null_value(0) {} virtual bool cmp(void)=0; virtual ~Cached_item(); /*line -e1509 */ @@ -3080,6 +3105,7 @@ public: class Cached_item_str :public Cached_item { Item *item; + uint32 value_max_length; String value,tmp_value; public: Cached_item_str(THD *thd, Item *arg); |