Commit f61909e1 authored by Alexander Barkov's avatar Alexander Barkov

MDEV-10182 Bad value when inserting COALESCE(CURRENT_TIMESTAMP) into a DECIMAL column

This problem was earlier fixed by the patch cb16d753
for MDEV-11337 Split Item::save_in_field() into virtual methods in Type_handler.

Adding tests only.
parent 4787913d
...@@ -206,3 +206,22 @@ time(f1) ...@@ -206,3 +206,22 @@ time(f1)
21:00:00.000000 21:00:00.000000
21:00:01.000000 21:00:01.000000
drop table t1; drop table t1;
#
# Start of 10.3 tests
#
#
# MDEV-10182 Bad value when inserting COALESCE(CURRENT_TIMESTAMP) into a DECIMAL column
#
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;
a
20010101102030
20010101102030
DROP TABLE t1;
SET timestamp=DEFAULT;
#
# End of 10.3 tests
#
...@@ -106,3 +106,24 @@ alter table t1 modify f1 varchar(100); ...@@ -106,3 +106,24 @@ alter table t1 modify f1 varchar(100);
select time(f1) from t1; select time(f1) from t1;
select time(f1) from t1 union all select time(f1 + interval 1 second) from t1; select time(f1) from t1 union all select time(f1 + interval 1 second) from t1;
drop table 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 #
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment