Commit 9fe1e83d authored by Igor Babaev's avatar Igor Babaev

MDEV-16188 Post merge fixes: more for TokuDB

parent 651347b6
......@@ -48,8 +48,8 @@ a
alter table t1 add unique uniq_id using BTREE (a);
select * from t1 where a > 736494;
a
869751
802616
869751
select * from t1 where a = 736494;
a
736494
......
......@@ -37,6 +37,7 @@ create table t1 (a int not null) engine=heap;
insert into t1 values (869751),(736494),(226312),(802616),(728912);
select * from t1 where a > 736494;
alter table t1 add unique uniq_id using BTREE (a);
--sorted_result
select * from t1 where a > 736494;
select * from t1 where a = 736494;
select * from t1 where a=869751 or a=736494;
......
......@@ -426,13 +426,14 @@ select 0+a from t1 where a=869751 or a=736494;
explain select 0+a from t1 where a=869751 or a=736494;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range uniq_id uniq_id 8 NULL 2 Using where
select 0+a from t1 where a in (869751,736494,226312,802616);
select 0+a from t1 where a in (869751,736494,226312,802616,728912);
0+a
869751
736494
226312
802616
explain select 0+a from t1 where a in (869751,736494,226312,802616);
728912
explain select 0+a from t1 where a in (869751,736494,226312,802616,728912);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL uniq_id NULL NULL NULL 5 Using where
drop table t1;
......
......@@ -313,8 +313,8 @@ select 0+a from t1 where a = 736494;
explain select 0+a from t1 where a = 736494;
select 0+a from t1 where a=869751 or a=736494;
explain select 0+a from t1 where a=869751 or a=736494;
select 0+a from t1 where a in (869751,736494,226312,802616);
explain select 0+a from t1 where a in (869751,736494,226312,802616);
select 0+a from t1 where a in (869751,736494,226312,802616,728912);
explain select 0+a from t1 where a in (869751,736494,226312,802616,728912);
drop table t1;
--echo End of 5.3 tests
......
......@@ -12,8 +12,6 @@ DELETE IGNORE FROM t1;;
connection con1;
DELETE FROM t1 WHERE col_int_key IN (1, 40000000);
connection default;
Warnings:
Warning 1205 Lock wait timeout exceeded; try restarting transaction
disconnect con1;
drop table t1;
SET GLOBAL innodb_lock_wait_timeout=default;
......
......@@ -507,6 +507,15 @@
VARIABLE_COMMENT Maximum stored procedure recursion depth
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 255
@@ -2485,7 +2485,7 @@
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT The maximum size of the container of a rowid filter
NUMERIC_MIN_VALUE 1024
-NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_MAX_VALUE 4294967295
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
@@ -2494,7 +2494,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 32
......
......@@ -1357,7 +1357,8 @@ int Explain_table_access::print_explain(select_result_sink *output, uint8 explai
if (rowid_filter)
{
r_rows_str.append(" (");
r_rows_str.append_ulonglong(rowid_filter->tracker->get_r_selectivity_pct() * 100.0);
r_rows_str.append_ulonglong(
(ulonglong) (rowid_filter->tracker->get_r_selectivity_pct() * 100.0));
r_rows_str.append("%)");
}
item_list.push_back(new (mem_root)
......
......@@ -124,9 +124,9 @@ Tables_in_test
explain select * from seq_1_to_15_step_2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE seq_1_to_15_step_2 index NULL PRIMARY 8 NULL 8 Using index
explain select * from seq_1_to_15_step_2 where seq > 4;
explain select * from seq_1_to_15_step_2 where seq > 10;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE seq_1_to_15_step_2 range PRIMARY PRIMARY 8 NULL 6 Using where; Using index
1 SIMPLE seq_1_to_15_step_2 range PRIMARY PRIMARY 8 NULL 3 Using where; Using index
explain select * from seq_1_to_15_step_2 where seq between 4 and 9;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE seq_1_to_15_step_2 range PRIMARY PRIMARY 8 NULL 3 Using where; Using index
......
......@@ -52,7 +52,7 @@ show open tables from test;
show tables;
# row estimates
explain select * from seq_1_to_15_step_2;
explain select * from seq_1_to_15_step_2 where seq > 4;
explain select * from seq_1_to_15_step_2 where seq > 10;
explain select * from seq_1_to_15_step_2 where seq between 4 and 9;
explain select * from seq_1_to_15_step_2 where seq between 20 and 30;
explain select * from seq_1_to_15_step_2 where seq between 4 and 6;
......
......@@ -20,7 +20,7 @@ z a b c
999 4 40 400
explain select * from foo where b > 20;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE foo range b b 5 NULL 2 Using where; Using index
1 SIMPLE foo index b b 5 NULL 4 Using where; Using index
select* from foo where b > 10;
z a b c
999 2 20 200
......@@ -40,7 +40,7 @@ a b c
4 40 400
explain select * from foo where b > 20;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE foo range b b 5 NULL 2 Using where; Using index
1 SIMPLE foo index b b 5 NULL 4 Using where; Using index
select* from foo where b > 10;
a b c
2 20 200
......@@ -59,7 +59,7 @@ a b c z
4 40 400 NULL
explain select * from foo where b > 20;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE foo range b b 5 NULL 2 Using where; Using index
1 SIMPLE foo index b b 5 NULL 4 Using where; Using index
select* from foo where b > 10;
a b c z
2 20 200 NULL
......@@ -94,7 +94,7 @@ a b c
3 30 300
4 40 400
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE foo range b b 5 NULL 2 Using where; Using index
1 SIMPLE foo index b b 5 NULL 4 Using where; Using index
a b c
2 20 200
3 30 300
......@@ -110,7 +110,7 @@ a b c
4 40 400
explain select * from foo where b > 20;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE foo range b b 5 NULL 2 Using where; Using index
1 SIMPLE foo index b b 5 NULL 4 Using where; Using index
select* from foo where b > 10;
a b c
2 20 200
......@@ -154,7 +154,7 @@ a b c g
4 40 400 NULL
5 50 500 NULL
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE foo range b b 5 NULL 3 Using where; Using index
1 SIMPLE foo index b b 5 NULL 5 Using where; Using index
set autocommit=on;
explain select * from foo;
id select_type table type possible_keys key key_len ref rows Extra
......
......@@ -6,5 +6,5 @@ create table t2970 (a int, b int, c int, d int, key(a), key(a,b));
insert into t2970 values (1,1,1,1),(1,2,3,4);
explain select a,count(b),max(b) from t2970 where a > 0 group by a order by a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2970 index a,a_2 a_2 10 NULL 2 Using where; Using index
1 SIMPLE t2970 range a,a_2 a_2 5 NULL 2 Using where; Using index
drop table t2970;
......@@ -10003,25 +10003,25 @@ insert into t values (9998,0);
insert into t values (9999,0);
explain select id from t where id>0 limit 10;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t range PRIMARY PRIMARY 8 NULL # Using where; Using index
1 SIMPLE t index PRIMARY PRIMARY 8 NULL # Using where; Using index
explain select * from t where id>0 limit 10;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t range PRIMARY PRIMARY 8 NULL # Using where
explain select id from t where id>1000 limit 10;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t range PRIMARY PRIMARY 8 NULL # Using where; Using index
1 SIMPLE t index PRIMARY PRIMARY 8 NULL # Using where; Using index
explain select * from t where id>1000 limit 10;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t range PRIMARY PRIMARY 8 NULL # Using where
explain select id from t where id>5000 limit 10;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t range PRIMARY PRIMARY 8 NULL # Using where; Using index
1 SIMPLE t index PRIMARY PRIMARY 8 NULL # Using where; Using index
explain select * from t where id>5000 limit 10;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t range PRIMARY PRIMARY 8 NULL # Using where
explain select id from t where id>6000 limit 10;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t range PRIMARY PRIMARY 8 NULL # Using where; Using index
1 SIMPLE t index PRIMARY PRIMARY 8 NULL # Using where; Using index
explain select * from t where id>6000 limit 10;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t range PRIMARY PRIMARY 8 NULL # Using where
......
......@@ -10009,7 +10009,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t range PRIMARY PRIMARY 8 NULL # Using where
explain select id from t where id>1000 limit 10;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t range PRIMARY PRIMARY 8 NULL # Using where; Using index
1 SIMPLE t index PRIMARY PRIMARY 8 NULL # Using where; Using index
explain select * from t where id>1000 limit 10;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t range PRIMARY PRIMARY 8 NULL # Using where
......
......@@ -60,13 +60,11 @@ c
400
500
600
explain select * from foo where c > 300;
explain select * from foo where c > 500;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE foo range c c 5 NULL 3 Using where; Using index
select * from foo where c > 300;
1 SIMPLE foo range c c 5 NULL 1 Using where; Using index
select * from foo where c > 500;
a b c
4 40 400
5 50 500
6 60 600
drop table foo;
create table foo (a int, b int);
......
......@@ -150,13 +150,11 @@ a b c
2 20 200
1 100 100
1 10 100
explain select * from foo where a>=4;
explain select * from foo where a>=5;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE foo range a a 4 NULL NULL; Using where
select * from foo where a>=4;
select * from foo where a>=5;
a b c
4 40 400
4 400 400
5 50 500
5 500 500
6 60 600
......
......@@ -26,8 +26,8 @@ alter table foo drop index b;
alter table foo add index c(c) clustering=yes;
select c from foo;
explain select * from foo where c > 300;
select * from foo where c > 300;
explain select * from foo where c > 500;
select * from foo where c > 500;
drop table foo;
# simple test on hidden primary key
......
......@@ -117,8 +117,8 @@ 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;
explain select * from foo where a>=5;
select * from foo where a>=5;
#HA_READ_KEY_OR_PREV not used anymore
......
......@@ -12,6 +12,7 @@ insert t1 values (1, 1, 1);
insert t1 select a+1, a+1, a+1 from t1;
insert t1 select a+2, a+2, a+2 from t1;
insert t1 select a+4, a+4, a+4 from t1;
insert t1 select a+8, a+8, a+8 from t1;
select * from t1;
a b c
1 1 1
......@@ -22,10 +23,18 @@ a b c
6 6 6
7 7 7
8 8 8
explain select a,c from t1 where a > 2;
9 9 9
10 10 10
11 11 11
12 12 12
13 13 13
14 14 14
15 15 15
16 16 16
explain select a,c from t1 where a > 4;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range a a 5 NULL 6 Using where; Using index
explain select b,c from t1 where b > 2;
1 SIMPLE t1 index a a 5 NULL 16 Using where; Using index
explain select b,c from t1 where b > 4;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL b NULL NULL NULL 8 Using where
1 SIMPLE t1 ALL b NULL NULL NULL 16 Using where
drop table t1;
......@@ -6,10 +6,11 @@ insert t1 values (1, 1, 1);
insert t1 select a+1, a+1, a+1 from t1;
insert t1 select a+2, a+2, a+2 from t1;
insert t1 select a+4, a+4, a+4 from t1;
insert t1 select a+8, a+8, a+8 from t1;
select * from t1;
explain select a,c from t1 where a > 2;
explain select b,c from t1 where b > 2;
explain select a,c from t1 where a > 4;
explain select b,c from t1 where b > 4;
drop table t1;
......
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