[SERVER-1388] Assertion failure on $or $in empty array Created: 09/Jul/10  Updated: 29/May/12  Resolved: 17/Dec/11

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: 1.5.4
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Luke Maurer Assignee: Eliot Horowitz (Inactive)
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Ubuntu Lucid


Attachments: File transcript    
Issue Links:
Duplicate
duplicates SERVER-1296 giving an empty array to a $in condit... Closed
Operating System: ALL
Participants:

 Description   

I'm getting an assertion failure (line db/queryutil.cpp:706) whenever "{$in: []}" appears within an $or. A nontrivial $in works fine, and "{$in: []}" works fine at the top level of the query (I've attached a transcript to illustrate this).

The application-level workaround is obvious — if you're building a query where $in appears within $or, omit the $in if the array happens to be empty — so this isn't urgent for me (not nearly as much as $or is a lifesaver ), but it's inconvenient, and moreover this could be a much subtler issue in a bigger project with complex queries, especially if some list is "usually" empty.


Generated at Thu Feb 08 02:56:53 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.