summaryrefslogtreecommitdiff
path: root/db/ops/query.cpp
diff options
context:
space:
mode:
authorAntonin Kral <a.kral@bobek.cz>2012-03-30 21:40:47 +0200
committerAntonin Kral <a.kral@bobek.cz>2012-03-30 21:40:47 +0200
commitf4cdad7de83b306b815e03435883794423b7a010 (patch)
tree3bf78e89033459d7bd6e7a92265a5085308c2b08 /db/ops/query.cpp
parent4bf70009546d751d87bc4912e9193341429f4b54 (diff)
parenteaaa7b30c99b89b5483e0a372bb73fe8c8695185 (diff)
downloadmongodb-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.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));