Bug #22015 | nested group_concat in subselect results in server crash | ||
---|---|---|---|
Submitted: | 5 Sep 2006 12:24 | Modified: | 4 Oct 2006 19:27 |
Reporter: | Jochen Wersdörfer | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server | Severity: | S1 (Critical) |
Version: | mysql-debug-5.0.24a-linux-i686-icc-glibc | OS: | Linux (Debian-GNU/Linux 2.6.16-2-k7) |
Assigned to: | Igor Babaev | CPU Architecture: | Any |
Tags: | group_concat, subselect |
[5 Sep 2006 12:24]
Jochen Wersdörfer
[5 Sep 2006 12:56]
Valeriy Kravchuk
Thank you for a bug report. Verified just as described with 5.0.25-BK (ChangeSet@1.2258, 2006-09-04 11:45:43+02:00) on Linux: openxs@suse:~/dbs/5.0> bin/mysql -uroot test Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1 to server version: 5.0.25-debug Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> drop table t; Query OK, 0 rows affected (0.02 sec) mysql> CREATE TABLE `t` ( -> `a` int(10) unsigned NOT NULL default '0', -> `b` int(10) unsigned NOT NULL default '0' -> ) ENGINE=MyISAM DEFAULT CHARSET=utf8; Query OK, 0 rows affected (0.01 sec) mysql> mysql> insert into t (a, b) values (2, 1), (1, 2); Query OK, 2 rows affected (0.02 sec) Records: 2 Duplicates: 0 Warnings: 0 mysql> select group_concat(a), x from -> (select a, group_concat(b) x -> from t group by a -> ) as s -> group by x; ERROR 2013 (HY000): Lost connection to MySQL server during query mysql> Number of processes running now: 0 060905 14:50:18 mysqld restarted
[19 Sep 2006 16:51]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/12220 ChangeSet@1.2273, 2006-09-19 09:45:41-07:00, igor@rurik.mysql.com +3 -0 Fixed bug #22015: crash with GROUP_CONCAT over a derived table that returns the results of aggregation by GROUP_CONCAT. The crash was due to an overflow happened for the field sortoder->length. The fix prevents this overflow exploiting the fact that the value of sortoder->length cannot be greater than the value of thd->variables.max_sort_length.
[20 Sep 2006 18:27]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/12282 ChangeSet@1.2275, 2006-09-20 08:08:57-07:00, igor@rurik.mysql.com +3 -0 Fixed bug #22015: crash with GROUP_CONCAT over a derived table that returns the results of aggregation by GROUP_CONCAT. The crash was due to an overflow happened for the field sortoder->length. The fix prevents this overflow exploiting the fact that the value of sortoder->length cannot be greater than the value of thd->variables.max_sort_length.
[1 Oct 2006 9:00]
Georgi Kodinov
Pushed in 5.0.26/5.1.12
[4 Oct 2006 19:27]
Paul DuBois
Noted in 5.0.26, 5.1.12 changelogs.
[13 Jul 2012 10:03]
Geoff Winkless
For what it's worth you can workaround this bug on legacy installations - replace the GROUP BY with a calculated field - I use LEFT, with MD5 just in case the string is longer than the LEFT value, eg: SELECT GROUP_CONCAT(a), x from ( SELECT a, GROUP_CONCAT(b) AS x FROM t GROUP BY a ) AS s GROUP BY LEFT(x, 10000), MD5(x); Tested working on a legacy 5.0.19 system.