mariadb/mysql-test/suite/innodb/r/mvcc_secondary.result
Marko Mäkelä 25ed665a20 MDEV-25459 MVCC read from index on CHAR or VARCHAR wrongly omits rows
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 3945d5e554.

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.
2021-04-24 09:26:49 +03:00

24 lines
596 B
Text

#
# MDEV-25459 MVCC read from index on CHAR or VARCHAR wrongly omits rows
#
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);
pk
1
connection default;
COMMIT;
connection con1;
SELECT pk FROM t1 FORCE INDEX (c);
pk
1
disconnect con1;
connection default;
DROP TABLE t1;