mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Merge 10.3 into 10.4, except for MDEV-20265
The MDEV-20265 commit e746f451d5
introduces DBUG_ASSERT(right_op == r_tbl) in
st_select_lex::add_cross_joined_table(), and that assertion would
fail in several tests that exercise joins. That commit was skipped
in this merge, and a separate fix of MDEV-20265 will be necessary in 10.4.
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
--source include/have_stat_tables.inc
|
||||
--source include/have_sequence.inc
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists t0,t1,t2,t3;
|
||||
@ -1104,3 +1105,26 @@ set @@optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectiv
|
||||
drop table t1;
|
||||
drop function f1;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-19834 Selectivity of an equality condition discounted twice
|
||||
--echo #
|
||||
set @@optimizer_use_condition_selectivity=4;
|
||||
set @@use_stat_tables='preferably';
|
||||
create table t1 (a int, b int, key (b), key (a));
|
||||
insert into t1
|
||||
select (rand(1)*1000)/10, (rand(1001)*1000)/50 from seq_1_to_1000;
|
||||
analyze table t1 ;
|
||||
|
||||
--echo # Check what info the optimizer has about selectivities
|
||||
explain extended select * from t1 use index () where a in (17,51,5);
|
||||
explain extended select * from t1 use index () where b=2;
|
||||
|
||||
--echo # Now, the equality is used for ref access, while the range condition
|
||||
--echo # gives selectivity data
|
||||
explain extended select * from t1 where a in (17,51,5) and b=2;
|
||||
drop table t1;
|
||||
|
||||
set use_stat_tables= @save_use_stat_tables;
|
||||
set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity;
|
||||
--echo # End of 10.1 tests
|
||||
|
||||
|
Reference in New Issue
Block a user