[Commits] 22dae70: Added testcase for MDEV-7193: Incorrect Query Result (MySQL Bug 68897) ...

Sergei Petrunia psergey at askmonty.org
Tue Feb 17 19:07:13 EET 2015


revision-id: 22dae70015bd9666a0278e908d023aa23fc3215b
parent(s): a06624d61f36c70edd63adcfe2803bb7a8564de5
committer: Sergei Petrunia
branch nick: 10.0
timestamp: 2015-02-17 20:07:12 +0300
message:

Added testcase for MDEV-7193: Incorrect Query Result (MySQL Bug 68897) ...

---
 mysql-test/r/group_by_innodb.result |   44 +++++++++++++++++++++++++++++++++++
 mysql-test/t/group_by_innodb.test   |   40 +++++++++++++++++++++++++++++++
 2 files changed, 84 insertions(+)

diff --git a/mysql-test/r/group_by_innodb.result b/mysql-test/r/group_by_innodb.result
index 1098579..381e0d7 100644
--- a/mysql-test/r/group_by_innodb.result
+++ b/mysql-test/r/group_by_innodb.result
@@ -79,4 +79,48 @@ oidGroup	oid	oid
 1	3	3
 1	4	NULL
 DROP TABLE t1, t2;
+#
+# MDEV-7193: Incorrect Query Result (MySQL Bug 68897) in MariaDB 10.0.14
+# (fixed by MDEV-5719)
+#
+CREATE TABLE  `t1` (
+`param` int(11) NOT NULL,
+`idx` int(11) NOT NULL,
+`text` varchar(255) default NULL,
+PRIMARY KEY  (`param`,`idx`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+INSERT INTO `t1` (`param`, `idx`, `text`) VALUES
+(1, 0, 'select'),
+(1, 1, 'Kabel mit Stecker 5-polig'),
+(1, 2, 'Kabel ohne Stecker'),
+(2, 0, 'number'),
+(2, 1, '22'),
+(2, 2, '25');
+CREATE TABLE `t2` (
+`id` int PRIMARY KEY
+);
+INSERT INTO t2 VALUES (1),(2),(3),(4);
+SELECT t2.id AS id, T.text AS xtext,GROUP_CONCAT(T3.text) AS optionen
+FROM t2
+LEFT JOIN t1 AS T  ON(T.param=t2.id AND T.idx=0 )
+LEFT JOIN t1 AS T3 ON(T3.param=t2.id AND T3.idx>0 ) 
+GROUP BY t2.id
+ORDER BY id ASC;
+id	xtext	optionen
+1	select	Kabel mit Stecker 5-polig,Kabel ohne Stecker
+2	number	22,25
+3	NULL	NULL
+4	NULL	NULL
+SELECT t2.id AS id, T.text AS xtext,GROUP_CONCAT(T3.text) AS optionen
+FROM t2
+LEFT JOIN t1 AS T  ON(T.param=t2.id AND T.idx=0 )
+LEFT JOIN t1 AS T3 ON(T3.param=t2.id AND T3.idx>0 ) 
+GROUP BY t2.id
+ORDER BY id DESC;
+id	xtext	optionen
+4	NULL	NULL
+3	NULL	NULL
+2	number	22,25
+1	select	Kabel mit Stecker 5-polig,Kabel ohne Stecker
+DROP TABLE t1, t2;
 # End of tests
diff --git a/mysql-test/t/group_by_innodb.test b/mysql-test/t/group_by_innodb.test
index 75ee3d0..e072a94 100644
--- a/mysql-test/t/group_by_innodb.test
+++ b/mysql-test/t/group_by_innodb.test
@@ -85,4 +85,44 @@ a.oid=b.oid WHERE a.oidGroup=1 GROUP BY a.oid;
 
 DROP TABLE t1, t2;
 
+--echo #
+--echo # MDEV-7193: Incorrect Query Result (MySQL Bug 68897) in MariaDB 10.0.14
+--echo # (fixed by MDEV-5719)
+--echo #
+
+CREATE TABLE  `t1` (
+  `param` int(11) NOT NULL,
+  `idx` int(11) NOT NULL,
+  `text` varchar(255) default NULL,
+  PRIMARY KEY  (`param`,`idx`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+INSERT INTO `t1` (`param`, `idx`, `text`) VALUES
+(1, 0, 'select'),
+(1, 1, 'Kabel mit Stecker 5-polig'),
+(1, 2, 'Kabel ohne Stecker'),
+(2, 0, 'number'),
+(2, 1, '22'),
+(2, 2, '25');
+CREATE TABLE `t2` (
+  `id` int PRIMARY KEY
+);
+
+INSERT INTO t2 VALUES (1),(2),(3),(4);
+SELECT t2.id AS id, T.text AS xtext,GROUP_CONCAT(T3.text) AS optionen
+FROM t2
+LEFT JOIN t1 AS T  ON(T.param=t2.id AND T.idx=0 )
+LEFT JOIN t1 AS T3 ON(T3.param=t2.id AND T3.idx>0 ) 
+GROUP BY t2.id
+ORDER BY id ASC;
+
+SELECT t2.id AS id, T.text AS xtext,GROUP_CONCAT(T3.text) AS optionen
+FROM t2
+LEFT JOIN t1 AS T  ON(T.param=t2.id AND T.idx=0 )
+LEFT JOIN t1 AS T3 ON(T3.param=t2.id AND T3.idx>0 ) 
+GROUP BY t2.id
+ORDER BY id DESC;
+
+DROP TABLE t1, t2;
+
 --echo # End of tests


More information about the commits mailing list