summaryrefslogtreecommitdiff
path: root/mysql-test/t/join_outer.test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/t/join_outer.test')
-rw-r--r--mysql-test/t/join_outer.test48
1 files changed, 48 insertions, 0 deletions
diff --git a/mysql-test/t/join_outer.test b/mysql-test/t/join_outer.test
index 44f4afd451b..24885c056b8 100644
--- a/mysql-test/t/join_outer.test
+++ b/mysql-test/t/join_outer.test
@@ -1439,6 +1439,37 @@ GROUP BY t2.f1, t2.f2;
DROP TABLE t1,t2;
+--echo #
+--echo # Bug#13068506 - QUERY WITH GROUP BY ON NON-AGGR COLUMN RETURNS
+--echo # WRONG RESULT
+--echo #
+
+CREATE TABLE t1 (i1 int);
+INSERT INTO t1 VALUES (100), (101);
+
+CREATE TABLE t2 (i2 int, i3 int);
+INSERT INTO t2 VALUES (20,1),(10,2);
+
+CREATE TABLE t3 (i4 int(11));
+INSERT INTO t3 VALUES (1),(2);
+
+let $query= SELECT (
+ SELECT MAX( t2.i2 )
+ FROM t3 RIGHT JOIN t2 ON ( t2.i3 = 2 )
+ WHERE t2.i3 <> t1.i1
+) AS field1
+FROM t1;
+
+--echo
+--eval $query;
+--echo
+--eval $query GROUP BY field1;
+
+--echo
+drop table t1,t2,t3;
+
+--echo # End of test for Bug#13068506
+
--echo End of 5.1 tests
--echo #
@@ -1622,4 +1653,21 @@ ORDER BY t1.b;
DROP TABLE t1,t2;
+--echo #
+--echo # Bug mdev-4336: LEFT JOIN with disjunctive
+--echo # <non-nullable datetime field> IS NULL in WHERE
+--echo # causes a hang and eventual crash
+--echo #
+
+CREATE TABLE t1 (
+ id int(11) NOT NULL,
+ modified datetime NOT NULL,
+ PRIMARY KEY (id)
+);
+
+SELECT a.* FROM t1 a LEFT JOIN t1 b ON a.id = b.id
+ WHERE a.modified > b.modified or b.modified IS NULL;
+
+DROP TABLE t1;
+
SET optimizer_switch=@save_optimizer_switch;