1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

Merge 10.11 into 11.0

This commit is contained in:
Marko Mäkelä
2024-03-28 10:51:36 +02:00
490 changed files with 14843 additions and 4704 deletions

View File

@ -894,7 +894,7 @@ show status like 'Last_query_cost';
Variable_name Value
Last_query_cost 0.011600
select 'The cost of accessing t1 (dont care if it changes' '^';
The cost of accessing t1 (dont care if it changes
The cost of accessing t1 (dont care if it changes^
The cost of accessing t1 (dont care if it changes^
select 'vv: Following query must use ALL(t1), eq_ref(A), eq_ref(B): vv' Z;
Z
@ -3435,6 +3435,62 @@ SELECT COUNT(*) FROM t1 LEFT JOIN (t2 LEFT JOIN t3 ON t2.b = t3.c) ON t1.a = t2.
COUNT(*)
2
DROP TABLE t1, t2, t3;
#
# MDEV-30975: Wrong result with cross Join given join order
#
CREATE TABLE `t1` (
`t1_seq` INT NOT NULL,
`c1` VARCHAR(10) NOT NULL ,
PRIMARY KEY (`t1_seq`) USING BTREE
);
CREATE TABLE `t2` (
`t2_seq` INT NOT NULL,
`t1_seq` INT NOT NULL,
`c2` VARCHAR(10) NOT NULL ,
PRIMARY KEY (`t2_seq`, `t1_seq`) USING BTREE
);
INSERT INTO t1 VALUES(1, 'A');
INSERT INTO t2 VALUES(1, 1, 'T2-1-1');
INSERT INTO t2 VALUES(2, 1, 'T2-1-2');
INSERT INTO t2 VALUES(3, 1, 'T2-1-3');
SELECT LPAD(@rownum := @rownum + 1, 8, 0) AS str_num
, t1.t1_seq
, t2.t2_seq
, t1.c1
, t2.c2
FROM t1
INNER JOIN t2 ON (t1.t1_seq = t2.t1_seq)
CROSS JOIN ( SELECT @rownum := 0 ) X;
str_num t1_seq t2_seq c1 c2
00000001 1 1 A T2-1-1
00000002 1 2 A T2-1-2
00000003 1 3 A T2-1-3
SELECT STRAIGHT_JOIN LPAD(@rownum := @rownum + 1, 8, 0) AS str_num
, t1.t1_seq
, t2.t2_seq
, t1.c1
, t2.c2
FROM t1
INNER JOIN t2 ON (t1.t1_seq = t2.t1_seq)
CROSS JOIN ( SELECT @rownum := 0 ) X;
str_num t1_seq t2_seq c1 c2
00000001 1 1 A T2-1-1
00000002 1 2 A T2-1-2
00000003 1 3 A T2-1-3
SELECT STRAIGHT_JOIN * FROM t1 JOIN t2 ON (t1.t1_seq = t2.t1_seq) JOIN (SELECT @a := 0) x;
t1_seq c1 t2_seq t1_seq c2 @a := 0
1 A 1 1 T2-1-1 0
1 A 2 1 T2-1-2 0
1 A 3 1 T2-1-3 0
SELECT * FROM t1 JOIN t2 ON (t1.t1_seq = t2.t1_seq) JOIN (SELECT @a := 0) x;
t1_seq c1 t2_seq t1_seq c2 @a := 0
1 A 1 1 T2-1-1 0
1 A 2 1 T2-1-2 0
1 A 3 1 T2-1-3 0
SELECT STRAIGHT_JOIN c1 FROM t1 JOIN (SELECT @a := 0) x;
c1
A
DROP TABLE t1, t2;
# End of 10.5 tests
#
# MDEV-31449: Assertion s->table->opt_range_condition_rows <= s->found_records