mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Merge branch '10.6' into 10.11
This commit is contained in:
@@ -3330,4 +3330,33 @@ a
|
||||
2
|
||||
DEALLOCATE PREPARE stmt;
|
||||
DROP TABLE t1,t2,t3;
|
||||
#
|
||||
# MDEV-33747: Optimization of (SELECT) IN (SELECT ...) executes subquery at prepare stage
|
||||
#
|
||||
create table t1 (a int, b int);
|
||||
insert into t1 select seq, seq from seq_1_to_200;
|
||||
create table t2 as select * from t1;
|
||||
create table t3 as select * from t1;
|
||||
analyze table t1,t2,t3;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 analyze status Engine-independent statistics collected
|
||||
test.t1 analyze status OK
|
||||
test.t2 analyze status Engine-independent statistics collected
|
||||
test.t2 analyze status OK
|
||||
test.t3 analyze status Engine-independent statistics collected
|
||||
test.t3 analyze status OK
|
||||
select @@expensive_subquery_limit < 200 as DEFAULTS_ARE_SUITABLE;
|
||||
DEFAULTS_ARE_SUITABLE
|
||||
1
|
||||
flush status;
|
||||
explain select * from t1 where a<3 or (select max(a) from t2) in (select b from t3);
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY t1 ALL NULL NULL NULL NULL 200 Using where
|
||||
3 SUBQUERY t3 ALL NULL NULL NULL NULL 200 Using where
|
||||
2 SUBQUERY t2 ALL NULL NULL NULL NULL 200
|
||||
# Must show 0. If this shows 200, this means subquery was executed and you have a bug:
|
||||
show status like 'Handler_read_rnd_next%';
|
||||
Variable_name Value
|
||||
Handler_read_rnd_next 0
|
||||
drop table t1,t2,t3;
|
||||
# End of 10.4 tests
|
||||
|
Reference in New Issue
Block a user