mirror of
https://github.com/MariaDB/server.git
synced 2025-04-28 06:45:23 +03:00
row_sel_sec_rec_is_for_clust_rec(): If the field in the clustered index record stored off page, always fetch it, also when the secondary index field has been built on the entire column. This was broken ever since the InnoDB Plugin for MySQL Server 5.1 introduced ROW_FORMAT=DYNAMIC and ROW_FORMAT=COMPRESSED for InnoDB tables. That code was first introduced in this tree in commit 3945d5e5549187a18c64a112899f90a7f6a320d6. For the original ROW_FORMAT=REDUNDANT and the MySQL 5.0.3 ROW_FORMAT=COMPRESSED, there was no problem, because for those tables we always stored at least a 768-byte prefix of each column in the clustered index record. row_sel_sec_rec_is_for_blob(): Allow prefix_len==0 for matching the full column.
27 lines
661 B
Plaintext
27 lines
661 B
Plaintext
--source include/innodb_page_size_small.inc
|
|
|
|
--echo #
|
|
--echo # MDEV-25459 MVCC read from index on CHAR or VARCHAR wrongly omits rows
|
|
--echo #
|
|
|
|
CREATE TABLE t1 (
|
|
pk int PRIMARY KEY, c varchar(255) UNIQUE,
|
|
d char(255), e varchar(255), f char(255), g char(255)
|
|
) ENGINE=InnoDB ROW_FORMAT=DYNAMIC DEFAULT CHARACTER SET ucs2;
|
|
|
|
INSERT INTO t1 VALUES
|
|
(1,REPEAT('c',248),REPEAT('a',106),REPEAT('b',220),REPEAT('x',14),'');
|
|
|
|
BEGIN;
|
|
UPDATE t1 SET c=REPEAT('d',170);
|
|
|
|
connect (con1,localhost,root,,);
|
|
SELECT pk FROM t1 FORCE INDEX (c);
|
|
connection default;
|
|
COMMIT;
|
|
connection con1;
|
|
SELECT pk FROM t1 FORCE INDEX (c);
|
|
disconnect con1;
|
|
connection default;
|
|
DROP TABLE t1;
|