Bug #27229 | crash/incorrect result in subquery with aggregate(outer_column) (debug server) | ||
---|---|---|---|
Submitted: | 16 Mar 2007 21:25 | Modified: | 11 Apr 2007 1:59 |
Reporter: | Martin Friebe (Gold Quality Contributor) (OCA) | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server | Severity: | S3 (Non-critical) |
Version: | 5.0.38/5.1BK | OS: | FreeBSD (freebsd) |
Assigned to: | Igor Babaev | CPU Architecture: | Any |
Tags: | aggrecate, crash, group_concat, qc, suquery |
[16 Mar 2007 21:25]
Martin Friebe
[16 Mar 2007 21:38]
Martin Friebe
sorry wrong copy and paste. version 5.x only
[16 Mar 2007 23:25]
MySQL Verification Team
Thank you for the bug report. [New Thread -1257030752 (LWP 4873)] 070316 20:12:10 [Note] /home/miguel/dbs/5.0/libexec/mysqld: ready for connections. Version: '5.0.38-debug' socket: '/tmp/mysql.sock' port: 3306 Source distribution [New Thread -1257231456 (LWP 4879)] mysqld: item_sum.cc:2934: int dump_leaf_key(byte*, element_count, Item_func_group_concat*): Assertion `offset < table->s->reclength' failed. Program received signal SIGABRT, Aborted. [Switching to Thread -1257231456 (LWP 4879)] 0xffffe410 in __kernel_vsyscall () (gdb) bt full #0 0xffffe410 in __kernel_vsyscall () No symbol table info available. #1 0xb7d7d770 in raise () from /lib/tls/i686/cmov/libc.so.6 No symbol table info available. #2 0xb7d7eef3 in abort () from /lib/tls/i686/cmov/libc.so.6 No symbol table info available. #3 0xb7d76dbb in __assert_fail () from /lib/tls/i686/cmov/libc.so.6 No symbol table info available. The Windows version doesn't crash on my side: mysql> #Crash mysql> select count(*) c, a, -> ( select group_concat(count(a)) from t2 where m = a ) -> from t1 group by a; # crash +---+------+-------------------------------------------------------+ | c | a | ( select group_concat(count(a)) from t2 where m = a ) | +---+------+-------------------------------------------------------+ | 2 | 2 | -7531142204535799277 | | 3 | 3 | -7531142204535799277 | | 1 | 4 | -7531142204535799277,-7531142204535799277 | +---+------+-------------------------------------------------------+ 3 rows in set (0.00 sec) mysql> mysql> select version(); +-----------+ | version() | +-----------+ | 5.0.38 | +-----------+ 1 row in set (0.00 sec) mysql> exit Bye c:\build\5.0>
[19 Mar 2007 12:07]
MySQL Verification Team
Please see bug: http://bugs.mysql.com/bug.php?id=27257.
[22 Mar 2007 4:32]
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/22554 ChangeSet@1.2489, 2007-03-21 21:31:39-07:00, igor@olga.mysql.com +9 -0 Fixed bug #27229: crash when a set function aggregated in outer context was used as an argument of GROUP_CONCAT. Ensured correct setting of the depended_from field in references generated for set functions aggregated in outer selects. A wrong value of this field resulted in wrong maps returned by used_tables() for these references. Made sure that a temporary table field is added for any set function aggregated in outer context when creation of a temporary table is needed to execute the inner subquery.
[22 Mar 2007 15:56]
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/22657 ChangeSet@1.2489, 2007-03-22 08:55:50-07:00, igor@olga.mysql.com +9 -0 Fixed bug #27229: crash when a set function aggregated in outer context was used as an argument of GROUP_CONCAT. Ensured correct setting of the depended_from field in references generated for set functions aggregated in outer selects. A wrong value of this field resulted in wrong maps returned by used_tables() for these references. Made sure that a temporary table field is added for any set function aggregated in outer context when creation of a temporary table is needed to execute the inner subquery.
[22 Mar 2007 21:48]
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/22710 ChangeSet@1.2489, 2007-03-22 14:48:03-07:00, igor@olga.mysql.com +9 -0 Fixed bug #27229: crash when a set function aggregated in outer context was used as an argument of GROUP_CONCAT. Ensured correct setting of the depended_from field in references generated for set functions aggregated in outer selects. A wrong value of this field resulted in wrong maps returned by used_tables() for these references. Made sure that a temporary table field is added for any set function aggregated in outer context when creation of a temporary table is needed to execute the inner subquery.
[26 Mar 2007 6:44]
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/22906 ChangeSet@1.2417, 2007-03-25 23:44:06-07:00, igor@olga.mysql.com +2 -0 This is a fix for the memory corruption occurred in one of test cases from func_group.test after the patch for bug #27229 had been applied. The memory corruption happened because in some rare cases the function count_field_types underestimated the number of elements in in the array param->items_to_copy.
[31 Mar 2007 8:38]
Bugs System
Pushed into 5.1.18-beta
[31 Mar 2007 8:44]
Bugs System
Pushed into 5.0.40
[11 Apr 2007 1:59]
Paul DuBois
Noted in 5.0.40, 5.1.18 changelogs. Use of an aggregate function from an outer context as an argument to GROUP_CONCAT() caused a server crash.