BUG#11754168: Reverting back changes as it is making other tests fail.

This commit is contained in:
Sneha Modi 2011-11-03 12:30:09 +05:30
parent b51cbbaaf2
commit ffd0c80914
6 changed files with 29 additions and 1353 deletions

View File

@ -6,7 +6,6 @@ binlog.binlog_multi_engine # joro : NDB tests marked as experiment
funcs_1.charset_collation_1 # depends on compile-time decisions funcs_1.charset_collation_1 # depends on compile-time decisions
main.func_math @freebsd # Bug#11751977 2010-05-04 alik main.func_math fails on FreeBSD in PB2 main.func_math @freebsd # Bug#11751977 2010-05-04 alik main.func_math fails on FreeBSD in PB2
main.index_merge_innodb #Bug 11754168 - 45727: Disabled parts of index_merge_innodb due to explain diffs have been enabled
main.lock_multi_bug38499 # Bug#11755645 2009-09-19 alik main.lock_multi_bug38499 times out sporadically main.lock_multi_bug38499 # Bug#11755645 2009-09-19 alik main.lock_multi_bug38499 times out sporadically
main.outfile_loaddata @solaris # Bug#11755168 2010-01-20 alik Test "outfile_loaddata" fails (reproducible) main.outfile_loaddata @solaris # Bug#11755168 2010-01-20 alik Test "outfile_loaddata" fails (reproducible)
main.signal_demo3 @solaris # Bug#11753919 2010-01-20 alik Several test cases fail on Solaris with error Thread stack overrun main.signal_demo3 @solaris # Bug#11753919 2010-01-20 alik Several test cases fail on Solaris with error Thread stack overrun

View File

@ -11,7 +11,6 @@
# Note: The comments/expectations refer to MyISAM. # Note: The comments/expectations refer to MyISAM.
# They might be not valid for other storage engines. # They might be not valid for other storage engines.
# #
# Last update: # Last update:
# 2006-08-02 ML test refactored # 2006-08-02 ML test refactored
# old name was t/index_merge.test # old name was t/index_merge.test
@ -58,129 +57,82 @@ update t0 set key2=key1,key3=key1,key4=key1,key5=key1,key6=key1,key7=key1,key8=1
analyze table t0; analyze table t0;
# 1. One index # 1. One index
--sorted_result
--replace_column 9 #
explain select * from t0 where key1 < 3 or key1 > 1020; explain select * from t0 where key1 < 3 or key1 > 1020;
# 2. Simple cases # 2. Simple cases
--sorted_result
--replace_column 9 #
explain explain
select * from t0 where key1 < 3 or key2 > 1020; select * from t0 where key1 < 3 or key2 > 1020;
select * from t0 where key1 < 3 or key2 > 1020; select * from t0 where key1 < 3 or key2 > 1020;
--sorted_result
--replace_column 9 #
explain select * from t0 where key1 < 3 or key2 <4; explain select * from t0 where key1 < 3 or key2 <4;
--sorted_result
--replace_column 9 #
explain explain
select * from t0 where (key1 > 30 and key1<35) or (key2 >32 and key2 < 40); select * from t0 where (key1 > 30 and key1<35) or (key2 >32 and key2 < 40);
# Bug#21277: InnoDB, wrong result set, index_merge strategy, second index not evaluated # Bug#21277: InnoDB, wrong result set, index_merge strategy, second index not evaluated
select * from t0 where (key1 > 30 and key1<35) or (key2 >32 and key2 < 40); select * from t0 where (key1 > 30 and key1<35) or (key2 >32 and key2 < 40);
# 3. Check that index_merge doesn't break "ignore/force/use index" # 3. Check that index_merge doesn't break "ignore/force/use index"
--sorted_result
--replace_column 9 #
explain select * from t0 ignore index (i2) where key1 < 3 or key2 <4; explain select * from t0 ignore index (i2) where key1 < 3 or key2 <4;
--sorted_result
--replace_column 9 #
explain select * from t0 where (key1 < 3 or key2 <4) and key3 = 50; explain select * from t0 where (key1 < 3 or key2 <4) and key3 = 50;
--sorted_result
--replace_column 9 #
explain select * from t0 use index (i1,i2) where (key1 < 3 or key2 <4) and key3 = 50; explain select * from t0 use index (i1,i2) where (key1 < 3 or key2 <4) and key3 = 50;
--sorted_result
--replace_column 9 #
explain select * from t0 where (key1 > 1 or key2 > 2); explain select * from t0 where (key1 > 1 or key2 > 2);
--sorted_result
--replace_column 9 #
explain select * from t0 force index (i1,i2) where (key1 > 1 or key2 > 2); explain select * from t0 force index (i1,i2) where (key1 > 1 or key2 > 2);
# 4. Check if conjuncts are grouped by keyuse # 4. Check if conjuncts are grouped by keyuse
--sorted_result
--replace_column 9 #
explain explain
select * from t0 where key1<3 or key2<3 or (key1>5 and key1<8) or select * from t0 where key1<3 or key2<3 or (key1>5 and key1<8) or
(key1>10 and key1<12) or (key2>100 and key2<110); (key1>10 and key1<12) or (key2>100 and key2<110);
# 5. Check index_merge with conjuncts that are always true/false # 5. Check index_merge with conjuncts that are always true/false
# verify fallback to "range" if there is only one non-confluent condition # verify fallback to "range" if there is only one non-confluent condition
--sorted_result
--replace_column 9 #
explain select * from t0 where key2 = 45 or key1 <=> null; explain select * from t0 where key2 = 45 or key1 <=> null;
--sorted_result
--replace_column 9 #
explain select * from t0 where key2 = 45 or key1 is not null; explain select * from t0 where key2 = 45 or key1 is not null;
--sorted_result
--replace_column 9 #
explain select * from t0 where key2 = 45 or key1 is null; explain select * from t0 where key2 = 45 or key1 is null;
# the last conj. is always false and will be discarded # the last conj. is always false and will be discarded
--sorted_result
--replace_column 9 #
explain select * from t0 where key2=10 or key3=3 or key4 <=> null; explain select * from t0 where key2=10 or key3=3 or key4 <=> null;
# the last conj. is always true and will cause 'all' scan # the last conj. is always true and will cause 'all' scan
--sorted_result
--replace_column 9 #
explain select * from t0 where key2=10 or key3=3 or key4 is null; explain select * from t0 where key2=10 or key3=3 or key4 is null;
# some more complicated cases # some more complicated cases
--sorted_result
--replace_column 9 #
explain select key1 from t0 where (key1 <=> null) or (key2 < 5) or explain select key1 from t0 where (key1 <=> null) or (key2 < 5) or
(key3=10) or (key4 <=> null); (key3=10) or (key4 <=> null);
--sorted_result
--replace_column 9 #
explain select key1 from t0 where (key1 <=> null) or (key1 < 5) or explain select key1 from t0 where (key1 <=> null) or (key1 < 5) or
(key3=10) or (key4 <=> null); (key3=10) or (key4 <=> null);
# 6.Several ways to do index_merge, (ignored) index_merge vs. range # 6.Several ways to do index_merge, (ignored) index_merge vs. range
--sorted_result
--replace_column 9 #
explain select * from t0 where explain select * from t0 where
(key1 < 3 or key2 < 3) and (key3 < 4 or key4 < 4) and (key5 < 5 or key6 < 5); (key1 < 3 or key2 < 3) and (key3 < 4 or key4 < 4) and (key5 < 5 or key6 < 5);
--sorted_result
--replace_column 9 #
explain explain
select * from t0 where (key1 < 3 or key2 < 6) and (key1 < 7 or key3 < 4); select * from t0 where (key1 < 3 or key2 < 6) and (key1 < 7 or key3 < 4);
select * from t0 where (key1 < 3 or key2 < 6) and (key1 < 7 or key3 < 4); select * from t0 where (key1 < 3 or key2 < 6) and (key1 < 7 or key3 < 4);
--sorted_result
--replace_column 9 #
explain select * from t0 where explain select * from t0 where
(key1 < 3 or key2 < 3) and (key3 < 4 or key4 < 4) and (key5 < 2 or key6 < 2); (key1 < 3 or key2 < 3) and (key3 < 4 or key4 < 4) and (key5 < 2 or key6 < 2);
# now index_merge is not used at all when "range" is possible # now index_merge is not used at all when "range" is possible
--sorted_result
--replace_column 9 #
explain select * from t0 where explain select * from t0 where
(key1 < 3 or key2 < 3) and (key3 < 100); (key1 < 3 or key2 < 3) and (key3 < 100);
# this even can cause "all" scan: # this even can cause "all" scan:
--sorted_result
--replace_column 9 #
explain select * from t0 where explain select * from t0 where
(key1 < 3 or key2 < 3) and (key3 < 1000); (key1 < 3 or key2 < 3) and (key3 < 1000);
# 7. Complex cases # 7. Complex cases
# tree_or(List<SEL_IMERGE>, range SEL_TREE). # tree_or(List<SEL_IMERGE>, range SEL_TREE).
--sorted_result
--replace_column 9 #
explain select * from t0 where explain select * from t0 where
((key1 < 4 or key2 < 4) and (key2 <5 or key3 < 4)) ((key1 < 4 or key2 < 4) and (key2 <5 or key3 < 4))
or or
key2 > 5; key2 > 5;
--sorted_result
--replace_column 9 #
explain select * from t0 where explain select * from t0 where
((key1 < 4 or key2 < 4) and (key2 <5 or key3 < 4)) ((key1 < 4 or key2 < 4) and (key2 <5 or key3 < 4))
or or
@ -192,43 +144,31 @@ select * from t0 where
key1 < 7; key1 < 7;
# tree_or(List<SEL_IMERGE>, List<SEL_IMERGE>). # tree_or(List<SEL_IMERGE>, List<SEL_IMERGE>).
--sorted_result
--replace_column 9 #
explain select * from t0 where explain select * from t0 where
((key1 < 4 or key2 < 4) and (key3 <5 or key5 < 4)) ((key1 < 4 or key2 < 4) and (key3 <5 or key5 < 4))
or or
((key5 < 5 or key6 < 6) and (key7 <7 or key8 < 4)); ((key5 < 5 or key6 < 6) and (key7 <7 or key8 < 4));
--sorted_result
--replace_column 9 #
explain select * from t0 where explain select * from t0 where
((key3 <5 or key5 < 4) and (key1 < 4 or key2 < 4)) ((key3 <5 or key5 < 4) and (key1 < 4 or key2 < 4))
or or
((key7 <7 or key8 < 4) and (key5 < 5 or key6 < 6)); ((key7 <7 or key8 < 4) and (key5 < 5 or key6 < 6));
--sorted_result
--replace_column 9 #
explain select * from t0 where explain select * from t0 where
((key3 <5 or key5 < 4) and (key1 < 4 or key2 < 4)) ((key3 <5 or key5 < 4) and (key1 < 4 or key2 < 4))
or or
((key3 <7 or key5 < 2) and (key5 < 5 or key6 < 6)); ((key3 <7 or key5 < 2) and (key5 < 5 or key6 < 6));
--sorted_result
--replace_column 9 #
explain select * from t0 where explain select * from t0 where
((key3 <5 or key5 < 4) and (key1 < 4 or key2 < 4)) ((key3 <5 or key5 < 4) and (key1 < 4 or key2 < 4))
or or
(((key3 <7 and key7 < 6) or key5 < 2) and (key5 < 5 or key6 < 6)); (((key3 <7 and key7 < 6) or key5 < 2) and (key5 < 5 or key6 < 6));
--sorted_result
--replace_column 9 #
explain select * from t0 where explain select * from t0 where
((key3 <5 or key5 < 4) and (key1 < 4 or key2 < 4)) ((key3 <5 or key5 < 4) and (key1 < 4 or key2 < 4))
or or
((key3 >=5 or key5 < 2) and (key5 < 5 or key6 < 6)); ((key3 >=5 or key5 < 2) and (key5 < 5 or key6 < 6));
--sorted_result
--replace_column 9 #
explain select * from t0 force index(i1, i2, i3, i4, i5, i6 ) where explain select * from t0 force index(i1, i2, i3, i4, i5, i6 ) where
((key3 <5 or key5 < 4) and (key1 < 4 or key2 < 4)) ((key3 <5 or key5 < 4) and (key1 < 4 or key2 < 4))
or or
@ -237,8 +177,6 @@ explain select * from t0 force index(i1, i2, i3, i4, i5, i6 ) where
# 8. Verify that "order by" after index merge uses filesort # 8. Verify that "order by" after index merge uses filesort
select * from t0 where key1 < 5 or key8 < 4 order by key1; select * from t0 where key1 < 5 or key8 < 4 order by key1;
--sorted_result
--replace_column 9 #
explain explain
select * from t0 where key1 < 5 or key8 < 4 order by key1; select * from t0 where key1 < 5 or key8 < 4 order by key1;
@ -253,18 +191,12 @@ alter table t2 drop index i2;
alter table t2 add index i321(key3, key2, key1); alter table t2 add index i321(key3, key2, key1);
# index_merge vs 'index', index_merge is better. # index_merge vs 'index', index_merge is better.
--sorted_result
--replace_column 9 #
explain select key3 from t2 where key1 = 100 or key2 = 100; explain select key3 from t2 where key1 = 100 or key2 = 100;
# index_merge vs 'index', 'index' is better. # index_merge vs 'index', 'index' is better.
--sorted_result
--replace_column 9 #
explain select key3 from t2 where key1 <100 or key2 < 100; explain select key3 from t2 where key1 <100 or key2 < 100;
# index_merge vs 'all', index_merge is better. # index_merge vs 'all', index_merge is better.
--sorted_result
--replace_column 9 #
explain select key7 from t2 where key1 <100 or key2 < 100; explain select key7 from t2 where key1 <100 or key2 < 100;
# 10. Multipart keys. # 10. Multipart keys.
@ -285,21 +217,13 @@ insert into t4 select key1,key1,key1 div 10, key1 % 10, key1 % 10, key1 from t0;
# the following will be handled by index_merge: # the following will be handled by index_merge:
select * from t4 where key1a = 3 or key1b = 4; select * from t4 where key1a = 3 or key1b = 4;
--sorted_result
--replace_column 9 #
explain select * from t4 where key1a = 3 or key1b = 4; explain select * from t4 where key1a = 3 or key1b = 4;
# and the following will not # and the following will not
--sorted_result
--replace_column 9 #
explain select * from t4 where key2 = 1 and (key2_1 = 1 or key3 = 5); explain select * from t4 where key2 = 1 and (key2_1 = 1 or key3 = 5);
--sorted_result
--replace_column 9 #
explain select * from t4 where key2 = 1 and (key2_1 = 1 or key2_2 = 5); explain select * from t4 where key2 = 1 and (key2_1 = 1 or key2_2 = 5);
--sorted_result
--replace_column 9 #
explain select * from t4 where key2_1 = 1 or key2_2 = 5; explain select * from t4 where key2_1 = 1 or key2_2 = 5;
@ -308,54 +232,38 @@ create table t1 like t0;
insert into t1 select * from t0; insert into t1 select * from t0;
# index_merge on first table in join # index_merge on first table in join
--sorted_result
--replace_column 9 #
explain select * from t0 left join t1 on (t0.key1=t1.key1) explain select * from t0 left join t1 on (t0.key1=t1.key1)
where t0.key1=3 or t0.key2=4; where t0.key1=3 or t0.key2=4;
select * from t0 left join t1 on (t0.key1=t1.key1) select * from t0 left join t1 on (t0.key1=t1.key1)
where t0.key1=3 or t0.key2=4; where t0.key1=3 or t0.key2=4;
--sorted_result
--replace_column 9 #
explain explain
select * from t0,t1 where (t0.key1=t1.key1) and ( t0.key1=3 or t0.key2=4); select * from t0,t1 where (t0.key1=t1.key1) and ( t0.key1=3 or t0.key2=4);
# index_merge vs. ref # index_merge vs. ref
--sorted_result
--replace_column 8 test.t0.key1 4 # 6 # 9 # 7 # 10 #
explain explain
select * from t0,t1 where (t0.key1=t1.key1) and select * from t0,t1 where (t0.key1=t1.key1) and
(t0.key1=3 or t0.key2=4) and t1.key1<200; (t0.key1=3 or t0.key2=4) and t1.key1<200;
# index_merge vs. ref # index_merge vs. ref
--sorted_result
--replace_column 8 test.t0.key1 9 #
explain explain
select * from t0,t1 where (t0.key1=t1.key1) and select * from t0,t1 where (t0.key1=t1.key1) and
(t0.key1=3 or t0.key2<4) and t1.key1=2; (t0.key1=3 or t0.key2<4) and t1.key1=2;
# index_merge on second table in join # index_merge on second table in join
--sorted_result
--replace_column 8 test.t0.key1 9 #
explain select * from t0,t1 where t0.key1 = 5 and explain select * from t0,t1 where t0.key1 = 5 and
(t1.key1 = t0.key1 or t1.key8 = t0.key1); (t1.key1 = t0.key1 or t1.key8 = t0.key1);
# Fix for bug#1974 # Fix for bug#1974
--sorted_result
--replace_column 8 test.t0.key1 9 #
explain select * from t0,t1 where t0.key1 < 3 and explain select * from t0,t1 where t0.key1 < 3 and
(t1.key1 = t0.key1 or t1.key8 = t0.key1); (t1.key1 = t0.key1 or t1.key8 = t0.key1);
# index_merge inside union # index_merge inside union
--sorted_result
--replace_column 9 #
explain select * from t1 where key1=3 or key2=4 explain select * from t1 where key1=3 or key2=4
union select * from t1 where key1<4 or key3=5; union select * from t1 where key1<4 or key3=5;
# index merge in subselect # index merge in subselect
--sorted_result
--replace_column 9 #
explain select * from (select * from t1 where key1 = 3 or key2 =3) as Z where key8 >5; explain select * from (select * from t1 where key1 = 3 or key2 =3) as Z where key8 >5;
# 12. check for long index_merges. # 12. check for long index_merges.
@ -367,8 +275,6 @@ alter table t3 add keyB int not null, add index iB(keyB);
alter table t3 add keyC int not null, add index iC(keyC); alter table t3 add keyC int not null, add index iC(keyC);
update t3 set key9=key1,keyA=key1,keyB=key1,keyC=key1; update t3 set key9=key1,keyA=key1,keyB=key1,keyC=key1;
--sorted_result
--replace_column 9 #
explain select * from t3 where explain select * from t3 where
key1=1 or key2=2 or key3=3 or key4=4 or key1=1 or key2=2 or key3=3 or key4=4 or
key5=5 or key6=6 or key7=7 or key8=8 or key5=5 or key6=6 or key7=7 or key8=8 or
@ -380,8 +286,6 @@ select * from t3 where
key9=9 or keyA=10 or keyB=11 or keyC=12; key9=9 or keyA=10 or keyB=11 or keyC=12;
# Test for Bug#3183 # Test for Bug#3183
--sorted_result
--replace_column 9 # 4 # 6 # 7 # 10 #
explain select * from t0 where key1 < 3 or key2 < 4; explain select * from t0 where key1 < 3 or key2 < 4;
# Bug#21277: InnoDB, wrong result set, index_merge strategy, second index not evaluated # Bug#21277: InnoDB, wrong result set, index_merge strategy, second index not evaluated
select * from t0 where key1 < 3 or key2 < 4; select * from t0 where key1 < 3 or key2 < 4;
@ -400,8 +304,6 @@ create table t4 (a int);
insert into t4 values (1),(4),(3); insert into t4 values (1),(4),(3);
set @save_join_buffer_size=@@join_buffer_size; set @save_join_buffer_size=@@join_buffer_size;
set join_buffer_size= 4096; set join_buffer_size= 4096;
--sorted_result
--replace_column 9 #
explain select max(A.key1 + B.key1 + A.key2 + B.key2 + A.key3 + B.key3 + A.key4 + B.key4 + A.key5 + B.key5) explain select max(A.key1 + B.key1 + A.key2 + B.key2 + A.key3 + B.key3 + A.key4 + B.key4 + A.key5 + B.key5)
from t0 as A force index(i1,i2), t0 as B force index (i1,i2) from t0 as A force index(i1,i2), t0 as B force index (i1,i2)
where (A.key1 < 500000 or A.key2 < 3) where (A.key1 < 500000 or A.key2 < 3)
@ -413,8 +315,6 @@ select max(A.key1 + B.key1 + A.key2 + B.key2 + A.key3 + B.key3 + A.key4 + B.key4
and (B.key1 < 500000 or B.key2 < 3); and (B.key1 < 500000 or B.key2 < 3);
update t0 set key1=1; update t0 set key1=1;
--sorted_result
--replace_column 9 #
explain select max(A.key1 + B.key1 + A.key2 + B.key2 + A.key3 + B.key3 + A.key4 + B.key4 + A.key5 + B.key5) explain select max(A.key1 + B.key1 + A.key2 + B.key2 + A.key3 + B.key3 + A.key4 + B.key4 + A.key5 + B.key5)
from t0 as A force index(i1,i2), t0 as B force index (i1,i2) from t0 as A force index(i1,i2), t0 as B force index (i1,i2)
where (A.key1 = 1 or A.key2 = 1) where (A.key1 = 1 or A.key2 = 1)
@ -431,11 +331,8 @@ update t0 set key2=1, key3=1, key4=1, key5=1,key6=1,key7=1 where key7 < 500;
# The next query will not use index i7 in intersection if the OS doesn't # The next query will not use index i7 in intersection if the OS doesn't
# support file sizes > 2GB. (ha_myisam::ref_length depends on this and index # support file sizes > 2GB. (ha_myisam::ref_length depends on this and index
# scan cost estimates depend on ha_myisam::ref_length) # scan cost estimates depend on ha_myisam::ref_length)
--sorted_result
--replace_column 9 # --replace_column 9 #
--replace_result "4,4,4,4,4,4,4" X "4,4,4,4,4,4" X "i6,i7" "i6,i7?" "i6" "i6,i7?" --replace_result "4,4,4,4,4,4,4" X "4,4,4,4,4,4" X "i6,i7" "i6,i7?" "i6" "i6,i7?"
--sorted_result
--replace_column 9 # 4 # 6 # 7 # 10 #
explain select max(A.key1 + B.key1 + A.key2 + B.key2 + A.key3 + B.key3 + A.key4 + B.key4 + A.key5 + B.key5) explain select max(A.key1 + B.key1 + A.key2 + B.key2 + A.key3 + B.key3 + A.key4 + B.key4 + A.key5 + B.key5)
from t0 as A, t0 as B from t0 as A, t0 as B
where (A.key1 = 1 and A.key2 = 1 and A.key3 = 1 and A.key4=1 and A.key5=1 and A.key6=1 and A.key7 = 1 or A.key8=1) where (A.key1 = 1 and A.key2 = 1 and A.key3 = 1 and A.key4=1 and A.key5=1 and A.key6=1 and A.key7 = 1 or A.key8=1)
@ -477,9 +374,7 @@ while ($1)
OPTIMIZE TABLE t1; OPTIMIZE TABLE t1;
select count(*) from t1; select count(*) from t1;
--replace_column 9 #
explain select * from t1 WHERE cola = 'foo' AND colb = 'bar'; explain select * from t1 WHERE cola = 'foo' AND colb = 'bar';
--replace_column 9 #
explain select * from t1 force index(cola,colb) WHERE cola = 'foo' AND colb = 'bar'; explain select * from t1 force index(cola,colb) WHERE cola = 'foo' AND colb = 'bar';
drop table t1; drop table t1;
@ -504,10 +399,8 @@ create table t3 (
key(a),key(b) key(a),key(b)
) engine=merge union=(t1,t2); ) engine=merge union=(t1,t2);
--sorted_result
--replace_column 9 # --replace_column 9 #
explain select * from t1 where a=1 and b=1; explain select * from t1 where a=1 and b=1;
--sorted_result
--replace_column 9 # --replace_column 9 #
explain select * from t3 where a=1 and b=1; explain select * from t3 where a=1 and b=1;
@ -579,7 +472,6 @@ create table t2(
insert into t2 select * from t1; insert into t2 select * from t1;
--echo must use sort-union rather than union: --echo must use sort-union rather than union:
--sorted_result
--replace_column 9 # --replace_column 9 #
explain select * from t1 where a=4 or b=4; explain select * from t1 where a=4 or b=4;
--sorted_result --sorted_result
@ -588,7 +480,6 @@ select * from t1 where a=4 or b=4;
select * from t1 ignore index(a,b) where a=4 or b=4; select * from t1 ignore index(a,b) where a=4 or b=4;
--echo must use union, not sort-union: --echo must use union, not sort-union:
--sorted_result
--replace_column 9 # --replace_column 9 #
explain select * from t2 where a=4 or b=4; explain select * from t2 where a=4 or b=4;
--sorted_result --sorted_result
@ -626,8 +517,6 @@ insert into t3 select 1000, 1000,'filler' from t0 A, t0 B, t0 C;
insert into t3 values (1,1,'data'); insert into t3 values (1,1,'data');
insert into t3 values (1,1,'data'); insert into t3 values (1,1,'data');
-- echo The plan should be ALL/ALL/ALL(Range checked for each record (index map: 0x3) -- echo The plan should be ALL/ALL/ALL(Range checked for each record (index map: 0x3)
--sorted_result
--replace_column 9 #
explain select * from t1 explain select * from t1
where exists (select 1 from t2, t3 where exists (select 1 from t2, t3
where t2.a=t1.a and (t3.a=t2.b or t3.b=t2.b or t3.b=t2.b+1)); where t2.a=t1.a and (t3.a=t2.b or t3.b=t2.b or t3.b=t2.b+1));
@ -651,9 +540,7 @@ INSERT INTO t1 SELECT * FROM t1;
INSERT INTO t1 SELECT * FROM t1; INSERT INTO t1 SELECT * FROM t1;
INSERT INTO t1 SELECT * FROM t1; INSERT INTO t1 SELECT * FROM t1;
SET SESSION sort_buffer_size=1; SET SESSION sort_buffer_size=1;
--sorted_result EXPLAIN
--replace_column 9 #
explain
SELECT * FROM t1 FORCE INDEX(a,b) WHERE a LIKE 'a%' OR b LIKE 'b%' SELECT * FROM t1 FORCE INDEX(a,b) WHERE a LIKE 'a%' OR b LIKE 'b%'
ORDER BY a,b; ORDER BY a,b;
# we don't actually care about the result : we're checking if it crashes # we don't actually care about the result : we're checking if it crashes

View File

@ -124,7 +124,6 @@ select count(*) from t1;
if ($index_merge_random_rows_in_EXPLAIN) if ($index_merge_random_rows_in_EXPLAIN)
{ {
--sorted_result
--replace_column 9 # --replace_column 9 #
} }
explain select count(*) from t1 where explain select count(*) from t1 where
@ -135,7 +134,6 @@ select count(*) from t1 where
if ($index_merge_random_rows_in_EXPLAIN) if ($index_merge_random_rows_in_EXPLAIN)
{ {
--sorted_result
--replace_column 9 # --replace_column 9 #
} }
explain select count(*) from t1 where explain select count(*) from t1 where
@ -326,32 +324,32 @@ SELECT COUNT(*) FROM t1 WHERE b = 0 AND a = 0 AND c = 13286427 AND
drop table t1; drop table t1;
# BUG#21277: Index Merge/sort_union: wrong query results # BUG#21277: Index Merge/sort_union: wrong query results
#create table t1 create table t1
#( (
# key1 int not null, key1 int not null,
# key2 int not null default 0, key2 int not null default 0,
# key3 int not null default 0 key3 int not null default 0
#); );
#insert into t1(key1) values (1),(2),(3),(4),(5),(6),(7),(8); insert into t1(key1) values (1),(2),(3),(4),(5),(6),(7),(8);
#let $1=7; let $1=7;
#set @d=8; set @d=8;
#while ($1) while ($1)
#{ {
# eval insert into t1 (key1) select key1+@d from t1; eval insert into t1 (key1) select key1+@d from t1;
# eval set @d=@d*2; eval set @d=@d*2;
# dec $1; dec $1;
#} }
#alter table t1 add index i2(key2); alter table t1 add index i2(key2);
#alter table t1 add index i3(key3); alter table t1 add index i3(key3);
#update t1 set key2=key1,key3=key1; update t1 set key2=key1,key3=key1;
# to test the bug, the following must use "sort_union": # to test the bug, the following must use "sort_union":
#explain select * from t1 where (key3 > 30 and key3<35) or (key2 >32 and key2 < 40); explain select * from t1 where (key3 > 30 and key3<35) or (key2 >32 and key2 < 40);
#select * from t1 where (key3 > 30 and key3<35) or (key2 >32 and key2 < 40); select * from t1 where (key3 > 30 and key3<35) or (key2 >32 and key2 < 40);
#drop table t1; drop table t1;
--echo # --echo #
--echo # Bug#56423: Different count with SELECT and CREATE SELECT queries --echo # Bug#56423: Different count with SELECT and CREATE SELECT queries

View File

@ -118,12 +118,8 @@ alter table t1 enable keys;
select count(*) from t1; select count(*) from t1;
# One row results tests for cases where a single row matches all conditions # One row results tests for cases where a single row matches all conditions
--sorted_result
--replace_column 9 #
explain select key1,key2 from t1 where key1=100 and key2=100; explain select key1,key2 from t1 where key1=100 and key2=100;
select key1,key2 from t1 where key1=100 and key2=100; select key1,key2 from t1 where key1=100 and key2=100;
--sorted_result
--replace_column 9 #
explain select key1,key2,key3,key4,filler1 from t1 where key1=100 and key2=100 or key3=100 and key4=100; explain select key1,key2,key3,key4,filler1 from t1 where key1=100 and key2=100 or key3=100 and key4=100;
select key1,key2,key3,key4,filler1 from t1 where key1=100 and key2=100 or key3=100 and key4=100; select key1,key2,key3,key4,filler1 from t1 where key1=100 and key2=100 or key3=100 and key4=100;
@ -132,35 +128,25 @@ insert into t1 (key1, key2, key3, key4, filler1) values (100, 100, -1, -1, 'key1
insert into t1 (key1, key2, key3, key4, filler1) values (-1, -1, 100, 100, 'key4-key3'); insert into t1 (key1, key2, key3, key4, filler1) values (-1, -1, 100, 100, 'key4-key3');
# ROR-intersection, not covering # ROR-intersection, not covering
--sorted_result
--replace_column 9 #
explain select key1,key2,filler1 from t1 where key1=100 and key2=100; explain select key1,key2,filler1 from t1 where key1=100 and key2=100;
select key1,key2,filler1 from t1 where key1=100 and key2=100; select key1,key2,filler1 from t1 where key1=100 and key2=100;
# ROR-intersection, covering # ROR-intersection, covering
--sorted_result
--replace_column 9 #
explain select key1,key2 from t1 where key1=100 and key2=100; explain select key1,key2 from t1 where key1=100 and key2=100;
select key1,key2 from t1 where key1=100 and key2=100; select key1,key2 from t1 where key1=100 and key2=100;
# ROR-union of ROR-intersections # ROR-union of ROR-intersections
--sorted_result
--replace_column 9 #
explain select key1,key2,key3,key4 from t1 where key1=100 and key2=100 or key3=100 and key4=100; explain select key1,key2,key3,key4 from t1 where key1=100 and key2=100 or key3=100 and key4=100;
select key1,key2,key3,key4 from t1 where key1=100 and key2=100 or key3=100 and key4=100; select key1,key2,key3,key4 from t1 where key1=100 and key2=100 or key3=100 and key4=100;
explain select key1,key2,key3,key4,filler1 from t1 where key1=100 and key2=100 or key3=100 and key4=100; explain select key1,key2,key3,key4,filler1 from t1 where key1=100 and key2=100 or key3=100 and key4=100;
select key1,key2,key3,key4,filler1 from t1 where key1=100 and key2=100 or key3=100 and key4=100; select key1,key2,key3,key4,filler1 from t1 where key1=100 and key2=100 or key3=100 and key4=100;
# 3-way ROR-intersection # 3-way ROR-intersection
--sorted_result
--replace_column 9 #
explain select key1,key2,key3 from t1 where key1=100 and key2=100 and key3=100; explain select key1,key2,key3 from t1 where key1=100 and key2=100 and key3=100;
select key1,key2,key3 from t1 where key1=100 and key2=100 and key3=100; select key1,key2,key3 from t1 where key1=100 and key2=100 and key3=100;
# ROR-union(ROR-intersection, ROR-range) # ROR-union(ROR-intersection, ROR-range)
insert into t1 (key1,key2,key3,key4,filler1) values (101,101,101,101, 'key1234-101'); insert into t1 (key1,key2,key3,key4,filler1) values (101,101,101,101, 'key1234-101');
--sorted_result
--replace_column 9 #
explain select key1,key2,key3,key4,filler1 from t1 where key1=100 and key2=100 or key3=101; explain select key1,key2,key3,key4,filler1 from t1 where key1=100 and key2=100 or key3=101;
select key1,key2,key3,key4,filler1 from t1 where key1=100 and key2=100 or key3=101; select key1,key2,key3,key4,filler1 from t1 where key1=100 and key2=100 or key3=101;
@ -173,22 +159,16 @@ select key1,key2,filler1 from t1 where key2=100 and key2=200;
# ROR-union(ROR-intersection) with one of ROR-intersection giving empty # ROR-union(ROR-intersection) with one of ROR-intersection giving empty
# results # results
--sorted_result
--replace_column 9 #
explain select key1,key2,key3,key4,filler1 from t1 where key1=100 and key2=100 or key3=100 and key4=100; explain select key1,key2,key3,key4,filler1 from t1 where key1=100 and key2=100 or key3=100 and key4=100;
select key1,key2,key3,key4,filler1 from t1 where key1=100 and key2=100 or key3=100 and key4=100; select key1,key2,key3,key4,filler1 from t1 where key1=100 and key2=100 or key3=100 and key4=100;
delete from t1 where key3=100 and key4=100; delete from t1 where key3=100 and key4=100;
# ROR-union with all ROR-intersections giving empty results # ROR-union with all ROR-intersections giving empty results
--sorted_result
--replace_column 9 #
explain select key1,key2,key3,key4,filler1 from t1 where key1=100 and key2=100 or key3=100 and key4=100; explain select key1,key2,key3,key4,filler1 from t1 where key1=100 and key2=100 or key3=100 and key4=100;
select key1,key2,key3,key4,filler1 from t1 where key1=100 and key2=100 or key3=100 and key4=100; select key1,key2,key3,key4,filler1 from t1 where key1=100 and key2=100 or key3=100 and key4=100;
# ROR-intersection with empty result # ROR-intersection with empty result
--sorted_result
--replace_column 9 #
explain select key1,key2 from t1 where key1=100 and key2=100; explain select key1,key2 from t1 where key1=100 and key2=100;
select key1,key2 from t1 where key1=100 and key2=100; select key1,key2 from t1 where key1=100 and key2=100;
@ -198,22 +178,16 @@ insert into t1 (key1, key2, key3, key4, filler1) values (100, 100, 200, 200,'key
insert into t1 (key1, key2, key3, key4, filler1) values (100, 100, 200, 200,'key1-key2-key3-key4-2'); insert into t1 (key1, key2, key3, key4, filler1) values (100, 100, 200, 200,'key1-key2-key3-key4-2');
insert into t1 (key1, key2, key3, key4, filler1) values (100, 100, 200, 200,'key1-key2-key3-key4-3'); insert into t1 (key1, key2, key3, key4, filler1) values (100, 100, 200, 200,'key1-key2-key3-key4-3');
--sorted_result
--replace_column 9 #
explain select key1,key2,key3,key4,filler1 from t1 where key3=200 or (key1=100 and key2=100) or key4=200; explain select key1,key2,key3,key4,filler1 from t1 where key3=200 or (key1=100 and key2=100) or key4=200;
select key1,key2,key3,key4,filler1 from t1 where key3=200 or (key1=100 and key2=100) or key4=200; select key1,key2,key3,key4,filler1 from t1 where key3=200 or (key1=100 and key2=100) or key4=200;
insert into t1 (key1, key2, key3, key4, filler1) values (-1, -1, -1, 200,'key4'); insert into t1 (key1, key2, key3, key4, filler1) values (-1, -1, -1, 200,'key4');
--sorted_result
--replace_column 9 #
explain select key1,key2,key3,key4,filler1 from t1 where key3=200 or (key1=100 and key2=100) or key4=200; explain select key1,key2,key3,key4,filler1 from t1 where key3=200 or (key1=100 and key2=100) or key4=200;
select key1,key2,key3,key4,filler1 from t1 where key3=200 or (key1=100 and key2=100) or key4=200; select key1,key2,key3,key4,filler1 from t1 where key3=200 or (key1=100 and key2=100) or key4=200;
insert into t1 (key1, key2, key3, key4, filler1) values (-1, -1, 200, -1,'key3'); insert into t1 (key1, key2, key3, key4, filler1) values (-1, -1, 200, -1,'key3');
--sorted_result
--replace_column 9 #
explain select key1,key2,key3,key4,filler1 from t1 where key3=200 or (key1=100 and key2=100) or key4=200; explain select key1,key2,key3,key4,filler1 from t1 where key3=200 or (key1=100 and key2=100) or key4=200;
select key1,key2,key3,key4,filler1 from t1 where key3=200 or (key1=100 and key2=100) or key4=200; select key1,key2,key3,key4,filler1 from t1 where key3=200 or (key1=100 and key2=100) or key4=200;
@ -222,16 +196,10 @@ select key1,key2,key3,key4,filler1 from t1 where key3=200 or (key1=100 and key2=
## ##
# Check that the shortest key is used for ROR-intersection, covering and non-covering. # Check that the shortest key is used for ROR-intersection, covering and non-covering.
--sorted_result
--replace_column 9 # 6 #
explain select * from t1 where st_a=1 and st_b=1; explain select * from t1 where st_a=1 and st_b=1;
--sorted_result
--replace_column 9 #
explain select st_a,st_b from t1 where st_a=1 and st_b=1; explain select st_a,st_b from t1 where st_a=1 and st_b=1;
# Check if "ingore index" syntax works # Check if "ingore index" syntax works
--sorted_result
--replace_column 9 # 6 #
explain select st_a from t1 ignore index (st_a) where st_a=1 and st_b=1; explain select st_a from t1 ignore index (st_a) where st_a=1 and st_b=1;
# Do many tests # Do many tests
@ -240,49 +208,30 @@ explain select st_a from t1 ignore index (st_a) where st_a=1 and st_b=1;
# Different value on 32 and 64 bit # Different value on 32 and 64 bit
--replace_result sta_swt12a sta_swt21a sta_swt12a, sta_swt12a, --replace_result sta_swt12a sta_swt21a sta_swt12a, sta_swt12a,
--replace_column 9 #
explain select * from t1 where st_a=1 and swt1a=1 and swt2a=1; explain select * from t1 where st_a=1 and swt1a=1 and swt2a=1;
--sorted_result
--replace_column 9 #
explain select * from t1 where st_b=1 and swt1b=1 and swt2b=1; explain select * from t1 where st_b=1 and swt1b=1 and swt2b=1;
--sorted_result
--replace_column 9 #
explain select * from t1 where st_a=1 and swt1a=1 and swt2a=1 and st_b=1 and swt1b=1 and swt2b=1; explain select * from t1 where st_a=1 and swt1a=1 and swt2a=1 and st_b=1 and swt1b=1 and swt2b=1;
--sorted_result
--replace_column 9 #
explain select * from t1 ignore index (sta_swt21a, stb_swt1a_2b) explain select * from t1 ignore index (sta_swt21a, stb_swt1a_2b)
where st_a=1 and swt1a=1 and swt2a=1 and st_b=1 and swt1b=1 and swt2b=1; where st_a=1 and swt1a=1 and swt2a=1 and st_b=1 and swt1b=1 and swt2b=1;
--sorted_result
--replace_column 9 #
explain select * from t1 ignore index (sta_swt21a, sta_swt12a, stb_swt1a_2b) explain select * from t1 ignore index (sta_swt21a, sta_swt12a, stb_swt1a_2b)
where st_a=1 and swt1a=1 and swt2a=1 and st_b=1 and swt1b=1 and swt2b=1; where st_a=1 and swt1a=1 and swt2a=1 and st_b=1 and swt1b=1 and swt2b=1;
--sorted_result
--replace_column 9 #
explain select * from t1 ignore index (sta_swt21a, sta_swt12a, stb_swt1a_2b, stb_swt1b) explain select * from t1 ignore index (sta_swt21a, sta_swt12a, stb_swt1a_2b, stb_swt1b)
where st_a=1 and swt1a=1 and swt2a=1 and st_b=1 and swt1b=1 and swt2b=1; where st_a=1 and swt1a=1 and swt2a=1 and st_b=1 and swt1b=1 and swt2b=1;
--sorted_result
--replace_column 9 #
explain select * from t1 explain select * from t1
where st_a=1 and swt1a=1 and swt2a=1 and st_b=1 and swt1b=1; where st_a=1 and swt1a=1 and swt2a=1 and st_b=1 and swt1b=1;
--sorted_result
--replace_column 9 #
explain select * from t1 explain select * from t1
where st_a=1 and swt1a=1 and st_b=1 and swt1b=1 and swt1b=1; where st_a=1 and swt1a=1 and st_b=1 and swt1b=1 and swt1b=1;
--sorted_result
--replace_column 9 #
explain select st_a from t1 explain select st_a from t1
where st_a=1 and swt1a=1 and st_b=1 and swt1b=1 and swt1b=1; where st_a=1 and swt1a=1 and st_b=1 and swt1b=1 and swt1b=1;
--sorted_result
--replace_column 9 #
explain select st_a from t1 explain select st_a from t1
where st_a=1 and swt1a=1 and st_b=1 and swt1b=1 and swt1b=1; where st_a=1 and swt1a=1 and st_b=1 and swt1b=1 and swt1b=1;
@ -321,7 +270,6 @@ select count(a) from t2 where a='AAAAAAAA' and b='AAAAAAAA';
select count(a) from t2 ignore index(a,b) where a='AAAAAAAA' and b='AAAAAAAA'; select count(a) from t2 ignore index(a,b) where a='AAAAAAAA' and b='AAAAAAAA';
insert into t2 values ('ab', 'ab', 'uh', 'oh'); insert into t2 values ('ab', 'ab', 'uh', 'oh');
--replace_column 9 #
explain select a from t2 where a='ab'; explain select a from t2 where a='ab';
drop table t2; drop table t2;

File diff suppressed because it is too large Load Diff

View File

@ -22,9 +22,9 @@ let $index_merge_random_rows_in_EXPLAIN = 1;
let $merge_table_support= 0; let $merge_table_support= 0;
# -- [DISABLED Bug#45727] # -- [DISABLED Bug#45727]
--source include/index_merge1.inc # --source include/index_merge1.inc
--source include/index_merge_ror.inc # --source include/index_merge_ror.inc
--source include/index_merge2.inc # --source include/index_merge2.inc
--source include/index_merge_2sweeps.inc --source include/index_merge_2sweeps.inc
--source include/index_merge_ror_cpk.inc --source include/index_merge_ror_cpk.inc