diff options
Diffstat (limited to 'mysql-test/t/insert_select.test')
-rw-r--r-- | mysql-test/t/insert_select.test | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/mysql-test/t/insert_select.test b/mysql-test/t/insert_select.test index 1994d23afd7..6cb4c6d3af4 100644 --- a/mysql-test/t/insert_select.test +++ b/mysql-test/t/insert_select.test @@ -265,4 +265,30 @@ INSERT INTO bug21774_2.t1 SELECT t1.* FROM t1; DROP DATABASE bug21774_1; DROP DATABASE bug21774_2; +USE test; +# +# Bug#19978: INSERT .. ON DUPLICATE erroneously reports some records were +# updated. +# +create table t1(f1 int primary key, f2 int); +--enable_info +insert into t1 values (1,1); +insert into t1 values (1,1) on duplicate key update f2=1; +insert into t1 values (1,1) on duplicate key update f2=2; +--disable_info +select * from t1; +drop table t1; + +# +# Bug#23170: LAST_INSERT_ID isn't reset to 0 in INSERT .. SELECT if no rows +# were inserted. +# +create table t1(f1 int primary key auto_increment, f2 int unique); +insert into t1(f2) values(1); +select @@identity; +insert ignore t1(f2) values(1); +select @@identity; +insert ignore t1(f2) select 1; +select @@identity; +drop table t1; |