diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2023-05-11 14:05:52 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2023-05-11 14:05:52 +0300 |
commit | cd5ca0b11882cfa8eafa8c687ed3084423bc7e52 (patch) | |
tree | 92045e255e18d9acbe7cd8385c64c9f1830db257 /mysql-test/main/insert_update.test | |
parent | 78a1264cfae37667a2812c5bb5cc6638d9eed5ff (diff) | |
parent | c271057288f71746d1816824f338f2d9c47f67c1 (diff) | |
download | mariadb-git-bb-10.6-MDEV-29911.tar.gz |
Merge 10.6bb-10.6-MDEV-29911
Diffstat (limited to 'mysql-test/main/insert_update.test')
-rw-r--r-- | mysql-test/main/insert_update.test | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/mysql-test/main/insert_update.test b/mysql-test/main/insert_update.test index 06e16be84d7..25953938ad1 100644 --- a/mysql-test/main/insert_update.test +++ b/mysql-test/main/insert_update.test @@ -311,3 +311,29 @@ insert into t1(f1) values(1) on duplicate key update f1=1; select @stamp2:=f2 from t1; select if( @stamp1 = @stamp2, "correct", "wrong"); drop table t1; + +--echo # +--echo # MDEV-31164 default current_timestamp() not working when used INSERT ON DUPLICATE KEY in some cases +--echo # +set timestamp=unix_timestamp('2000-10-20 0:0:0'); +create table t1 (pk integer primary key, val varchar(20) not null, ts timestamp); +insert t1 (pk, val) values(1, 'val1'); +select * from t1; +set timestamp=unix_timestamp('2000-10-20 1:0:0'); +insert t1 (pk, val) select 2, 'val3' union select 3, 'val4' + on duplicate key update ts=now(); +select * from t1; +set timestamp=unix_timestamp('2000-10-20 2:0:0'); +insert t1 (pk, val) select 1, 'val1' union select 4, 'val2' + on duplicate key update ts=now(); +select * from t1; +set timestamp=unix_timestamp('2000-10-20 3:0:0'); +insert t1 (pk, val) select 5, 'val1' union select 1, 'val2' + on duplicate key update ts=now(); +select * from t1; +drop table t1; +set timestamp=default; + +--echo # +--echo # End of 10.4 tests +--echo # |