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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
c00605c6
Commit
c00605c6
authored
May 01, 2008
by
gkodinov/kgeorge@magare.gmz
Browse files
Options
Browse Files
Download
Plain Diff
Merge magare.gmz:/home/kgeorge/mysql/work/B35298-5.0-bugteam
into magare.gmz:/home/kgeorge/mysql/work/B35298-5.1-bugteam
parents
e24f509d
e22ef242
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
63 additions
and
1 deletion
+63
-1
mysql-test/r/func_gconcat.result
mysql-test/r/func_gconcat.result
+26
-0
mysql-test/t/func_gconcat.test
mysql-test/t/func_gconcat.test
+36
-0
sql/item_sum.cc
sql/item_sum.cc
+1
-1
No files found.
mysql-test/r/func_gconcat.result
View file @
c00605c6
...
@@ -952,4 +952,30 @@ GROUP BY 1
...
@@ -952,4 +952,30 @@ GROUP BY 1
d1
d1
NULL
NULL
DROP TABLE t1;
DROP TABLE t1;
CREATE TABLE t1 (a INT);
CREATE TABLE t2 (a INT);
INSERT INTO t1 VALUES(1);
SELECT GROUP_CONCAT(DISTINCT t2.a) FROM t1 LEFT JOIN t2 ON t2.a = t1.a GROUP BY t1.a;
GROUP_CONCAT(DISTINCT t2.a)
NULL
DROP TABLE t1, t2;
CREATE TABLE t1 (a INT, KEY(a));
CREATE TABLE t2 (b INT);
INSERT INTO t1 VALUES (NULL), (8), (2);
INSERT INTO t2 VALUES (4), (10);
SELECT 1 FROM t1 WHERE t1.a NOT IN
(
SELECT GROUP_CONCAT(DISTINCT t1.a)
FROM t1 WHERE t1.a IN
(
SELECT b FROM t2
)
AND NOT t1.a >= (SELECT t1.a FROM t1 LIMIT 1)
GROUP BY t1.a
);
1
1
1
1
DROP TABLE t1, t2;
End of 5.0 tests
End of 5.0 tests
mysql-test/t/func_gconcat.test
View file @
c00605c6
...
@@ -657,4 +657,40 @@ SELECT s1.d1 FROM
...
@@ -657,4 +657,40 @@ SELECT s1.d1 FROM
)
AS
s1
;
)
AS
s1
;
DROP
TABLE
t1
;
DROP
TABLE
t1
;
#
# Bug #35298: GROUP_CONCAT with DISTINCT can crash the server
#
CREATE
TABLE
t1
(
a
INT
);
CREATE
TABLE
t2
(
a
INT
);
INSERT
INTO
t1
VALUES
(
1
);
SELECT
GROUP_CONCAT
(
DISTINCT
t2
.
a
)
FROM
t1
LEFT
JOIN
t2
ON
t2
.
a
=
t1
.
a
GROUP
BY
t1
.
a
;
DROP
TABLE
t1
,
t2
;
#
# Bug #36024: group_concat distinct in subquery crash
#
CREATE
TABLE
t1
(
a
INT
,
KEY
(
a
));
CREATE
TABLE
t2
(
b
INT
);
INSERT
INTO
t1
VALUES
(
NULL
),
(
8
),
(
2
);
INSERT
INTO
t2
VALUES
(
4
),
(
10
);
SELECT
1
FROM
t1
WHERE
t1
.
a
NOT
IN
(
SELECT
GROUP_CONCAT
(
DISTINCT
t1
.
a
)
FROM
t1
WHERE
t1
.
a
IN
(
SELECT
b
FROM
t2
)
AND
NOT
t1
.
a
>=
(
SELECT
t1
.
a
FROM
t1
LIMIT
1
)
GROUP
BY
t1
.
a
);
DROP
TABLE
t1
,
t2
;
--
echo
End
of
5.0
tests
--
echo
End
of
5.0
tests
sql/item_sum.cc
View file @
c00605c6
...
@@ -3256,7 +3256,7 @@ void Item_func_group_concat::clear()
...
@@ -3256,7 +3256,7 @@ void Item_func_group_concat::clear()
no_appended
=
TRUE
;
no_appended
=
TRUE
;
if
(
tree
)
if
(
tree
)
reset_tree
(
tree
);
reset_tree
(
tree
);
if
(
distinct
)
if
(
unique_filter
)
unique_filter
->
reset
();
unique_filter
->
reset
();
/* No need to reset the table as we never call write_row */
/* No need to reset the table as we never call write_row */
}
}
...
...
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