1#ifndef ITEM_TIMEFUNC_INCLUDED
2#define ITEM_TIMEFUNC_INCLUDED
70 const char *
func_name()
const override {
return "period_add"; }
80 const char *
func_name()
const override {
return "period_diff"; }
89 const char *
func_name()
const override {
return "to_days"; }
104 const char *
func_name()
const override {
return "to_seconds"; }
112 int *input_version = (
int *)
int_arg;
114 int output_version = std::max(*input_version, 50500);
115 *input_version = output_version;
130 const char *
func_name()
const override {
return "dayofmonth"; }
163 const char *
func_name()
const override {
return "month"; }
178 const char *
func_name()
const override {
return "monthname"; }
192 const char *
func_name()
const override {
return "dayofyear"; }
205 const char *
func_name()
const override {
return "hour"; }
218 const char *
func_name()
const override {
return "minute"; }
231 const char *
func_name()
const override {
return "quarter"; }
244 const char *
func_name()
const override {
return "second"; }
263 const char *
func_name()
const override {
return "week"; }
273 const char *
func_name()
const override {
return "yearweek"; }
286 const char *
func_name()
const override {
return "year"; }
303 const char *
func_name()
const override {
return "cast_as_year"; }
325 return static_cast<double>(
val_int());
337 return (
odbc_type ?
"dayofweek" :
"weekday");
359 const char *
func_name()
const override {
return "dayname"; }
415 const char *
func_name()
const override {
return "unix_timestamp"; }
455 pointer_cast<Check_function_as_value_generator_parameters *>(p_arg);
467 const char *
func_name()
const override {
return "time_to_sec"; }
543 bool no_conversions)
override;
619 const char *
func_name()
const override {
return "date"; }
860 const char *
func_name()
const override {
return "date_literal"; }
881 bool eq(
const Item *item,
bool binary_cmp)
const override;
901 const char *
func_name()
const override {
return "time_literal"; }
922 bool eq(
const Item *item,
bool binary_cmp)
const override;
944 const char *
func_name()
const override {
return "datetime_literal"; }
966 bool eq(
const Item *item,
bool binary_cmp)
const override;
996 const char *
func_name()
const override {
return "time_zone"; }
1056 pointer_cast<Check_function_as_value_generator_parameters *>(
1071 const char *
func_name()
const override {
return "curtime"; }
1081 const char *
func_name()
const override {
return "utc_time"; }
1111 pointer_cast<Check_function_as_value_generator_parameters *>(
1125 const char *
func_name()
const override {
return "curdate"; }
1134 const char *
func_name()
const override {
return "utc_date"; }
1146 bool no_conversions)
override;
1174 pointer_cast<Check_function_as_value_generator_parameters *>(
1215 const char *
func_name()
const override {
return "utc_timestamp"; }
1227 const char *
func_name()
const override {
return "sysdate"; }
1245 const char *
func_name()
const override {
return "from_days"; }
1265 bool is_time_format_arg =
false)
1273 bool eq(
const Item *item,
bool binary_cmp)
const override;
1280 const char *
func_name()
const override {
return "from_unixtime"; }
1309 const char *
func_name()
const override {
return "convert_tz"; }
1327 const char *
func_name()
const override {
return "sec_to_time"; }
1355 const char *
func_name()
const override {
return "date_add_interval"; }
1358 bool eq(
const Item *item,
bool binary_cmp)
const override;
1388 const char *
func_name()
const override {
return "extract"; }
1390 bool eq(
const Item *item,
bool binary_cmp)
const override;
1449 const char *
func_name()
const override {
return "cast_as_date"; }
1478 const char *
func_name()
const override {
return "cast_as_time"; }
1516 const char *
func_name()
const override {
return "cast_as_datetime"; }
1537 const char *
func_name()
const override {
return "makedate"; }
1562 m_sign(negate ? -1 : 1) {}
1567 m_sign(negate ? -1 : 1) {}
1575 const char *
func_name()
const override {
return "add_time"; }
1584 const char *
func_name()
const override {
return "timediff"; }
1616 const char *
func_name()
const override {
return "maketime"; }
1625 const char *
func_name()
const override {
return "microsecond"; }
1641 const char *
func_name()
const override {
return "timestampdiff"; }
1669 const char *
func_name()
const override {
return "get_format"; }
1693 const char *
func_name()
const override {
return "str_to_date"; }
1702 const char *
func_name()
const override {
return "last_day"; }
1716 const char *
func_name()
const override {
return "internal_update_time"; }
1726 const char *
func_name()
const override {
return "internal_check_time"; }
Kerberos Client Authentication nullptr
Definition: auth_kerberos_client_plugin.cc:250
void set_numeric()
Definition: item.h:212
const CHARSET_INFO * collation
Definition: item.h:178
Implementation class for the DATE_ADD and DATE_SUB functions.
Definition: item_timefunc.h:1338
bool eq(const Item *item, bool binary_cmp) const override
Definition: item_timefunc.cc:2653
enum Functype functype() const override
Definition: item_timefunc.h:1356
void print(const THD *thd, String *str, enum_query_type query_type) const override
This method is used for to:
Definition: item_timefunc.cc:2687
const bool m_subtract
False if function is DATE_ADD, true if function is DATE_SUB.
Definition: item_timefunc.h:1375
Item_temporal_hybrid_func super
Definition: item_timefunc.h:1339
bool val_datetime(MYSQL_TIME *ltime, my_time_flags_t fuzzy_date) override
Get "native" temporal value as MYSQL_TIME.
Definition: item_timefunc.cc:2646
const char * func_name() const override
Definition: item_timefunc.h:1355
bool is_subtract() const
Definition: item_timefunc.h:1362
void add_json_info(Json_object *obj) override
Add all the node-specific json fields.
Definition: item_timefunc.cc:2698
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.cc:2468
bool get_date_internal(MYSQL_TIME *res, my_time_flags_t fuzzy_date)
Definition: item_timefunc.cc:2558
const interval_type m_interval_type
The type of the interval argument.
Definition: item_timefunc.h:1373
Item_date_add_interval(Item *a, Item *b, interval_type type, bool subtract)
POS-less ctor for post-parse construction with implicit addition to THD's free_list (see Item::Item()...
Definition: item_timefunc.h:1351
interval_type get_interval_type() const
Definition: item_timefunc.h:1361
String value
Definition: item_timefunc.h:1376
bool get_time_internal(MYSQL_TIME *res)
Definition: item_timefunc.cc:2593
Item_date_add_interval(const POS &pos, Item *a, Item *b, interval_type type, bool subtract)
Definition: item_timefunc.h:1342
Abstract class for functions returning DATE values.
Definition: item_timefunc.h:593
double val_real() override
Definition: item_timefunc.h:618
bool get_date(MYSQL_TIME *res, my_time_flags_t fuzzy_date) override=0
const char * func_name() const override
Definition: item_timefunc.h:619
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.h:621
enum Functype functype() const override
Definition: item_timefunc.h:620
Item_date_func(const POS &pos)
Definition: item_timefunc.h:601
Item_date_func()
Definition: item_timefunc.h:600
Item_date_func(Item *a)
Definition: item_timefunc.h:604
Item_date_func(const POS &pos, Item *a, Item *b)
Definition: item_timefunc.h:608
longlong val_date_temporal() override
Return date value of item in packed longlong format.
Definition: item_timefunc.cc:930
bool get_time(MYSQL_TIME *ltime) override
Definition: item_timefunc.h:612
longlong val_int() override
Definition: item_timefunc.h:616
Item_date_func(const POS &pos, Item *a)
Definition: item_timefunc.h:605
type_conversion_status save_in_field_inner(Field *field, bool) override
Helper function which does all of the work for save_in_field(Field*, bool), except some error checkin...
Definition: item_timefunc.h:595
String * val_str(String *str) override
Definition: item_timefunc.h:615
my_decimal * val_decimal(my_decimal *decimal_value) override
Definition: item_timefunc.h:622
DATE'2010-01-01'.
Definition: item_timefunc.h:847
bool basic_const_item() const override
Returns true if this is a simple constant item like an integer, not a constant expression.
Definition: item_timefunc.h:877
Item_date_literal(MYSQL_TIME *ltime)
Constructor for Item_date_literal.
Definition: item_timefunc.h:855
bool get_date(MYSQL_TIME *ltime, my_time_flags_t fuzzy_date) override
Definition: item_timefunc.h:867
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.h:875
void print(const THD *thd, String *str, enum_query_type query_type) const override
Appends function name with argument list or fractional seconds part to the String str.
Definition: item_timefunc.cc:954
bool eq(const Item *item, bool binary_cmp) const override
Definition: item_timefunc.cc:946
const char * func_name() const override
Definition: item_timefunc.h:860
longlong val_date_temporal() override
Return date value of item in packed longlong format.
Definition: item_timefunc.h:863
MYSQL_TIME_cache cached_time
Definition: item_timefunc.h:848
void cleanup() override
Called for every Item after use (preparation and execution).
Definition: item_timefunc.h:880
table_map used_tables() const override
Definition: item_timefunc.h:878
bool check_partition_func_processor(uchar *) override
Check if a partition function is allowed.
Definition: item_timefunc.h:876
String * val_str(String *str) override
Definition: item_timefunc.h:871
table_map not_null_tables() const override
Return table map of tables that can't be NULL tables (tables that are used in a context where if they...
Definition: item_timefunc.h:879
Abstract class for functions returning DATETIME values.
Definition: item_timefunc.h:635
longlong val_int() override
Definition: item_timefunc.h:678
Item_datetime_func(Item *a)
Definition: item_timefunc.h:648
Item_datetime_func(const POS &pos)
Definition: item_timefunc.h:645
Item_datetime_func()
Definition: item_timefunc.h:642
String * val_str(String *str) override
Definition: item_timefunc.h:675
double val_real() override
Definition: item_timefunc.h:674
longlong val_date_temporal() override
Return date value of item in packed longlong format.
Definition: item_timefunc.cc:938
bool get_time(MYSQL_TIME *ltime) override
Definition: item_timefunc.h:684
Item_datetime_func(const POS &pos, PT_item_list *list)
Definition: item_timefunc.h:669
Item_datetime_func(Item *a, Item *b, Item *c)
Definition: item_timefunc.h:658
type_conversion_status save_in_field_inner(Field *field, bool) override
Helper function which does all of the work for save_in_field(Field*, bool), except some error checkin...
Definition: item_timefunc.h:637
Item_datetime_func(const POS &pos, Item *a, Item *b, Item *c)
Definition: item_timefunc.h:661
bool get_date(MYSQL_TIME *res, my_time_flags_t fuzzy_date) override=0
Item_datetime_func(const POS &pos, Item *a, Item *b, Item *c, Item *d)
Definition: item_timefunc.h:665
my_decimal * val_decimal(my_decimal *decimal_value) override
Definition: item_timefunc.h:680
Item_datetime_func(const POS &pos, Item *a, Item *b)
Definition: item_timefunc.h:654
Item_datetime_func(const POS &pos, Item *a)
Definition: item_timefunc.h:651
TIMESTAMP'2001-01-01 10:20:30'.
Definition: item_timefunc.h:928
MYSQL_TIME_cache cached_time
Definition: item_timefunc.h:929
bool basic_const_item() const override
Returns true if this is a simple constant item like an integer, not a constant expression.
Definition: item_timefunc.h:962
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.h:960
table_map not_null_tables() const override
Return table map of tables that can't be NULL tables (tables that are used in a context where if they...
Definition: item_timefunc.h:964
enum Functype functype() const override
Definition: item_timefunc.h:945
const char * func_name() const override
Definition: item_timefunc.h:944
void cleanup() override
Called for every Item after use (preparation and execution).
Definition: item_timefunc.h:965
Item_datetime_literal(MYSQL_TIME *ltime, uint dec_arg, const Time_zone *tz)
Constructor for Item_datetime_literal.
Definition: item_timefunc.h:939
bool check_partition_func_processor(uchar *) override
Check if a partition function is allowed.
Definition: item_timefunc.h:961
void print(const THD *thd, String *str, enum_query_type query_type) const override
Appends function name with argument list or fractional seconds part to the String str.
Definition: item_timefunc.cc:968
bool eq(const Item *item, bool binary_cmp) const override
Definition: item_timefunc.cc:960
bool get_date(MYSQL_TIME *ltime, my_time_flags_t fuzzy_date) override
Definition: item_timefunc.h:952
String * val_str(String *str) override
Definition: item_timefunc.h:956
longlong val_date_temporal() override
Return date value of item in packed longlong format.
Definition: item_timefunc.h:948
table_map used_tables() const override
Definition: item_timefunc.h:963
Add a time expression to a temporal expression, or subtract a time expression from a temporal express...
Definition: item_timefunc.h:1552
int m_sign
+1 for ADD, -1 for SUBTRACT
Definition: item_timefunc.h:1554
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.cc:3031
const char * func_name() const override
Definition: item_timefunc.h:1575
Item_func_add_time(Item *a, Item *b, bool datetime, bool negate)
Definition: item_timefunc.h:1559
const bool m_datetime
True if first argument expected to be datetime.
Definition: item_timefunc.h:1553
int sign() const
Definition: item_timefunc.h:1577
enum Functype functype() const override
Definition: item_timefunc.h:1576
bool val_datetime(MYSQL_TIME *time, my_time_flags_t fuzzy_date) override
ADDTIME(t,a) and SUBTIME(t,a) are time functions that calculate a time/datetime value.
Definition: item_timefunc.cc:3075
Item_func_add_time(const POS &pos, Item *a, Item *b, bool datetime, bool negate)
Definition: item_timefunc.h:1563
Item_func_add_time(const POS &pos, Item *a, Item *b)
Definition: item_timefunc.h:1569
void print(const THD *thd, String *str, enum_query_type query_type) const override
This method is used for to:
Definition: item_timefunc.cc:3144
This function implements the AT TIME ZONE operator, which casts a temporal value to a temporal with t...
Definition: item_timefunc.h:986
bool check_type() const
Definition: item_timefunc.cc:1037
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.cc:989
bool set_time_zone(THD *thd)
Definition: item_timefunc.cc:1001
const char * func_name() const override
Definition: item_timefunc.h:996
bool m_is_interval
Whether the syntax used the INTERVAL construction.
Definition: item_timefunc.h:1018
bool get_date(MYSQL_TIME *res, my_time_flags_t) override
Definition: item_timefunc.cc:1012
const char * m_specifier_string
The specifier string argument, not used after resolution.
Definition: item_timefunc.h:1012
const Time_zone * m_tz
The time zone that the specifier string argument resolves to.
Definition: item_timefunc.h:1009
const char * specifier_string() const
Definition: item_timefunc.h:1002
Item_func_at_time_zone(const POS &pos, Item *datetime, const char *specifier_string, bool is_interval)
Definition: item_timefunc.h:988
Definition: item_timefunc.h:1294
const char * func_name() const override
Definition: item_timefunc.h:1309
bool get_date(MYSQL_TIME *res, my_time_flags_t fuzzy_date) override
Definition: item_timefunc.cc:2424
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.cc:2416
void cleanup() override
Called for every Item after use (preparation and execution).
Definition: item_timefunc.cc:2462
Time_zone * from_tz
Definition: item_timefunc.h:1302
Item_func_convert_tz(const POS &pos, Item *a, Item *b, Item *c)
Definition: item_timefunc.h:1305
bool from_tz_cached
Definition: item_timefunc.h:1301
bool to_tz_cached
Definition: item_timefunc.h:1301
enum Functype functype() const override
Definition: item_timefunc.h:1310
Time_zone * to_tz
Definition: item_timefunc.h:1302
Definition: item_timefunc.h:1119
Time_zone * time_zone() override
Definition: item_timefunc.cc:1998
const char * func_name() const override
Definition: item_timefunc.h:1125
Item_func_curdate_local(const POS &pos)
Definition: item_timefunc.h:1124
Definition: item_timefunc.h:1128
Time_zone * time_zone() override
Definition: item_timefunc.cc:2002
Item_func_curdate_utc(const POS &pos)
Definition: item_timefunc.h:1133
const char * func_name() const override
Definition: item_timefunc.h:1134
Abstract CURDATE function.
Definition: item_timefunc.h:1089
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.cc:1993
Item_date_func super
Definition: item_timefunc.h:1090
longlong val_date_temporal() override
Return date value of item in packed longlong format.
Definition: item_timefunc.cc:2004
String * val_str(String *) override
Definition: item_timefunc.cc:2018
virtual Time_zone * time_zone()=0
bool check_function_as_value_generator(uchar *checker_args) override
Check if this item is allowed for a virtual column or inside a default expression.
Definition: item_timefunc.h:1109
bool get_date(MYSQL_TIME *res, my_time_flags_t) override
Definition: item_timefunc.cc:2011
Item_func_curdate(const POS &pos)
Definition: item_timefunc.h:1096
bool do_itemize(Parse_context *pc, Item **res) override
The core function that does the actual itemization.
Definition: item_timefunc.cc:1986
table_map get_initial_pseudo_tables() const override
This function must assign a new value for each execution.
Definition: item_timefunc.h:1101
Definition: item_timefunc.h:1064
Item_func_curtime_local(const POS &pos, uint8 dec_arg)
Definition: item_timefunc.h:1069
const char * func_name() const override
Definition: item_timefunc.h:1071
Time_zone * time_zone() override
Definition: item_timefunc.cc:2083
Definition: item_timefunc.h:1074
Time_zone * time_zone() override
Definition: item_timefunc.cc:2087
const char * func_name() const override
Definition: item_timefunc.h:1081
Item_func_curtime_utc(const POS &pos, uint8 dec_arg)
Definition: item_timefunc.h:1079
Abstract CURTIME function. Children should define what time zone is used.
Definition: item_timefunc.h:1022
virtual Time_zone * time_zone()=0
String * val_str(String *) override
Definition: item_timefunc.cc:2070
table_map get_initial_pseudo_tables() const override
This function must assign a new value for each execution.
Definition: item_timefunc.h:1046
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.cc:2039
bool get_time(MYSQL_TIME *ltime) override
Definition: item_timefunc.cc:2062
bool check_function_as_value_generator(uchar *checker_args) override
Check if this item is allowed for a virtual column or inside a default expression.
Definition: item_timefunc.h:1054
Item_func_curtime(const POS &pos, uint8 dec_arg)
Constructor for Item_func_curtime.
Definition: item_timefunc.h:1039
bool do_itemize(Parse_context *pc, Item **res) override
The core function that does the actual itemization.
Definition: item_timefunc.cc:2032
void add_json_info(Json_object *obj) override
Add all the node-specific json fields.
Definition: item_timefunc.h:1029
longlong val_time_temporal() override
Return time value of item in packed longlong format.
Definition: item_timefunc.cc:2054
Item_time_func super
Definition: item_timefunc.h:1023
TS-TODO: Item_func_dayname should be derived from Item_str_func.
Definition: item_timefunc.h:353
bool get_date(MYSQL_TIME *ltime, my_time_flags_t fuzzydate) override
Definition: item_timefunc.h:362
enum Item_result result_type() const override
Definition: item_timefunc.h:368
bool get_time(MYSQL_TIME *ltime) override
Definition: item_timefunc.h:365
const char * func_name() const override
Definition: item_timefunc.h:359
Item_func_dayname(const POS &pos, Item *a)
Definition: item_timefunc.h:357
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.cc:1482
bool check_partition_func_processor(uchar *) override
Check if a partition function is allowed.
Definition: item_timefunc.h:370
String * val_str(String *str) override
Definition: item_timefunc.cc:1493
MY_LOCALE * locale
Definition: item_timefunc.h:354
enum Functype functype() const override
Definition: item_timefunc.h:360
Definition: item_timefunc.h:125
bool check_valid_arguments_processor(uchar *) override
Definition: item_timefunc.h:134
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.cc:1249
Item_func_dayofmonth(const POS &pos, Item *a)
Definition: item_timefunc.h:127
bool check_partition_func_processor(uchar *) override
Check if a partition function is allowed.
Definition: item_timefunc.h:133
const char * func_name() const override
Definition: item_timefunc.h:130
longlong val_int() override
Definition: item_timefunc.cc:1259
enum Functype functype() const override
Definition: item_timefunc.h:131
Definition: item_timefunc.h:188
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.cc:1231
bool check_valid_arguments_processor(uchar *) override
Definition: item_timefunc.h:196
longlong val_int() override
Definition: item_timefunc.cc:1241
bool check_partition_func_processor(uchar *) override
Check if a partition function is allowed.
Definition: item_timefunc.h:195
Item_func_dayofyear(const POS &pos, Item *a)
Definition: item_timefunc.h:190
const char * func_name() const override
Definition: item_timefunc.h:192
enum Functype functype() const override
Definition: item_timefunc.h:193
Definition: item_timefunc.h:1242
const char * func_name() const override
Definition: item_timefunc.h:1245
Item_func_from_days(const POS &pos, Item *a)
Definition: item_timefunc.h:1244
bool check_valid_arguments_processor(uchar *) override
Definition: item_timefunc.h:1249
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.h:1252
bool check_partition_func_processor(uchar *) override
Check if a partition function is allowed.
Definition: item_timefunc.h:1247
bool get_date(MYSQL_TIME *res, my_time_flags_t fuzzy_date) override
Definition: item_timefunc.cc:1892
enum Functype functype() const override
Definition: item_timefunc.h:1248
Definition: item_timefunc.h:1276
bool get_date(MYSQL_TIME *res, my_time_flags_t fuzzy_date) override
Definition: item_timefunc.cc:2363
const char * func_name() const override
Definition: item_timefunc.h:1280
Item_func_from_unixtime(const POS &pos, Item *a)
Definition: item_timefunc.h:1278
enum Functype functype() const override
Definition: item_timefunc.h:1281
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.cc:2355
Definition: item_timefunc.h:201
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.cc:1327
bool check_valid_arguments_processor(uchar *) override
Definition: item_timefunc.h:209
longlong val_int() override
Definition: item_timefunc.cc:1336
const char * func_name() const override
Definition: item_timefunc.h:205
enum Functype functype() const override
Definition: item_timefunc.h:206
Item_func_hour(const POS &pos, Item *a)
Definition: item_timefunc.h:203
bool check_partition_func_processor(uchar *) override
Check if a partition function is allowed.
Definition: item_timefunc.h:208
Definition: item_timefunc.h:1721
enum Functype functype() const override
Definition: item_timefunc.h:1725
bool get_date(MYSQL_TIME *res, my_time_flags_t fuzzy_date) override
Definition: item_timefunc.cc:3761
const char * func_name() const override
Definition: item_timefunc.h:1726
Item_func_internal_check_time(const POS &pos, PT_item_list *list)
Definition: item_timefunc.h:1723
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.cc:3753
Definition: item_timefunc.h:1711
const char * func_name() const override
Definition: item_timefunc.h:1716
enum Functype functype() const override
Definition: item_timefunc.h:1715
Item_func_internal_update_time(const POS &pos, PT_item_list *list)
Definition: item_timefunc.h:1713
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.cc:3674
bool get_date(MYSQL_TIME *res, my_time_flags_t fuzzy_date) override
Definition: item_timefunc.cc:3682
Definition: item_timefunc.h:1697
Item_func_last_day(const POS &pos, Item *a)
Definition: item_timefunc.h:1699
const char * func_name() const override
Definition: item_timefunc.h:1702
enum Functype functype() const override
Definition: item_timefunc.h:1703
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.h:1705
bool get_date(MYSQL_TIME *res, my_time_flags_t fuzzy_date) override
Definition: item_timefunc.cc:3650
Definition: item_timefunc.h:1531
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.h:1540
enum Functype functype() const override
Definition: item_timefunc.h:1539
bool get_date(MYSQL_TIME *ltime, my_time_flags_t fuzzy_date) override
MAKEDATE(a,b) is a date function that creates a date value from a year and day value.
Definition: item_timefunc.cc:3002
Item_func_makedate(const POS &pos, Item *a, Item *b)
Definition: item_timefunc.h:1533
const char * func_name() const override
Definition: item_timefunc.h:1537
Definition: item_timefunc.h:1603
enum Functype functype() const override
Definition: item_timefunc.h:1617
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.h:1609
bool get_time(MYSQL_TIME *ltime) override
MAKETIME(h,m,s) is a time function that calculates a time value from the total number of hours,...
Definition: item_timefunc.cc:3228
Item_func_maketime(const POS &pos, Item *a, Item *b, Item *c)
Definition: item_timefunc.h:1605
const char * func_name() const override
Definition: item_timefunc.h:1616
Definition: item_timefunc.h:1621
bool check_valid_arguments_processor(uchar *) override
Definition: item_timefunc.h:1629
longlong val_int() override
MICROSECOND(a) is a function ( extraction) that extracts the microseconds from a.
Definition: item_timefunc.cc:3301
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.cc:3307
enum Functype functype() const override
Definition: item_timefunc.h:1626
Item_func_microsecond(const POS &pos, Item *a)
Definition: item_timefunc.h:1623
const char * func_name() const override
Definition: item_timefunc.h:1625
bool check_partition_func_processor(uchar *) override
Check if a partition function is allowed.
Definition: item_timefunc.h:1628
Definition: item_timefunc.h:214
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.cc:1342
const char * func_name() const override
Definition: item_timefunc.h:218
longlong val_int() override
Definition: item_timefunc.cc:1351
Item_func_minute(const POS &pos, Item *a)
Definition: item_timefunc.h:216
bool check_partition_func_processor(uchar *) override
Check if a partition function is allowed.
Definition: item_timefunc.h:221
enum Functype functype() const override
Definition: item_timefunc.h:219
bool check_valid_arguments_processor(uchar *) override
Definition: item_timefunc.h:222
TS-TODO: This should probably have Item_int_func as parent class.
Definition: item_timefunc.h:142
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.cc:1265
double val_real() override
Definition: item_timefunc.h:149
enum Item_result result_type() const override
Definition: item_timefunc.h:165
longlong val_int() override
Definition: item_timefunc.cc:1275
const char * func_name() const override
Definition: item_timefunc.h:163
String * val_str(String *str) override
Definition: item_timefunc.h:153
bool get_time(MYSQL_TIME *ltime) override
Definition: item_timefunc.h:162
Item_func_month(const POS &pos, Item *a)
Definition: item_timefunc.h:144
bool check_valid_arguments_processor(uchar *) override
Definition: item_timefunc.h:168
enum Functype functype() const override
Definition: item_timefunc.h:164
bool check_partition_func_processor(uchar *) override
Check if a partition function is allowed.
Definition: item_timefunc.h:167
bool get_date(MYSQL_TIME *ltime, my_time_flags_t fuzzydate) override
Definition: item_timefunc.h:159
Definition: item_timefunc.h:173
Item_func_monthname(const POS &pos, Item *a)
Definition: item_timefunc.h:177
MY_LOCALE * locale
Definition: item_timefunc.h:174
const char * func_name() const override
Definition: item_timefunc.h:178
bool check_valid_arguments_processor(uchar *) override
Definition: item_timefunc.h:183
bool check_partition_func_processor(uchar *) override
Check if a partition function is allowed.
Definition: item_timefunc.h:182
String * val_str(String *str) override
Definition: item_timefunc.cc:1292
enum Functype functype() const override
Definition: item_timefunc.h:179
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.cc:1281
Definition: item_timefunc.h:1182
static void store_in(Field *field)
Stores the query start time in a field, truncating to the field's number of fractional second digits.
Definition: item_timefunc.cc:2099
Time_zone * time_zone() override
Definition: item_timefunc.cc:2106
const char * func_name() const override
Definition: item_timefunc.h:1199
Item_func_now_local(const POS &pos, uint8 dec_arg)
Definition: item_timefunc.h:1196
enum Functype functype() const override
Definition: item_timefunc.h:1200
Item_func_now_local(uint8 dec_arg)
Definition: item_timefunc.h:1195
Definition: item_timefunc.h:1203
const char * func_name() const override
Definition: item_timefunc.h:1215
Item_func_now_utc(const POS &pos, uint8 dec_arg)
Definition: item_timefunc.h:1210
bool do_itemize(Parse_context *pc, Item **res) override
The core function that does the actual itemization.
Definition: item_timefunc.cc:2108
Item_func_now super
Definition: item_timefunc.h:1204
Time_zone * time_zone() override
Definition: item_timefunc.cc:2115
Abstract CURRENT_TIMESTAMP function.
Definition: item_timefunc.h:1142
Item_func_now(uint8 dec_arg)
Constructor for Item_func_now.
Definition: item_timefunc.h:1158
type_conversion_status save_in_field_inner(Field *to, bool no_conversions) override
Helper function which does all of the work for save_in_field(Field*, bool), except some error checkin...
Definition: item_timefunc.cc:2146
longlong val_date_temporal() override
Return date value of item in packed longlong format.
Definition: item_timefunc.cc:2117
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.cc:2091
virtual Time_zone * time_zone()=0
bool check_function_as_value_generator(uchar *checker_args) override
Check if this item is allowed for a virtual column or inside a default expression.
Definition: item_timefunc.h:1172
String * val_str(String *) override
Definition: item_timefunc.cc:2133
void add_json_info(Json_object *obj) override
Add all the node-specific json fields.
Definition: item_timefunc.h:1148
table_map get_initial_pseudo_tables() const override
This function must assign a new value for each execution.
Definition: item_timefunc.h:1164
bool get_date(MYSQL_TIME *res, my_time_flags_t) override
Definition: item_timefunc.cc:2125
Item_func_now(const POS &pos, uint8 dec_arg)
Definition: item_timefunc.h:1159
Definition: item_timefunc.h:65
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.cc:1051
longlong val_int() override
Definition: item_timefunc.cc:1055
enum Functype functype() const override
Definition: item_timefunc.h:71
const char * func_name() const override
Definition: item_timefunc.h:70
Item_func_period_add(const POS &pos, Item *a, Item *b)
Definition: item_timefunc.h:67
Definition: item_timefunc.h:75
const char * func_name() const override
Definition: item_timefunc.h:80
enum Functype functype() const override
Definition: item_timefunc.h:81
Item_func_period_diff(const POS &pos, Item *a, Item *b)
Definition: item_timefunc.h:77
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.cc:1069
longlong val_int() override
Definition: item_timefunc.cc:1073
Definition: item_timefunc.h:227
const char * func_name() const override
Definition: item_timefunc.h:231
bool check_partition_func_processor(uchar *) override
Check if a partition function is allowed.
Definition: item_timefunc.h:234
bool check_valid_arguments_processor(uchar *) override
Definition: item_timefunc.h:235
enum Functype functype() const override
Definition: item_timefunc.h:232
Item_func_quarter(const POS &pos, Item *a)
Definition: item_timefunc.h:229
longlong val_int() override
Returns the quarter of the year.
Definition: item_timefunc.cc:1320
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.cc:1307
Definition: item_timefunc.h:1316
const char * func_name() const override
Definition: item_timefunc.h:1327
Item_func_sec_to_time(const POS &pos, Item *item)
Definition: item_timefunc.h:1318
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.h:1320
enum Functype functype() const override
Definition: item_timefunc.h:1328
bool get_time(MYSQL_TIME *ltime) override
Definition: item_timefunc.cc:2178
Definition: item_timefunc.h:240
bool check_valid_arguments_processor(uchar *) override
Definition: item_timefunc.h:248
const char * func_name() const override
Definition: item_timefunc.h:244
bool check_partition_func_processor(uchar *) override
Check if a partition function is allowed.
Definition: item_timefunc.h:247
enum Functype functype() const override
Definition: item_timefunc.h:245
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.cc:1357
Item_func_second(const POS &pos, Item *a)
Definition: item_timefunc.h:242
longlong val_int() override
Returns the second in time_exp in the range of 0 - 59.
Definition: item_timefunc.cc:1369
Definition: item_timefunc.h:1683
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.cc:3567
Item_func_str_to_date(const POS &pos, Item *a, Item *b)
Definition: item_timefunc.h:1691
bool val_datetime(MYSQL_TIME *ltime, my_time_flags_t fuzzy_date) override
Get "native" temporal value as MYSQL_TIME.
Definition: item_timefunc.cc:3600
void fix_from_format(const char *format, size_t length)
Set type of datetime value (DATE/TIME/...) which will be produced according to format string.
Definition: item_timefunc.cc:3517
const char * func_name() const override
Definition: item_timefunc.h:1693
enum_mysql_timestamp_type cached_timestamp_type
Definition: item_timefunc.h:1684
SYSDATE() is like NOW(), but always uses the real current time, not the query_start().
Definition: item_timefunc.h:1222
table_map get_initial_pseudo_tables() const override
This function is non-deterministic and hence depends on the 'RAND' pseudo-table.
Definition: item_timefunc.h:1237
const char * func_name() const override
Definition: item_timefunc.h:1227
Item_func_sysdate_local(uint8 dec_arg)
Definition: item_timefunc.h:1224
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.cc:2172
bool get_date(MYSQL_TIME *res, my_time_flags_t fuzzy_date) override
Converts current time in my_time_t to MYSQL_TIME representation for local time zone.
Definition: item_timefunc.cc:2159
enum Functype functype() const override
Definition: item_timefunc.h:1229
Definition: item_timefunc.h:462
enum Functype functype() const override
Definition: item_timefunc.h:468
longlong val_int() override
Definition: item_timefunc.cc:1726
bool check_partition_func_processor(uchar *) override
Check if a partition function is allowed.
Definition: item_timefunc.h:470
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.cc:1719
Item_func_time_to_sec(const POS &pos, Item *item)
Definition: item_timefunc.h:464
bool check_valid_arguments_processor(uchar *) override
Definition: item_timefunc.h:471
const char * func_name() const override
Definition: item_timefunc.h:467
Definition: item_timefunc.h:1580
bool get_time(MYSQL_TIME *ltime) override
TIMEDIFF(t,s) is a time function that calculates the time value between a start and end time.
Definition: item_timefunc.cc:3172
enum Functype functype() const override
Definition: item_timefunc.h:1585
Item_func_timediff(const POS &pos, Item *a, Item *b)
Definition: item_timefunc.h:1582
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.h:1586
const char * func_name() const override
Definition: item_timefunc.h:1584
Definition: item_timefunc.h:1634
interval_type intervaltype() const
Definition: item_timefunc.h:1643
const char * func_name() const override
Definition: item_timefunc.h:1641
enum Functype functype() const override
Definition: item_timefunc.h:1642
longlong val_int() override
Definition: item_timefunc.cc:3313
void print(const THD *thd, String *str, enum_query_type query_type) const override
This method is used for to:
Definition: item_timefunc.cc:3409
Item_func_timestamp_diff(const POS &pos, Item *a, Item *b, interval_type type_arg)
Definition: item_timefunc.h:1638
const interval_type int_type
Definition: item_timefunc.h:1635
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.h:1645
Definition: item_timefunc.h:85
Item_func_to_days(const POS &pos, Item *a)
Definition: item_timefunc.h:87
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.cc:1088
bool check_partition_func_processor(uchar *) override
Check if a partition function is allowed.
Definition: item_timefunc.h:94
longlong val_int() override
Definition: item_timefunc.cc:1101
enum Functype functype() const override
Definition: item_timefunc.h:90
const char * func_name() const override
Definition: item_timefunc.h:89
bool check_valid_arguments_processor(uchar *) override
Definition: item_timefunc.h:95
longlong val_int_endpoint(bool left_endp, bool *incl_endp) override
Definition: item_timefunc.cc:1182
enum_monotonicity_info get_monotonicity_info() const override
Definition: item_timefunc.cc:1163
Definition: item_timefunc.h:100
bool intro_version(uchar *int_arg) override
Definition: item_timefunc.h:111
enum_monotonicity_info get_monotonicity_info() const override
Definition: item_timefunc.cc:1173
Item_func_to_seconds(const POS &pos, Item *a)
Definition: item_timefunc.h:102
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.cc:1131
longlong val_int() override
Definition: item_timefunc.cc:1137
enum Functype functype() const override
Definition: item_timefunc.h:105
const char * func_name() const override
Definition: item_timefunc.h:104
bool check_partition_func_processor(uchar *) override
Check if a partition function is allowed.
Definition: item_timefunc.h:109
longlong val_int_endpoint(bool left_endp, bool *incl_endp) override
Definition: item_timefunc.cc:1108
bool check_valid_arguments_processor(uchar *) override
Definition: item_timefunc.h:120
Definition: item_timefunc.h:404
bool check_partition_func_processor(uchar *) override
Check if a partition function is allowed.
Definition: item_timefunc.h:421
table_map get_initial_pseudo_tables() const override
Returns the pseudo tables depended upon in order to evaluate this function expression.
Definition: item_timefunc.h:431
longlong val_int_endpoint(bool left_endp, bool *incl_endp) override
Definition: item_timefunc.cc:1710
const char * func_name() const override
Definition: item_timefunc.h:415
Item_func_unix_timestamp(const POS &pos)
Definition: item_timefunc.h:408
bool check_function_as_value_generator(uchar *p_arg) override
Check if this item is allowed for a virtual column or inside a default expression.
Definition: item_timefunc.h:449
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.h:436
Item_timeval_func super
Definition: item_timefunc.h:405
enum_monotonicity_info get_monotonicity_info() const override
Definition: item_timefunc.cc:1703
bool do_itemize(Parse_context *pc, Item **res) override
The core function that does the actual itemization.
Definition: item_timefunc.cc:1680
Item_func_unix_timestamp(Item *a)
Definition: item_timefunc.h:410
bool check_valid_arguments_processor(uchar *) override
Definition: item_timefunc.h:427
enum Functype functype() const override
Definition: item_timefunc.h:416
Item_func_unix_timestamp(const POS &pos, Item *a)
Definition: item_timefunc.h:412
bool val_timeval(my_timeval *tm) override
Definition: item_timefunc.cc:1691
Definition: item_timefunc.h:253
const char * func_name() const override
Definition: item_timefunc.h:263
longlong val_int() override
Definition: item_timefunc.cc:1434
bool do_itemize(Parse_context *pc, Item **res) override
The core function that does the actual itemization.
Definition: item_timefunc.cc:1381
Item_func_week(const POS &pos, Item *a, Item *b)
Definition: item_timefunc.h:258
Item_func_week(Item *a, Item *b)
Definition: item_timefunc.h:257
Item_int_func super
Definition: item_timefunc.h:254
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.cc:1392
enum Functype functype() const override
Definition: item_timefunc.h:264
TS-TODO: This should probably have Item_int_func as parent class.
Definition: item_timefunc.h:313
Item_func_weekday(const POS &pos, Item *a, bool type_arg)
Definition: item_timefunc.h:317
bool check_partition_func_processor(uchar *) override
Check if a partition function is allowed.
Definition: item_timefunc.h:342
const char * func_name() const override
Definition: item_timefunc.h:336
bool check_valid_arguments_processor(uchar *) override
Definition: item_timefunc.h:343
double val_real() override
Definition: item_timefunc.h:323
String * val_str(String *str) override
Definition: item_timefunc.h:327
bool odbc_type
Definition: item_timefunc.h:314
enum Item_result result_type() const override
Definition: item_timefunc.h:340
enum Functype functype() const override
Definition: item_timefunc.h:339
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.cc:1462
bool get_time(MYSQL_TIME *ltime) override
Definition: item_timefunc.h:335
bool get_date(MYSQL_TIME *ltime, my_time_flags_t fuzzydate) override
Definition: item_timefunc.h:332
longlong val_int() override
Definition: item_timefunc.cc:1471
Definition: item_timefunc.h:282
enum Functype functype() const override
Definition: item_timefunc.h:287
longlong val_int_endpoint(bool left_endp, bool *incl_endp) override
Definition: item_timefunc.cc:1624
enum_monotonicity_info get_monotonicity_info() const override
Definition: item_timefunc.cc:1616
bool check_partition_func_processor(uchar *) override
Check if a partition function is allowed.
Definition: item_timefunc.h:291
const char * func_name() const override
Definition: item_timefunc.h:286
longlong val_int() override
Definition: item_timefunc.cc:1514
Item_func_year(const POS &pos, Item *a)
Definition: item_timefunc.h:284
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.cc:1507
bool check_valid_arguments_processor(uchar *) override
Definition: item_timefunc.h:292
Definition: item_timefunc.h:268
bool check_partition_func_processor(uchar *) override
Check if a partition function is allowed.
Definition: item_timefunc.h:276
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.cc:1442
enum Functype functype() const override
Definition: item_timefunc.h:274
longlong val_int() override
Definition: item_timefunc.cc:1452
Item_func_yearweek(const POS &pos, Item *a, Item *b)
Definition: item_timefunc.h:270
bool check_valid_arguments_processor(uchar *) override
Definition: item_timefunc.h:277
const char * func_name() const override
Definition: item_timefunc.h:273
Definition: item_func.h:100
bool param_type_uses_non_param(THD *thd, enum_field_types def=MYSQL_TYPE_VARCHAR)
Definition: item_func.cc:615
Item ** args
Array of pointers to arguments.
Definition: item_func.h:107
Functype
Definition: item_func.h:183
@ DATEADD_FUNC
Definition: item_func.h:289
@ YEAR_FUNC
Definition: item_func.h:269
@ HOUR_FUNC
Definition: item_func.h:280
@ TIME_TO_SEC_FUNC
Definition: item_func.h:294
@ PERIODDIFF_FUNC
Definition: item_func.h:310
@ FROM_UNIXTIME_FUNC
Definition: item_func.h:290
@ MAKETIME_FUNC
Definition: item_func.h:272
@ NOW_FUNC
Definition: item_func.h:224
@ FROM_DAYS_FUNC
Definition: item_func.h:225
@ CONVERT_TZ_FUNC
Definition: item_func.h:291
@ DD_INTERNAL_FUNC
Definition: item_func.h:239
@ DAY_FUNC
Definition: item_func.h:275
@ MAKEDATE_FUNC
Definition: item_func.h:271
@ SEC_TO_TIME_FUNC
Definition: item_func.h:311
@ DATE_FUNC
Definition: item_func.h:279
@ TIMESTAMPDIFF_FUNC
Definition: item_func.h:295
@ SECOND_FUNC
Definition: item_func.h:282
@ PERIODADD_FUNC
Definition: item_func.h:309
@ EXTRACT_FUNC
Definition: item_func.h:230
@ MONTH_FUNC
Definition: item_func.h:273
@ TO_SECONDS_FUNC
Definition: item_func.h:278
@ MICROSECOND_FUNC
Definition: item_func.h:283
@ QUARTER_FUNC
Definition: item_func.h:286
@ TIMEDIFF_FUNC
Definition: item_func.h:308
@ SYSDATE_FUNC
Definition: item_func.h:307
@ MONTHNAME_FUNC
Definition: item_func.h:274
@ TYPECAST_FUNC
Definition: item_func.h:231
@ LAST_DAY_FUNC
Definition: item_func.h:292
@ WEEKDAY_FUNC
Definition: item_func.h:288
@ ADDTIME_FUNC
Definition: item_func.h:285
@ DAYOFYEAR_FUNC
Definition: item_func.h:284
@ GET_FORMAT_FUNC
Definition: item_func.h:312
@ DAYNAME_FUNC
Definition: item_func.h:276
@ DATETIME_LITERAL
Definition: item_func.h:296
@ MINUTE_FUNC
Definition: item_func.h:281
@ TO_DAYS_FUNC
Definition: item_func.h:277
@ WEEK_FUNC
Definition: item_func.h:287
@ YEARWEEK_FUNC
Definition: item_func.h:270
@ UNIX_TIMESTAMP_FUNC
Definition: item_func.h:293
bool has_timestamp_args()
Definition: item_func.h:583
enum Type type() const override
Definition: item_func.h:322
bool param_type_is_default(THD *thd, uint start, uint end, uint step, enum_field_types def)
For arguments of this Item_func ("args" array), in range [start, start+step, start+2*step,...
Definition: item_func.cc:526
bool propagate_type(THD *thd, const Type_properties &type) override
Default implementation for all functions: Propagate base_item's type into all arguments.
Definition: item_func.cc:502
bool has_date_args()
Definition: item_func.h:593
uint arg_count
How many arguments in 'args'.
Definition: item_func.h:130
bool has_time_args()
Definition: item_func.h:604
bool has_datetime_args()
Definition: item_func.h:615
Definition: item_func.h:942
virtual const char * func_name() const =0
Definition: item_strfunc.h:147
Definition: item_strfunc.h:75
String * val_str_from_val_str_ascii(String *str, String *str2)
Definition: item_strfunc.cc:147
void add_json_info(Json_object *obj) override
Add all the node-specific json fields.
Definition: item_strfunc.h:139
Abstract class for functions returning TIME, DATE, DATETIME types whose data type is known at constru...
Definition: item_timefunc.h:480
Item_temporal_func()
Definition: item_timefunc.h:491
Item_temporal_func(const POS &pos, Item *a)
Definition: item_timefunc.h:495
Item_temporal_func(const POS &pos, Item *a, Item *b)
Definition: item_timefunc.h:497
Item_temporal_func(const POS &pos)
Definition: item_timefunc.h:492
Item_temporal_func(Item *a)
Definition: item_timefunc.h:494
Item_temporal_func(Item *a, Item *b, Item *c)
Definition: item_timefunc.h:499
Field * tmp_table_field(TABLE *table) override
Definition: item_timefunc.h:511
Item_temporal_func(const POS &pos, PT_item_list *list)
Definition: item_timefunc.h:504
bool check_precision()
Definition: item_timefunc.cc:805
void add_json_info(Json_object *obj) override
Add all the node-specific json fields.
Definition: item_timefunc.h:485
Item_temporal_func(const POS &pos, Item *a, Item *b, Item *c)
Definition: item_timefunc.h:500
Item_temporal_func(const POS &pos, Item *a, Item *b, Item *c, Item *d)
Definition: item_timefunc.h:502
uint datetime_precision() override
DATETIME precision of the item: 0..6.
Definition: item_timefunc.h:518
void print(const THD *thd, String *str, enum_query_type query_type) const override
Appends function name with argument list or fractional seconds part to the String str.
Definition: item_timefunc.cc:825
uint time_precision() override
TIME precision of the item: 0..6.
Definition: item_timefunc.h:514
const CHARSET_INFO * charset_for_protocol() override
Definition: item_timefunc.h:508
Item_result result_type() const override
Definition: item_timefunc.h:507
Abstract class for functions returning TIME, DATE, DATETIME or string values, whose data type depends...
Definition: item_timefunc.h:530
const CHARSET_INFO * charset_for_protocol() override
Definition: item_timefunc.h:555
Field * tmp_table_field(TABLE *table) override
Definition: item_timefunc.h:566
my_decimal * val_decimal(my_decimal *decimal_value) override
Definition: item_timefunc.cc:854
sql_mode_t sql_mode
Definition: item_timefunc.h:532
double val_real() override
Definition: item_timefunc.h:570
void add_json_info(Json_object *obj) override
Add all the node-specific json fields.
Definition: item_timefunc.h:544
Item_result result_type() const override
Definition: item_timefunc.h:554
bool get_time(MYSQL_TIME *ltime) override
Definition: item_timefunc.cc:889
Item_temporal_hybrid_func(const POS &pos, Item *a, Item *b)
Definition: item_timefunc.h:551
virtual bool val_datetime(MYSQL_TIME *ltime, my_time_flags_t fuzzy_date)=0
Get "native" temporal value as MYSQL_TIME.
Item_temporal_hybrid_func(Item *a, Item *b)
Definition: item_timefunc.h:549
String * val_str(String *str) override
Return string value in @character_set_connection.
Definition: item_timefunc.h:579
String * val_str_ascii(String *str) override
Return string value in ASCII character set.
Definition: item_timefunc.cc:900
longlong val_int() override
Definition: item_timefunc.h:569
String ascii_buf
Definition: item_timefunc.h:533
type_conversion_status save_in_field_inner(Field *field, bool no_conversions) override
Helper function which does all of the work for save_in_field(Field*, bool), except some error checkin...
Definition: item_timefunc.cc:847
bool get_date(MYSQL_TIME *ltime, my_time_flags_t fuzzydate) override
Definition: item_timefunc.cc:875
Abstract class for functions returning TIME values.
Definition: item_timefunc.h:696
type_conversion_status save_in_field_inner(Field *field, bool) override
Helper function which does all of the work for save_in_field(Field*, bool), except some error checkin...
Definition: item_timefunc.h:698
longlong val_int() override
Definition: item_timefunc.h:726
String * val_str(String *str) override
Definition: item_timefunc.h:731
Item_time_func(const POS &pos, Item *a)
Definition: item_timefunc.h:710
Item_time_func(const POS &pos, Item *a, Item *b, Item *c)
Definition: item_timefunc.h:717
Item_time_func(Item *a)
Definition: item_timefunc.h:707
longlong val_time_temporal() override
Return time value of item in packed longlong format.
Definition: item_timefunc.cc:924
my_decimal * val_decimal(my_decimal *decimal_value) override
Definition: item_timefunc.h:722
Item_time_func(const POS &pos)
Definition: item_timefunc.h:704
bool get_time(MYSQL_TIME *res) override=0
double val_real() override
Definition: item_timefunc.h:721
Item_time_func(const POS &pos, Item *a, Item *b)
Definition: item_timefunc.h:713
bool get_date(MYSQL_TIME *res, my_time_flags_t) override
Definition: item_timefunc.h:728
Item_time_func()
Definition: item_timefunc.h:703
TIME'10:10:10'.
Definition: item_timefunc.h:887
bool get_time(MYSQL_TIME *ltime) override
Definition: item_timefunc.h:908
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.h:916
bool check_partition_func_processor(uchar *) override
Check if a partition function is allowed.
Definition: item_timefunc.h:917
void cleanup() override
Called for every Item after use (preparation and execution).
Definition: item_timefunc.h:921
bool basic_const_item() const override
Returns true if this is a simple constant item like an integer, not a constant expression.
Definition: item_timefunc.h:918
Item_time_literal(MYSQL_TIME *ltime, uint dec_arg)
Constructor for Item_time_literal.
Definition: item_timefunc.h:896
const char * func_name() const override
Definition: item_timefunc.h:901
void print(const THD *thd, String *str, enum_query_type query_type) const override
Appends function name with argument list or fractional seconds part to the String str.
Definition: item_timefunc.cc:983
longlong val_time_temporal() override
Return time value of item in packed longlong format.
Definition: item_timefunc.h:904
bool eq(const Item *item, bool binary_cmp) const override
Definition: item_timefunc.cc:975
table_map used_tables() const override
Definition: item_timefunc.h:919
table_map not_null_tables() const override
Return table map of tables that can't be NULL tables (tables that are used in a context where if they...
Definition: item_timefunc.h:920
String * val_str(String *str) override
Definition: item_timefunc.h:912
MYSQL_TIME_cache cached_time
Definition: item_timefunc.h:888
Definition: item_timefunc.h:376
bool get_date(MYSQL_TIME *ltime, my_time_flags_t fuzzydate) override
Definition: item_timefunc.h:393
virtual bool val_timeval(my_timeval *tm)=0
Return timestamp in "struct timeval" format.
longlong val_int() override
Definition: item_timefunc.cc:1651
String * val_str(String *str) override
Definition: item_timefunc.cc:1671
Item_timeval_func(const POS &pos, Item *a)
Definition: item_timefunc.h:381
my_decimal * val_decimal(my_decimal *decimal_value) override
Definition: item_timefunc.cc:1656
Item_timeval_func(Item *a)
Definition: item_timefunc.h:380
enum Item_result result_type() const override
Definition: item_timefunc.h:399
Item_timeval_func(const POS &pos)
Definition: item_timefunc.h:378
double val_real() override
Definition: item_timefunc.cc:1664
bool get_time(MYSQL_TIME *ltime) override
Definition: item_timefunc.h:396
Definition: item_timefunc.h:1431
bool m_explicit_cast
Definition: item_timefunc.h:1432
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.h:1443
void print(const THD *thd, String *str, enum_query_type query_type) const override
Appends function name with argument list or fractional seconds part to the String str.
Definition: item_timefunc.cc:2956
const char * cast_type() const
Definition: item_timefunc.h:1453
bool get_date(MYSQL_TIME *ltime, my_time_flags_t fuzzy_date) override
Definition: item_timefunc.cc:2965
const char * func_name() const override
Definition: item_timefunc.h:1449
bool is_explicit_cast() const
Definition: item_timefunc.h:1451
enum Functype functype() const override
Definition: item_timefunc.h:1450
Item_typecast_date(Item *a, bool explicit_cast)
Definition: item_timefunc.h:1435
Item_typecast_date(const POS &pos, Item *a)
Definition: item_timefunc.h:1439
Definition: item_timefunc.h:1493
Item_typecast_datetime(Item *a, uint8 dec_arg)
Definition: item_timefunc.h:1510
Item_typecast_datetime(const POS &pos, Item *a)
Definition: item_timefunc.h:1502
Item_typecast_datetime(Item *a, bool explicit_cast)
Definition: item_timefunc.h:1498
enum Functype functype() const override
Definition: item_timefunc.h:1517
bool is_explicit_cast() const
Definition: item_timefunc.h:1519
const char * func_name() const override
Definition: item_timefunc.h:1516
bool m_explicit_cast
Definition: item_timefunc.h:1495
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.h:1520
Item_typecast_datetime(const POS &pos, Item *a, uint8 dec_arg)
Definition: item_timefunc.h:1505
void print(const THD *thd, String *str, enum_query_type query_type) const override
Appends function name with argument list or fractional seconds part to the String str.
Definition: item_timefunc.cc:2896
bool detect_precision_from_arg
Definition: item_timefunc.h:1494
bool get_date(MYSQL_TIME *res, my_time_flags_t fuzzy_date) override
Definition: item_timefunc.cc:2906
const char * cast_type() const
Definition: item_timefunc.h:1518
Definition: item_timefunc.h:1456
Item_typecast_time(Item *a, uint8 dec_arg)
Definition: item_timefunc.h:1472
Item_typecast_time(const POS &pos, Item *a)
Definition: item_timefunc.h:1464
bool is_explicit_cast() const
Definition: item_timefunc.h:1480
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.h:1483
Item_typecast_time(const POS &pos, Item *a, uint8 dec_arg)
Definition: item_timefunc.h:1467
bool get_time(MYSQL_TIME *ltime) override
Definition: item_timefunc.cc:2944
const char * cast_type() const
Definition: item_timefunc.h:1482
enum Functype functype() const override
Definition: item_timefunc.h:1479
bool detect_precision_from_arg
Definition: item_timefunc.h:1457
Item_typecast_time(Item *a)
Definition: item_timefunc.h:1461
void print(const THD *thd, String *str, enum_query_type query_type) const override
Appends function name with argument list or fractional seconds part to the String str.
Definition: item_timefunc.cc:2934
const char * func_name() const override
Definition: item_timefunc.h:1478
bool m_explicit_cast
Definition: item_timefunc.h:1458
Definition: item_timefunc.h:297
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.cc:1520
Item_typecast_year(const POS &pos, Item *a)
Definition: item_timefunc.h:299
longlong val_int() override
Definition: item_timefunc.cc:1535
void print(const THD *thd, String *str, enum_query_type query_type) const override
This method is used for to:
Definition: item_timefunc.cc:1528
enum Functype functype() const override
Definition: item_timefunc.h:304
const char * func_name() const override
Definition: item_timefunc.h:303
Base class that is used to represent any kind of expression in a relational query.
Definition: item.h:932
void set_nullable(bool nullable)
Definition: item.h:3605
void set_data_type_date()
Set all type properties for Item of DATE type.
Definition: item.h:1682
DTCollation collation
Character set and collation properties assigned for this Item.
Definition: item.h:3503
longlong val_int_from_decimal()
Definition: item.cc:473
void set_data_type(enum_field_types data_type)
Set the data type of the current Item.
Definition: item.h:1503
longlong val_int_from_datetime()
Definition: item.cc:504
bool get_time_from_string(MYSQL_TIME *ltime)
Convert val_str() to time in MYSQL_TIME.
Definition: item.cc:1685
static const CHARSET_INFO * default_charset()
Definition: item.cc:1797
String * val_string_from_date(String *str)
Definition: item.cc:327
double val_real_from_decimal()
Definition: item.cc:455
String * val_string_from_datetime(String *str)
Definition: item.cc:317
bool get_date_from_time(MYSQL_TIME *ltime)
Convert get_time() from time to date in MYSQL_TIME.
Definition: item.cc:1635
bool get_time_from_datetime(MYSQL_TIME *ltime)
Convert datetime to time.
Definition: item.cc:1730
longlong val_int_from_date()
Definition: item.cc:496
void set_data_type_year()
Set the data type of the Item to be YEAR.
Definition: item.h:1747
Field * tmp_table_field_from_field_type(TABLE *table, bool fixed_length) const
Create a field based on field_type of argument.
Definition: item.cc:6568
bool get_time_from_date(MYSQL_TIME *ltime)
Convert date to time.
Definition: item.cc:1722
enum_field_types data_type() const
Retrieve the derived data type of the Item.
Definition: item.h:1471
bool fixed
True if item has been resolved.
Definition: item.h:3593
longlong val_int_from_time()
Definition: item.cc:482
bool null_value
True if item is null.
Definition: item.h:3630
void set_data_type_datetime(uint8 fsp)
Set all properties for Item of DATETIME type.
Definition: item.h:1706
virtual uint datetime_precision()
DATETIME precision of the item: 0..6.
Definition: item.cc:808
bool get_date_from_numeric(MYSQL_TIME *ltime, my_time_flags_t fuzzydate)
Convert a numeric type to date.
Definition: item.cc:1645
my_decimal * val_decimal_from_date(my_decimal *decimal_value)
Definition: item.cc:380
@ MARKER_NONE
Definition: item.h:3523
bool get_date_from_string(MYSQL_TIME *ltime, my_time_flags_t flags)
Convert val_str() to date in MYSQL_TIME.
Definition: item.cc:1598
type_conversion_status save_time_in_field(Field *field)
Definition: item.cc:527
item_marker marker
This member has several successive meanings, depending on the phase we're in (.
Definition: item.h:3562
bool get_time_from_numeric(MYSQL_TIME *ltime)
Convert a numeric type to time.
Definition: item.cc:1737
uint8 decimals
Number of decimals in result when evaluating this item.
Definition: item.h:3602
void set_data_type_string(uint32 max_l)
Set the Item to be variable length string.
Definition: item.h:1586
bool get_date_from_int(MYSQL_TIME *ltime, my_time_flags_t flags)
Convert val_int() to date in MYSQL_TIME.
Definition: item.cc:1626
String * val_string_from_time(String *str)
Definition: item.cc:337
void set_data_type_longlong()
Set the data type of the Item to be longlong.
Definition: item.h:1543
void set_data_type_time(uint8 fsp)
Set all type properties for Item of TIME type.
Definition: item.h:1694
void set_data_type_decimal(uint8 precision, uint8 scale)
Set the data type of the Item to be decimal.
Definition: item.h:1556
my_decimal * val_decimal_from_time(my_decimal *decimal_value)
Definition: item.cc:389
type_conversion_status save_date_in_field(Field *field)
Definition: item.cc:534
bool get_time_from_int(MYSQL_TIME *ltime)
Convert val_int() to time in MYSQL_TIME.
Definition: item.cc:1713
Represents a JSON container value of type "object" (ECMA), type J_OBJECT here.
Definition: json_dom.h:374
bool add_alias(const std::string &key, Json_dom *value)
Insert the value into the object.
Definition: json_dom.h:416
Cache for MYSQL_TIME value with various representations.
Definition: item_timefunc.h:745
uint string_length
length of string
Definition: item_timefunc.h:749
bool get_date(MYSQL_TIME *ltime, uint fuzzyflags) const
Store MYSQL_TIME representation into the given date/datetime variable checking date flags.
Definition: item_timefunc.cc:1972
void set_time(MYSQL_TIME *ltime, uint8 dec_arg)
Set time and time_packed from a TIME value.
Definition: item_timefunc.cc:1916
MYSQL_TIME * get_TIME_ptr()
Return pointer to MYSQL_TIME representation.
Definition: item_timefunc.h:830
bool get_time(MYSQL_TIME *ltime) const
Store MYSQL_TIME representation into the given time variable.
Definition: item_timefunc.h:823
longlong val_packed() const
Return packed representation.
Definition: item_timefunc.h:811
MYSQL_TIME_cache()
Definition: item_timefunc.h:761
uint8 decimals() const
Return number of decimal digits.
Definition: item_timefunc.h:803
uint8 dec
Number of decimals.
Definition: item_timefunc.h:750
const char * cptr() const
Return C string representation.
Definition: item_timefunc.h:841
longlong time_packed
packed representation
Definition: item_timefunc.h:747
void set_date(MYSQL_TIME *ltime)
Set time and time_packed from a DATE value.
Definition: item_timefunc.cc:1924
MYSQL_TIME time
MYSQL_TIME representation.
Definition: item_timefunc.h:746
void set_datetime(MYSQL_TIME *ltime, uint8 dec_arg, const Time_zone *tz=nullptr)
Set time and time_packed from a DATETIME value.
Definition: item_timefunc.cc:1932
bool eq(const MYSQL_TIME_cache &tm) const
Test if cached value is equal to another MYSQL_TIME_cache value.
Definition: item_timefunc.h:796
String * val_str(String *str)
Store string representation into String.
Definition: item_timefunc.cc:1979
char string_buff[MAX_DATE_STRING_REP_LENGTH]
string representation
Definition: item_timefunc.h:748
void get_TIME(MYSQL_TIME *ltime) const
Store MYSQL_TIME representation into the given MYSQL_TIME variable.
Definition: item_timefunc.h:755
Definition: sql_locale.h:36
Wrapper class for an Item list head, used to allocate Item lists in the parser in a context-independe...
Definition: parse_tree_helpers.h:104
Base class for parse tree nodes (excluding the Parse_tree_root hierarchy)
Definition: parse_tree_node_base.h:229
Using this class is fraught with peril, and you need to be very careful when doing so.
Definition: sql_string.h:166
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:35
This class represents abstract time zone and provides basic interface for MYSQL_TIME <-> my_time_t co...
Definition: tztime.h:48
my_decimal class limits 'decimal_t' type to what we need in MySQL.
Definition: my_decimal.h:94
uint64_t sql_mode_t
Definition: dd_event.h:38
enum_query_type
Query type constants (usable as bitmap flags).
Definition: enum_query_type.h:30
This file contains the field type.
@ MYSQL_TYPE_LONGLONG
Definition: field_types.h:63
@ MYSQL_TYPE_TIME
Definition: field_types.h:66
@ MYSQL_TYPE_STRING
Definition: field_types.h:87
@ MYSQL_TYPE_NEWDECIMAL
Definition: field_types.h:79
@ MYSQL_TYPE_DATE
Definition: field_types.h:65
@ MYSQL_TYPE_DATETIME
Definition: field_types.h:67
static const std::string dec("DECRYPTION")
enum monotonicity_info enum_monotonicity_info
const char * interval_names[]
Definition: item_timefunc.cc:2666
bool make_date_time(Date_time_format *format, MYSQL_TIME *l_time, enum_mysql_timestamp_type type, String *str)
Create a formatted date/time value in a string.
Definition: item_timefunc.cc:520
date_time_format
Definition: item_timefunc.h:1654
@ USA_FORMAT
Definition: item_timefunc.h:1655
@ JIS_FORMAT
Definition: item_timefunc.h:1656
@ INTERNAL_FORMAT
Definition: item_timefunc.h:1659
@ EUR_FORMAT
Definition: item_timefunc.h:1658
@ ISO_FORMAT
Definition: item_timefunc.h:1657
bool get_interval_value(Item *args, interval_type int_type, String *str_value, Interval *interval)
Convert a string to a interval value.
Definition: item_timefunc.cc:1741
A better implementation of the UNIX ctype(3) library.
MYSQL_STRINGS_EXPORT CHARSET_INFO my_charset_bin
Definition: ctype-bin.cc:508
Some integer typedefs for easier portability.
uint8_t uint8
Definition: my_inttypes.h:62
unsigned char uchar
Definition: my_inttypes.h:51
long long int longlong
Definition: my_inttypes.h:54
uint64_t table_map
Definition: my_table_map.h:29
Interface for low level time utilities.
constexpr const int DATETIME_MAX_DECIMALS
Definition: my_time.h:142
unsigned int my_time_flags_t
Flags to str_to_datetime and number_to_datetime.
Definition: my_time.h:93
constexpr const std::size_t MAX_DATE_STRING_REP_LENGTH
Required buffer length for my_time_to_str, my_date_to_str, my_datetime_to_str and TIME_to_string func...
Definition: my_time.h:429
interval_type
Available interval types used in any statement.
Definition: my_time.h:454
@ INTERVAL_HOUR_SECOND
Definition: my_time.h:469
@ INTERVAL_MONTH
Definition: my_time.h:457
@ INTERVAL_HOUR_MICROSECOND
Definition: my_time.h:472
@ INTERVAL_MINUTE
Definition: my_time.h:461
@ INTERVAL_HOUR_MINUTE
Definition: my_time.h:468
@ INTERVAL_DAY
Definition: my_time.h:459
@ INTERVAL_MINUTE_MICROSECOND
Definition: my_time.h:473
@ INTERVAL_MINUTE_SECOND
Definition: my_time.h:470
@ INTERVAL_QUARTER
Definition: my_time.h:456
@ INTERVAL_YEAR
Definition: my_time.h:455
@ INTERVAL_DAY_MICROSECOND
Definition: my_time.h:471
@ INTERVAL_SECOND_MICROSECOND
Definition: my_time.h:474
@ INTERVAL_SECOND
Definition: my_time.h:462
@ INTERVAL_DAY_HOUR
Definition: my_time.h:465
@ INTERVAL_HOUR
Definition: my_time.h:460
@ INTERVAL_YEAR_MONTH
Definition: my_time.h:464
@ INTERVAL_DAY_SECOND
Definition: my_time.h:467
@ INTERVAL_MICROSECOND
Definition: my_time.h:463
@ INTERVAL_DAY_MINUTE
Definition: my_time.h:466
Time declarations shared between the server and client API: you should not add anything to this heade...
enum_mysql_timestamp_type
Definition: mysql_time.h:44
@ MYSQL_TIMESTAMP_NONE
Definition: mysql_time.h:45
static int interval
Definition: mysqladmin.cc:69
std::string str(const mysqlrouter::ConfigGenerator::Options::Endpoint &ep)
Definition: config_generator.cc:1085
static PFS_engine_table_share_proxy table
Definition: pfs.cc:60
bool length(const dd::Spatial_reference_system *srs, const Geometry *g1, double *length, bool *null) noexcept
Computes the length of linestrings and multilinestrings.
Definition: length.cc:75
std::list< T, ut::allocator< T > > list
Specialization of list which uses ut_allocator.
Definition: ut0new.h:2877
required string type
Definition: replication_group_member_actions.proto:33
"public" interface to sys_var - server configuration variables.
type_conversion_status
Status when storing a value in a field or converting from one datatype to another.
Definition: field.h:203
@ VGS_CHECK_CONSTRAINT
Definition: field.h:477
@ VGS_GENERATED_COLUMN
Definition: field.h:475
File containing constants that can be used throughout the server.
constexpr const table_map RAND_TABLE_BIT
Definition: sql_const.h:111
constexpr const table_map INNER_TABLE_BIT
Definition: sql_const.h:109
Our own string classes, used pervasively throughout the executor.
Definition: m_ctype.h:422
Struct used to pass around arguments to/from check_function_as_value_generator.
Definition: item.h:489
const char * banned_function_name
the name of the function which is not allowed
Definition: item.h:503
Value_generator_source source
Definition: item.h:501
Struct representing a duration.
Definition: my_time.h:227
Definition: mysql_time.h:81
enum enum_mysql_timestamp_type time_type
Definition: mysql_time.h:85
Bison "location" class.
Definition: parse_location.h:42
Environment data for the contextualization phase.
Definition: parse_tree_node_base.h:418
Replacement of system's struct timeval to ensure we can carry 64 bit values even on a platform which ...
Definition: my_time_t.h:44
static task_arg int_arg(int i)
Definition: task.h:164
Item_result
Type of the user defined function return slot and arguments.
Definition: udf_registration_types.h:38
@ STRING_RESULT
not valid for UDFs
Definition: udf_registration_types.h:40
@ DECIMAL_RESULT
not valid for UDFs
Definition: udf_registration_types.h:44
@ INT_RESULT
double
Definition: udf_registration_types.h:42