Bug #833 GROUP_CONCAT in HAVING clause crashes mysql
Submitted: 11 Jul 2003 6:14 Modified: 15 Sep 2003 13:02
Reporter: Daniel Penning Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S1 (Critical)
Version:4.1.0 OS:Windows (Windows 2000)
Assigned to: Bugs System CPU Architecture:Any

[11 Jul 2003 6:14] Daniel Penning
Description:
MySQL crashes when comparing the result of GROUP_CONCAT to a value in the HAVING clause.
This bug requires a minimum of two records to occur.

How to repeat:
CREATE TABLE foo (bar varchar(32));
INSERT INTO foo VALUES('test'),('test2');
SELECT * FROM foo HAVING GROUP_CONCAT(bar)='';

Suggested fix:
don't know
[12 Jul 2003 20:39] MySQL Verification Team
Thank you for the bug report. Below back-trace:

>mysqld.exe!Field::is_null(unsigned int row_offset=0)  Line 125 + 0xf	C++
 mysqld.exe!Item_func_group_concat::add()  Line 1715 + 0xa	C++
 mysqld.exe!Item_func_group_concat::reset()  Line 1698	C++
 mysqld.exe!init_sum_functions(Item_sum * * func_ptr=0x02a36c40, Item_sum 
            * * end_ptr=0x02a36c44)  Line 8109 + 0x14	C++
 mysqld.exe!end_send_group(JOIN * join=0x02a360d8, st_join_table *
            join_tab=0x02a36fe0, int end_of_records=0)  Line 5892 + 0x20 C++
 mysqld.exe!sub_select(JOIN * join=0x02a360d8, st_join_table *
            join_tab=0x02a36e98, int end_of_records=0)  Line 5225 + 0x15 C++
 mysqld.exe!do_select(JOIN * join=0x02a360d8, List<Item> * fields=0x02a36a94,
            st_table * table=0x00000000, Procedure * procedure=0x00000000)
            Line 5110 + 0xf	C++
 mysqld.exe!JOIN::exec()  Line 1320 + 0x2d	C++
 mysqld.exe!mysql_select(THD * thd=0x011fadb0, Item * * * 
            rref_pointer_array=0x011fb1a4, st_table_list * tables=0x02a35d18,
            unsigned int wild_num=1, List<Item> & fields={...}, Item *
            conds=0x00000000, unsigned int og_num=0, st_order *
            order=0x00000000, st_order * group=0x00000000, Item *
            having=0x02a36018, st_order * proc_param=0x00000000,
            unsigned long select_options=84448256, select_result *
            result=0x02a360c8, st_select_lex_unit * unit=0x011fb034,
            st_select_lex * select_lex=0x011fb154,int     tables_and_fields_initied=0)
            Line 1426	C++
 mysqld.exe!handle_select(THD * thd=0x011fadb0, st_lex * lex=0x011fb028,
            select_result * result=0x02a360c8)  Line 190 + 0x93	C++
 mysqld.exe!mysql_execute_command(THD * thd=0x011fadb0)  Line 1787 + 0x11  C++
 mysqld.exe!mysql_parse(THD * thd=0x011fadb0, char * inBuf=0x02a35c50,
            unsigned int length=45)  Line 3629 + 0x9	C++
 mysqld.exe!dispatch_command(enum_server_command command=COM_QUERY, 
            THD * thd=0x011fadb0, char * packet=0x02a31be9, unsigned int
            packet_length=46)  Line 1304 + 0x1d	C++
 mysqld.exe!do_command(THD * thd=0x011fadb0)  Line 1099 + 0x37	C++
 mysqld.exe!handle_one_connection(void * arg=0x011fadb0)  Line 876 + 0x9  C++
 mysqld.exe!pthread_start(void * param=0x011fffe8)  Line 63 + 0x7	C
 mysqld.exe!_threadstart(void * ptd=0x011fefc0)  Line 173 + 0xd	C
 KERNEL32.DLL!77e8b2d8()
[23 Jul 2003 7:31] MySQL Verification Team
A fix will come in 4.0.15
[15 Sep 2003 13:02] Vasily Kishkin
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html

bug was fixed