Bug #146 Crash in MySQL-4.1 with IN subselect
Submitted: 11 Mar 2003 23:07 Modified: 12 Mar 2003 4:16
Reporter: jocelyn fournier (Silver Quality Contributor) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S1 (Critical)
Version:4.1 OS:Any (all)
Assigned to: CPU Architecture:Any

[11 Mar 2003 23:07] jocelyn fournier
Description:
MySQL crashes when those two queries are executed one after the other. (no matter the table and the field)

How to repeat:
SELECT /*!40001 SQL_CALC_FOUND_ROWS */ titre,numeropost,auteur,icone,nbrep,maxnumrep,date,vue,ouvert,lastauteur,sondage,next,prev FROM forumconthardwarefr7 WHERE numeropost IN (SELECT topic,sum(1) as d FROM searchjoinhardwarefr7,searchmainhardwarefr7 WHERE searchmainhardwarefr7.numreponse=searchjoinhardwarefr7.numreponse AND (mot='test') GROUP BY topic ORDER BY d DESC) LIMIT 0,20;

=> ERROR 1239: Cardinality error (more/less than 1 columns)

SELECT /*!40001 SQL_CALC_FOUND_ROWS */ titre,numeropost,auteur,icone,nbrep,maxnumrep,date,vue,ouvert,lastauteur,sondage,next,prev FROM forumconthardwarefr7 WHERE numeropost IN (SELECT topic FROM searchjoinhardwarefr7,searchmainhardwarefr7 WHERE searchmainhardwarefr7.numreponse=searchjoinhardwarefr7.numreponse AND (mot='test') GROUP BY topic ORDER BY d DESC);

=> crash

Stack trace :

0x80abac1 handle_segfault + 481
0x82a8a58 pthread_sighandler + 176
0xc70845 (?)
0x80533e7 Item_ref_null_helper::~Item_ref_null_helper [in-charge deleting]() + 23
0x80befbc mysql_parse(THD*, char*, unsigned) + 204
0x80b8c33 dispatch_command(enum_server_command, THD*, char*, unsigned) + 867
0x80b8885 do_command(THD*) + 133
0x80b80f1 handle_one_connection + 913
0x82a647a pthread_start_thread + 218
0x82da9ca thread_start + 4
[12 Mar 2003 1:17] Oleksandr Byelkin
1. Above is not good test suite I can't reproduce this because have 
not tables 
2. It looks like I fixed this bug in cset 1.1506 03/03/10 16:38:06 (not 
yet pushed)
[12 Mar 2003 2:33] jocelyn fournier
no tables are needed for this test, no databases need to be selected to reproduce the crash.
[12 Mar 2003 4:16] Oleksandr Byelkin
yes. this bug is fixed. 
 
thank you for bugreport.