summaryrefslogtreecommitdiff
path: root/mysql-test/r/auto_increment.result
diff options
context:
space:
mode:
authorunknown <serg@sergbook.mysql.com>2003-03-31 23:14:26 +0400
committerunknown <serg@sergbook.mysql.com>2003-03-31 23:14:26 +0400
commit76bd91752616f251cd7177971e30ec2e8939d356 (patch)
tree11a64e2559175719b5ebced7d91d2316bcc2060a /mysql-test/r/auto_increment.result
parent7e13ac1242b8e9f229b76687622bc1f5de301b92 (diff)
downloadmariadb-git-76bd91752616f251cd7177971e30ec2e8939d356.tar.gz
don't increment LAST_INSERT_ID() when incremented value cannot be stored in auto_increment column (e.g. is too big)
mysql-test/r/auto_increment.result: more tests mysql-test/t/auto_increment.test: more tests
Diffstat (limited to 'mysql-test/r/auto_increment.result')
-rw-r--r--mysql-test/r/auto_increment.result38
1 files changed, 38 insertions, 0 deletions
diff --git a/mysql-test/r/auto_increment.result b/mysql-test/r/auto_increment.result
index e79e6aab56b..2facb504294 100644
--- a/mysql-test/r/auto_increment.result
+++ b/mysql-test/r/auto_increment.result
@@ -105,3 +105,41 @@ Table Op Msg_type Msg_text
test.t1 check warning Found row where the auto_increment column has the value 0
test.t1 check status OK
drop table t1;
+create table t1 (i tinyint unsigned not null auto_increment primary key);
+insert into t1 set i = 254;
+insert into t1 set i = null;
+select last_insert_id();
+last_insert_id()
+255
+insert into t1 set i = null;
+Duplicate entry '255' for key 1
+select last_insert_id();
+last_insert_id()
+255
+drop table t1;
+create table t1 (i tinyint unsigned not null auto_increment, key (i));
+insert into t1 set i = 254;
+insert into t1 set i = null;
+select last_insert_id();
+last_insert_id()
+255
+insert into t1 set i = null;
+select last_insert_id();
+last_insert_id()
+255
+drop table t1;
+create table t1 (i tinyint unsigned not null auto_increment primary key, b int, unique (b));
+insert into t1 values (NULL, 10);
+select last_insert_id();
+last_insert_id()
+1
+insert into t1 values (NULL, 15);
+select last_insert_id();
+last_insert_id()
+2
+insert into t1 values (NULL, 10);
+Duplicate entry '10' for key 2
+select last_insert_id();
+last_insert_id()
+3
+drop table t1;