[SERVER-1365] assertion at db/geo/2d.cpp:290 fails when using find($near).limit(1) or runCommand(geoNear:.., num:1) Created: 06/Jul/10  Updated: 12/Jul/16  Resolved: 06/Jul/10

Status: Closed
Project: Core Server
Component/s: Geo
Affects Version/s: 1.5.4
Fix Version/s: 1.5.5

Type: Bug Priority: Major - P3
Reporter: Tomas Carnecky Assignee: Eliot Horowitz (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Participants:

 Description   

use test
db.data.remove()
db.data.insert(

{position:[1,1]}

)
db.data.ensureIndex(

{position:'2d'}

)

db.data.find({position:{$near:[1,1]}})
// -> ok

db.data.find({position:{$near:[1,1]}}).limit(1)
// -> error:

{ "$err" : "assertion db/geo/2d.cpp:290" }

db.runCommand (

{ geoNear : "data" , near : [1,1], num : 2}

);
// -> ok

db.runCommand (

{ geoNear : "data" , near : [1,1], num : 1}

);
// -> "errmsg" : "exception: assertion db/geo/2d.cpp:290",



 Comments   
Comment by auto [ 06/Jul/10 ]

Author:

{'login': 'erh', 'name': 'Eliot Horowitz', 'email': 'eliot@10gen.com'}

Message: fix Box::mid for tiny boxes SERVER-1365
http://github.com/mongodb/mongo/commit/b0422a3a65227bc96ed6a597093cdfa40ecb0336

Comment by Tomas Carnecky [ 06/Jul/10 ]

In case it's not apparent, it only fails when a document with the same or very similar position already is in the database. The following works fine:

db.data.find({position:{$near:[1,2]}}).limit(1)
// -> ok

while this also fails:

db.data.find({position:{$near:[1,1.000001]}}).limit(1)
// -> assertion failed

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