Commit 9de56caa authored by Christian Rober's avatar Christian Rober

[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
parent 45d17453
...@@ -9,7 +9,7 @@ insert into foo values (4,"four"); ...@@ -9,7 +9,7 @@ insert into foo values (4,"four");
alter table foo add clustering key a(a); alter table foo add clustering key a(a);
explain select * From foo where a > 0; explain select * From foo where a > 0;
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE foo range a a 5 NULL 5 Using where 1 SIMPLE foo range a a 5 NULL NULL; Using where
select * From foo where a > 0; select * From foo where a > 0;
a b a b
1 one 1 one
......
...@@ -20,23 +20,23 @@ count(*) ...@@ -20,23 +20,23 @@ count(*)
alter table foo add index (a), add index (b); alter table foo add index (a), add index (b);
explain select * from foo where a=2 and b=2; explain select * from foo where a=2 and b=2;
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE foo index_merge a,b a,b 5,5 NULL 1024 Using intersect(a,b); Using where 1 SIMPLE foo index_merge a,b a,b 5,5 NULL NULL; Using intersect(a,b); Using where
alter table foo drop index a; alter table foo drop index a;
alter table foo add clustering index (a); alter table foo add clustering index (a);
explain select * from foo where a=2 and b=2; explain select * from foo where a=2 and b=2;
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE foo ref b,a a 5 const 6144 Using where 1 SIMPLE foo ref b,a a 5 const NULL; Using where
alter table foo drop index a; alter table foo drop index a;
alter table foo drop index b; alter table foo drop index b;
alter table foo add index (a); alter table foo add index (a);
alter table foo add clustering index(b); alter table foo add clustering index(b);
explain select * from foo where a=2 and b=2; explain select * from foo where a=2 and b=2;
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE foo ref a,b b 5 const 6144 Using where 1 SIMPLE foo ref a,b b 5 const NULL; Using where
alter table foo drop index a; alter table foo drop index a;
alter table foo drop index b; alter table foo drop index b;
alter table foo add clustering index (a), add clustering index (b); alter table foo add clustering index (a), add clustering index (b);
explain select * from foo where a=2 and b=2; explain select * from foo where a=2 and b=2;
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE foo ref a,b a 5 const 6144 Using where 1 SIMPLE foo ref a,b a 5 const NULL; Using where
DROP TABLE foo; DROP TABLE foo;
...@@ -4,9 +4,9 @@ CREATE TABLE t (r INT, s INT, t BIGINT, PRIMARY KEY (r, s)); ...@@ -4,9 +4,9 @@ CREATE TABLE t (r INT, s INT, t BIGINT, PRIMARY KEY (r, s));
INSERT INTO t VALUES (1,2,3),(4,5,6); INSERT INTO t VALUES (1,2,3),(4,5,6);
EXPLAIN SELECT * FROM t WHERE r > 0; EXPLAIN SELECT * FROM t WHERE r > 0;
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t range PRIMARY PRIMARY 4 NULL 2 Using where 1 SIMPLE t range PRIMARY PRIMARY 4 NULL NULL; Using where
CREATE INDEX it on t(t); CREATE INDEX it on t(t);
EXPLAIN SELECT * FROM t WHERE r > 0; EXPLAIN SELECT * FROM t WHERE r > 0;
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t index PRIMARY it 9 NULL 2 Using where; Using index 1 SIMPLE t index PRIMARY it 9 NULL NULL; Using where; Using index
DROP TABLE t; DROP TABLE t;
...@@ -19,14 +19,14 @@ a b c ...@@ -19,14 +19,14 @@ a b c
6 600 600 6 600 600
explain select * from foo where a=4; explain select * from foo where a=4;
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE foo ref PRIMARY PRIMARY 4 const 2 1 SIMPLE foo ref PRIMARY PRIMARY 4 const NULL;
select * from foo where a=4; select * from foo where a=4;
a b c a b c
4 40 400 4 40 400
4 400 400 4 400 400
explain select * from foo where a>4; explain select * from foo where a>4;
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE foo range PRIMARY PRIMARY 4 NULL 4 Using where 1 SIMPLE foo range PRIMARY PRIMARY 4 NULL NULL; Using where
select * from foo where a>4; select * from foo where a>4;
a b c a b c
5 50 500 5 50 500
...@@ -35,7 +35,7 @@ a b c ...@@ -35,7 +35,7 @@ a b c
6 600 600 6 600 600
explain select * from foo where a<3 order by a desc; explain select * from foo where a<3 order by a desc;
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE foo range PRIMARY PRIMARY 4 NULL 4 Using where 1 SIMPLE foo range PRIMARY PRIMARY 4 NULL NULL; Using where
select * from foo where a<3 order by a desc; select * from foo where a<3 order by a desc;
a b c a b c
2 200 200 2 200 200
...@@ -44,7 +44,7 @@ a b c ...@@ -44,7 +44,7 @@ a b c
1 10 100 1 10 100
explain select * from foo where a>=4; explain select * from foo where a>=4;
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE foo range PRIMARY PRIMARY 4 NULL 6 Using where 1 SIMPLE foo range PRIMARY PRIMARY 4 NULL NULL; Using where
select * from foo where a>=4; select * from foo where a>=4;
a b c a b c
4 40 400 4 40 400
...@@ -55,7 +55,7 @@ a b c ...@@ -55,7 +55,7 @@ a b c
6 600 600 6 600 600
explain select * from foo where a<=2 order by a desc; explain select * from foo where a<=2 order by a desc;
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE foo range PRIMARY PRIMARY 4 NULL 4 Using where 1 SIMPLE foo range PRIMARY PRIMARY 4 NULL NULL; Using where
select * from foo where a<=2 order by a desc; select * from foo where a<=2 order by a desc;
a b c a b c
2 200 200 2 200 200
...@@ -64,7 +64,7 @@ a b c ...@@ -64,7 +64,7 @@ a b c
1 10 100 1 10 100
explain select * from foo where a=4 order by b desc; explain select * from foo where a=4 order by b desc;
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE foo ref PRIMARY PRIMARY 4 const 2 Using where 1 SIMPLE foo ref PRIMARY PRIMARY 4 const NULL; Using where
select * from foo where a=4 order by b desc; select * from foo where a=4 order by b desc;
a b c a b c
4 400 400 4 400 400
...@@ -73,14 +73,14 @@ alter table foo drop primary key; ...@@ -73,14 +73,14 @@ alter table foo drop primary key;
alter table foo add clustering index clst_a(a,b); alter table foo add clustering index clst_a(a,b);
explain select * from foo where a=4; explain select * from foo where a=4;
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE foo ref clst_a clst_a 4 const 2 1 SIMPLE foo ref clst_a clst_a 4 const NULL;
select * from foo where a=4; select * from foo where a=4;
a b c a b c
4 40 400 4 40 400
4 400 400 4 400 400
explain select * from foo where a>4; explain select * from foo where a>4;
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE foo range clst_a clst_a 4 NULL 4 Using where 1 SIMPLE foo range clst_a clst_a 4 NULL NULL; Using where
select * from foo where a>4; select * from foo where a>4;
a b c a b c
5 50 500 5 50 500
...@@ -89,7 +89,7 @@ a b c ...@@ -89,7 +89,7 @@ a b c
6 600 600 6 600 600
explain select * from foo where a<3 order by a desc; explain select * from foo where a<3 order by a desc;
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE foo range clst_a clst_a 4 NULL 4 Using where 1 SIMPLE foo range clst_a clst_a 4 NULL NULL; Using where
select * from foo where a<3 order by a desc; select * from foo where a<3 order by a desc;
a b c a b c
2 200 200 2 200 200
...@@ -98,7 +98,7 @@ a b c ...@@ -98,7 +98,7 @@ a b c
1 10 100 1 10 100
explain select * from foo where a>=4; explain select * from foo where a>=4;
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE foo range clst_a clst_a 4 NULL 6 Using where 1 SIMPLE foo range clst_a clst_a 4 NULL NULL; Using where
select * from foo where a>=4; select * from foo where a>=4;
a b c a b c
4 40 400 4 40 400
...@@ -109,7 +109,7 @@ a b c ...@@ -109,7 +109,7 @@ a b c
6 600 600 6 600 600
explain select * from foo where a<=2 order by a desc; explain select * from foo where a<=2 order by a desc;
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE foo range clst_a clst_a 4 NULL 4 Using where 1 SIMPLE foo range clst_a clst_a 4 NULL NULL; Using where
select * from foo where a<=2 order by a desc; select * from foo where a<=2 order by a desc;
a b c a b c
2 200 200 2 200 200
...@@ -118,7 +118,7 @@ a b c ...@@ -118,7 +118,7 @@ a b c
1 10 100 1 10 100
explain select * from foo where a=4 order by b desc; explain select * from foo where a=4 order by b desc;
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE foo ref clst_a clst_a 4 const 2 Using where 1 SIMPLE foo ref clst_a clst_a 4 const NULL; Using where
select * from foo where a=4 order by b desc; select * from foo where a=4 order by b desc;
a b c a b c
4 400 400 4 400 400
...@@ -127,14 +127,14 @@ alter table foo drop index clst_a; ...@@ -127,14 +127,14 @@ alter table foo drop index clst_a;
alter table foo add index (a,b); alter table foo add index (a,b);
explain select * from foo where a=4; explain select * from foo where a=4;
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE foo ref a a 4 const 2 1 SIMPLE foo ref a a 4 const NULL;
select * from foo where a=4; select * from foo where a=4;
a b c a b c
4 40 400 4 40 400
4 400 400 4 400 400
explain select * from foo where a>4; explain select * from foo where a>4;
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE foo range a a 4 NULL 4 Using where 1 SIMPLE foo range a a 4 NULL NULL; Using where
select * from foo where a>4; select * from foo where a>4;
a b c a b c
5 50 500 5 50 500
...@@ -143,7 +143,7 @@ a b c ...@@ -143,7 +143,7 @@ a b c
6 600 600 6 600 600
explain select * from foo where a<3 order by a desc; explain select * from foo where a<3 order by a desc;
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE foo range a a 4 NULL 4 Using where 1 SIMPLE foo range a a 4 NULL NULL; Using where
select * from foo where a<3 order by a desc; select * from foo where a<3 order by a desc;
a b c a b c
2 200 200 2 200 200
...@@ -152,7 +152,7 @@ a b c ...@@ -152,7 +152,7 @@ a b c
1 10 100 1 10 100
explain select * from foo where a>=4; explain select * from foo where a>=4;
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE foo range a a 4 NULL 6 Using where 1 SIMPLE foo range a a 4 NULL NULL; Using where
select * from foo where a>=4; select * from foo where a>=4;
a b c a b c
4 40 400 4 40 400
...@@ -163,7 +163,7 @@ a b c ...@@ -163,7 +163,7 @@ a b c
6 600 600 6 600 600
explain select * from foo where a<=2 order by a desc; explain select * from foo where a<=2 order by a desc;
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE foo range a a 4 NULL 4 Using where 1 SIMPLE foo range a a 4 NULL NULL; Using where
select * from foo where a<=2 order by a desc; select * from foo where a<=2 order by a desc;
a b c a b c
2 200 200 2 200 200
...@@ -172,7 +172,7 @@ a b c ...@@ -172,7 +172,7 @@ a b c
1 10 100 1 10 100
explain select * from foo where a=4 order by b desc; explain select * from foo where a=4 order by b desc;
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE foo ref a a 4 const 2 Using where 1 SIMPLE foo ref a a 4 const NULL; Using where
select * from foo where a=4 order by b desc; select * from foo where a=4 order by b desc;
a b c a b c
4 400 400 4 400 400
......
...@@ -18,6 +18,8 @@ insert into foo values (4,"four"); ...@@ -18,6 +18,8 @@ insert into foo values (4,"four");
alter table foo add clustering key a(a); alter table foo add clustering key a(a);
#ignore rows column
--replace_column 9 NULL;
explain select * From foo where a > 0; explain select * From foo where a > 0;
select * From foo where a > 0; select * From foo where a > 0;
......
...@@ -24,21 +24,29 @@ insert into foo select * from foo; ...@@ -24,21 +24,29 @@ insert into foo select * from foo;
select count(*) from foo; select count(*) from foo;
alter table foo add index (a), add index (b); alter table foo add index (a), add index (b);
# ignore rows column
--replace_column 9 NULL;
explain select * from foo where a=2 and b=2; explain select * from foo where a=2 and b=2;
alter table foo drop index a; alter table foo drop index a;
alter table foo add clustering index (a); alter table foo add clustering index (a);
# ignore rows column
--replace_column 9 NULL;
explain select * from foo where a=2 and b=2; explain select * from foo where a=2 and b=2;
alter table foo drop index a; alter table foo drop index a;
alter table foo drop index b; alter table foo drop index b;
alter table foo add index (a); alter table foo add index (a);
alter table foo add clustering index(b); alter table foo add clustering index(b);
# ignore rows column
--replace_column 9 NULL;
explain select * from foo where a=2 and b=2; explain select * from foo where a=2 and b=2;
alter table foo drop index a; alter table foo drop index a;
alter table foo drop index b; alter table foo drop index b;
alter table foo add clustering index (a), add clustering index (b); alter table foo add clustering index (a), add clustering index (b);
# ignore rows column
--replace_column 9 NULL;
explain select * from foo where a=2 and b=2; explain select * from foo where a=2 and b=2;
# Final cleanup. # Final cleanup.
......
...@@ -9,8 +9,12 @@ DROP TABLE IF EXISTS t; ...@@ -9,8 +9,12 @@ DROP TABLE IF EXISTS t;
CREATE TABLE t (r INT, s INT, t BIGINT, PRIMARY KEY (r, s)); CREATE TABLE t (r INT, s INT, t BIGINT, PRIMARY KEY (r, s));
INSERT INTO t VALUES (1,2,3),(4,5,6); INSERT INTO t VALUES (1,2,3),(4,5,6);
# ignore rows column
--replace_column 9 NULL;
EXPLAIN SELECT * FROM t WHERE r > 0; EXPLAIN SELECT * FROM t WHERE r > 0;
CREATE INDEX it on t(t); CREATE INDEX it on t(t);
# ignore rows column
--replace_column 9 NULL;
EXPLAIN SELECT * FROM t WHERE r > 0; EXPLAIN SELECT * FROM t WHERE r > 0;
# Final cleanup. # Final cleanup.
......
...@@ -14,28 +14,40 @@ insert into foo values (1,100,100),(2,200,200),(3,300,300),(4,400,400),(5,500,50 ...@@ -14,28 +14,40 @@ insert into foo values (1,100,100),(2,200,200),(3,300,300),(4,400,400),(5,500,50
select * from foo; select * from foo;
#HA_READ_KEY_EXACT #HA_READ_KEY_EXACT
# ignore rows column
--replace_column 9 NULL;
explain select * from foo where a=4; explain select * from foo where a=4;
select * from foo where a=4; select * from foo where a=4;
#HA_READ_AFTER_KEY #HA_READ_AFTER_KEY
# ignore rows column
--replace_column 9 NULL;
explain select * from foo where a>4; explain select * from foo where a>4;
select * from foo where a>4; select * from foo where a>4;
#HA_READ_BEFORE_KEY #HA_READ_BEFORE_KEY
# ignore rows column
--replace_column 9 NULL;
explain select * from foo where a<3 order by a desc; explain select * from foo where a<3 order by a desc;
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 #HA_READ_KEY_OR_NEXT
# ignore rows column
--replace_column 9 NULL;
explain select * from foo where a>=4; explain select * from foo where a>=4;
select * from foo where a>=4; select * from foo where a>=4;
#HA_READ_KEY_OR_PREV not used anymore #HA_READ_KEY_OR_PREV not used anymore
#HA_READ_PREFIX_LAST_OR_PREV #HA_READ_PREFIX_LAST_OR_PREV
# ignore rows column
--replace_column 9 NULL;
explain select * from foo where a<=2 order by a desc; explain select * from foo where a<=2 order by a desc;
select * from foo where a<=2 order by a desc; select * from foo where a<=2 order by a desc;
#HA_READ_PREFIX_LAST #HA_READ_PREFIX_LAST
# ignore rows column
--replace_column 9 NULL;
explain select * from foo where a=4 order by b desc; explain select * from foo where a=4 order by b desc;
select * from foo where a=4 order by b desc; select * from foo where a=4 order by b desc;
...@@ -44,28 +56,40 @@ alter table foo drop primary key; ...@@ -44,28 +56,40 @@ alter table foo drop primary key;
alter table foo add clustering index clst_a(a,b); alter table foo add clustering index clst_a(a,b);
#HA_READ_KEY_EXACT #HA_READ_KEY_EXACT
# ignore rows column
--replace_column 9 NULL;
explain select * from foo where a=4; explain select * from foo where a=4;
select * from foo where a=4; select * from foo where a=4;
#HA_READ_AFTER_KEY #HA_READ_AFTER_KEY
# ignore rows column
--replace_column 9 NULL;
explain select * from foo where a>4; explain select * from foo where a>4;
select * from foo where a>4; select * from foo where a>4;
#HA_READ_BEFORE_KEY #HA_READ_BEFORE_KEY
# ignore rows column
--replace_column 9 NULL;
explain select * from foo where a<3 order by a desc; explain select * from foo where a<3 order by a desc;
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 #HA_READ_KEY_OR_NEXT
# ignore rows column
--replace_column 9 NULL;
explain select * from foo where a>=4; explain select * from foo where a>=4;
select * from foo where a>=4; select * from foo where a>=4;
#HA_READ_KEY_OR_PREV not used anymore #HA_READ_KEY_OR_PREV not used anymore
#HA_READ_PREFIX_LAST_OR_PREV #HA_READ_PREFIX_LAST_OR_PREV
# ignore rows column
--replace_column 9 NULL;
explain select * from foo where a<=2 order by a desc; explain select * from foo where a<=2 order by a desc;
select * from foo where a<=2 order by a desc; select * from foo where a<=2 order by a desc;
#HA_READ_PREFIX_LAST #HA_READ_PREFIX_LAST
# ignore rows column
--replace_column 9 NULL;
explain select * from foo where a=4 order by b desc; explain select * from foo where a=4 order by b desc;
select * from foo where a=4 order by b desc; select * from foo where a=4 order by b desc;
...@@ -73,28 +97,40 @@ alter table foo drop index clst_a; ...@@ -73,28 +97,40 @@ alter table foo drop index clst_a;
alter table foo add index (a,b); alter table foo add index (a,b);
#HA_READ_KEY_EXACT #HA_READ_KEY_EXACT
# ignore rows column
--replace_column 9 NULL;
explain select * from foo where a=4; explain select * from foo where a=4;
select * from foo where a=4; select * from foo where a=4;
#HA_READ_AFTER_KEY #HA_READ_AFTER_KEY
# ignore rows column
--replace_column 9 NULL;
explain select * from foo where a>4; explain select * from foo where a>4;
select * from foo where a>4; select * from foo where a>4;
#HA_READ_BEFORE_KEY #HA_READ_BEFORE_KEY
# ignore rows column
--replace_column 9 NULL;
explain select * from foo where a<3 order by a desc; explain select * from foo where a<3 order by a desc;
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 #HA_READ_KEY_OR_NEXT
# ignore rows column
--replace_column 9 NULL;
explain select * from foo where a>=4; explain select * from foo where a>=4;
select * from foo where a>=4; select * from foo where a>=4;
#HA_READ_KEY_OR_PREV not used anymore #HA_READ_KEY_OR_PREV not used anymore
#HA_READ_PREFIX_LAST_OR_PREV #HA_READ_PREFIX_LAST_OR_PREV
# ignore rows column
--replace_column 9 NULL;
explain select * from foo where a<=2 order by a desc; explain select * from foo where a<=2 order by a desc;
select * from foo where a<=2 order by a desc; select * from foo where a<=2 order by a desc;
#HA_READ_PREFIX_LAST #HA_READ_PREFIX_LAST
# ignore rows column
--replace_column 9 NULL;
explain select * from foo where a=4 order by b desc; explain select * from foo where a=4 order by b desc;
select * from foo where a=4 order by b desc; select * from foo where a=4 order by b desc;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment