Skip to content
Permalink
Browse files
MDEV-10182 Bad value when inserting COALESCE(CURRENT_TIMESTAMP) into …
…a DECIMAL column

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

Adding tests only.
  • Loading branch information
abarkov committed Jun 15, 2018
1 parent 4787913 commit f61909e
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
@@ -206,3 +206,22 @@ time(f1)
21:00:00.000000
21:00:01.000000
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);
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 #

0 comments on commit f61909e

Please sign in to comment.