4338 Aditya A 2012-08-27 [merge]
Bug#14145950 AUTO_INCREMENT ON DOUBLE WILL FAIL ON WINDOWS
Backport from mysql-5.6 the fix
(revision-id sunny.bains@stripped)
Bug#13839886 - CRASH IN INNOBASE_NEXT_AUTOINC
The assertion introduce in the fix for Bug#13817703
is too strong, a negative number can be greater
than the column max value, when the column value is
a negative number.
rb://978 Approved by Jimmy Yang.
rb:1236 approved by Marko Makela
modified:
mysql-test/suite/innodb/r/innodb-autoinc.result
mysql-test/suite/innodb/t/innodb-autoinc.test
storage/innobase/handler/ha_innodb.cc
4337 Andrei Elkin 2012-08-27 [merge]
merging from 5.6.
modified:
sql/rpl_rli.cc
sql/rpl_slave.cc
=== modified file 'mysql-test/suite/innodb/r/innodb-autoinc.result'
--- a/mysql-test/suite/innodb/r/innodb-autoinc.result revid:andrei.elkin@stripped
+++ b/mysql-test/suite/innodb/r/innodb-autoinc.result revid:aditya.a@stripped
@@ -1346,3 +1346,14 @@ c1 c2
1 NULL
2147483647 NULL
DROP TABLE t1;
+CREATE TABLE t1 (c1 DOUBLE NOT NULL PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB
+AUTO_INCREMENT=10000000000000000000;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` double NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=InnoDB AUTO_INCREMENT=10000000000000000000 DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES ();
+ERROR HY000: Failed to read auto-increment value from storage engine
+DROP TABLE t1;
=== modified file 'mysql-test/suite/innodb/t/innodb-autoinc.test'
--- a/mysql-test/suite/innodb/t/innodb-autoinc.test revid:andrei.elkin@stripped
+++ b/mysql-test/suite/innodb/t/innodb-autoinc.test revid:aditya.a@stripped
@@ -677,3 +677,11 @@ SHOW CREATE TABLE t1;
REPLACE INTO t1 (c2 ) VALUES (0);
SELECT * FROM t1;
DROP TABLE t1;
+
+#DOUBLE
+CREATE TABLE t1 (c1 DOUBLE NOT NULL PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB
+AUTO_INCREMENT=10000000000000000000;
+SHOW CREATE TABLE t1;
+--error 1467
+INSERT INTO t1 VALUES ();
+DROP TABLE t1;
=== modified file 'storage/innobase/handler/ha_innodb.cc'
--- a/storage/innobase/handler/ha_innodb.cc revid:andrei.elkin@stripped
+++ b/storage/innobase/handler/ha_innodb.cc revid:aditya.a@stripped
@@ -1944,7 +1944,10 @@ innobase_next_autoinc(
}
/* Check for overflow. Current can be > max_value if the value is
- in reality a negative value. */
+ in reality a negative value.The visual studio compilers converts
+ large double values automatically into unsigned long long datatype
+ maximum value */
+
if (block >= max_value
|| offset > max_value
|| current >= max_value
No bundle (reason: useless for push emails).
| Thread |
|---|
| • bzr push into mysql-trunk branch (aditya.a:4337 to 4338) Bug#14145950 | Aditya A | 27 Aug |