Browse Source
Fixed wrong test cases (embedded and ASAN)
Fixed wrong test cases (embedded and ASAN)
- main.selectivity failed because one test produced different result with embedded (missing feature). Fixed by moving the failing part to selectivity_notembedded. - Disabled maria.encrypt-no-key for embedded as embedded does not support encryption - Moved test from join_cache to join_cache_notasan that tried to alloc() a buffer bigger than available memory.pull/2634/head
10 changed files with 248 additions and 270 deletions
-
27mysql-test/main/join_cache.result
-
28mysql-test/main/join_cache.test
-
27mysql-test/main/join_cache_notasan.result
-
35mysql-test/main/join_cache_notasan.test
-
69mysql-test/main/selectivity.result
-
79mysql-test/main/selectivity.test
-
67mysql-test/main/selectivity_innodb.result
-
83mysql-test/main/selectivity_notembedded.result
-
102mysql-test/main/selectivity_notembedded.test
-
1mysql-test/suite/maria/encrypt-no-key.test
@ -0,0 +1,27 @@ |
|||
# |
|||
# MDEV-28217 Incorrect Join Execution When Controlling Join Buffer Size |
|||
# |
|||
CREATE TABLE t1 (i int PRIMARY KEY)engine=innodb; |
|||
INSERT INTO t1 VALUES (1332945389); |
|||
CREATE TABLE t2 (i int PRIMARY KEY)engine=innodb; |
|||
INSERT INTO t2 VALUES (1180244875), (1951338178); |
|||
SET SESSION join_buffer_size= X; |
|||
Warnings: |
|||
Warning X Truncated incorrect join_buffer_size value: 'X' |
|||
SET SESSION join_cache_level = 4; |
|||
SET optimizer_switch='optimize_join_buffer_size=on'; |
|||
SELECT t2.i FROM t2 LEFT JOIN t1 ON t1.i = t2.i WHERE t1.i; |
|||
i |
|||
SET optimizer_switch='optimize_join_buffer_size=off'; |
|||
SELECT t1.i,t2.i FROM t2 LEFT JOIN t1 ON t1.i = t2.i WHERE t1.i; |
|||
ERROR HYX: Could not create a join buffer. Please check and adjust the value of the variables 'JOIN_BUFFER_SIZE (X)' and 'JOIN_BUFFER_SPACE_LIMIT (X)' |
|||
SET SESSION join_buffer_size= 10000000; |
|||
SELECT t1.i,t2.i FROM t2 LEFT JOIN t1 ON t1.i = t2.i WHERE t1.i; |
|||
i i |
|||
SET SESSION optimizer_switch= default; |
|||
SET SESSION join_buffer_size= default; |
|||
SET SESSION join_cache_level= default; |
|||
drop table t1,t2; |
|||
# |
|||
# End of 10.4 tests |
|||
# |
@ -0,0 +1,35 @@ |
|||
# |
|||
# Tests that should be in join_cache but cannot be run with ASAN |
|||
|
|||
--source include/not_asan.inc |
|||
--source include/have_innodb.inc |
|||
|
|||
--echo # |
|||
--echo # MDEV-28217 Incorrect Join Execution When Controlling Join Buffer Size |
|||
--echo # |
|||
|
|||
# This test tries to allocate a too big bufffer, for which ASAN gives an error |
|||
|
|||
CREATE TABLE t1 (i int PRIMARY KEY)engine=innodb; |
|||
INSERT INTO t1 VALUES (1332945389); |
|||
CREATE TABLE t2 (i int PRIMARY KEY)engine=innodb; |
|||
INSERT INTO t2 VALUES (1180244875), (1951338178); |
|||
--replace_regex /[0-9][0-9]+/X/ |
|||
SET SESSION join_buffer_size= 5250229460064350213; |
|||
SET SESSION join_cache_level = 4; |
|||
SET optimizer_switch='optimize_join_buffer_size=on'; |
|||
SELECT t2.i FROM t2 LEFT JOIN t1 ON t1.i = t2.i WHERE t1.i; |
|||
SET optimizer_switch='optimize_join_buffer_size=off'; |
|||
--replace_regex /[0-9][0-9]+/X/ |
|||
--error ER_OUTOFMEMORY |
|||
SELECT t1.i,t2.i FROM t2 LEFT JOIN t1 ON t1.i = t2.i WHERE t1.i; |
|||
SET SESSION join_buffer_size= 10000000; |
|||
SELECT t1.i,t2.i FROM t2 LEFT JOIN t1 ON t1.i = t2.i WHERE t1.i; |
|||
SET SESSION optimizer_switch= default; |
|||
SET SESSION join_buffer_size= default; |
|||
SET SESSION join_cache_level= default; |
|||
drop table t1,t2; |
|||
|
|||
--echo # |
|||
--echo # End of 10.4 tests |
|||
--echo # |
@ -0,0 +1,83 @@ |
|||
# |
|||
# MDEV-31067: selectivity_from_histogram >1.0 for a DOUBLE_PREC_HB histogram |
|||
# |
|||
set @save_histogram_size=@@histogram_size; |
|||
set @save_histogram_type=@@histogram_type; |
|||
set @save_use_stat_tables=@@use_stat_tables; |
|||
set @save_optimizer_use_condition_selectivity=@@optimizer_use_condition_selectivity; |
|||
SET histogram_size= 255; |
|||
set histogram_type='DOUBLE_PREC_HB'; |
|||
set use_stat_tables=preferably; |
|||
SET optimizer_use_condition_selectivity=3; |
|||
create table t0(a int); |
|||
insert into t0 select 1 from seq_1_to_78; |
|||
create table t1(a int); |
|||
insert into t1 select 1 from seq_1_to_26; |
|||
create table t10 (a int); |
|||
insert into t10 select 0 from t0, seq_1_to_4; |
|||
insert into t10 select 8693 from t1; |
|||
insert into t10 select 8694 from t1; |
|||
insert into t10 select 8695 from t1; |
|||
insert into t10 select 34783 from t1; |
|||
insert into t10 select 34784 from t1; |
|||
insert into t10 select 34785 from t1; |
|||
insert into t10 select 34785 from t0, seq_1_to_8; |
|||
insert into t10 select 65214 from t1; |
|||
insert into t10 select 65215 from t1; |
|||
insert into t10 select 65216 from t1; |
|||
insert into t10 select 65216 from t0, seq_1_to_52; |
|||
insert into t10 select 65217 from t1; |
|||
insert into t10 select 65218 from t1; |
|||
insert into t10 select 65219 from t1; |
|||
insert into t10 select 65219 from t0; |
|||
insert into t10 select 73913 from t1; |
|||
insert into t10 select 73914 from t1; |
|||
insert into t10 select 73915 from t1; |
|||
insert into t10 select 73915 from t0, seq_1_to_40; |
|||
insert into t10 select 78257 from t1; |
|||
insert into t10 select 78258 from t1; |
|||
insert into t10 select 78259 from t1; |
|||
insert into t10 select 91300 from t1; |
|||
insert into t10 select 91301 from t1; |
|||
insert into t10 select 91302 from t1; |
|||
insert into t10 select 91302 from t0, seq_1_to_6; |
|||
insert into t10 select 91303 from t1; |
|||
insert into t10 select 91304 from t1; |
|||
insert into t10 select 91305 from t1; |
|||
insert into t10 select 91305 from t0, seq_1_to_8; |
|||
insert into t10 select 99998 from t1; |
|||
insert into t10 select 99999 from t1; |
|||
insert into t10 select 100000 from t1; |
|||
analyze table t10 persistent for all; |
|||
Table Op Msg_type Msg_text |
|||
test.t10 analyze status Engine-independent statistics collected |
|||
test.t10 analyze status OK |
|||
flush tables; |
|||
set @tmp=@@optimizer_trace; |
|||
set optimizer_trace=1; |
|||
explain select * from t10 where a in (91303); |
|||
id select_type table type possible_keys key key_len ref rows Extra |
|||
1 SIMPLE t10 ALL NULL NULL NULL NULL 9984 Using where |
|||
# Must have selectivity_from_histogram <= 1.0: |
|||
select json_detailed(json_extract(trace, '$**.selectivity_for_columns')) |
|||
from information_schema.optimizer_trace; |
|||
json_detailed(json_extract(trace, '$**.selectivity_for_columns')) |
|||
[ |
|||
[ |
|||
{ |
|||
"column_name": "a", |
|||
"ranges": |
|||
["91303 <= a <= 91303"], |
|||
"selectivity_from_histogram": 0.0357 |
|||
} |
|||
] |
|||
] |
|||
drop table t0,t1,t10; |
|||
set optimizer_trace=@tmp; |
|||
set @@histogram_size=@save_histogram_size; |
|||
set @histogram_type=@save_histogram_type; |
|||
set @use_stat_tables=@save_use_stat_tables; |
|||
set @@optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity; |
|||
# |
|||
# End of 10.4 tests |
|||
# |
@ -0,0 +1,102 @@ |
|||
--source include/have_stat_tables.inc |
|||
--source include/have_sequence.inc |
|||
--source include/not_embedded.inc |
|||
|
|||
--echo # |
|||
--echo # MDEV-31067: selectivity_from_histogram >1.0 for a DOUBLE_PREC_HB histogram |
|||
--echo # |
|||
|
|||
set @save_histogram_size=@@histogram_size; |
|||
set @save_histogram_type=@@histogram_type; |
|||
set @save_use_stat_tables=@@use_stat_tables; |
|||
set @save_optimizer_use_condition_selectivity=@@optimizer_use_condition_selectivity; |
|||
|
|||
SET histogram_size= 255; |
|||
set histogram_type='DOUBLE_PREC_HB'; |
|||
set use_stat_tables=preferably; |
|||
SET optimizer_use_condition_selectivity=3; |
|||
|
|||
create table t0(a int); # This holds how many rows we hold in a bucket. |
|||
insert into t0 select 1 from seq_1_to_78; |
|||
|
|||
create table t1(a int); # one-third of a bucket |
|||
insert into t1 select 1 from seq_1_to_26; |
|||
|
|||
create table t10 (a int); |
|||
insert into t10 select 0 from t0, seq_1_to_4; |
|||
|
|||
insert into t10 select 8693 from t1; |
|||
insert into t10 select 8694 from t1; |
|||
insert into t10 select 8695 from t1; |
|||
|
|||
|
|||
insert into t10 select 34783 from t1; |
|||
insert into t10 select 34784 from t1; |
|||
insert into t10 select 34785 from t1; |
|||
|
|||
|
|||
insert into t10 select 34785 from t0, seq_1_to_8; |
|||
|
|||
insert into t10 select 65214 from t1; |
|||
insert into t10 select 65215 from t1; |
|||
insert into t10 select 65216 from t1; |
|||
|
|||
insert into t10 select 65216 from t0, seq_1_to_52; |
|||
|
|||
insert into t10 select 65217 from t1; |
|||
insert into t10 select 65218 from t1; |
|||
insert into t10 select 65219 from t1; |
|||
|
|||
insert into t10 select 65219 from t0; |
|||
|
|||
|
|||
insert into t10 select 73913 from t1; |
|||
insert into t10 select 73914 from t1; |
|||
insert into t10 select 73915 from t1; |
|||
|
|||
insert into t10 select 73915 from t0, seq_1_to_40; |
|||
|
|||
|
|||
insert into t10 select 78257 from t1; |
|||
insert into t10 select 78258 from t1; |
|||
insert into t10 select 78259 from t1; |
|||
|
|||
insert into t10 select 91300 from t1; |
|||
insert into t10 select 91301 from t1; |
|||
insert into t10 select 91302 from t1; |
|||
|
|||
insert into t10 select 91302 from t0, seq_1_to_6; |
|||
|
|||
insert into t10 select 91303 from t1; # Only 1/3rd of bucket matches the search tuple |
|||
insert into t10 select 91304 from t1; |
|||
insert into t10 select 91305 from t1; |
|||
|
|||
insert into t10 select 91305 from t0, seq_1_to_8; |
|||
|
|||
insert into t10 select 99998 from t1; |
|||
insert into t10 select 99999 from t1; |
|||
insert into t10 select 100000 from t1; |
|||
|
|||
analyze table t10 persistent for all; |
|||
flush tables; |
|||
|
|||
set @tmp=@@optimizer_trace; |
|||
set optimizer_trace=1; |
|||
explain select * from t10 where a in (91303); |
|||
|
|||
--echo # Must have selectivity_from_histogram <= 1.0: |
|||
--replace_result 0.035714283 0.0357 |
|||
select json_detailed(json_extract(trace, '$**.selectivity_for_columns')) |
|||
from information_schema.optimizer_trace; |
|||
|
|||
drop table t0,t1,t10; |
|||
|
|||
set optimizer_trace=@tmp; |
|||
set @@histogram_size=@save_histogram_size; |
|||
set @histogram_type=@save_histogram_type; |
|||
set @use_stat_tables=@save_use_stat_tables; |
|||
set @@optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity; |
|||
|
|||
--echo # |
|||
--echo # End of 10.4 tests |
|||
--echo # |
Write
Preview
Loading…
Cancel
Save
Reference in new issue