summaryrefslogtreecommitdiff
path: root/mysql-test/t/group_by_innodb.test
diff options
context:
space:
mode:
authorSergey Petrunya <psergey@askmonty.org>2015-01-25 16:16:25 +0100
committerSergey Petrunya <psergey@askmonty.org>2015-01-25 16:16:25 +0100
commitfb71449b10100e9a0f887b1585000fbfab294f3c (patch)
tree4af39c47d7a291b60721f6468648f49af0f5d85d /mysql-test/t/group_by_innodb.test
parentd1c4ff2b2cd54886087b6b879a6ea23f66d6582f (diff)
downloadmariadb-git-fb71449b10100e9a0f887b1585000fbfab294f3c.tar.gz
MDEV-5719: Wrong result with GROUP BY and LEFT OUTER JOINmariadb-10.0.16
Merged revision 5224 from mysql-5.6 and added a test case. .. revno: 5224 committer: Sergey Glukhov <sergey.glukhov@oracle.com> branch nick: mysql-5.6 timestamp: Wed 2013-06-19 14:24:08 +0400 message: Bug#16620047 INCORRECT QUERY RESULT (AFTER SERVER UPGRADE)
Diffstat (limited to 'mysql-test/t/group_by_innodb.test')
-rw-r--r--mysql-test/t/group_by_innodb.test19
1 files changed, 19 insertions, 0 deletions
diff --git a/mysql-test/t/group_by_innodb.test b/mysql-test/t/group_by_innodb.test
index df213cc189f..75ee3d0802a 100644
--- a/mysql-test/t/group_by_innodb.test
+++ b/mysql-test/t/group_by_innodb.test
@@ -67,3 +67,22 @@ DROP TABLE t1;
--echo End of 5.5 tests
+--echo #
+--echo # MDEV-5719: Wrong result with GROUP BY and LEFT OUTER JOIN
+--echo #
+CREATE TABLE t1 (oidGroup INT, oid INT PRIMARY KEY)ENGINE=INNODB;
+INSERT INTO t1 VALUES (1,1),(1,2),(1,3),(1,4);
+
+CREATE TABLE t2 (oid INT PRIMARY KEY)ENGINE=INNODB;
+INSERT INTO t2 VALUES (3);
+
+# Returns a value
+SELECT a.oidGroup, a.oid, b.oid FROM t1 a LEFT JOIN t2 b ON
+a.oid=b.oid WHERE a.oidGroup=1;
+
+SELECT a.oidGroup, a.oid, b.oid FROM t1 a LEFT JOIN t2 b ON
+a.oid=b.oid WHERE a.oidGroup=1 GROUP BY a.oid;
+
+DROP TABLE t1, t2;
+
+--echo # End of tests