Bug #1333 COMPRESS(NULL) segfaults
Submitted: 18 Sep 2003 8:54 Modified: 6 Oct 2003 3:09
Reporter: Georg Richter Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.1.1 OS:Linux (Linux)
Assigned to: Ramil Kalimullin CPU Architecture:Any

[18 Sep 2003 8:54] Georg Richter
Description:
When passing NULL to COMPRESS or UNCOMPRESS server segfaults

How to repeat:
SELECT COMPRESS(NULL);
SELECT UNCOMPRESS(NULL);
[18 Sep 2003 11:53] Alexander Keremidarski
Backtrace is:

(gdb) bt
#0  Item_func_compress::val_str(String*) (this=0x85d1418, str=0x0) at sql_string.h:86
#1  0x080e4cc8 in Item::send(Protocol*, String*) (this=0x85d1418, protocol=0x85a99f4, buffer=0x403bdf68) at item.cc:1262
#2  0x081422cd in select_send::send_data(List<Item>&) (this=0x85d14a8, items=@0x85a99f4) at sql_class.cc:626
#3  0x0818c2a8 in JOIN::exec() (this=0x85d14b8) at sql_select.cc:1065
#4  0x0818da76 in mysql_select(THD*, Item***, st_table_list*, unsigned, List<Item>&, Item*, unsigned, st_order*, st_order*, Item*, st_order*, unsigned long, select_result*, st_select_lex_unit*, st_select_lex*, bool) (thd=0x85a9298, rref_pointer_array=0x85a96c0, tables=0x0, wild_num=0, fields=@0x0, conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=17339392, result=0x85d14a8, unit=0x85a951c, select_lex=0x85a95e0, tables_and_fields_initied=false) at sql_select.cc:1542
#5  0x08189e79 in handle_select(THD*, st_lex*, select_result*) (thd=0x85a9298, lex=0x85a9510, result=0x85d14a8) at sql_select.cc:178
#6  0x08163aab in mysql_execute_command(THD*) (thd=0x85a9298) at sql_parse.cc:1768
#7  0x0816935b in mysql_parse(THD*, char*, unsigned) (thd=0x85a9298, inBuf=0x85d13c0 "SELECT COMPRESS(NULL)", length=140154128) at sql_parse.cc:3681
#8  0x08162687 in dispatch_command(enum_server_command, THD*, char*, unsigned) (command=COM_QUERY, thd=0x85a9298, packet=0x85c9361 "", packet_length=22) at sql_parse.cc:1284
#9  0x08161fd2 in do_command(THD*) (thd=0x85a9298) at sql_parse.cc:1118
#10 0x081614d3 in handle_one_connection (arg=0x0) at sql_parse.cc:897
#11 0x40173332 in start_thread () from /lib/tls/libpthread.so.0
#12 0x420de867 in clone () from /lib/tls/libc.so.6
[6 Oct 2003 3:09] Ramil Kalimullin
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