summaryrefslogtreecommitdiff
path: root/mysql-test/t/insert_update.test
diff options
context:
space:
mode:
authorholyfoot/hf@hfmain.(none) <>2007-06-14 16:41:10 +0500
committerholyfoot/hf@hfmain.(none) <>2007-06-14 16:41:10 +0500
commit8ccc50b303389879acc3055912577958d94547dc (patch)
tree6a54e529a87637aaecb9e9ea0eaa44a985ecf02c /mysql-test/t/insert_update.test
parentd870247de1f242c9f44c06e20a0fb2f5e308107d (diff)
parent20ad51500325027dcf629867c053ce0efeb5a81e (diff)
downloadmariadb-git-8ccc50b303389879acc3055912577958d94547dc.tar.gz
Merge bk@192.168.21.1:mysql-5.0
into mysql.com:/d2/hf/mrg/mysql-5.0-opt
Diffstat (limited to 'mysql-test/t/insert_update.test')
-rw-r--r--mysql-test/t/insert_update.test16
1 files changed, 16 insertions, 0 deletions
diff --git a/mysql-test/t/insert_update.test b/mysql-test/t/insert_update.test
index 725fbdb25d7..67108744ec6 100644
--- a/mysql-test/t/insert_update.test
+++ b/mysql-test/t/insert_update.test
@@ -290,3 +290,19 @@ INSERT IGNORE INTO t1 (id,c1) SELECT * FROM t2
SELECT * FROM t1;
DROP TABLE t1;
+
+#
+# Bug#28904: INSERT .. ON DUPLICATE was silently updating rows when it
+# shouldn't.
+#
+create table t1(f1 int primary key,
+ f2 timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP);
+insert into t1(f1) values(1);
+--replace_column 1 #
+select @stamp1:=f2 from t1;
+--sleep 2
+insert into t1(f1) values(1) on duplicate key update f1=1;
+--replace_column 1 #
+select @stamp2:=f2 from t1;
+select if( @stamp1 = @stamp2, "correct", "wrong");
+drop table t1;