summaryrefslogtreecommitdiff
path: root/db/ops/query.cpp
diff options
context:
space:
mode:
authorAntonin Kral <a.kral@bobek.cz>2012-03-30 21:40:45 +0200
committerAntonin Kral <a.kral@bobek.cz>2012-03-30 21:40:45 +0200
commiteaaa7b30c99b89b5483e0a372bb73fe8c8695185 (patch)
tree6c08f243b00c0f6b7a4897a236774cf484e61314 /db/ops/query.cpp
parentba59b00736b5b8dc0f0bd46397575aaf0cd4d44f (diff)
downloadmongodb-eaaa7b30c99b89b5483e0a372bb73fe8c8695185.tar.gz
Imported Upstream version 2.0.4
Diffstat (limited to 'db/ops/query.cpp')
-rw-r--r--db/ops/query.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/db/ops/query.cpp b/db/ops/query.cpp
index 36f2536..1010912 100644
--- a/db/ops/query.cpp
+++ b/db/ops/query.cpp
@@ -816,6 +816,7 @@ namespace mongo {
curop.debug().ns = ns;
curop.debug().ntoreturn = pq.getNumToReturn();
+ curop.debug().query = jsobj;
curop.setQuery(jsobj);
if ( pq.couldBeCommand() ) {
@@ -916,6 +917,19 @@ namespace mongo {
Client& c = cc();
bool found = Helpers::findById( c, ns , query , resObject , &nsFound , &indexFound );
if ( nsFound == false || indexFound == true ) {
+
+ if ( shardingState.needShardChunkManager( ns ) ) {
+ ShardChunkManagerPtr m = shardingState.getShardChunkManager( ns );
+ if ( m && ! m->belongsToMe( resObject ) ) {
+ // I have something this _id
+ // but it doesn't belong to me
+ // so return nothing
+ resObject = BSONObj();
+ found = false;
+ }
+ }
+
+
BufBuilder bb(sizeof(QueryResult)+resObject.objsize()+32);
bb.skip(sizeof(QueryResult));