summaryrefslogtreecommitdiff
path: root/sql/item_func.h
diff options
context:
space:
mode:
authorunknown <sanja@askmonty.org>2013-09-25 21:07:06 +0300
committerunknown <sanja@askmonty.org>2013-09-25 21:07:06 +0300
commit9d83468e78ba23f024ce3c11443913ad75cf1ea5 (patch)
tree0cef7fa6a3fd2e47fe22d105b2b8bbfe1b5a03e0 /sql/item_func.h
parent2fe0836eed16ce5809c34064893681f12c77da9f (diff)
parent64d6d8334fa63a0faa6d91ded21eca8e3871c7ec (diff)
downloadmariadb-git-9d83468e78ba23f024ce3c11443913ad75cf1ea5.tar.gz
merge 5.5 -> 10.0-base
Diffstat (limited to 'sql/item_func.h')
-rw-r--r--sql/item_func.h50
1 files changed, 20 insertions, 30 deletions
diff --git a/sql/item_func.h b/sql/item_func.h
index 3c3c6861d33..e236882b615 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;
/*
@@ -73,13 +71,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;
@@ -87,7 +85,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;
@@ -95,7 +93,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)))
@@ -107,7 +105,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)))
@@ -121,7 +119,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)))
@@ -189,7 +187,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;
@@ -395,11 +393,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;
- }
};
@@ -684,7 +677,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);
};
@@ -825,7 +818,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;
}
};
@@ -1157,7 +1150,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; }
};
@@ -1320,7 +1313,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)
{
@@ -1576,7 +1569,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 */
@@ -1591,7 +1584,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;}
table_map used_tables() const
{
return Item_int_func::used_tables() | RAND_TABLE_BIT;
@@ -1611,7 +1604,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;}
table_map used_tables() const
{
return Item_int_func::used_tables() | RAND_TABLE_BIT;
@@ -1635,7 +1628,7 @@ public:
Item_master_pos_wait(Item *a,Item *b, Item *c, Item *d) :Item_int_func(a,b,c,d) {}
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());
@@ -1859,8 +1852,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;}
};
@@ -1928,8 +1920,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());
@@ -1943,8 +1934,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());
@@ -1967,7 +1957,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)
{
@@ -2108,7 +2098,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());