From f61909e19e58525583316f8edb55335f094af7dd Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Fri, 15 Jun 2018 06:33:34 +0400 Subject: MDEV-10182 Bad value when inserting COALESCE(CURRENT_TIMESTAMP) into a DECIMAL column This problem was earlier fixed by the patch cb16d753b2db936afff844cca0dd434fa7fe736b for MDEV-11337 Split Item::save_in_field() into virtual methods in Type_handler. Adding tests only. --- mysql-test/main/func_time_hires.test | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'mysql-test/main/func_time_hires.test') diff --git a/mysql-test/main/func_time_hires.test b/mysql-test/main/func_time_hires.test index 4dcd51a85ba..35fd36b8456 100644 --- a/mysql-test/main/func_time_hires.test +++ b/mysql-test/main/func_time_hires.test @@ -106,3 +106,24 @@ alter table t1 modify f1 varchar(100); select time(f1) from t1; select time(f1) from t1 union all select time(f1 + interval 1 second) from t1; drop table t1; + + +--echo # +--echo # Start of 10.3 tests +--echo # + +--echo # +--echo # MDEV-10182 Bad value when inserting COALESCE(CURRENT_TIMESTAMP) into a DECIMAL column +--echo # + +SET timestamp=UNIX_TIMESTAMP('2001-01-01 10:20:30.000000'); +CREATE TABLE t1 (a DECIMAL(30,0)); +INSERT INTO t1 VALUES (CURRENT_TIMESTAMP(6)); +INSERT INTO t1 VALUES (COALESCE(CURRENT_TIMESTAMP(6))); +SELECT * FROM t1; +DROP TABLE t1; +SET timestamp=DEFAULT; + +--echo # +--echo # End of 10.3 tests +--echo # -- cgit v1.2.1