1#ifndef ITEM_TIMEFUNC_INCLUDED
2#define ITEM_TIMEFUNC_INCLUDED
70 const char *
func_name()
const override {
return "period_add"; }
79 const char *
func_name()
const override {
return "period_diff"; }
87 const char *
func_name()
const override {
return "to_days"; }
102 const char *
func_name()
const override {
return "to_seconds"; }
110 int *input_version = (
int *)
int_arg;
112 int output_version = std::max(*input_version, 50500);
113 *input_version = output_version;
128 const char *
func_name()
const override {
return "dayofmonth"; }
161 const char *
func_name()
const override {
return "month"; }
176 const char *
func_name()
const override {
return "monthname"; }
190 const char *
func_name()
const override {
return "dayofyear"; }
203 const char *
func_name()
const override {
return "hour"; }
216 const char *
func_name()
const override {
return "minute"; }
229 const char *
func_name()
const override {
return "quarter"; }
242 const char *
func_name()
const override {
return "second"; }
261 const char *
func_name()
const override {
return "week"; }
271 const char *
func_name()
const override {
return "yearweek"; }
284 const char *
func_name()
const override {
return "year"; }
301 const char *
func_name()
const override {
return "cast_as_year"; }
321 return static_cast<double>(
val_int());
333 return (
odbc_type ?
"dayofweek" :
"weekday");
355 const char *
func_name()
const override {
return "dayname"; }
411 const char *
func_name()
const override {
return "unix_timestamp"; }
445 pointer_cast<Check_function_as_value_generator_parameters *>(p_arg);
457 const char *
func_name()
const override {
return "time_to_sec"; }
527 bool no_conversions)
override;
600 const char *
func_name()
const override {
return "date"; }
841 const char *
func_name()
const override {
return "date_literal"; }
862 bool eq(
const Item *item,
bool binary_cmp)
const override;
882 const char *
func_name()
const override {
return "time_literal"; }
903 bool eq(
const Item *item,
bool binary_cmp)
const override;
925 const char *
func_name()
const override {
return "datetime_literal"; }
947 bool eq(
const Item *item,
bool binary_cmp)
const override;
977 const char *
func_name()
const override {
return "time_zone"; }
1033 pointer_cast<Check_function_as_value_generator_parameters *>(
1048 const char *
func_name()
const override {
return "curtime"; }
1058 const char *
func_name()
const override {
return "utc_time"; }
1088 pointer_cast<Check_function_as_value_generator_parameters *>(
1102 const char *
func_name()
const override {
return "curdate"; }
1111 const char *
func_name()
const override {
return "utc_date"; }
1123 bool no_conversions)
override;
1146 pointer_cast<Check_function_as_value_generator_parameters *>(
1187 const char *
func_name()
const override {
return "utc_timestamp"; }
1199 const char *
func_name()
const override {
return "sysdate"; }
1216 const char *
func_name()
const override {
return "from_days"; }
1236 bool is_time_format_arg =
false)
1244 bool eq(
const Item *item,
bool binary_cmp)
const override;
1251 const char *
func_name()
const override {
return "from_unixtime"; }
1280 const char *
func_name()
const override {
return "convert_tz"; }
1298 const char *
func_name()
const override {
return "sec_to_time"; }
1323 const char *
func_name()
const override {
return "date_add_interval"; }
1326 bool eq(
const Item *item,
bool binary_cmp)
const override;
1353 const char *
func_name()
const override {
return "extract"; }
1355 bool eq(
const Item *item,
bool binary_cmp)
const override;
1414 const char *
func_name()
const override {
return "cast_as_date"; }
1443 const char *
func_name()
const override {
return "cast_as_time"; }
1481 const char *
func_name()
const override {
return "cast_as_datetime"; }
1502 const char *
func_name()
const override {
return "makedate"; }
1527 m_sign(negate ? -1 : 1) {}
1532 m_sign(negate ? -1 : 1) {}
1540 const char *
func_name()
const override {
return "add_time"; }
1549 const char *
func_name()
const override {
return "timediff"; }
1580 const char *
func_name()
const override {
return "maketime"; }
1588 const char *
func_name()
const override {
return "microsecond"; }
1604 const char *
func_name()
const override {
return "timestampdiff"; }
1632 const char *
func_name()
const override {
return "get_format"; }
1652 const char *
func_name()
const override {
return "str_to_date"; }
1661 const char *
func_name()
const override {
return "last_day"; }
1675 const char *
func_name()
const override {
return "internal_update_time"; }
1685 const char *
func_name()
const override {
return "internal_check_time"; }
void set_numeric()
Definition: item.h:209
const CHARSET_INFO * collation
Definition: item.h:175
Implementation class for the DATE_ADD and DATE_SUB functions.
Definition: item_timefunc.h:1308
bool eq(const Item *item, bool binary_cmp) const override
Definition: item_timefunc.cc:2629
enum Functype functype() const override
Definition: item_timefunc.h:1324
void print(const THD *thd, String *str, enum_query_type query_type) const override
This method is used for to:
Definition: item_timefunc.cc:2663
const bool m_subtract
False if function is DATE_ADD, true if function is DATE_SUB.
Definition: item_timefunc.h:1340
bool val_datetime(MYSQL_TIME *ltime, my_time_flags_t fuzzy_date) override
Get "native" temporal value as MYSQL_TIME.
Definition: item_timefunc.cc:2622
const char * func_name() const override
Definition: item_timefunc.h:1323
bool is_subtract() const
Definition: item_timefunc.h:1330
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.cc:2444
bool get_date_internal(MYSQL_TIME *res, my_time_flags_t fuzzy_date)
Definition: item_timefunc.cc:2534
const interval_type m_interval_type
The type of the interval argument.
Definition: item_timefunc.h:1338
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:1319
interval_type get_interval_type() const
Definition: item_timefunc.h:1329
String value
Definition: item_timefunc.h:1341
bool get_time_internal(MYSQL_TIME *res)
Definition: item_timefunc.cc:2569
Item_date_add_interval(const POS &pos, Item *a, Item *b, interval_type type, bool subtract)
Definition: item_timefunc.h:1310
Abstract class for functions returning DATE values.
Definition: item_timefunc.h:574
double val_real() override
Definition: item_timefunc.h:599
bool get_date(MYSQL_TIME *res, my_time_flags_t fuzzy_date) override=0
const char * func_name() const override
Definition: item_timefunc.h:600
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.h:602
enum Functype functype() const override
Definition: item_timefunc.h:601
Item_date_func(const POS &pos)
Definition: item_timefunc.h:582
Item_date_func()
Definition: item_timefunc.h:581
Item_date_func(Item *a)
Definition: item_timefunc.h:585
Item_date_func(const POS &pos, Item *a, Item *b)
Definition: item_timefunc.h:589
longlong val_date_temporal() override
Return date value of item in packed longlong format.
Definition: item_timefunc.cc:914
bool get_time(MYSQL_TIME *ltime) override
Definition: item_timefunc.h:593
longlong val_int() override
Definition: item_timefunc.h:597
Item_date_func(const POS &pos, Item *a)
Definition: item_timefunc.h:586
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:576
String * val_str(String *str) override
Definition: item_timefunc.h:596
my_decimal * val_decimal(my_decimal *decimal_value) override
Definition: item_timefunc.h:603
DATE'2010-01-01'.
Definition: item_timefunc.h:828
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:858
Item_date_literal(MYSQL_TIME *ltime)
Constructor for Item_date_literal.
Definition: item_timefunc.h:836
bool get_date(MYSQL_TIME *ltime, my_time_flags_t fuzzy_date) override
Definition: item_timefunc.h:848
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.h:856
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:938
bool eq(const Item *item, bool binary_cmp) const override
Definition: item_timefunc.cc:930
const char * func_name() const override
Definition: item_timefunc.h:841
longlong val_date_temporal() override
Return date value of item in packed longlong format.
Definition: item_timefunc.h:844
MYSQL_TIME_cache cached_time
Definition: item_timefunc.h:829
void cleanup() override
Called for every Item after use (preparation and execution).
Definition: item_timefunc.h:861
table_map used_tables() const override
Definition: item_timefunc.h:859
bool check_partition_func_processor(uchar *) override
Check if a partition function is allowed.
Definition: item_timefunc.h:857
String * val_str(String *str) override
Definition: item_timefunc.h:852
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:860
Abstract class for functions returning DATETIME values.
Definition: item_timefunc.h:616
longlong val_int() override
Definition: item_timefunc.h:659
Item_datetime_func(Item *a)
Definition: item_timefunc.h:629
Item_datetime_func(const POS &pos)
Definition: item_timefunc.h:626
Item_datetime_func()
Definition: item_timefunc.h:623
String * val_str(String *str) override
Definition: item_timefunc.h:656
double val_real() override
Definition: item_timefunc.h:655
longlong val_date_temporal() override
Return date value of item in packed longlong format.
Definition: item_timefunc.cc:922
bool get_time(MYSQL_TIME *ltime) override
Definition: item_timefunc.h:665
Item_datetime_func(const POS &pos, PT_item_list *list)
Definition: item_timefunc.h:650
Item_datetime_func(Item *a, Item *b, Item *c)
Definition: item_timefunc.h:639
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:618
Item_datetime_func(const POS &pos, Item *a, Item *b, Item *c)
Definition: item_timefunc.h:642
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:646
my_decimal * val_decimal(my_decimal *decimal_value) override
Definition: item_timefunc.h:661
Item_datetime_func(const POS &pos, Item *a, Item *b)
Definition: item_timefunc.h:635
Item_datetime_func(const POS &pos, Item *a)
Definition: item_timefunc.h:632
TIMESTAMP'2001-01-01 10:20:30'.
Definition: item_timefunc.h:909
MYSQL_TIME_cache cached_time
Definition: item_timefunc.h:910
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:943
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.h:941
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:945
enum Functype functype() const override
Definition: item_timefunc.h:926
const char * func_name() const override
Definition: item_timefunc.h:925
void cleanup() override
Called for every Item after use (preparation and execution).
Definition: item_timefunc.h:946
Item_datetime_literal(MYSQL_TIME *ltime, uint dec_arg, const Time_zone *tz)
Constructor for Item_datetime_literal.
Definition: item_timefunc.h:920
bool check_partition_func_processor(uchar *) override
Check if a partition function is allowed.
Definition: item_timefunc.h:942
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:952
bool eq(const Item *item, bool binary_cmp) const override
Definition: item_timefunc.cc:944
bool get_date(MYSQL_TIME *ltime, my_time_flags_t fuzzy_date) override
Definition: item_timefunc.h:933
String * val_str(String *str) override
Definition: item_timefunc.h:937
longlong val_date_temporal() override
Return date value of item in packed longlong format.
Definition: item_timefunc.h:929
table_map used_tables() const override
Definition: item_timefunc.h:944
Add a time expression to a temporal expression, or subtract a time expression from a temporal express...
Definition: item_timefunc.h:1517
int m_sign
+1 for ADD, -1 for SUBTRACT
Definition: item_timefunc.h:1519
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.cc:3000
const char * func_name() const override
Definition: item_timefunc.h:1540
Item_func_add_time(Item *a, Item *b, bool datetime, bool negate)
Definition: item_timefunc.h:1524
const bool m_datetime
True if first argument expected to be datetime.
Definition: item_timefunc.h:1518
int sign() const
Definition: item_timefunc.h:1542
enum Functype functype() const override
Definition: item_timefunc.h:1541
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:3043
Item_func_add_time(const POS &pos, Item *a, Item *b, bool datetime, bool negate)
Definition: item_timefunc.h:1528
Item_func_add_time(const POS &pos, Item *a, Item *b)
Definition: item_timefunc.h:1534
void print(const THD *thd, String *str, enum_query_type query_type) const override
This method is used for to:
Definition: item_timefunc.cc:3112
This function implements the AT TIME ZONE operator, which casts a temporal value to a temporal with t...
Definition: item_timefunc.h:967
bool check_type() const
Definition: item_timefunc.cc:1021
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.cc:973
bool set_time_zone(THD *thd)
Definition: item_timefunc.cc:985
const char * func_name() const override
Definition: item_timefunc.h:977
bool m_is_interval
Whether the syntax used the INTERVAL construction.
Definition: item_timefunc.h:999
bool get_date(MYSQL_TIME *res, my_time_flags_t) override
Definition: item_timefunc.cc:996
const char * m_specifier_string
The specifier string argument, not used after resolution.
Definition: item_timefunc.h:993
const Time_zone * m_tz
The time zone that the specifier string argument resolves to.
Definition: item_timefunc.h:990
const char * specifier_string() const
Definition: item_timefunc.h:983
Item_func_at_time_zone(const POS &pos, Item *datetime, const char *specifier_string, bool is_interval)
Definition: item_timefunc.h:969
Definition: item_timefunc.h:1265
const char * func_name() const override
Definition: item_timefunc.h:1280
bool get_date(MYSQL_TIME *res, my_time_flags_t fuzzy_date) override
Definition: item_timefunc.cc:2400
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.cc:2392
void cleanup() override
Called for every Item after use (preparation and execution).
Definition: item_timefunc.cc:2438
Time_zone * from_tz
Definition: item_timefunc.h:1273
Item_func_convert_tz(const POS &pos, Item *a, Item *b, Item *c)
Definition: item_timefunc.h:1276
bool from_tz_cached
Definition: item_timefunc.h:1272
bool to_tz_cached
Definition: item_timefunc.h:1272
enum Functype functype() const override
Definition: item_timefunc.h:1281
Time_zone * to_tz
Definition: item_timefunc.h:1273
Definition: item_timefunc.h:1096
Time_zone * time_zone() override
Definition: item_timefunc.cc:1974
const char * func_name() const override
Definition: item_timefunc.h:1102
Item_func_curdate_local(const POS &pos)
Definition: item_timefunc.h:1101
Definition: item_timefunc.h:1105
Time_zone * time_zone() override
Definition: item_timefunc.cc:1978
Item_func_curdate_utc(const POS &pos)
Definition: item_timefunc.h:1110
const char * func_name() const override
Definition: item_timefunc.h:1111
Abstract CURDATE function.
Definition: item_timefunc.h:1066
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.cc:1969
Item_date_func super
Definition: item_timefunc.h:1067
longlong val_date_temporal() override
Return date value of item in packed longlong format.
Definition: item_timefunc.cc:1980
String * val_str(String *) override
Definition: item_timefunc.cc:1994
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:1086
bool itemize(Parse_context *pc, Item **res) override
The same as contextualize() but with additional parameter.
Definition: item_timefunc.cc:1962
bool get_date(MYSQL_TIME *res, my_time_flags_t) override
Definition: item_timefunc.cc:1987
Item_func_curdate(const POS &pos)
Definition: item_timefunc.h:1073
table_map get_initial_pseudo_tables() const override
This function must assign a new value for each execution.
Definition: item_timefunc.h:1078
Definition: item_timefunc.h:1041
Item_func_curtime_local(const POS &pos, uint8 dec_arg)
Definition: item_timefunc.h:1046
const char * func_name() const override
Definition: item_timefunc.h:1048
Time_zone * time_zone() override
Definition: item_timefunc.cc:2059
Definition: item_timefunc.h:1051
Time_zone * time_zone() override
Definition: item_timefunc.cc:2063
const char * func_name() const override
Definition: item_timefunc.h:1058
Item_func_curtime_utc(const POS &pos, uint8 dec_arg)
Definition: item_timefunc.h:1056
Abstract CURTIME function. Children should define what time zone is used.
Definition: item_timefunc.h:1003
virtual Time_zone * time_zone()=0
String * val_str(String *) override
Definition: item_timefunc.cc:2046
table_map get_initial_pseudo_tables() const override
This function must assign a new value for each execution.
Definition: item_timefunc.h:1023
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.cc:2015
bool get_time(MYSQL_TIME *ltime) override
Definition: item_timefunc.cc:2038
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:1031
Item_func_curtime(const POS &pos, uint8 dec_arg)
Constructor for Item_func_curtime.
Definition: item_timefunc.h:1016
bool itemize(Parse_context *pc, Item **res) override
The same as contextualize() but with additional parameter.
Definition: item_timefunc.cc:2008
longlong val_time_temporal() override
Return time value of item in packed longlong format.
Definition: item_timefunc.cc:2030
Item_time_func super
Definition: item_timefunc.h:1004
TS-TODO: Item_func_dayname should be derived from Item_str_func.
Definition: item_timefunc.h:349
bool get_date(MYSQL_TIME *ltime, my_time_flags_t fuzzydate) override
Definition: item_timefunc.h:358
enum Item_result result_type() const override
Definition: item_timefunc.h:364
bool get_time(MYSQL_TIME *ltime) override
Definition: item_timefunc.h:361
const char * func_name() const override
Definition: item_timefunc.h:355
Item_func_dayname(const POS &pos, Item *a)
Definition: item_timefunc.h:353
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.cc:1466
bool check_partition_func_processor(uchar *) override
Check if a partition function is allowed.
Definition: item_timefunc.h:366
String * val_str(String *str) override
Definition: item_timefunc.cc:1477
MY_LOCALE * locale
Definition: item_timefunc.h:350
enum Functype functype() const override
Definition: item_timefunc.h:356
Definition: item_timefunc.h:123
bool check_valid_arguments_processor(uchar *) override
Definition: item_timefunc.h:132
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.cc:1233
Item_func_dayofmonth(const POS &pos, Item *a)
Definition: item_timefunc.h:125
bool check_partition_func_processor(uchar *) override
Check if a partition function is allowed.
Definition: item_timefunc.h:131
const char * func_name() const override
Definition: item_timefunc.h:128
longlong val_int() override
Definition: item_timefunc.cc:1243
enum Functype functype() const override
Definition: item_timefunc.h:129
Definition: item_timefunc.h:186
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.cc:1215
bool check_valid_arguments_processor(uchar *) override
Definition: item_timefunc.h:194
longlong val_int() override
Definition: item_timefunc.cc:1225
bool check_partition_func_processor(uchar *) override
Check if a partition function is allowed.
Definition: item_timefunc.h:193
Item_func_dayofyear(const POS &pos, Item *a)
Definition: item_timefunc.h:188
const char * func_name() const override
Definition: item_timefunc.h:190
enum Functype functype() const override
Definition: item_timefunc.h:191
Definition: item_timefunc.h:1213
const char * func_name() const override
Definition: item_timefunc.h:1216
Item_func_from_days(const POS &pos, Item *a)
Definition: item_timefunc.h:1215
bool check_valid_arguments_processor(uchar *) override
Definition: item_timefunc.h:1220
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.h:1223
bool check_partition_func_processor(uchar *) override
Check if a partition function is allowed.
Definition: item_timefunc.h:1218
bool get_date(MYSQL_TIME *res, my_time_flags_t fuzzy_date) override
Definition: item_timefunc.cc:1868
enum Functype functype() const override
Definition: item_timefunc.h:1219
Definition: item_timefunc.h:1247
bool get_date(MYSQL_TIME *res, my_time_flags_t fuzzy_date) override
Definition: item_timefunc.cc:2339
const char * func_name() const override
Definition: item_timefunc.h:1251
Item_func_from_unixtime(const POS &pos, Item *a)
Definition: item_timefunc.h:1249
enum Functype functype() const override
Definition: item_timefunc.h:1252
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.cc:2331
Definition: item_timefunc.h:199
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.cc:1311
bool check_valid_arguments_processor(uchar *) override
Definition: item_timefunc.h:207
longlong val_int() override
Definition: item_timefunc.cc:1320
const char * func_name() const override
Definition: item_timefunc.h:203
enum Functype functype() const override
Definition: item_timefunc.h:204
Item_func_hour(const POS &pos, Item *a)
Definition: item_timefunc.h:201
bool check_partition_func_processor(uchar *) override
Check if a partition function is allowed.
Definition: item_timefunc.h:206
Definition: item_timefunc.h:1680
enum Functype functype() const override
Definition: item_timefunc.h:1684
bool get_date(MYSQL_TIME *res, my_time_flags_t fuzzy_date) override
Definition: item_timefunc.cc:3728
const char * func_name() const override
Definition: item_timefunc.h:1685
Item_func_internal_check_time(const POS &pos, PT_item_list *list)
Definition: item_timefunc.h:1682
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.cc:3720
Definition: item_timefunc.h:1670
const char * func_name() const override
Definition: item_timefunc.h:1675
enum Functype functype() const override
Definition: item_timefunc.h:1674
Item_func_internal_update_time(const POS &pos, PT_item_list *list)
Definition: item_timefunc.h:1672
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.cc:3641
bool get_date(MYSQL_TIME *res, my_time_flags_t fuzzy_date) override
Definition: item_timefunc.cc:3649
Definition: item_timefunc.h:1656
Item_func_last_day(const POS &pos, Item *a)
Definition: item_timefunc.h:1658
const char * func_name() const override
Definition: item_timefunc.h:1661
enum Functype functype() const override
Definition: item_timefunc.h:1662
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.h:1664
bool get_date(MYSQL_TIME *res, my_time_flags_t fuzzy_date) override
Definition: item_timefunc.cc:3617
Definition: item_timefunc.h:1496
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.h:1505
enum Functype functype() const override
Definition: item_timefunc.h:1504
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:2971
Item_func_makedate(const POS &pos, Item *a, Item *b)
Definition: item_timefunc.h:1498
const char * func_name() const override
Definition: item_timefunc.h:1502
Definition: item_timefunc.h:1567
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.h:1573
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:3196
Item_func_maketime(const POS &pos, Item *a, Item *b, Item *c)
Definition: item_timefunc.h:1569
const char * func_name() const override
Definition: item_timefunc.h:1580
Definition: item_timefunc.h:1584
bool check_valid_arguments_processor(uchar *) override
Definition: item_timefunc.h:1592
longlong val_int() override
MICROSECOND(a) is a function ( extraction) that extracts the microseconds from a.
Definition: item_timefunc.cc:3269
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.cc:3275
enum Functype functype() const override
Definition: item_timefunc.h:1589
Item_func_microsecond(const POS &pos, Item *a)
Definition: item_timefunc.h:1586
const char * func_name() const override
Definition: item_timefunc.h:1588
bool check_partition_func_processor(uchar *) override
Check if a partition function is allowed.
Definition: item_timefunc.h:1591
Definition: item_timefunc.h:212
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.cc:1326
const char * func_name() const override
Definition: item_timefunc.h:216
longlong val_int() override
Definition: item_timefunc.cc:1335
Item_func_minute(const POS &pos, Item *a)
Definition: item_timefunc.h:214
bool check_partition_func_processor(uchar *) override
Check if a partition function is allowed.
Definition: item_timefunc.h:219
enum Functype functype() const override
Definition: item_timefunc.h:217
bool check_valid_arguments_processor(uchar *) override
Definition: item_timefunc.h:220
TS-TODO: This should probably have Item_int_func as parent class.
Definition: item_timefunc.h:140
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
double val_real() override
Definition: item_timefunc.h:147
enum Item_result result_type() const override
Definition: item_timefunc.h:163
longlong val_int() override
Definition: item_timefunc.cc:1259
const char * func_name() const override
Definition: item_timefunc.h:161
String * val_str(String *str) override
Definition: item_timefunc.h:151
bool get_time(MYSQL_TIME *ltime) override
Definition: item_timefunc.h:160
Item_func_month(const POS &pos, Item *a)
Definition: item_timefunc.h:142
bool check_valid_arguments_processor(uchar *) override
Definition: item_timefunc.h:166
enum Functype functype() const override
Definition: item_timefunc.h:162
bool check_partition_func_processor(uchar *) override
Check if a partition function is allowed.
Definition: item_timefunc.h:165
bool get_date(MYSQL_TIME *ltime, my_time_flags_t fuzzydate) override
Definition: item_timefunc.h:157
Definition: item_timefunc.h:171
Item_func_monthname(const POS &pos, Item *a)
Definition: item_timefunc.h:175
MY_LOCALE * locale
Definition: item_timefunc.h:172
const char * func_name() const override
Definition: item_timefunc.h:176
bool check_valid_arguments_processor(uchar *) override
Definition: item_timefunc.h:181
bool check_partition_func_processor(uchar *) override
Check if a partition function is allowed.
Definition: item_timefunc.h:180
String * val_str(String *str) override
Definition: item_timefunc.cc:1276
enum Functype functype() const override
Definition: item_timefunc.h:177
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
Definition: item_timefunc.h:1154
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:2075
Time_zone * time_zone() override
Definition: item_timefunc.cc:2082
const char * func_name() const override
Definition: item_timefunc.h:1171
Item_func_now_local(const POS &pos, uint8 dec_arg)
Definition: item_timefunc.h:1168
enum Functype functype() const override
Definition: item_timefunc.h:1172
Item_func_now_local(uint8 dec_arg)
Definition: item_timefunc.h:1167
Definition: item_timefunc.h:1175
const char * func_name() const override
Definition: item_timefunc.h:1187
Item_func_now_utc(const POS &pos, uint8 dec_arg)
Definition: item_timefunc.h:1182
bool itemize(Parse_context *pc, Item **res) override
The same as contextualize() but with additional parameter.
Definition: item_timefunc.cc:2084
Item_func_now super
Definition: item_timefunc.h:1176
Time_zone * time_zone() override
Definition: item_timefunc.cc:2091
Abstract CURRENT_TIMESTAMP function.
Definition: item_timefunc.h:1119
Item_func_now(uint8 dec_arg)
Constructor for Item_func_now.
Definition: item_timefunc.h:1130
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:2122
longlong val_date_temporal() override
Return date value of item in packed longlong format.
Definition: item_timefunc.cc:2093
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.cc:2067
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:1144
String * val_str(String *) override
Definition: item_timefunc.cc:2109
table_map get_initial_pseudo_tables() const override
This function must assign a new value for each execution.
Definition: item_timefunc.h:1136
bool get_date(MYSQL_TIME *res, my_time_flags_t) override
Definition: item_timefunc.cc:2101
Item_func_now(const POS &pos, uint8 dec_arg)
Definition: item_timefunc.h:1131
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:1035
longlong val_int() override
Definition: item_timefunc.cc:1039
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:74
const char * func_name() const override
Definition: item_timefunc.h:79
Item_func_period_diff(const POS &pos, Item *a, Item *b)
Definition: item_timefunc.h:76
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.cc:1053
longlong val_int() override
Definition: item_timefunc.cc:1057
Definition: item_timefunc.h:225
const char * func_name() const override
Definition: item_timefunc.h:229
bool check_partition_func_processor(uchar *) override
Check if a partition function is allowed.
Definition: item_timefunc.h:232
bool check_valid_arguments_processor(uchar *) override
Definition: item_timefunc.h:233
enum Functype functype() const override
Definition: item_timefunc.h:230
Item_func_quarter(const POS &pos, Item *a)
Definition: item_timefunc.h:227
longlong val_int() override
Returns the quarter of the year.
Definition: item_timefunc.cc:1304
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.cc:1291
Definition: item_timefunc.h:1287
const char * func_name() const override
Definition: item_timefunc.h:1298
Item_func_sec_to_time(const POS &pos, Item *item)
Definition: item_timefunc.h:1289
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.h:1291
bool get_time(MYSQL_TIME *ltime) override
Definition: item_timefunc.cc:2154
Definition: item_timefunc.h:238
bool check_valid_arguments_processor(uchar *) override
Definition: item_timefunc.h:246
const char * func_name() const override
Definition: item_timefunc.h:242
bool check_partition_func_processor(uchar *) override
Check if a partition function is allowed.
Definition: item_timefunc.h:245
enum Functype functype() const override
Definition: item_timefunc.h:243
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.cc:1341
Item_func_second(const POS &pos, Item *a)
Definition: item_timefunc.h:240
longlong val_int() override
Returns the second in time_exp in the range of 0 - 59.
Definition: item_timefunc.cc:1353
Definition: item_timefunc.h:1642
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.cc:3535
Item_func_str_to_date(const POS &pos, Item *a, Item *b)
Definition: item_timefunc.h:1650
bool val_datetime(MYSQL_TIME *ltime, my_time_flags_t fuzzy_date) override
Get "native" temporal value as MYSQL_TIME.
Definition: item_timefunc.cc:3568
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:3485
const char * func_name() const override
Definition: item_timefunc.h:1652
enum_mysql_timestamp_type cached_timestamp_type
Definition: item_timefunc.h:1643
SYSDATE() is like NOW(), but always uses the real current time, not the query_start().
Definition: item_timefunc.h:1194
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:1208
const char * func_name() const override
Definition: item_timefunc.h:1199
Item_func_sysdate_local(uint8 dec_arg)
Definition: item_timefunc.h:1196
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.cc:2148
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:2135
Definition: item_timefunc.h:452
enum Functype functype() const override
Definition: item_timefunc.h:458
longlong val_int() override
Definition: item_timefunc.cc:1702
bool check_partition_func_processor(uchar *) override
Check if a partition function is allowed.
Definition: item_timefunc.h:460
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.cc:1695
Item_func_time_to_sec(const POS &pos, Item *item)
Definition: item_timefunc.h:454
bool check_valid_arguments_processor(uchar *) override
Definition: item_timefunc.h:461
const char * func_name() const override
Definition: item_timefunc.h:457
Definition: item_timefunc.h:1545
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:3140
Item_func_timediff(const POS &pos, Item *a, Item *b)
Definition: item_timefunc.h:1547
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.h:1550
const char * func_name() const override
Definition: item_timefunc.h:1549
Definition: item_timefunc.h:1597
interval_type intervaltype() const
Definition: item_timefunc.h:1606
const char * func_name() const override
Definition: item_timefunc.h:1604
enum Functype functype() const override
Definition: item_timefunc.h:1605
longlong val_int() override
Definition: item_timefunc.cc:3281
void print(const THD *thd, String *str, enum_query_type query_type) const override
This method is used for to:
Definition: item_timefunc.cc:3377
Item_func_timestamp_diff(const POS &pos, Item *a, Item *b, interval_type type_arg)
Definition: item_timefunc.h:1601
const interval_type int_type
Definition: item_timefunc.h:1598
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.h:1608
Definition: item_timefunc.h:83
Item_func_to_days(const POS &pos, Item *a)
Definition: item_timefunc.h:85
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.cc:1072
bool check_partition_func_processor(uchar *) override
Check if a partition function is allowed.
Definition: item_timefunc.h:92
longlong val_int() override
Definition: item_timefunc.cc:1085
enum Functype functype() const override
Definition: item_timefunc.h:88
const char * func_name() const override
Definition: item_timefunc.h:87
bool check_valid_arguments_processor(uchar *) override
Definition: item_timefunc.h:93
longlong val_int_endpoint(bool left_endp, bool *incl_endp) override
Definition: item_timefunc.cc:1166
enum_monotonicity_info get_monotonicity_info() const override
Definition: item_timefunc.cc:1147
Definition: item_timefunc.h:98
bool intro_version(uchar *int_arg) override
Definition: item_timefunc.h:109
enum_monotonicity_info get_monotonicity_info() const override
Definition: item_timefunc.cc:1157
Item_func_to_seconds(const POS &pos, Item *a)
Definition: item_timefunc.h:100
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.cc:1115
longlong val_int() override
Definition: item_timefunc.cc:1121
enum Functype functype() const override
Definition: item_timefunc.h:103
const char * func_name() const override
Definition: item_timefunc.h:102
bool check_partition_func_processor(uchar *) override
Check if a partition function is allowed.
Definition: item_timefunc.h:107
longlong val_int_endpoint(bool left_endp, bool *incl_endp) override
Definition: item_timefunc.cc:1092
bool check_valid_arguments_processor(uchar *) override
Definition: item_timefunc.h:118
Definition: item_timefunc.h:400
bool check_partition_func_processor(uchar *) override
Check if a partition function is allowed.
Definition: item_timefunc.h:417
longlong val_int_endpoint(bool left_endp, bool *incl_endp) override
Definition: item_timefunc.cc:1686
const char * func_name() const override
Definition: item_timefunc.h:411
Item_func_unix_timestamp(const POS &pos)
Definition: item_timefunc.h:404
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:439
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.h:426
Item_timeval_func super
Definition: item_timefunc.h:401
enum_monotonicity_info get_monotonicity_info() const override
Definition: item_timefunc.cc:1679
Item_func_unix_timestamp(Item *a)
Definition: item_timefunc.h:406
bool check_valid_arguments_processor(uchar *) override
Definition: item_timefunc.h:423
bool itemize(Parse_context *pc, Item **res) override
The same as contextualize() but with additional parameter.
Definition: item_timefunc.cc:1657
enum Functype functype() const override
Definition: item_timefunc.h:412
Item_func_unix_timestamp(const POS &pos, Item *a)
Definition: item_timefunc.h:408
bool val_timeval(my_timeval *tm) override
Definition: item_timefunc.cc:1668
Definition: item_timefunc.h:251
const char * func_name() const override
Definition: item_timefunc.h:261
longlong val_int() override
Definition: item_timefunc.cc:1418
bool itemize(Parse_context *pc, Item **res) override
The same as contextualize() but with additional parameter.
Definition: item_timefunc.cc:1365
Item_func_week(const POS &pos, Item *a, Item *b)
Definition: item_timefunc.h:256
Item_func_week(Item *a, Item *b)
Definition: item_timefunc.h:255
Item_int_func super
Definition: item_timefunc.h:252
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.cc:1376
enum Functype functype() const override
Definition: item_timefunc.h:262
TS-TODO: This should probably have Item_int_func as parent class.
Definition: item_timefunc.h:309
Item_func_weekday(const POS &pos, Item *a, bool type_arg)
Definition: item_timefunc.h:313
bool check_partition_func_processor(uchar *) override
Check if a partition function is allowed.
Definition: item_timefunc.h:338
const char * func_name() const override
Definition: item_timefunc.h:332
bool check_valid_arguments_processor(uchar *) override
Definition: item_timefunc.h:339
double val_real() override
Definition: item_timefunc.h:319
String * val_str(String *str) override
Definition: item_timefunc.h:323
bool odbc_type
Definition: item_timefunc.h:310
enum Item_result result_type() const override
Definition: item_timefunc.h:336
enum Functype functype() const override
Definition: item_timefunc.h:335
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.cc:1446
bool get_time(MYSQL_TIME *ltime) override
Definition: item_timefunc.h:331
bool get_date(MYSQL_TIME *ltime, my_time_flags_t fuzzydate) override
Definition: item_timefunc.h:328
longlong val_int() override
Definition: item_timefunc.cc:1455
Definition: item_timefunc.h:280
enum Functype functype() const override
Definition: item_timefunc.h:285
longlong val_int_endpoint(bool left_endp, bool *incl_endp) override
Definition: item_timefunc.cc:1601
enum_monotonicity_info get_monotonicity_info() const override
Definition: item_timefunc.cc:1593
bool check_partition_func_processor(uchar *) override
Check if a partition function is allowed.
Definition: item_timefunc.h:289
const char * func_name() const override
Definition: item_timefunc.h:284
longlong val_int() override
Definition: item_timefunc.cc:1498
Item_func_year(const POS &pos, Item *a)
Definition: item_timefunc.h:282
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.cc:1491
bool check_valid_arguments_processor(uchar *) override
Definition: item_timefunc.h:290
Definition: item_timefunc.h:266
bool check_partition_func_processor(uchar *) override
Check if a partition function is allowed.
Definition: item_timefunc.h:274
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.cc:1426
enum Functype functype() const override
Definition: item_timefunc.h:272
longlong val_int() override
Definition: item_timefunc.cc:1436
Item_func_yearweek(const POS &pos, Item *a, Item *b)
Definition: item_timefunc.h:268
bool check_valid_arguments_processor(uchar *) override
Definition: item_timefunc.h:275
const char * func_name() const override
Definition: item_timefunc.h:271
Definition: item_func.h:93
bool param_type_uses_non_param(THD *thd, enum_field_types def=MYSQL_TYPE_VARCHAR)
Definition: item_func.cc:604
Item ** args
Array of pointers to arguments.
Definition: item_func.h:100
Functype
Definition: item_func.h:176
@ DATEADD_FUNC
Definition: item_func.h:281
@ YEAR_FUNC
Definition: item_func.h:262
@ HOUR_FUNC
Definition: item_func.h:272
@ TIME_TO_SEC_FUNC
Definition: item_func.h:286
@ FROM_UNIXTIME_FUNC
Definition: item_func.h:282
@ NOW_FUNC
Definition: item_func.h:217
@ FROM_DAYS_FUNC
Definition: item_func.h:218
@ CONVERT_TZ_FUNC
Definition: item_func.h:283
@ DD_INTERNAL_FUNC
Definition: item_func.h:232
@ DAY_FUNC
Definition: item_func.h:267
@ MAKEDATE_FUNC
Definition: item_func.h:264
@ DATE_FUNC
Definition: item_func.h:271
@ TIMESTAMPDIFF_FUNC
Definition: item_func.h:287
@ SECOND_FUNC
Definition: item_func.h:274
@ EXTRACT_FUNC
Definition: item_func.h:223
@ MONTH_FUNC
Definition: item_func.h:265
@ TO_SECONDS_FUNC
Definition: item_func.h:270
@ MICROSECOND_FUNC
Definition: item_func.h:275
@ QUARTER_FUNC
Definition: item_func.h:278
@ MONTHNAME_FUNC
Definition: item_func.h:266
@ TYPECAST_FUNC
Definition: item_func.h:224
@ LAST_DAY_FUNC
Definition: item_func.h:284
@ WEEKDAY_FUNC
Definition: item_func.h:280
@ ADDTIME_FUNC
Definition: item_func.h:277
@ DAYOFYEAR_FUNC
Definition: item_func.h:276
@ DAYNAME_FUNC
Definition: item_func.h:268
@ DATETIME_LITERAL
Definition: item_func.h:288
@ MINUTE_FUNC
Definition: item_func.h:273
@ TO_DAYS_FUNC
Definition: item_func.h:269
@ WEEK_FUNC
Definition: item_func.h:279
@ YEARWEEK_FUNC
Definition: item_func.h:263
@ UNIX_TIMESTAMP_FUNC
Definition: item_func.h:285
bool has_timestamp_args()
Definition: item_func.h:568
enum Type type() const override
Definition: item_func.h:307
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:516
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:492
bool has_date_args()
Definition: item_func.h:578
uint arg_count
How many arguments in 'args'.
Definition: item_func.h:123
bool has_time_args()
Definition: item_func.h:589
bool has_datetime_args()
Definition: item_func.h:600
Definition: item_func.h:926
virtual const char * func_name() const =0
Definition: item_strfunc.h:143
Definition: item_strfunc.h:75
String * val_str_from_val_str_ascii(String *str, String *str2)
Definition: item_strfunc.cc:141
Abstract class for functions returning TIME, DATE, DATETIME types whose data type is known at constru...
Definition: item_timefunc.h:470
Item_temporal_func()
Definition: item_timefunc.h:475
Item_temporal_func(const POS &pos, Item *a)
Definition: item_timefunc.h:479
Item_temporal_func(const POS &pos, Item *a, Item *b)
Definition: item_timefunc.h:481
Item_temporal_func(const POS &pos)
Definition: item_timefunc.h:476
Item_temporal_func(Item *a)
Definition: item_timefunc.h:478
Item_temporal_func(Item *a, Item *b, Item *c)
Definition: item_timefunc.h:483
Field * tmp_table_field(TABLE *table) override
Definition: item_timefunc.h:495
Item_temporal_func(const POS &pos, PT_item_list *list)
Definition: item_timefunc.h:488
bool check_precision()
Definition: item_timefunc.cc:789
Item_temporal_func(const POS &pos, Item *a, Item *b, Item *c)
Definition: item_timefunc.h:484
Item_temporal_func(const POS &pos, Item *a, Item *b, Item *c, Item *d)
Definition: item_timefunc.h:486
uint datetime_precision() override
DATETIME precision of the item: 0..6.
Definition: item_timefunc.h:502
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:809
uint time_precision() override
TIME precision of the item: 0..6.
Definition: item_timefunc.h:498
const CHARSET_INFO * charset_for_protocol() override
Definition: item_timefunc.h:492
Item_result result_type() const override
Definition: item_timefunc.h:491
Abstract class for functions returning TIME, DATE, DATETIME or string values, whose data type depends...
Definition: item_timefunc.h:514
const CHARSET_INFO * charset_for_protocol() override
Definition: item_timefunc.h:536
Field * tmp_table_field(TABLE *table) override
Definition: item_timefunc.h:547
my_decimal * val_decimal(my_decimal *decimal_value) override
Definition: item_timefunc.cc:838
sql_mode_t sql_mode
Definition: item_timefunc.h:516
double val_real() override
Definition: item_timefunc.h:551
Item_result result_type() const override
Definition: item_timefunc.h:535
bool get_time(MYSQL_TIME *ltime) override
Definition: item_timefunc.cc:873
Item_temporal_hybrid_func(const POS &pos, Item *a, Item *b)
Definition: item_timefunc.h:532
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:530
String * val_str(String *str) override
Return string value in @character_set_connection.
Definition: item_timefunc.h:560
String * val_str_ascii(String *str) override
Return string value in ASCII character set.
Definition: item_timefunc.cc:884
longlong val_int() override
Definition: item_timefunc.h:550
String ascii_buf
Definition: item_timefunc.h:517
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:831
bool get_date(MYSQL_TIME *ltime, my_time_flags_t fuzzydate) override
Definition: item_timefunc.cc:859
Abstract class for functions returning TIME values.
Definition: item_timefunc.h:677
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:679
longlong val_int() override
Definition: item_timefunc.h:707
String * val_str(String *str) override
Definition: item_timefunc.h:712
Item_time_func(const POS &pos, Item *a)
Definition: item_timefunc.h:691
Item_time_func(const POS &pos, Item *a, Item *b, Item *c)
Definition: item_timefunc.h:698
Item_time_func(Item *a)
Definition: item_timefunc.h:688
longlong val_time_temporal() override
Return time value of item in packed longlong format.
Definition: item_timefunc.cc:908
my_decimal * val_decimal(my_decimal *decimal_value) override
Definition: item_timefunc.h:703
Item_time_func(const POS &pos)
Definition: item_timefunc.h:685
bool get_time(MYSQL_TIME *res) override=0
double val_real() override
Definition: item_timefunc.h:702
Item_time_func(const POS &pos, Item *a, Item *b)
Definition: item_timefunc.h:694
bool get_date(MYSQL_TIME *res, my_time_flags_t) override
Definition: item_timefunc.h:709
Item_time_func()
Definition: item_timefunc.h:684
TIME'10:10:10'.
Definition: item_timefunc.h:868
bool get_time(MYSQL_TIME *ltime) override
Definition: item_timefunc.h:889
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.h:897
bool check_partition_func_processor(uchar *) override
Check if a partition function is allowed.
Definition: item_timefunc.h:898
void cleanup() override
Called for every Item after use (preparation and execution).
Definition: item_timefunc.h:902
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:899
Item_time_literal(MYSQL_TIME *ltime, uint dec_arg)
Constructor for Item_time_literal.
Definition: item_timefunc.h:877
const char * func_name() const override
Definition: item_timefunc.h:882
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:967
longlong val_time_temporal() override
Return time value of item in packed longlong format.
Definition: item_timefunc.h:885
bool eq(const Item *item, bool binary_cmp) const override
Definition: item_timefunc.cc:959
table_map used_tables() const override
Definition: item_timefunc.h:900
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:901
String * val_str(String *str) override
Definition: item_timefunc.h:893
MYSQL_TIME_cache cached_time
Definition: item_timefunc.h:869
Definition: item_timefunc.h:372
bool get_date(MYSQL_TIME *ltime, my_time_flags_t fuzzydate) override
Definition: item_timefunc.h:389
virtual bool val_timeval(my_timeval *tm)=0
Return timestamp in "struct timeval" format.
longlong val_int() override
Definition: item_timefunc.cc:1628
String * val_str(String *str) override
Definition: item_timefunc.cc:1648
Item_timeval_func(const POS &pos, Item *a)
Definition: item_timefunc.h:377
my_decimal * val_decimal(my_decimal *decimal_value) override
Definition: item_timefunc.cc:1633
Item_timeval_func(Item *a)
Definition: item_timefunc.h:376
enum Item_result result_type() const override
Definition: item_timefunc.h:395
Item_timeval_func(const POS &pos)
Definition: item_timefunc.h:374
double val_real() override
Definition: item_timefunc.cc:1641
bool get_time(MYSQL_TIME *ltime) override
Definition: item_timefunc.h:392
Definition: item_timefunc.h:1396
bool m_explicit_cast
Definition: item_timefunc.h:1397
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.h:1408
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:2925
const char * cast_type() const
Definition: item_timefunc.h:1418
bool get_date(MYSQL_TIME *ltime, my_time_flags_t fuzzy_date) override
Definition: item_timefunc.cc:2934
const char * func_name() const override
Definition: item_timefunc.h:1414
bool is_explicit_cast() const
Definition: item_timefunc.h:1416
enum Functype functype() const override
Definition: item_timefunc.h:1415
Item_typecast_date(Item *a, bool explicit_cast)
Definition: item_timefunc.h:1400
Item_typecast_date(const POS &pos, Item *a)
Definition: item_timefunc.h:1404
Definition: item_timefunc.h:1458
Item_typecast_datetime(Item *a, uint8 dec_arg)
Definition: item_timefunc.h:1475
Item_typecast_datetime(const POS &pos, Item *a)
Definition: item_timefunc.h:1467
Item_typecast_datetime(Item *a, bool explicit_cast)
Definition: item_timefunc.h:1463
enum Functype functype() const override
Definition: item_timefunc.h:1482
bool is_explicit_cast() const
Definition: item_timefunc.h:1484
const char * func_name() const override
Definition: item_timefunc.h:1481
bool m_explicit_cast
Definition: item_timefunc.h:1460
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.h:1485
Item_typecast_datetime(const POS &pos, Item *a, uint8 dec_arg)
Definition: item_timefunc.h:1470
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:2865
bool detect_precision_from_arg
Definition: item_timefunc.h:1459
bool get_date(MYSQL_TIME *res, my_time_flags_t fuzzy_date) override
Definition: item_timefunc.cc:2875
const char * cast_type() const
Definition: item_timefunc.h:1483
Definition: item_timefunc.h:1421
Item_typecast_time(Item *a, uint8 dec_arg)
Definition: item_timefunc.h:1437
Item_typecast_time(const POS &pos, Item *a)
Definition: item_timefunc.h:1429
bool is_explicit_cast() const
Definition: item_timefunc.h:1445
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.h:1448
Item_typecast_time(const POS &pos, Item *a, uint8 dec_arg)
Definition: item_timefunc.h:1432
bool get_time(MYSQL_TIME *ltime) override
Definition: item_timefunc.cc:2913
const char * cast_type() const
Definition: item_timefunc.h:1447
enum Functype functype() const override
Definition: item_timefunc.h:1444
bool detect_precision_from_arg
Definition: item_timefunc.h:1422
Item_typecast_time(Item *a)
Definition: item_timefunc.h:1426
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:2903
const char * func_name() const override
Definition: item_timefunc.h:1443
bool m_explicit_cast
Definition: item_timefunc.h:1423
Definition: item_timefunc.h:295
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_timefunc.cc:1504
Item_typecast_year(const POS &pos, Item *a)
Definition: item_timefunc.h:297
longlong val_int() override
Definition: item_timefunc.cc:1512
enum Functype functype() const override
Definition: item_timefunc.h:302
const char * func_name() const override
Definition: item_timefunc.h:301
Base class that is used to represent any kind of expression in a relational query.
Definition: item.h:850
void set_nullable(bool nullable)
Definition: item.h:3424
void set_data_type_date()
Set all type properties for Item of DATE type.
Definition: item.h:1538
DTCollation collation
Character set and collation properties assigned for this Item.
Definition: item.h:3341
longlong val_int_from_decimal()
Definition: item.cc:454
void set_data_type(enum_field_types data_type)
Set the data type of the current Item.
Definition: item.h:1391
longlong val_int_from_datetime()
Definition: item.cc:485
bool get_time_from_string(MYSQL_TIME *ltime)
Convert val_str() to time in MYSQL_TIME.
Definition: item.cc:1537
static const CHARSET_INFO * default_charset()
Definition: item.cc:1649
String * val_string_from_date(String *str)
Definition: item.cc:308
double val_real_from_decimal()
Definition: item.cc:436
String * val_string_from_datetime(String *str)
Definition: item.cc:298
bool get_date_from_time(MYSQL_TIME *ltime)
Convert get_time() from time to date in MYSQL_TIME.
Definition: item.cc:1487
bool get_time_from_datetime(MYSQL_TIME *ltime)
Convert datetime to time.
Definition: item.cc:1582
longlong val_int_from_date()
Definition: item.cc:477
void set_data_type_year()
Set the data type of the Item to be YEAR.
Definition: item.h:1603
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:6374
bool get_time_from_date(MYSQL_TIME *ltime)
Convert date to time.
Definition: item.cc:1574
enum_field_types data_type() const
Retrieve the derived data type of the Item.
Definition: item.h:1359
bool fixed
True if item has been resolved.
Definition: item.h:3412
longlong val_int_from_time()
Definition: item.cc:463
bool null_value
True if item is null.
Definition: item.h:3449
void set_data_type_datetime(uint8 fsp)
Set all properties for Item of DATETIME type.
Definition: item.h:1562
virtual uint datetime_precision()
DATETIME precision of the item: 0..6.
Definition: item.cc:688
bool get_date_from_numeric(MYSQL_TIME *ltime, my_time_flags_t fuzzydate)
Convert a numeric type to date.
Definition: item.cc:1497
my_decimal * val_decimal_from_date(my_decimal *decimal_value)
Definition: item.cc:361
@ MARKER_NONE
Definition: item.h:3361
bool get_date_from_string(MYSQL_TIME *ltime, my_time_flags_t flags)
Convert val_str() to date in MYSQL_TIME.
Definition: item.cc:1450
type_conversion_status save_time_in_field(Field *field)
Definition: item.cc:508
item_marker marker
This member has several successive meanings, depending on the phase we're in (.
Definition: item.h:3400
bool get_time_from_numeric(MYSQL_TIME *ltime)
Convert a numeric type to time.
Definition: item.cc:1589
uint8 decimals
Number of decimals in result when evaluating this item.
Definition: item.h:3421
void set_data_type_string(uint32 max_l)
Set the Item to be variable length string.
Definition: item.h:1449
bool get_date_from_int(MYSQL_TIME *ltime, my_time_flags_t flags)
Convert val_int() to date in MYSQL_TIME.
Definition: item.cc:1478
String * val_string_from_time(String *str)
Definition: item.cc:318
void set_data_type_longlong()
Set the data type of the Item to be longlong.
Definition: item.h:1406
void set_data_type_time(uint8 fsp)
Set all type properties for Item of TIME type.
Definition: item.h:1550
void set_data_type_decimal(uint8 precision, uint8 scale)
Set the data type of the Item to be decimal.
Definition: item.h:1419
my_decimal * val_decimal_from_time(my_decimal *decimal_value)
Definition: item.cc:370
type_conversion_status save_date_in_field(Field *field)
Definition: item.cc:515
bool get_time_from_int(MYSQL_TIME *ltime)
Convert val_int() to time in MYSQL_TIME.
Definition: item.cc:1565
Cache for MYSQL_TIME value with various representations.
Definition: item_timefunc.h:726
uint string_length
length of string
Definition: item_timefunc.h:730
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:1948
void set_time(MYSQL_TIME *ltime, uint8 dec_arg)
Set time and time_packed from a TIME value.
Definition: item_timefunc.cc:1892
MYSQL_TIME * get_TIME_ptr()
Return pointer to MYSQL_TIME representation.
Definition: item_timefunc.h:811
bool get_time(MYSQL_TIME *ltime) const
Store MYSQL_TIME representation into the given time variable.
Definition: item_timefunc.h:804
longlong val_packed() const
Return packed representation.
Definition: item_timefunc.h:792
MYSQL_TIME_cache()
Definition: item_timefunc.h:742
uint8 decimals() const
Return number of decimal digits.
Definition: item_timefunc.h:784
uint8 dec
Number of decimals.
Definition: item_timefunc.h:731
const char * cptr() const
Return C string representation.
Definition: item_timefunc.h:822
longlong time_packed
packed representation
Definition: item_timefunc.h:728
void set_date(MYSQL_TIME *ltime)
Set time and time_packed from a DATE value.
Definition: item_timefunc.cc:1900
MYSQL_TIME time
MYSQL_TIME representation.
Definition: item_timefunc.h:727
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:1908
bool eq(const MYSQL_TIME_cache &tm) const
Test if cached value is equal to another MYSQL_TIME_cache value.
Definition: item_timefunc.h:777
String * val_str(String *str)
Store string representation into String.
Definition: item_timefunc.cc:1955
char string_buff[MAX_DATE_STRING_REP_LENGTH]
string representation
Definition: item_timefunc.h:729
void get_TIME(MYSQL_TIME *ltime) const
Store MYSQL_TIME representation into the given MYSQL_TIME variable.
Definition: item_timefunc.h:736
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:138
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:33
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:93
ulonglong sql_mode_t
Definition: dd_event.h:36
enum_query_type
Query type constants (usable as bitmap flags).
Definition: enum_query_type.h:30
Fido Client Authentication nullptr
Definition: fido_client_plugin.cc:221
This file contains the field type.
@ MYSQL_TYPE_LONGLONG
Definition: field_types.h:61
@ MYSQL_TYPE_TIME
Definition: field_types.h:64
@ MYSQL_TYPE_STRING
Definition: field_types.h:85
@ MYSQL_TYPE_NEWDECIMAL
Definition: field_types.h:77
@ MYSQL_TYPE_DATE
Definition: field_types.h:63
@ MYSQL_TYPE_DATETIME
Definition: field_types.h:65
static const std::string dec("DECRYPTION")
enum monotonicity_info enum_monotonicity_info
const char * interval_names[]
Definition: item_timefunc.cc:2642
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:505
date_time_format
Definition: item_timefunc.h:1617
@ USA_FORMAT
Definition: item_timefunc.h:1618
@ JIS_FORMAT
Definition: item_timefunc.h:1619
@ INTERNAL_FORMAT
Definition: item_timefunc.h:1622
@ EUR_FORMAT
Definition: item_timefunc.h:1621
@ ISO_FORMAT
Definition: item_timefunc.h:1620
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:1717
A better implementation of the UNIX ctype(3) library.
MYSQL_PLUGIN_IMPORT CHARSET_INFO my_charset_bin
Definition: ctype-bin.cc:510
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:64
std::string str(const mysqlrouter::ConfigGenerator::Options::Endpoint &ep)
Definition: config_generator.cc:1054
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:2876
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:201
@ VGS_CHECK_CONSTRAINT
Definition: field.h:475
@ VGS_GENERATED_COLUMN
Definition: field.h:473
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:382
Struct used to pass around arguments to/from check_function_as_value_generator.
Definition: item.h:486
const char * banned_function_name
the name of the function which is not allowed
Definition: item.h:500
Value_generator_source source
Definition: item.h:498
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
Environment data for the contextualization phase.
Definition: parse_tree_node_base.h:120
Bison "location" class.
Definition: parse_location.h:42
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
unsigned int uint
Definition: uca9-dump.cc:74
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