diff options
author | Alexander Barkov <bar@mariadb.org> | 2016-11-25 07:40:10 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.org> | 2016-12-16 18:23:20 +0400 |
commit | cb16d753b2db936afff844cca0dd434fa7fe736b (patch) | |
tree | 710867c377f49c3089f2cfff467a3e48050fe6cc /sql/item_timefunc.h | |
parent | 4b4efb04854388f525d6515e5f95ecb92d992b34 (diff) | |
download | mariadb-git-cb16d753b2db936afff844cca0dd434fa7fe736b.tar.gz |
MDEV-11337 Split Item::save_in_field() into virtual methods in Type_handler
Also fixes:
MDEV-11331 Wrong result for INSERT INTO t1 (datetime_field) VALUES (hybrid_function_of_TIME_data_type)
MDEV-11333 Expect "Impossible where condition" for WHERE timestamp_field>=DATE_ADD(TIMESTAMP'9999-01-01 00:00:00',INTERVAL 1000 YEAR)
This patch does the following:
1. Splits the function Item::save_in_field() into pieces:
- Item::save_str_in_field()
- Item::save_real_in_field()
- Item::save_decimal_in_field()
- Item::save_int_in_field()
2. Adds the missing "no_conversion" parameters to
Item::save_time_in_field() and Item::save_date_in_field(),
so this parameter is now correctly passed to
set_field_to_null_with_conversions().
This fixes the problem reported in 11333.
3. Introduces a new virtual method Type_handler::Item_save_in_field()
and uses the methods Item::save_xxx_in_field() from the implementations
of Type_handler_xxx::Item_save_in_field().
These changes additionally fix the problem reported in MDEV-11331,
as the old code erroneously handled expressions like
COALESE(datetime-expression) through the STRING_RESULT branch of
Item::save_in_field() and therefore they looked like string type expressions
for the target fields. Now such expressions are correctly handled by
Item::save_date_in_field().
Diffstat (limited to 'sql/item_timefunc.h')
-rw-r--r-- | sql/item_timefunc.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/item_timefunc.h b/sql/item_timefunc.h index dafcdf64b45..ad92f50661b 100644 --- a/sql/item_timefunc.h +++ b/sql/item_timefunc.h @@ -548,7 +548,7 @@ public: Field *create_field_for_create_select(TABLE *table) { return tmp_table_field_from_field_type(table, false, false); } int save_in_field(Field *field, bool no_conversions) - { return save_date_in_field(field); } + { return save_date_in_field(field, no_conversions); } void fix_length_and_dec(); }; |