summaryrefslogtreecommitdiff
path: root/mysql-test/r/join_outer.result
diff options
context:
space:
mode:
authorunknown <igor@rurik.mysql.com>2004-10-04 22:26:36 -0700
committerunknown <igor@rurik.mysql.com>2004-10-04 22:26:36 -0700
commitdc25de58e58bf64c82e290b5c625fb68caa82953 (patch)
treec47a3c7624dcde60e441e64b81dc6251c6491495 /mysql-test/r/join_outer.result
parent2f9c7c0b09fd652b1e3523c46973371743782380 (diff)
downloadmariadb-git-dc25de58e58bf64c82e290b5c625fb68caa82953.tar.gz
join_outer.result, join_outer.test:
Added a test case for bug #5896. sql_select.cc: Fixed the problem of ignoring on expressions depending only on outer table when outer table either contains 1 row or is guaranteed to return only 1 row (bug #5896). sql/sql_select.cc: Fixed the problem of ignoring on expressions depending only on outer tables when outer tables either contained 1 row or is guaranteed to return not more than 1 row. (bug #5896). mysql-test/t/join_outer.test: Added a test case for bug #5896. mysql-test/r/join_outer.result: Added a test case for bug #5896.
Diffstat (limited to 'mysql-test/r/join_outer.result')
-rw-r--r--mysql-test/r/join_outer.result46
1 files changed, 45 insertions, 1 deletions
diff --git a/mysql-test/r/join_outer.result b/mysql-test/r/join_outer.result
index 6bafe533fac..35226c56dab 100644
--- a/mysql-test/r/join_outer.result
+++ b/mysql-test/r/join_outer.result
@@ -1,4 +1,4 @@
-drop table if exists t1,t2,t3,t4,t5;
+drop table if exists t0,t1,t2,t3,t4,t5;
CREATE TABLE t1 (
grp int(11) default NULL,
a bigint(20) unsigned default NULL,
@@ -745,3 +745,47 @@ player_id match_1_h * match_id home UUX
7 4 * 1 2 2
3 3 * 1 2 1
drop table t1, t2;
+CREATE TABLE t0 (a0 int PRIMARY KEY);
+CREATE TABLE t1 (a1 int PRIMARY KEY);
+CREATE TABLE t2 (a2 int);
+CREATE TABLE t3 (a3 int);
+INSERT INTO t0 VALUES (1);
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (1), (2);
+INSERT INTO t3 VALUES (1), (2);
+SELECT * FROM t1 LEFT JOIN t2 ON a1=0;
+a1 a2
+1 NULL
+EXPLAIN SELECT * FROM t1 LEFT JOIN t2 ON a1=0;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 system NULL NULL NULL NULL 1
+1 SIMPLE t2 ALL NULL NULL NULL NULL 2
+SELECT * FROM t1 LEFT JOIN (t2,t3) ON a1=0;
+a1 a2 a3
+1 NULL NULL
+EXPLAIN SELECT * FROM t1 LEFT JOIN (t2,t3) ON a1=0;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 system NULL NULL NULL NULL 1
+1 SIMPLE t2 ALL NULL NULL NULL NULL 2
+1 SIMPLE t3 ALL NULL NULL NULL NULL 2
+SELECT * FROM t0, t1 LEFT JOIN (t2,t3) ON a1=0 WHERE a0=a1;
+a0 a1 a2 a3
+1 1 NULL NULL
+EXPLAIN SELECT * FROM t0, t1 LEFT JOIN (t2,t3) ON a1=0 WHERE a0=a1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t0 system PRIMARY NULL NULL NULL 1
+1 SIMPLE t1 system PRIMARY NULL NULL NULL 1
+1 SIMPLE t2 ALL NULL NULL NULL NULL 2
+1 SIMPLE t3 ALL NULL NULL NULL NULL 2
+INSERT INTO t0 VALUES (0);
+INSERT INTO t1 VALUES (0);
+SELECT * FROM t0, t1 LEFT JOIN (t2,t3) ON a1=5 WHERE a0=a1 AND a0=1;
+a0 a1 a2 a3
+1 1 NULL NULL
+EXPLAIN SELECT * FROM t0, t1 LEFT JOIN (t2,t3) ON a1=5 WHERE a0=a1 AND a0=1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t0 const PRIMARY PRIMARY 4 const 1 Using index
+1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1 Using index
+1 SIMPLE t2 ALL NULL NULL NULL NULL 2
+1 SIMPLE t3 ALL NULL NULL NULL NULL 2
+DROP TABLE t0,t1,t2,t3;