Commit 2de9fc6e authored by marko's avatar marko

innodb.test, innodb.result: Add test case for Bug #26835.

The bug could be reproduced as follows:

Define a table so that the first column of the clustered index is
a VARCHAR or a UTF-8 CHAR in a collation where sequences of bytes
of differing length are considered equivalent.

Insert and delete a record.  Before the delete-marked record is
purged, insert another record whose first column is of different
length but equivalent to the first record.  Under certain conditions,
the insertion can be incorrectly performed as update-in-place.

Likewise, an operation that could be done as update-in-place can
unnecessarily be performed as delete and insert, but that would not
cause corruption but merely degraded performance.
parent e0ab42c8
......@@ -3480,3 +3480,12 @@ ALTER TABLE t2 MODIFY a INT NOT NULL;
ERROR HY000: Error on rename of '#sql-temporary' to './test/t2' (errno: 150)
DELETE FROM t1;
DROP TABLE t2,t1;
CREATE TABLE t1 (a VARCHAR(5) COLLATE utf8_unicode_ci PRIMARY KEY)
ENGINE=InnoDB;
INSERT INTO t1 VALUES (0xEFBCA4EFBCA4EFBCA4);
DELETE FROM t1;
INSERT INTO t1 VALUES ('DDD');
SELECT * FROM t1;
a
DDD
DROP TABLE t1;
......@@ -2530,6 +2530,18 @@ ALTER TABLE t2 MODIFY a INT NOT NULL;
DELETE FROM t1;
DROP TABLE t2,t1;
#
# Bug #26835: table corruption after delete+insert
#
CREATE TABLE t1 (a VARCHAR(5) COLLATE utf8_unicode_ci PRIMARY KEY)
ENGINE=InnoDB;
INSERT INTO t1 VALUES (0xEFBCA4EFBCA4EFBCA4);
DELETE FROM t1;
INSERT INTO t1 VALUES ('DDD');
SELECT * FROM t1;
DROP TABLE t1;
#######################################################################
# #
# Please, DO NOT TOUCH this file as well as the innodb.result file. #
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment