1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Merge branch '10.11' into 11.2

This commit is contained in:
Oleksandr Byelkin
2024-10-29 16:39:47 +01:00
660 changed files with 8148 additions and 3604 deletions

View File

@ -205,10 +205,53 @@ set @trace=(select trace from information_schema.optimizer_trace);
--source include/optimizer_trace_no_costs.inc
select json_detailed(json_extract(@trace, '$**.join_limit_shortcut_choice')) as JS;
set optimizer_search_depth=@tmp_osd;
set optimizer_trace=@tmp_os;
--echo # An extra testcase for MDEV-35164 (its main testcase is below).
alter table t1 add unique key(col2);
insert into t10 select * from t10;
insert into t10 select * from t10;
analyze table t10;
--echo # This will not crash and also show that sorting is not done when
--echo # ORDER BY only refers to const table columns:
explain
select
*
from
t1
join t10 on t1.a=t10.a
join t11 on t1.b=t11.b
where
t1.col2=3
order by
t1.col1
limit 10;
drop table t1, t10, t11;
set optimizer_join_limit_pref_ratio=default;
--echo #
--echo # MDEV-35072: Assertion failure with optimizer_join_limit_pref_ratio and 1-table select
--echo #
SET optimizer_join_limit_pref_ratio=1;
CREATE TABLE t1 (c1 INT, INDEX(c1));
INSERT INTO t1 VALUES (1),(2);
SELECT * FROM t1 ORDER BY c1 LIMIT 1;
DROP TABLE t1;
--echo #
--echo # MDEV-35164: optimizer_join_limit_pref_ratio: assertion when the ORDER BY table becomes constant
--echo # Original testcase:
--echo #
SET optimizer_join_limit_pref_ratio=1;
CREATE TABLE t1 (a INT KEY,b INT, KEY(b)) ;
INSERT INTO t1 VALUES (2,NULL);
INSERT INTO t1 VALUES (5,NULL);
SELECT * FROM t1 NATURAL JOIN t1 AS t2 WHERE t1.b=NULL ORDER BY t1.a LIMIT 1;
DROP TABLE t1;
set optimizer_join_limit_pref_ratio=default;
--echo #
--echo # MDEV-35072: Assertion failure with optimizer_join_limit_pref_ratio and 1-table select