mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
a fix
(Bug #4035 GROUP_CONCAT with HAVING clause truncates field Bug #4057 LEFT() function in HAVING clause truncates query result).
This commit is contained in:
@@ -189,3 +189,15 @@ INSERT INTO t1 VALUES (1), (2);
|
||||
INSERT INTO t2 VALUES (1), (2);
|
||||
SELECT GROUP_CONCAT(t1.a*t2.a ORDER BY t2.a) FROM t1, t2 GROUP BY t1.a;
|
||||
DROP TABLE t1, t2;
|
||||
|
||||
#
|
||||
# Bug #4035: group_concat() and HAVING
|
||||
#
|
||||
|
||||
CREATE TABLE t1 (a char(4));
|
||||
INSERT INTO t1 VALUES ('John'), ('Anna'), ('Bill');
|
||||
SELECT GROUP_CONCAT(a SEPARATOR '||') AS names FROM t1
|
||||
HAVING names LIKE '%An%';
|
||||
SELECT GROUP_CONCAT(a SEPARATOR '###') AS names FROM t1
|
||||
HAVING LEFT(names, 1) ='J';
|
||||
DROP TABLE t1;
|
||||
|
||||
Reference in New Issue
Block a user