summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorMichael Widenius <monty@askmonty.org>2012-01-04 17:22:06 +0200
committerMichael Widenius <monty@askmonty.org>2012-01-04 17:22:06 +0200
commit98135fed0ff9c354d48ddd53fae4b8d4e289a11c (patch)
tree8467fff60737aab9edb8d561c3ff0c288df5d2bb /mysql-test
parenta0afa025a3f949efe0f414c2bf562139c4069f88 (diff)
parent74fdbec68e81fb30a82ab5f9ff66b748d506f909 (diff)
downloadmariadb-git-98135fed0ff9c354d48ddd53fae4b8d4e289a11c.tar.gz
Merge with 5.1
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/join_outer_innodb.result8
-rw-r--r--mysql-test/t/join_outer_innodb.test15
2 files changed, 23 insertions, 0 deletions
diff --git a/mysql-test/r/join_outer_innodb.result b/mysql-test/r/join_outer_innodb.result
index e8a2d6f668b..c8bc9758408 100644
--- a/mysql-test/r/join_outer_innodb.result
+++ b/mysql-test/r/join_outer_innodb.result
@@ -17,3 +17,11 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 index NULL fkey 5 NULL 5 Using index
1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t2.fkey 1 Using where
DROP TABLE t1,t2;
+CREATE TABLE t1(a int, b int, KEY (a), PRIMARY KEY (b)) ENGINE=InnoDB;
+CREATE TABLE t2 (b int, PRIMARY KEY (b));
+INSERT INTO t2 VALUES (4),(9);
+SELECT STRAIGHT_JOIN t1.a FROM t1 RIGHT JOIN t2 ON t1.b = t2.b
+WHERE (t1.b NOT BETWEEN 1 AND 7 OR t1.a IS NULL AND t1.b = t2.b) AND t2.b = 4
+GROUP BY 1;
+a
+DROP TABLE t1,t2;
diff --git a/mysql-test/t/join_outer_innodb.test b/mysql-test/t/join_outer_innodb.test
index 40add7f488f..565bb72b152 100644
--- a/mysql-test/t/join_outer_innodb.test
+++ b/mysql-test/t/join_outer_innodb.test
@@ -24,3 +24,18 @@ SELECT COUNT(*) FROM t2 LEFT JOIN t1 ON t2.fkey = t1.id
WHERE t1.name LIKE 'A%' OR FALSE;
DROP TABLE t1,t2;
+
+#
+# Bug #848652: crash with RIGHT JOIN and GROUP BY
+#
+
+CREATE TABLE t1(a int, b int, KEY (a), PRIMARY KEY (b)) ENGINE=InnoDB;
+
+CREATE TABLE t2 (b int, PRIMARY KEY (b));
+INSERT INTO t2 VALUES (4),(9);
+
+SELECT STRAIGHT_JOIN t1.a FROM t1 RIGHT JOIN t2 ON t1.b = t2.b
+ WHERE (t1.b NOT BETWEEN 1 AND 7 OR t1.a IS NULL AND t1.b = t2.b) AND t2.b = 4
+GROUP BY 1;
+
+DROP TABLE t1,t2;