mirror of
https://github.com/MariaDB/server.git
synced 2026-04-19 06:45:32 +02:00
MDEV-10182 Bad value when inserting COALESCE(CURRENT_TIMESTAMP) into a DECIMAL column
This problem was earlier fixed by the patch cb16d753b2
for MDEV-11337 Split Item::save_in_field() into virtual methods in Type_handler.
Adding tests only.
This commit is contained in:
parent
4787913db0
commit
f61909e19e
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 #
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue