summaryrefslogtreecommitdiff
path: root/mysql-test/t/innodb-autoinc.test
diff options
context:
space:
mode:
authorTimothy Smith <timothy.smith@sun.com>2009-03-11 18:18:44 -0600
committerTimothy Smith <timothy.smith@sun.com>2009-03-11 18:18:44 -0600
commit8cbd34f0d7a08f112ca4fb900bda31aeaf0703f1 (patch)
tree47a6ed3afb32b34d280a67e848d3134927abd6c6 /mysql-test/t/innodb-autoinc.test
parent08ee9470a97888380059f8f8b7e6dab1a0eb2da8 (diff)
downloadmariadb-git-8cbd34f0d7a08f112ca4fb900bda31aeaf0703f1.tar.gz
Applying InnoDB snashot 5.1-ss4350, part 5. Fixes
Bug #43203 Overflow from auto incrementing causes server segv Detailed revision comments: r4325 | sunny | 2009-03-02 02:28:52 +0200 (Mon, 02 Mar 2009) | 10 lines branches/5.1: Bug#43203: Overflow from auto incrementing causes server segv It was not a SIGSEGV but an assertion failure. The assertion was checking the invariant that *first_value passed in by MySQL doesn't contain a value that is greater than the max value for that type. The assertion has been changed to a check and if the value is greater than the max we report a generic AUTOINC failure. rb://93 Approved by Heikki
Diffstat (limited to 'mysql-test/t/innodb-autoinc.test')
-rw-r--r--mysql-test/t/innodb-autoinc.test21
1 files changed, 20 insertions, 1 deletions
diff --git a/mysql-test/t/innodb-autoinc.test b/mysql-test/t/innodb-autoinc.test
index 6be2e5ac67e..d76b29a7dc8 100644
--- a/mysql-test/t/innodb-autoinc.test
+++ b/mysql-test/t/innodb-autoinc.test
@@ -418,7 +418,7 @@ INSERT INTO t1 VALUES(NULL, 4);
SELECT * FROM t1;
DROP TABLE t1;
-#
+#
# Bug# 42714: AUTOINC column calculated next value not greater than highest
# value stored in table.
#
@@ -459,3 +459,22 @@ SELECT * FROM t1;
SHOW CREATE TABLE t1;
DROP TABLE t1;
DROP TABLE t2;
+#
+# 43203: Overflow from auto incrementing causes server segv
+#
+
+DROP TABLE IF EXISTS t1;
+DROP TABLE IF EXISTS t2;
+CREATE TABLE t1(
+ c1 INT(10) UNSIGNED NOT NULL AUTO_INCREMENT
+ PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
+CREATE TABLE t2(
+ c1 TINYINT(3) UNSIGNED NOT NULL AUTO_INCREMENT
+ PRIMARY KEY) ENGINE=InnoDB;
+-- error ER_DUP_ENTRY,1062
+INSERT INTO t2 SELECT c1 FROM t1;
+-- error ER_DUP_ENTRY,1467
+INSERT INTO t2 SELECT NULL FROM t1;
+DROP TABLE t1;
+DROP TABLE t2;