summaryrefslogtreecommitdiff
path: root/sql/item.h
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.com>2020-08-22 08:56:58 +0400
committerAlexander Barkov <bar@mariadb.com>2020-08-22 08:56:58 +0400
commit6708e67acc7ff1ee05845fb223abdb3bc8702d80 (patch)
treee0d7c94337e41276c43a84675ccdc046c9215562 /sql/item.h
parentee61c8c0b762840ab5badaa9d6b3a24b1c2ee8c7 (diff)
parentae33ebe5b32a82629a40e51c8d6c6611842fbd03 (diff)
downloadmariadb-git-6708e67acc7ff1ee05845fb223abdb3bc8702d80.tar.gz
Merge remote-tracking branch 'origin/10.4' into 10.5
Diffstat (limited to 'sql/item.h')
-rw-r--r--sql/item.h16
1 files changed, 12 insertions, 4 deletions
diff --git a/sql/item.h b/sql/item.h
index c4fbf8f9c0a..e66d815d484 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -1333,16 +1333,13 @@ public:
{
/*
The default implementation for the Items that do not need native format:
- - Item_basic_value
+ - Item_basic_value (default implementation)
- Item_copy
- Item_exists_subselect
- Item_sum_field
- Item_sum_or_func (default implementation)
- Item_proc
- Item_type_holder (as val_xxx() are never called for it);
- - TODO: Item_name_const will need val_native() in the future,
- when we add this syntax:
- TIMESTAMP WITH LOCAL TIMEZONE'2001-01-01 00:00:00'
These hybrid Item types override val_native():
- Item_field
@@ -1353,6 +1350,8 @@ public:
- Item_direct_ref
- Item_direct_view_ref
- Item_ref_null_helper
+ - Item_name_const
+ - Item_time_literal
- Item_sum_or_func
Note, these hybrid type Item_sum_or_func descendants
override the default implementation:
@@ -3173,6 +3172,7 @@ public:
String *val_str(String *sp);
my_decimal *val_decimal(my_decimal *);
bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate);
+ bool val_native(THD *thd, Native *to);
bool is_null();
virtual void print(String *str, enum_query_type query_type);
@@ -4897,6 +4897,10 @@ public:
String *val_str(String *to) { return Time(this).to_string(to, decimals); }
my_decimal *val_decimal(my_decimal *to) { return Time(this).to_decimal(to); }
bool get_date(THD *thd, MYSQL_TIME *res, date_mode_t fuzzydate);
+ bool val_native(THD *thd, Native *to)
+ {
+ return Time(thd, this).to_native(to, decimals);
+ }
Item *get_copy(THD *thd)
{ return get_item_copy<Item_time_literal>(thd, this); }
};
@@ -6874,6 +6878,10 @@ public:
{
return has_value() ? Time(this).to_decimal(to) : NULL;
}
+ bool val_native(THD *thd, Native *to)
+ {
+ return has_value() ? Time(thd, this).to_native(to, decimals) : true;
+ }
};