summaryrefslogtreecommitdiff
path: root/mysql-test/suite/parts/r/partition_auto_increment_innodb.result
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/suite/parts/r/partition_auto_increment_innodb.result')
-rw-r--r--mysql-test/suite/parts/r/partition_auto_increment_innodb.result76
1 files changed, 74 insertions, 2 deletions
diff --git a/mysql-test/suite/parts/r/partition_auto_increment_innodb.result b/mysql-test/suite/parts/r/partition_auto_increment_innodb.result
index 4cd7aa57417..34e47f58272 100644
--- a/mysql-test/suite/parts/r/partition_auto_increment_innodb.result
+++ b/mysql-test/suite/parts/r/partition_auto_increment_innodb.result
@@ -134,8 +134,44 @@ Table Create Table
t1 CREATE TABLE `t1` (
`c1` int(11) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`c1`)
-) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1
+) ENGINE=InnoDB AUTO_INCREMENT=102 DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1
+(a INT NULL AUTO_INCREMENT,
+UNIQUE KEY (a))
+ENGINE='InnoDB';
+SET LAST_INSERT_ID = 999;
+SET INSERT_ID = 0;
+INSERT INTO t1 SET a = 1 ON DUPLICATE KEY UPDATE a = NULL;
+SELECT LAST_INSERT_ID();
+LAST_INSERT_ID()
+999
+SELECT * FROM t1;
+a
+1
+INSERT INTO t1 SET a = 1 ON DUPLICATE KEY UPDATE a = NULL;
+SELECT LAST_INSERT_ID();
+LAST_INSERT_ID()
+999
+SELECT * FROM t1;
+a
+0
+UPDATE t1 SET a = 1 WHERE a IS NULL;
+SELECT LAST_INSERT_ID();
+LAST_INSERT_ID()
+999
+SELECT * FROM t1;
+a
+0
+UPDATE t1 SET a = NULL WHERE a = 1;
+SELECT LAST_INSERT_ID();
+LAST_INSERT_ID()
+999
+SELECT * FROM t1;
+a
+0
DROP TABLE t1;
+SET INSERT_ID = 1;
# Simple test with NULL
CREATE TABLE t1 (
c1 INT NOT NULL AUTO_INCREMENT,
@@ -404,7 +440,7 @@ Table Create Table
t1 CREATE TABLE `t1` (
`c1` int(11) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`c1`)
-) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1
+) ENGINE=InnoDB AUTO_INCREMENT=102 DEFAULT CHARSET=latin1
/*!50100 PARTITION BY HASH (c1)
PARTITIONS 2 */
DROP TABLE t1;
@@ -1023,4 +1059,40 @@ c1 c2
2 20
127 40
DROP TABLE t;
+CREATE TABLE t1
+(a INT NULL AUTO_INCREMENT,
+UNIQUE KEY (a))
+ENGINE='InnoDB'
+PARTITION BY KEY(a) PARTITIONS 2;
+SET LAST_INSERT_ID = 999;
+SET INSERT_ID = 0;
+INSERT INTO t1 SET a = 1 ON DUPLICATE KEY UPDATE a = NULL;
+SELECT LAST_INSERT_ID();
+LAST_INSERT_ID()
+999
+SELECT * FROM t1;
+a
+1
+INSERT INTO t1 SET a = 1 ON DUPLICATE KEY UPDATE a = NULL;
+SELECT LAST_INSERT_ID();
+LAST_INSERT_ID()
+999
+SELECT * FROM t1;
+a
+0
+UPDATE t1 SET a = 1 WHERE a IS NULL;
+SELECT LAST_INSERT_ID();
+LAST_INSERT_ID()
+999
+SELECT * FROM t1;
+a
+0
+UPDATE t1 SET a = NULL WHERE a = 1;
+SELECT LAST_INSERT_ID();
+LAST_INSERT_ID()
+999
+SELECT * FROM t1;
+a
+0
+DROP TABLE t1;
##############################################################################