summaryrefslogtreecommitdiff
path: root/mysql-test/t/default.test
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.org>2016-11-25 07:40:10 +0400
committerAlexander Barkov <bar@mariadb.org>2016-12-16 18:23:20 +0400
commitcb16d753b2db936afff844cca0dd434fa7fe736b (patch)
tree710867c377f49c3089f2cfff467a3e48050fe6cc /mysql-test/t/default.test
parent4b4efb04854388f525d6515e5f95ecb92d992b34 (diff)
downloadmariadb-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 'mysql-test/t/default.test')
-rw-r--r--mysql-test/t/default.test2
1 files changed, 0 insertions, 2 deletions
diff --git a/mysql-test/t/default.test b/mysql-test/t/default.test
index d9d7f429848..a81f4867add 100644
--- a/mysql-test/t/default.test
+++ b/mysql-test/t/default.test
@@ -756,11 +756,9 @@ DROP TABLE t1;
CREATE TABLE t1 (a DECIMAL(30,6) DEFAULT COALESCE(CURRENT_TIMESTAMP(6)));
SHOW CREATE TABLE t1;
-# Same as insert into t1 values ("2016-06-05 12:54:52.342095");
INSERT INTO t1 VALUES();
INSERT IGNORE INTO t1 VALUES();
SET sql_mode = 'STRICT_ALL_TABLES';
---error WARN_DATA_TRUNCATED
INSERT INTO t1 VALUES();
SET sql_mode = DEFAULT;
DROP TABLE t1;