diff options
Diffstat (limited to 'mysql-test/t/select.test')
-rw-r--r-- | mysql-test/t/select.test | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test index 96510bdcf7e..ab0487e6acf 100644 --- a/mysql-test/t/select.test +++ b/mysql-test/t/select.test @@ -4124,6 +4124,76 @@ SELECT 1 FROM t1 ORDER BY a COLLATE latin1_german2_ci; DROP TABLE t1; + +--echo # +--echo # Bug #58422: Incorrect result when OUTER JOIN'ing +--echo # with an empty table +--echo # + +CREATE TABLE t_empty(pk INT PRIMARY KEY, i INT) ENGINE = MYISAM; +CREATE TABLE t1(pk INT PRIMARY KEY, i INT) ENGINE = MYISAM; +INSERT INTO t1 VALUES (1,1), (2,2), (3,3); +CREATE TABLE t2(pk INT PRIMARY KEY, i INT) ENGINE = MYISAM; +INSERT INTO t2 VALUES (1,1), (2,2), (3,3); + +EXPLAIN +SELECT * + FROM + t1 + LEFT OUTER JOIN + (t2 INNER JOIN t_empty ON TRUE) + ON t1.pk=t2.pk + WHERE t2.pk <> 2; + +SELECT * + FROM + t1 + LEFT OUTER JOIN + (t2 INNER JOIN t_empty ON TRUE) + ON t1.pk=t2.pk + WHERE t2.pk <> 2; + + +EXPLAIN +SELECT * + FROM + t1 + LEFT OUTER JOIN + (t2 CROSS JOIN t_empty) + ON t1.pk=t2.pk + WHERE t2.pk <> 2; + +SELECT * + FROM + t1 + LEFT OUTER JOIN + (t2 CROSS JOIN t_empty) + ON t1.pk=t2.pk + WHERE t2.pk <> 2; + + +EXPLAIN +SELECT * + FROM + t1 + LEFT OUTER JOIN + (t2 INNER JOIN t_empty ON t_empty.i=t2.i) + ON t1.pk=t2.pk + WHERE t2.pk <> 2; + +SELECT * + FROM + t1 + LEFT OUTER JOIN + (t2 INNER JOIN t_empty ON t_empty.i=t2.i) + ON t1.pk=t2.pk + WHERE t2.pk <> 2; + + + +DROP TABLE t1,t2,t_empty; + + --echo End of 5.1 tests --echo # @@ -4148,3 +4218,22 @@ DROP VIEW view_t1; DROP TABLE t1; --echo # End of test BUG#54515 + +--echo # +--echo # Bug #57203 Assertion `field_length <= 255' failed. +--echo # + +SELECT coalesce((avg(distinct (geomfromtext("point(25379 -22010)"))))) +UNION ALL +SELECT coalesce((avg(distinct (geomfromtext("point(25379 -22010)"))))) +AS foo +; + +CREATE table t1(a text); +INSERT INTO t1 VALUES (''), (''); +SELECT avg(distinct(t1.a)) FROM t1, t1 t2 +GROUP BY t2.a ORDER BY t1.a; + +DROP TABLE t1; + +--echo # End of test BUG#57203 |