summaryrefslogtreecommitdiffstats
path: root/mysql-test/main/join.result
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-18 13:22:53 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-18 13:22:53 +0000
commit347c164c35eddab388009470e6848cb361ac93f8 (patch)
tree2c0c44eac690f510bb0a35b2a13b36d606b77b6b /mysql-test/main/join.result
parentReleasing progress-linux version 1:10.11.7-4~progress7.99u1. (diff)
downloadmariadb-347c164c35eddab388009470e6848cb361ac93f8.tar.xz
mariadb-347c164c35eddab388009470e6848cb361ac93f8.zip
Merging upstream version 1:10.11.8.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'mysql-test/main/join.result')
-rw-r--r--mysql-test/main/join.result58
1 files changed, 57 insertions, 1 deletions
diff --git a/mysql-test/main/join.result b/mysql-test/main/join.result
index fe195cd8..b5789142 100644
--- a/mysql-test/main/join.result
+++ b/mysql-test/main/join.result
@@ -894,7 +894,7 @@ show status like 'Last_query_cost';
Variable_name Value
Last_query_cost 4.016090
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
@@ -3423,6 +3423,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