Bug #4237 Server crash with a subquery SELECT
Submitted: 21 Jun 2004 21:38 Modified: 24 Jun 2004 12:21
Reporter: Simon Ilyushchenko Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:4.1.2-alpha-standard OS:Linux (Redhat 9)
Assigned to: Ramil Kalimullin CPU Architecture:Any

[21 Jun 2004 21:38] Simon Ilyushchenko
Description:
Hi,

I am going to upload a file with three tables. It's fairly big, but I was not able to reduce the dataset further and still have the error. The stack trace is:

0x808b137 handle_segfault + 423
0x82b2a58 pthread_sighandler + 184
0x82da573 memcpy + 51
0x80c8bd5 read_cached_record__FP13st_join_table + 293
0x80c560b flush_cached_records__FP4JOINP13st_join_tableb + 347
0x80c51f3 sub_select_cache__FP4JOINP13st_join_tableb + 179
0x80c5657 flush_cached_records__FP4JOINP13st_join_tableb + 423
0x80c51f3 sub_select_cache__FP4JOINP13st_join_tableb + 179
0x80c5319 sub_select__FP4JOINP13st_join_tableb + 233
0x80c5014 do_select__FP4JOINPt4List1Z4ItemP8st_tableP9Procedure + 516
0x80bbcc0 exec__4JOIN + 4240
0x8074da5 exec__30subselect_single_select_engine + 293
0x8071dbf exec__14Item_subselect + 111
0x8072ad3 val__21Item_exists_subselect + 19
0x805b5cb val_int__13Item_func_not + 27
0x80c52f5 sub_select__FP4JOINP13st_join_tableb + 197
0x80c5014 do_select__FP4JOINPt4List1Z4ItemP8st_tableP9Procedure + 516
0x80bbcc0 exec__4JOIN + 4240
0x80bc188 mysql_select__FP3THDPPP4ItemP13st_table_listUiRt4List1Z4ItemP4ItemUiP8st_orderT7T5T7UlP13select_resultP18st_
select_lex_unitP13s + 808
0x80b91c9 handle_select__FP3THDP6st_lexP13select_result + 153
0x8099c5a mysql_execute_command__FP3THD + 1226
0x809e0c1 mysql_parse__FP3THDPcUi + 177
0x8098907 dispatch_command__F19enum_server_commandP3THDPcUi + 1671
0x8098274 do_command__FP3THD + 196
0x8097987 handle_one_connection + 615
0x82b020c pthread_start_thread + 220
0x82e18fa thread_start + 4

I also got this in the error log before the backtrace:

thd=0x8606a70
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
Cannot determine thread, fp=0xbfe7eb48, backtrace may not be correct.

I am using the 4.1 RPMs that I have recently downloaded.

How to repeat:
Import the attached table descriptions and data. Then run:

SELECT count(*) FROM allShort as m where  not exists  (select n.* from allShort as n,Experiments as e, ExptType as t where  t.id=e.ExptTypes  and n.chrom=m.chrom  ) ;

The client shows the message "ERROR 2013 (HY000): Lost connection to MySQL server during query",  and the server error log displays the above backtrace.
[21 Jun 2004 21:40] Simon Ilyushchenko
The file size is 480 K, so I am above your file size limit. Can I email the data?
[21 Jun 2004 21:41] Simon Ilyushchenko
The file size is 480 K, so it exceeds your file size limit. You can download the file from 
http://www.simonf.com/tables.tar.bz
[23 Jun 2004 10:45] Ramil Kalimullin
ChangeSet
  1.1947 04/06/23 13:40:59 ram@gw.mysql.r18.ru +1 -0
  A fix (Bug #4237: Server crash with a subquery SELECT).
[24 Jun 2004 12:21] 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