summaryrefslogtreecommitdiff
path: root/sql/item_timefunc.h
diff options
context:
space:
mode:
authorMonty <monty@mariadb.org>2020-09-02 03:13:32 +0300
committerSergei Golubchik <serg@mariadb.org>2021-05-19 22:27:28 +0200
commit6079b46d8d371262882d1bbe7ebeec23b2f83075 (patch)
treead649946b27e58e5b451b6bbd470d14d1c161189 /sql/item_timefunc.h
parent7ca4e381f7af59dad07aebc5dc4f467b235ab962 (diff)
downloadmariadb-git-6079b46d8d371262882d1bbe7ebeec23b2f83075.tar.gz
Split item->flags into base_flags and with_flags
This was done to simplify copying of with_* flags Other things: - Changed Flags to C++ enums, which enables gdb to print out bit values for the flags. This also enables compiler errors if one tries to manipulate a non existing bit in a variable. - Added set_maybe_null() as a shortcut as setting the MAYBE_NULL flags was used in a LOT of places. - Renamed PARAM flag to SP_VAR to ensure it's not confused with persistent statement parameters.
Diffstat (limited to 'sql/item_timefunc.h')
-rw-r--r--sql/item_timefunc.h44
1 files changed, 22 insertions, 22 deletions
diff --git a/sql/item_timefunc.h b/sql/item_timefunc.h
index 26501dbd077..c717a7bde98 100644
--- a/sql/item_timefunc.h
+++ b/sql/item_timefunc.h
@@ -97,7 +97,7 @@ public:
{
decimals=0;
max_length=6*MY_CHARSET_BIN_MB_MAXLEN;
- flags|= ITEM_FLAG_MAYBE_NULL;
+ set_maybe_null();
return FALSE;
}
enum_monotonicity_info get_monotonicity_info() const;
@@ -125,7 +125,7 @@ public:
{
decimals=0;
fix_char_length(12);
- flags|= ITEM_FLAG_MAYBE_NULL;
+ set_maybe_null();
return FALSE;
}
enum_monotonicity_info get_monotonicity_info() const;
@@ -152,7 +152,7 @@ public:
{
decimals=0;
max_length=2*MY_CHARSET_BIN_MB_MAXLEN;
- flags|= ITEM_FLAG_MAYBE_NULL;
+ set_maybe_null();
return FALSE;
}
bool check_partition_func_processor(void *int_arg) {return FALSE;}
@@ -177,7 +177,7 @@ public:
{
decimals= 0;
fix_char_length(2);
- flags|= ITEM_FLAG_MAYBE_NULL;
+ set_maybe_null();
return FALSE;
}
bool check_partition_func_processor(void *int_arg) {return FALSE;}
@@ -223,7 +223,7 @@ public:
{
decimals= 0;
fix_char_length(3);
- flags|= ITEM_FLAG_MAYBE_NULL;
+ set_maybe_null();
return FALSE;
}
bool check_partition_func_processor(void *int_arg) {return FALSE;}
@@ -247,7 +247,7 @@ public:
{
decimals=0;
max_length=2*MY_CHARSET_BIN_MB_MAXLEN;
- flags|= ITEM_FLAG_MAYBE_NULL;
+ set_maybe_null();
return FALSE;
}
bool check_partition_func_processor(void *int_arg) {return FALSE;}
@@ -271,7 +271,7 @@ public:
{
decimals=0;
max_length=2*MY_CHARSET_BIN_MB_MAXLEN;
- flags|= ITEM_FLAG_MAYBE_NULL;
+ set_maybe_null();
return FALSE;
}
bool check_partition_func_processor(void *int_arg) {return FALSE;}
@@ -295,7 +295,7 @@ public:
{
decimals=0;
max_length=1*MY_CHARSET_BIN_MB_MAXLEN;
- flags|= ITEM_FLAG_MAYBE_NULL;
+ set_maybe_null();
return FALSE;
}
bool check_partition_func_processor(void *int_arg) {return FALSE;}
@@ -319,7 +319,7 @@ public:
{
decimals=0;
max_length=2*MY_CHARSET_BIN_MB_MAXLEN;
- flags|= ITEM_FLAG_MAYBE_NULL;
+ set_maybe_null();
return FALSE;
}
bool check_partition_func_processor(void *int_arg) {return FALSE;}
@@ -349,7 +349,7 @@ public:
{
decimals=0;
max_length=2*MY_CHARSET_BIN_MB_MAXLEN;
- flags|= ITEM_FLAG_MAYBE_NULL;
+ set_maybe_null();
return FALSE;
}
bool check_vcol_func_processor(void *arg)
@@ -382,7 +382,7 @@ public:
{
decimals=0;
max_length=6*MY_CHARSET_BIN_MB_MAXLEN;
- flags|= ITEM_FLAG_MAYBE_NULL;
+ set_maybe_null();
return FALSE;
}
bool check_partition_func_processor(void *int_arg) {return FALSE;}
@@ -408,7 +408,7 @@ public:
{
decimals=0;
max_length=4*MY_CHARSET_BIN_MB_MAXLEN;
- flags|= ITEM_FLAG_MAYBE_NULL;
+ set_maybe_null();
return FALSE;
}
bool check_partition_func_processor(void *int_arg) {return FALSE;}
@@ -441,7 +441,7 @@ public:
{
decimals= 0;
fix_char_length(1);
- flags|= ITEM_FLAG_MAYBE_NULL;
+ set_maybe_null();
return FALSE;
}
bool check_partition_func_processor(void *int_arg) {return FALSE;}
@@ -487,7 +487,7 @@ public:
DBUG_ASSERT(dec <= TIME_SECOND_PART_DIGITS);
decimals= dec;
max_length=17 + (decimals ? decimals + 1 : 0);
- flags|= ITEM_FLAG_MAYBE_NULL;
+ set_maybe_null();
if (decimals)
set_handler(&type_handler_newdecimal);
else
@@ -906,7 +906,7 @@ class Item_func_convert_tz :public Item_datetimefunc
bool fix_length_and_dec()
{
fix_attributes_datetime(args[0]->datetime_precision(current_thd));
- flags|= ITEM_FLAG_MAYBE_NULL;
+ set_maybe_null();
return FALSE;
}
bool get_date(THD *thd, MYSQL_TIME *res, date_mode_t fuzzydate);
@@ -926,7 +926,7 @@ public:
bool fix_length_and_dec()
{
fix_attributes_time(args[0]->decimals);
- flags|= ITEM_FLAG_MAYBE_NULL;
+ set_maybe_null();
return FALSE;
}
const char *func_name() const { return "sec_to_time"; }
@@ -1214,7 +1214,7 @@ public:
uint dec0= args[0]->datetime_precision(thd);
uint dec1= Interval_DDhhmmssff::fsp(thd, args[1]);
fix_attributes_datetime(MY_MAX(dec0, dec1));
- flags|= ITEM_FLAG_MAYBE_NULL;
+ set_maybe_null();
return false;
}
bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate)
@@ -1274,7 +1274,7 @@ public:
uint dec= MY_MAX(args[0]->time_precision(thd),
args[1]->time_precision(thd));
fix_attributes_time(dec);
- flags|= ITEM_FLAG_MAYBE_NULL;
+ set_maybe_null();
return FALSE;
}
bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate);
@@ -1296,7 +1296,7 @@ public:
bool fix_length_and_dec()
{
fix_attributes_time(args[2]->decimals);
- flags|= ITEM_FLAG_MAYBE_NULL;
+ set_maybe_null();
return FALSE;
}
const char *func_name() const { return "maketime"; }
@@ -1315,7 +1315,7 @@ public:
bool fix_length_and_dec()
{
decimals=0;
- flags|= ITEM_FLAG_MAYBE_NULL;
+ set_maybe_null();
fix_char_length(6);
return FALSE;
}
@@ -1346,7 +1346,7 @@ public:
bool fix_length_and_dec()
{
decimals=0;
- flags|= ITEM_FLAG_MAYBE_NULL;
+ set_maybe_null();
return FALSE;
}
virtual void print(String *str, enum_query_type query_type);
@@ -1371,7 +1371,7 @@ public:
const char *func_name() const { return "get_format"; }
bool fix_length_and_dec()
{
- flags|= ITEM_FLAG_MAYBE_NULL;
+ set_maybe_null();
decimals=0;
fix_length_and_charset(17, default_charset());
return FALSE;