# Bug #23481444 OPTIMISER CALL ROW_SEARCH_MVCC() AND READ # THE INDEX APPLIED BY UNCOMMITTED ROWS. CREATE TABLE t1(f1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, f2 INT NOT NULL, f3 INT NOT NULL, KEY(f2, f3))ENGINE=INNODB; CREATE PROCEDURE populate_t1(IN BASE INT, IN SIZE INT) BEGIN DECLARE i INT DEFAULT BASE; WHILE (i <= SIZE) DO INSERT INTO t1(f2, f3) values (i, i); SET i = i + 1; END WHILE; END| CALL populate_t1(1, 10000); INSERT INTO t1(f2, f3) VALUES(10000, 10000); BEGIN; CALL populate_t1(10001, 20000); SELECT SQL_NO_CACHE f2, f3 FROM t1 WHERE f2=10000 and f3 between 9999 and 10000; f2 f3 10000 10000 10000 10000 DROP TABLE t1; CREATE TABLE t1(f2 INT NOT NULL, f3 INT NOT NULL, PRIMARY KEY(f2, f3))ENGINE=INNODB; CALL populate_t1(1, 10000); BEGIN; CALL populate_t1(10001, 20000); SELECT SQL_NO_CACHE f2, f3 FROM t1 WHERE f2=10000 and f3 between 9999 and 10000; f2 f3 10000 10000 DROP TABLE t1; CREATE TABLE t1(f1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, f2 INT NOT NULL, f3 INT NOT NULL, KEY(f2), KEY(f3))ENGINE=INNODB; CALL populate_t1(1, 10000); BEGIN; CALL populate_t1(10001, 20000); SELECT count(*) FROM t1 FORCE INDEX(f2, f3) WHERE f2 < 10000 or f3 < 10000; count(*) 9999 DROP TABLE t1; CREATE TABLE t1(f1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, f2 INT NOT NULL, f3 INT NOT NULL, KEY(f2, f3))ENGINE=INNODB; CALL populate_t1(1, 10000); CALL populate_t1(100000, 100200); BEGIN; CALL populate_t1(10001, 20000); SELECT SQL_NO_CACHE COUNT(*) FROM t1 WHERE f2 BETWEEN 9999 AND 10000 OR f2 >= 100000; COUNT(*) 203 DROP TABLE t1; DROP PROCEDURE populate_t1;