summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authormonty@mashka.mysql.fi <>2002-09-18 21:04:49 +0300
committermonty@mashka.mysql.fi <>2002-09-18 21:04:49 +0300
commitf638ee6df91a32ed767fa67cf643dfa07f9a82d4 (patch)
tree83f34b98c4e43e4f23f9b941d93676b65ef1b657 /mysql-test
parentdfd0f82b9368cd4d023ebc1f6eab6e88622b060c (diff)
downloadmariadb-git-f638ee6df91a32ed767fa67cf643dfa07f9a82d4.tar.gz
Added code to flush a bulk_insert index.
This fixes a bug when doing multi-row inserts on table with an auto_increment key that is not in the first key segment.
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/insert.result8
-rw-r--r--mysql-test/t/insert.test9
2 files changed, 17 insertions, 0 deletions
diff --git a/mysql-test/r/insert.result b/mysql-test/r/insert.result
index b27cbb46210..2ffa9d88618 100644
--- a/mysql-test/r/insert.result
+++ b/mysql-test/r/insert.result
@@ -41,6 +41,14 @@ a t>0 c i
5 0 a NULL
6 1 hello NULL
drop table t1;
+create table t1 (sid char(20), id int(2) NOT NULL auto_increment, key(sid, id));
+insert into t1 values ('skr',NULL),('skr',NULL),('test',NULL);
+select * from t1;
+sid id
+skr 1
+skr 2
+test 1
+drop table t1;
drop database if exists foo;
create database foo;
use foo;
diff --git a/mysql-test/t/insert.test b/mysql-test/t/insert.test
index 2c912d94c70..0bca8dc5890 100644
--- a/mysql-test/t/insert.test
+++ b/mysql-test/t/insert.test
@@ -40,6 +40,15 @@ select a,t>0,c,i from t1;
drop table t1;
#
+# Test problem with bulk insert and auto_increment on second part keys
+#
+
+create table t1 (sid char(20), id int(2) NOT NULL auto_increment, key(sid, id));
+insert into t1 values ('skr',NULL),('skr',NULL),('test',NULL);
+select * from t1;
+drop table t1;
+
+#
# Test of mysqld crash with fully qualified column names
#