Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
22dae700
Commit
22dae700
authored
Feb 17, 2015
by
Sergei Petrunia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added testcase for MDEV-7193: Incorrect Query Result (MySQL Bug 68897) ...
parent
a06624d6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
84 additions
and
0 deletions
+84
-0
mysql-test/r/group_by_innodb.result
mysql-test/r/group_by_innodb.result
+44
-0
mysql-test/t/group_by_innodb.test
mysql-test/t/group_by_innodb.test
+40
-0
No files found.
mysql-test/r/group_by_innodb.result
View file @
22dae700
...
...
@@ -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
mysql-test/t/group_by_innodb.test
View file @
22dae700
...
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment