summaryrefslogtreecommitdiff
path: root/mysql-test/r/insert_select.result
diff options
context:
space:
mode:
authorunknown <evgen@moonbone.local>2007-02-09 22:25:09 +0300
committerunknown <evgen@moonbone.local>2007-02-09 22:25:09 +0300
commitdd6feec4f40e89ae7d830b0a15d009ea2e66759e (patch)
tree5de1750759adba44229208a231218412005757ec /mysql-test/r/insert_select.result
parentd4b4952f8b8e470fc68aea2cf2f91c1dc9b6452f (diff)
downloadmariadb-git-dd6feec4f40e89ae7d830b0a15d009ea2e66759e.tar.gz
Bug#23170: LAST_INSERT_ID isn't reset to 0 in INSERT .. SELECT when no rows were
inserted. The select_insert::send_eof() function now resets LAST_INSERT_ID variable if no rows were inserted. mysql-test/t/insert_select.test: Added a test case for bug#23170: LAST_INSERT_ID isn't reset to 0 in INSERT .. SELECT when no rows were inserted. mysql-test/r/insert_select.result: Added a test case for bug#23170: LAST_INSERT_ID isn't reset to 0 in INSERT .. SELECT when no rows were inserted. sql/sql_insert.cc: Bug#23170: LAST_INSERT_ID isn't reset to 0 in INSERT .. SELECT when no rows were inserted.The select_insert::send_eof() function now resets LAST_INSERT_ID variable if no rows were inserted.
Diffstat (limited to 'mysql-test/r/insert_select.result')
-rw-r--r--mysql-test/r/insert_select.result14
1 files changed, 14 insertions, 0 deletions
diff --git a/mysql-test/r/insert_select.result b/mysql-test/r/insert_select.result
index 82cc1b036a7..2e0acf303c2 100644
--- a/mysql-test/r/insert_select.result
+++ b/mysql-test/r/insert_select.result
@@ -717,3 +717,17 @@ select * from t1;
f1 f2
1 2
drop table t1;
+create table t1(f1 int primary key auto_increment, f2 int unique);
+insert into t1(f2) values(1);
+select @@identity;
+@@identity
+1
+insert ignore t1(f2) values(1);
+select @@identity;
+@@identity
+0
+insert ignore t1(f2) select 1;
+select @@identity;
+@@identity
+0
+drop table t1;