Bug #5131 IN keyword and Subquery
Submitted: 20 Aug 2004 20:10 Modified: 20 Sep 2004 23:00
Reporter: Rebecca Vest Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:4.1.3 OS:Windows (Win XP Professional)
Assigned to: CPU Architecture:Any

[20 Aug 2004 20:10] Rebecca Vest
Description:
I am running PHP 5.0.1 on Apache 2.0.50 with a mysql 4.1.3 database server. The query noted below crashes Apache but more likely it crashes PHP and then Apache.

SELECT  Documents.DocumentID AS DocumentID, Documents.ParentDocumentID
AS ParentDocumentID, Documents.Title AS Title FROM Documents
WHERE  Documents.Status = 'approved' AND Documents.Inactive = 0 AND Documents.Deleted = 0 AND Documents.IsTemplate = 0 AND Documents.DocumentID IN (SELECT DocumentID FROM xDocumentsGroups XDGDept
INNER JOIN xGroupsGroups XGGDept ON XGGDept.ChildGroupID = XDGDept.GroupID AND XGGDept.ParentGroupID = 1)
ORDER BY  Documents.Title

This query works wonderfully in Microsoft SQL server

How to repeat:
Just run the query and it won't run.

Suggested fix:
Fix the IN functionally
[20 Aug 2004 20:44] MySQL Verification Team
Hi!

Thank you for writting to us.

In order to verify that this query crashes our server we need your data that lead to the crash. 

You can upload data to the Files section of this bug report.
[20 Aug 2004 23:00] Rebecca Vest
We just upgraded from 4.0.20 to 4.1.3 and we didn't think to stop the 4.0.20 service and add the 4.1.3 as a service. So 4.0.20 was still running instead of 4.1.3.
[14 Feb 2005 22:54] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".