diff options
Diffstat (limited to 'mysql-test/main/type_date.result')
-rw-r--r-- | mysql-test/main/type_date.result | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/mysql-test/main/type_date.result b/mysql-test/main/type_date.result index 897f42a2ec4..2c268cfdd88 100644 --- a/mysql-test/main/type_date.result +++ b/mysql-test/main/type_date.result @@ -621,7 +621,7 @@ SELECT * FROM t1 WHERE LENGTH(a)=11+RAND() AND a=' garbage '; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Warning 1292 Incorrect datetime value: ' garbage ' +Warning 1292 Truncated incorrect datetime value: ' garbage ' Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = DATE'0000-00-00' and <cache>(octet_length(DATE'0000-00-00')) = 11 + rand() DROP TABLE t1; CREATE TABLE t1 (a DATE); @@ -962,5 +962,41 @@ Warnings: Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where coalesce(<cache>(DATE'2001-01-02'),`test`.`t1`.`a`) <=> coalesce(DATE'2001-01-01',`test`.`t1`.`a`) DROP TABLE t1; # +# MDEV-15406 NO_ZERO_IN_DATE erroneously affects how CAST(AS DATE) warns about fractional digit truncation +# +SET sql_mode=''; +CREATE TABLE t1 (a DATE); +SELECT CAST(20061108.01 AS DATE); +CAST(20061108.01 AS DATE) +2006-11-08 +Warnings: +Note 1292 Truncated incorrect date value: '20061108.01' +INSERT INTO t1 VALUES (20061108.01); +Warnings: +Note 1265 Data truncated for column 'a' at row 1 +DROP TABLE t1; +SET sql_mode=NO_ZERO_IN_DATE; +SELECT CAST(20061108.01 AS DATE); +CAST(20061108.01 AS DATE) +2006-11-08 +Warnings: +Note 1292 Truncated incorrect date value: '20061108.01' +CREATE TABLE t1 (a DATE); +INSERT INTO t1 VALUES (20061108.01); +Warnings: +Note 1265 Data truncated for column 'a' at row 1 +DROP TABLE t1; +SET sql_mode=DEFAULT; +# +# MDEV-17216 Assertion `!dt->fraction_remainder(decimals())' failed in Field_temporal_with_date::store_TIME_with_warning +# +SET sql_mode=''; +CREATE TABLE t1 (i1 date ); +CREATE TABLE t2 (i2 int unsigned ); +INSERT INTO t2 VALUES (0); +INSERT INTO t1 SELECT * FROM t2; +DROP TABLE t1,t2; +SET sql_mode=DEFAULT; +# # End of 10.4 tests # |