diff options
author | unknown <sanja@askmonty.org> | 2013-09-25 17:16:13 +0300 |
---|---|---|
committer | unknown <sanja@askmonty.org> | 2013-09-25 17:16:13 +0300 |
commit | 64d6d8334fa63a0faa6d91ded21eca8e3871c7ec (patch) | |
tree | c313ec7d9f9db0c90649df5297e2d39230986291 /sql/item_func.h | |
parent | 72dffd878e47e4fcfd224cadfea06caed0ac956b (diff) | |
parent | ec7da1561e028aac40dee69433113978c982ce84 (diff) | |
download | mariadb-git-64d6d8334fa63a0faa6d91ded21eca8e3871c7ec.tar.gz |
merge 5.3 -> 5.5
Diffstat (limited to 'sql/item_func.h')
-rw-r--r-- | sql/item_func.h | 50 |
1 files changed, 20 insertions, 30 deletions
diff --git a/sql/item_func.h b/sql/item_func.h index eca6249d1dd..de998087618 100644 --- a/sql/item_func.h +++ b/sql/item_func.h @@ -39,8 +39,6 @@ protected: 0 means get this number from first argument */ uint allowed_arg_cols; - /* maybe_null can't be changed by parameters or used table state */ - bool persistent_maybe_null; public: uint arg_count; table_map used_tables_cache, not_null_tables_cache; @@ -66,13 +64,13 @@ public: enum Type type() const { return FUNC_ITEM; } virtual enum Functype functype() const { return UNKNOWN_FUNC; } Item_func(void): - allowed_arg_cols(1), persistent_maybe_null(0), arg_count(0) + allowed_arg_cols(1), arg_count(0) { with_sum_func= 0; with_field= 0; } Item_func(Item *a): - allowed_arg_cols(1), persistent_maybe_null(0), arg_count(1) + allowed_arg_cols(1), arg_count(1) { args= tmp_arg; args[0]= a; @@ -80,7 +78,7 @@ public: with_field= a->with_field; } Item_func(Item *a,Item *b): - allowed_arg_cols(1), persistent_maybe_null(0), arg_count(2) + allowed_arg_cols(1), arg_count(2) { args= tmp_arg; args[0]= a; args[1]= b; @@ -88,7 +86,7 @@ public: with_field= a->with_field || b->with_field; } Item_func(Item *a,Item *b,Item *c): - allowed_arg_cols(1), persistent_maybe_null(0) + allowed_arg_cols(1) { arg_count= 0; if ((args= (Item**) sql_alloc(sizeof(Item*)*3))) @@ -100,7 +98,7 @@ public: } } Item_func(Item *a,Item *b,Item *c,Item *d): - allowed_arg_cols(1), persistent_maybe_null(0) + allowed_arg_cols(1) { arg_count= 0; if ((args= (Item**) sql_alloc(sizeof(Item*)*4))) @@ -114,7 +112,7 @@ public: } } Item_func(Item *a,Item *b,Item *c,Item *d,Item* e): - allowed_arg_cols(1), persistent_maybe_null(0) + allowed_arg_cols(1) { arg_count= 5; if ((args= (Item**) sql_alloc(sizeof(Item*)*5))) @@ -182,7 +180,7 @@ public: if (max_result_length >= MAX_BLOB_WIDTH) { max_length= MAX_BLOB_WIDTH; - set_persist_maybe_null(1); + maybe_null= 1; } else max_length= (uint32) max_result_length; @@ -388,11 +386,6 @@ public: info.bool_function= &Item::restore_to_before_no_rows_in_result; walk(&Item::call_bool_func_processor, FALSE, (uchar*) &info); } - inline void set_persist_maybe_null(bool mb_null) - { - maybe_null= mb_null; - persistent_maybe_null= 1; - } }; @@ -675,7 +668,7 @@ public: } double val_real(); enum_field_types field_type() const { return MYSQL_TYPE_DOUBLE; } - void fix_length_and_dec() { set_persist_maybe_null(1); } + void fix_length_and_dec() { maybe_null= 1; } const char *func_name() const { return "double_typecast"; } virtual void print(String *str, enum_query_type query_type); }; @@ -816,7 +809,7 @@ class Item_dec_func :public Item_real_func void fix_length_and_dec() { decimals=NOT_FIXED_DEC; max_length=float_length(decimals); - set_persist_maybe_null(1); + maybe_null=1; } }; @@ -1148,7 +1141,7 @@ public: Item_func_coercibility(Item *a) :Item_int_func(a) {} longlong val_int(); const char *func_name() const { return "coercibility"; } - void fix_length_and_dec() { max_length=10; set_persist_maybe_null(0); } + void fix_length_and_dec() { max_length=10; maybe_null= 0; } table_map not_null_tables() const { return 0; } }; @@ -1311,7 +1304,7 @@ public: {} longlong val_int(); const char *func_name() const { return "benchmark"; } - void fix_length_and_dec() { max_length=1; set_persist_maybe_null(0); } + void fix_length_and_dec() { max_length=1; maybe_null=0; } virtual void print(String *str, enum_query_type query_type); bool check_vcol_func_processor(uchar *int_arg) { @@ -1564,7 +1557,7 @@ public: double val_real() { DBUG_ASSERT(fixed == 1); null_value= 1; return 0.0; } longlong val_int() { DBUG_ASSERT(fixed == 1); null_value=1; return 0; } enum Item_result result_type () const { return STRING_RESULT; } - void fix_length_and_dec() { set_persist_maybe_null(1); max_length=0; } + void fix_length_and_dec() { maybe_null=1; max_length=0; } }; #endif /* HAVE_DLOPEN */ @@ -1585,7 +1578,7 @@ class Item_func_get_lock :public Item_int_func Item_func_get_lock(Item *a,Item *b) :Item_int_func(a,b) {} longlong val_int(); const char *func_name() const { return "get_lock"; } - void fix_length_and_dec() { max_length=1; set_persist_maybe_null(1);} + void fix_length_and_dec() { max_length=1; maybe_null=1;} bool check_vcol_func_processor(uchar *int_arg) { return trace_unsupported_by_check_vcol_func_processor(func_name()); @@ -1599,7 +1592,7 @@ public: Item_func_release_lock(Item *a) :Item_int_func(a) {} longlong val_int(); const char *func_name() const { return "release_lock"; } - void fix_length_and_dec() { max_length=1; set_persist_maybe_null(1);} + void fix_length_and_dec() { max_length=1; maybe_null=1;} bool check_vcol_func_processor(uchar *int_arg) { return trace_unsupported_by_check_vcol_func_processor(func_name()); @@ -1616,7 +1609,7 @@ public: Item_master_pos_wait(Item *a,Item *b,Item *c) :Item_int_func(a,b,c) {} longlong val_int(); const char *func_name() const { return "master_pos_wait"; } - void fix_length_and_dec() { max_length=21; set_persist_maybe_null(1);} + void fix_length_and_dec() { max_length=21; maybe_null=1;} bool check_vcol_func_processor(uchar *int_arg) { return trace_unsupported_by_check_vcol_func_processor(func_name()); @@ -1834,8 +1827,7 @@ public: Item_func_inet_aton(Item *a) :Item_int_func(a) {} longlong val_int(); const char *func_name() const { return "inet_aton"; } - void fix_length_and_dec() - { decimals= 0; max_length= 21; set_persist_maybe_null(1); unsigned_flag= 1; } + void fix_length_and_dec() { decimals= 0; max_length= 21; maybe_null= 1; unsigned_flag= 1;} }; @@ -1903,8 +1895,7 @@ public: Item_func_is_free_lock(Item *a) :Item_int_func(a) {} longlong val_int(); const char *func_name() const { return "is_free_lock"; } - void fix_length_and_dec() - { decimals= 0; max_length= 1; set_persist_maybe_null(1); } + void fix_length_and_dec() { decimals=0; max_length=1; maybe_null=1;} bool check_vcol_func_processor(uchar *int_arg) { return trace_unsupported_by_check_vcol_func_processor(func_name()); @@ -1918,8 +1909,7 @@ public: Item_func_is_used_lock(Item *a) :Item_int_func(a) {} longlong val_int(); const char *func_name() const { return "is_used_lock"; } - void fix_length_and_dec() - { decimals= 0; max_length= 10; set_persist_maybe_null(1);} + void fix_length_and_dec() { decimals=0; max_length=10; maybe_null=1;} bool check_vcol_func_processor(uchar *int_arg) { return trace_unsupported_by_check_vcol_func_processor(func_name()); @@ -1942,7 +1932,7 @@ public: Item_func_row_count() :Item_int_func() {} longlong val_int(); const char *func_name() const { return "row_count"; } - void fix_length_and_dec() { decimals= 0; set_persist_maybe_null(0); } + void fix_length_and_dec() { decimals= 0; maybe_null=0; } bool check_vcol_func_processor(uchar *int_arg) { @@ -2083,7 +2073,7 @@ public: Item_func_found_rows() :Item_int_func() {} longlong val_int(); const char *func_name() const { return "found_rows"; } - void fix_length_and_dec() { decimals= 0; set_persist_maybe_null(0); } + void fix_length_and_dec() { decimals= 0; maybe_null=0; } bool check_vcol_func_processor(uchar *int_arg) { return trace_unsupported_by_check_vcol_func_processor(func_name()); |