mirror of
https://github.com/MariaDB/server.git
synced 2025-01-19 13:32:33 +01:00
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.
This commit is contained in:
parent
e0ab42c8a7
commit
2de9fc6eac
2 changed files with 21 additions and 0 deletions
|
@ -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. #
|
||||
|
|
Loading…
Reference in a new issue