Bug #4436 Doing a boolean search can cause mysql to crash
Submitted: 7 Jul 2004 17:18 Modified: 7 Jul 2004 23:37
Reporter: Richard Thomas Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server Severity:S1 (Critical)
Version:4.0.20 OS:Linux (Fedora Core 2 64bit)
Assigned to: CPU Architecture:Any

[7 Jul 2004 17:18] Richard Thomas
Description:
Using the x86 because the x86_64 crashes, open bugs already covering this issue/library linking compatibility problems..
-- Log info -- 
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort...
thd->query at 0x84ca310 = SELECT * FROM partall WHERE    MATCH (partsno,description,mfg) AGAINST(' +19"* +TFT*' IN BOOLEAN MODE) AND mfg LIKE '%%%%' AND spe
thd->thread_id=48496

Anyway the following query crashes the system
SELECT * FROM partall WHERE    MATCH (partsno,description,mfg) AGAINST(' +22"* +inch*' IN BOOLEAN MODE) AND mfg LIKE '%%%%' AND special LIKE '%%%%'  LIMIT 250

I have tried multiple formats of the search and found that its the " in the AGAINST statement that causes the problem, I found multiple times mysql auto recovered due to this, only noticed it today because the mysql failed to auto restart

Stack trace
0x80720d4 handle_segfault + 420
0x8250d48 pthread_sighandler + 184
0x822b51d _ftb_strstr + 61
0x822b6ea _ftb_climb_the_tree + 202
0x822bd9d ft_boolean_find_relevance + 509
0x822bb25 ft_boolean_read_next + 837
0x80caf34 ft_read__9ha_myisamPc + 52
0x80a0545 join_ft_read_first__FP13st_join_table + 53
0x809f516 sub_select__FP4JOINP13st_join_tableb + 86
0x809f2b3 do_select__FP4JOINPt4List1Z4ItemP8st_tableP9Procedure + 403
0x8097778 mysql_select__FP3THDP13st_table_listRt4List1Z4ItemP4ItemP8st_orderT4T3T4UlP13select_result + 7000
0x8095be6 handle_select__FP3THDP6st_lexP13select_result + 102
0x807cfd2 mysql_execute_command__Fv + 1026
0x8080935 mysql_parse__FP3THDPcUi + 149
0x807c113 dispatch_command__F19enum_server_commandP3THDPcUi + 1443
0x807bb5e do_command__FP3THD + 158
0x807b388 handle_one_connection + 648
0x824e4fc pthread_start_thread + 220
0x828452a thread_start + 4

How to repeat:
Run the following query format
SELECT * FROM partall WHERE    MATCH (partsno,description,mfg) AGAINST(' +22"* +inch*' IN BOOLEAN MODE) AND mfg LIKE '%%%%' AND special LIKE '%%%%'  LIMIT 250

Make +22" = +22 and the crash goes away
[7 Jul 2004 23:37] Sergei Golubchik
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. Because of this, we hope you add your comments
to the original bug instead.

Thank you for your interest in MySQL.

Additional info:

http://bugs.mysql.com/3870