Skip to content

Commit b0c0f83

Browse files
committed
SERVER-13337 lite parsed query should set _showDiskLoc
1 parent 6ada135 commit b0c0f83

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

jstests/core/showdiskloc.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,8 @@ checkResults( t.find().batchSize( 2 )._addSpecial("$showDiskLoc" , true).toArray
2323
t.ensureIndex( { a:1 } );
2424
checkResults
2525
( t.find( {}, { _id:0, a:1 } ).hint( { a:1 } )._addSpecial("$showDiskLoc" , true).toArray() );
26+
27+
// Check with an idhack query.
28+
t.drop();
29+
t.save({_id: 0, a: 1});
30+
checkResults( t.find( { _id: 0 } )._addSpecial("$showDiskLoc", true).toArray() );

src/mongo/db/query/lite_parsed_query.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,8 @@ namespace mongo {
399399
else if (str::equals("showDiskLoc", name)) {
400400
// Won't throw.
401401
if (e.trueValue()) {
402+
_showDiskLoc = true;
403+
402404
BSONObjBuilder projBob;
403405
projBob.appendElements(_proj);
404406
BSONObj metaDiskLoc = BSON("$diskLoc" <<

0 commit comments

Comments
 (0)