mariadb/mysql-test/suite/tokudb.bugs/t/index_read.test
Christian Rober 11dbc697aa [t:4324] First batch of fixed tests. Only includes update rows column.
git-svn-id: file:///svn/mysql/tests/mysql-test@38875 c7de825b-a66e-492c-adef-691d508d4ae1
2012-01-16 17:44:31 +00:00

138 lines
No EOL
3.4 KiB
Text
Executable file

# ticket 895 is a query optimization problem with the primary key
#--source include/have_tokudb.inc
SET STORAGE_ENGINE = 'tokudb';
--disable_warnings
DROP TABLE IF EXISTS foo;
--enable_warnings
create table foo (a int, b int, c int, primary key (a,b));
insert into foo values (1,10,100),(2,20,200),(3,30,300),(4,40,400),(5,50,500),(6,60,600);
insert into foo values (1,100,100),(2,200,200),(3,300,300),(4,400,400),(5,500,500),(6,600,600);
select * from foo;
#HA_READ_KEY_EXACT
# ignore rows column
--replace_column 9 NULL;
explain select * from foo where a=4;
select * from foo where a=4;
#HA_READ_AFTER_KEY
# ignore rows column
--replace_column 9 NULL;
explain select * from foo where a>4;
select * from foo where a>4;
#HA_READ_BEFORE_KEY
# ignore rows column
--replace_column 9 NULL;
explain select * from foo where a<3 order by a desc;
select * from foo where a<3 order by a desc;
#HA_READ_KEY_OR_NEXT
# ignore rows column
--replace_column 9 NULL;
explain select * from foo where a>=4;
select * from foo where a>=4;
#HA_READ_KEY_OR_PREV not used anymore
#HA_READ_PREFIX_LAST_OR_PREV
# ignore rows column
--replace_column 9 NULL;
explain select * from foo where a<=2 order by a desc;
select * from foo where a<=2 order by a desc;
#HA_READ_PREFIX_LAST
# ignore rows column
--replace_column 9 NULL;
explain select * from foo where a=4 order by b desc;
select * from foo where a=4 order by b desc;
alter table foo drop primary key;
alter table foo add clustering index clst_a(a,b);
#HA_READ_KEY_EXACT
# ignore rows column
--replace_column 9 NULL;
explain select * from foo where a=4;
select * from foo where a=4;
#HA_READ_AFTER_KEY
# ignore rows column
--replace_column 9 NULL;
explain select * from foo where a>4;
select * from foo where a>4;
#HA_READ_BEFORE_KEY
# ignore rows column
--replace_column 9 NULL;
explain select * from foo where a<3 order by a desc;
select * from foo where a<3 order by a desc;
#HA_READ_KEY_OR_NEXT
# ignore rows column
--replace_column 9 NULL;
explain select * from foo where a>=4;
select * from foo where a>=4;
#HA_READ_KEY_OR_PREV not used anymore
#HA_READ_PREFIX_LAST_OR_PREV
# ignore rows column
--replace_column 9 NULL;
explain select * from foo where a<=2 order by a desc;
select * from foo where a<=2 order by a desc;
#HA_READ_PREFIX_LAST
# ignore rows column
--replace_column 9 NULL;
explain select * from foo where a=4 order by b desc;
select * from foo where a=4 order by b desc;
alter table foo drop index clst_a;
alter table foo add index (a,b);
#HA_READ_KEY_EXACT
# ignore rows column
--replace_column 9 NULL;
explain select * from foo where a=4;
select * from foo where a=4;
#HA_READ_AFTER_KEY
# ignore rows column
--replace_column 9 NULL;
explain select * from foo where a>4;
select * from foo where a>4;
#HA_READ_BEFORE_KEY
# ignore rows column
--replace_column 9 NULL;
explain select * from foo where a<3 order by a desc;
select * from foo where a<3 order by a desc;
#HA_READ_KEY_OR_NEXT
# ignore rows column
--replace_column 9 NULL;
explain select * from foo where a>=4;
select * from foo where a>=4;
#HA_READ_KEY_OR_PREV not used anymore
#HA_READ_PREFIX_LAST_OR_PREV
# ignore rows column
--replace_column 9 NULL;
explain select * from foo where a<=2 order by a desc;
select * from foo where a<=2 order by a desc;
#HA_READ_PREFIX_LAST
# ignore rows column
--replace_column 9 NULL;
explain select * from foo where a=4 order by b desc;
select * from foo where a=4 order by b desc;
# Final cleanup.
DROP TABLE foo;