mirror of
https://github.com/MariaDB/server.git
synced 2026-04-22 08:15:31 +02:00
Fixed crashing bug in GROUP_CONCAT with ROLLUP
Fixed MDEV-4002: Server crash or valgrind errors in Item_func_group_concat::setup and Item_func_group_concat::add mysql-test/r/group_by.result: Added test case for failing GROUP_CONCAT ... ROLLUP queries mysql-test/t/group_by.test: Added test case for failing GROUP_CONCAT ... ROLLUP queries sql/item_sum.cc: Fixed issue where field->table pointed to different temporary table than expected. Ensure that order->next points to the right object (could cause problems with setup_order())
This commit is contained in:
parent
5f68820cd4
commit
9684140f02
3 changed files with 108 additions and 9 deletions
|
|
@ -2160,3 +2160,48 @@ f1 MIN(f2) MAX(f2)
|
|||
4 00:25:00 00:25:00
|
||||
DROP TABLE t1;
|
||||
#End of test#49771
|
||||
#
|
||||
# Test of bug in GROUP_CONCAT with ROLLUP
|
||||
#
|
||||
CREATE TABLE t1 ( b VARCHAR(8) NOT NULL, a INT NOT NULL ) ENGINE=MyISAM;
|
||||
INSERT INTO t1 (a,b) VALUES (1,'c'),(2,'v');
|
||||
CREATE TABLE t2 ( c VARCHAR(8), d INT, KEY (c, d) ) ENGINE=MyISAM;
|
||||
INSERT INTO t2 VALUES ('v',6),('c',4),('v',3);
|
||||
SELECT b, GROUP_CONCAT( a, b ORDER BY a, b )
|
||||
FROM t1 JOIN t2 ON c = b GROUP BY b;
|
||||
b GROUP_CONCAT( a, b ORDER BY a, b )
|
||||
c 1c
|
||||
v 2v,2v
|
||||
SELECT b, GROUP_CONCAT( a, b ORDER BY a, b )
|
||||
FROM t1 JOIN t2 ON c = b GROUP BY b WITH ROLLUP;
|
||||
b GROUP_CONCAT( a, b ORDER BY a, b )
|
||||
c 1c
|
||||
v 2v,2v
|
||||
NULL 1c,2v,2v
|
||||
DROP TABLE t1,t2;
|
||||
#
|
||||
# Test of MDEV-4002
|
||||
#
|
||||
CREATE TABLE t1 (
|
||||
pk INT NOT NULL PRIMARY KEY,
|
||||
d1 DOUBLE,
|
||||
d2 DOUBLE,
|
||||
i INT NOT NULL DEFAULT '0',
|
||||
KEY (i)
|
||||
) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (1,1.0,1.1,1),(2,2.0,2.2,2);
|
||||
PREPARE stmt FROM "
|
||||
SELECT DISTINCT i, GROUP_CONCAT( d1, d2 ORDER BY d1, d2 )
|
||||
FROM t1 a1 NATURAL JOIN t1 a2 GROUP BY i WITH ROLLUP
|
||||
";
|
||||
EXECUTE stmt;
|
||||
i GROUP_CONCAT( d1, d2 ORDER BY d1, d2 )
|
||||
1 11.1
|
||||
2 22.2
|
||||
NULL 11.1,22.2
|
||||
EXECUTE stmt;
|
||||
i GROUP_CONCAT( d1, d2 ORDER BY d1, d2 )
|
||||
1 11.1
|
||||
2 22.2
|
||||
NULL 11.1,22.2
|
||||
DROP TABLE t1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue