diff options
author | Antonin Kral <a.kral@bobek.cz> | 2012-03-30 21:40:47 +0200 |
---|---|---|
committer | Antonin Kral <a.kral@bobek.cz> | 2012-03-30 21:40:47 +0200 |
commit | f4cdad7de83b306b815e03435883794423b7a010 (patch) | |
tree | 3bf78e89033459d7bd6e7a92265a5085308c2b08 /db/ops/query.cpp | |
parent | 4bf70009546d751d87bc4912e9193341429f4b54 (diff) | |
parent | eaaa7b30c99b89b5483e0a372bb73fe8c8695185 (diff) | |
download | mongodb-f4cdad7de83b306b815e03435883794423b7a010.tar.gz |
Merge tag 'upstream/2.0.4'
Upstream version 2.0.4
Diffstat (limited to 'db/ops/query.cpp')
-rw-r--r-- | db/ops/query.cpp | 14 |
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)); |