Current Path : /home/usr.opt/mysql57/mysql-test/suite/innodb/t/ |
FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64 |
Current File : //home/usr.opt/mysql57/mysql-test/suite/innodb/t/end_range_check.test |
--source include/have_innodb.inc --source include/not_embedded.inc --source include/big_test.inc --echo # Bug #23481444 OPTIMISER CALL ROW_SEARCH_MVCC() AND READ --echo # 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; DELIMITER |; 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| DELIMITER ;| CALL populate_t1(1, 10000); INSERT INTO t1(f2, f3) VALUES(10000, 10000); BEGIN; CALL populate_t1(10001, 20000); connect (con1,localhost,root,,); connection con1; SELECT SQL_NO_CACHE f2, f3 FROM t1 WHERE f2=10000 and f3 between 9999 and 10000; connection default; 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); connection con1; SELECT SQL_NO_CACHE f2, f3 FROM t1 WHERE f2=10000 and f3 between 9999 and 10000; connection default; 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); connection con1; SELECT count(*) FROM t1 FORCE INDEX(f2, f3) WHERE f2 < 10000 or f3 < 10000; connection default; 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); connection con1; SELECT SQL_NO_CACHE COUNT(*) FROM t1 WHERE f2 BETWEEN 9999 AND 10000 OR f2 >= 100000; connection default; COMMIT; DROP TABLE t1; CREATE TABLE t1(f1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, f2 INT NOT NULL, f3 INT NOT NULL, f4 INT AS (f2) VIRTUAL, key(f3, f4)) PARTITION BY KEY() PARTITIONS 2; CALL populate_t1(1, 10000); BEGIN; CALL populate_t1(10001, 20000); connection con1; SELECT /*+ NO_ICP(t1) */ * FROM t1 WHERE f3 = 10000 AND f4 BETWEEN 9999 AND 10000; connection default; COMMIT; drop table t1; CREATE TABLE t1(f1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, f2 INT NOT NULL, f3 INT NOT NULL, f4 INT AS (f2) VIRTUAL, f5 INT AS (f2) VIRTUAL, key(f4, f5)) PARTITION BY KEY() PARTITIONS 2; CALL populate_t1(1, 10000); BEGIN; CALL populate_t1(10001, 20000); connection con1; SELECT /*+ NO_ICP(t1) */ * FROM t1 WHERE f4 = 10000 AND f5 BETWEEN 9999 AND 10000; connection default; COMMIT; DROP TABLE t1; DROP PROCEDURE populate_t1; CREATE TABLE t2(f1 int not null, f2 char(100), f3 INT, KEY(f2(20), f3))ENGINE=INNODB; DELIMITER |; CREATE PROCEDURE populate_t2(IN BASE INT, IN SIZE INT) BEGIN DECLARE i INT DEFAULT BASE; WHILE (i <= SIZE) DO INSERT INTO t2(f1, f2, f3) values (i, repeat('a', 100), i); SET i = i + 1; END WHILE; END| DELIMITER ;| CALL populate_t2(1, 10000); BEGIN; CALL populate_t2(10001, 20000); connection con1; SELECT /*+ NO_ICP(t2) */ f1 FROM t2 WHERE f2 = repeat('a', 100) and f3 BETWEEN 10000 and 10001; disconnect con1; connection default; DROP PROCEDURE populate_t2; DROP TABLE t2;