[SERVER-1296] giving an empty array to a $in condition inside a $or causes a failed assertion Created: 24/Jun/10  Updated: 12/Jul/16  Resolved: 16/Jul/10

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: 1.5.3
Fix Version/s: 1.5.5

Type: Bug Priority: Major - P3
Reporter: Adam R. Smith Assignee: Aaron Staple
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Centos 5.3 32-bit


Issue Links:
Depends
depends on SERVER-1211 don't use simplifiedQuery() to negate... Closed
Duplicate
is duplicated by SERVER-1388 Assertion failure on $or $in empty array Closed
Operating System: ALL
Participants:

 Description   

It works correctly when not using $or:
> db.character.find({'_id':

{'$in': []}

, '_priv.lvl': 1}).count()
0

But when inside a $or:
> db.character.find({'$or': [{'_id':

{'$in': []}

, '_priv.lvl': 1}]}).count()
Thu Jun 24 14:47:07 uncaught exception: count failed: {
"errmsg" : "exception: assertion db/queryutil.cpp:706",
"code" : 0,
"ok" : false
}



 Comments   
Comment by auto [ 16/Jul/10 ]

Author:

{'login': 'astaple', 'name': 'Aaron', 'email': 'aaron@10gen.com'}

Message: SERVER-1296 fix or/empty in assertion
http://github.com/mongodb/mongo/commit/5ca4354bd66cbd1b60fef2b7a612beb57faf746e

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