mariadb/mysql-test/suite/tokudb.cluster/r/create_table.result
Zardosht Kasheff f2af46ff01 [t:3072], fix up some tests
git-svn-id: file:///svn/mysql/tests/mysql-test@26077 c7de825b-a66e-492c-adef-691d508d4ae1
2010-12-01 17:45:59 +00:00

58 lines
1.8 KiB
Text

SET STORAGE_ENGINE='tokudb';
DROP TABLE IF EXISTS t1;
create table t1(a int, b int, c int, d int, primary key(a), clustering key(b))engine=tokudb;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL DEFAULT '0',
`b` int(11) DEFAULT NULL,
`c` int(11) DEFAULT NULL,
`d` int(11) DEFAULT NULL,
PRIMARY KEY (`a`),
CLUSTERING KEY `b` (`b`)
) ENGINE=TOKUDB DEFAULT CHARSET=latin1
create clustering index foo on t1(c,d);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL DEFAULT '0',
`b` int(11) DEFAULT NULL,
`c` int(11) DEFAULT NULL,
`d` int(11) DEFAULT NULL,
PRIMARY KEY (`a`),
CLUSTERING KEY `b` (`b`),
CLUSTERING KEY `foo` (`c`,`d`)
) ENGINE=TOKUDB DEFAULT CHARSET=latin1
alter table t1 drop primary key;
alter table t1 add primary key (a,b,c,d);
alter table t1 add clustering key bar(d,c,b,a);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL DEFAULT '0',
`b` int(11) NOT NULL DEFAULT '0',
`c` int(11) NOT NULL DEFAULT '0',
`d` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`a`,`b`,`c`,`d`),
CLUSTERING KEY `b` (`b`),
CLUSTERING KEY `foo` (`c`,`d`),
CLUSTERING KEY `bar` (`d`,`c`,`b`,`a`)
) ENGINE=TOKUDB DEFAULT CHARSET=latin1
insert into t1 value (1,1,1,1),(2,2,2,2),(3,3,3,3),(4,4,4,4),(32,54,12,56);
explain select * from t1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index NULL PRIMARY 16 NULL 5 Using index
select * from t1;
a b c d
1 1 1 1
2 2 2 2
3 3 3 3
4 4 4 4
32 54 12 56
explain select d from t1 where d > 30;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range bar bar 4 NULL 1 Using where; Using index
select * from t1 where d > 30;
a b c d
32 54 12 56
drop table t1;