summaryrefslogtreecommitdiff
path: root/src/mongo/db
diff options
context:
space:
mode:
authorKevin Albertson <kevin.albertson@10gen.com>2015-06-08 17:37:48 -0400
committerDavid Storch <david.storch@10gen.com>2015-06-09 11:34:03 -0400
commit4a37e349883983236db844bbb10ce786b3f1df0b (patch)
treed71ce87538bc5cc0500a09e98ec88ffafc84ea22 /src/mongo/db
parent4a921ef2cc2ed313f5dd50c4e6a4580021bf8a9b (diff)
downloadmongo-4a37e349883983236db844bbb10ce786b3f1df0b.tar.gz
SERVER-18881 Corrects limitAmount on explain
Closes #980 Signed-off-by: David Storch <david.storch@10gen.com>
Diffstat (limited to 'src/mongo/db')
-rw-r--r--src/mongo/db/exec/limit.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/mongo/db/exec/limit.cpp b/src/mongo/db/exec/limit.cpp
index 87527e36970..13f61532f15 100644
--- a/src/mongo/db/exec/limit.cpp
+++ b/src/mongo/db/exec/limit.cpp
@@ -41,7 +41,12 @@ namespace mongo {
const char* LimitStage::kStageType = "LIMIT";
LimitStage::LimitStage(int limit, WorkingSet* ws, PlanStage* child)
- : _ws(ws), _child(child), _numToReturn(limit), _commonStats(kStageType) { }
+ : _ws(ws),
+ _child(child),
+ _numToReturn(limit),
+ _commonStats(kStageType) {
+ _specificStats.limit = _numToReturn;
+ }
LimitStage::~LimitStage() { }
@@ -114,7 +119,6 @@ namespace mongo {
PlanStageStats* LimitStage::getStats() {
_commonStats.isEOF = isEOF();
- _specificStats.limit = _numToReturn;
auto_ptr<PlanStageStats> ret(new PlanStageStats(_commonStats, STAGE_LIMIT));
ret->specific.reset(new LimitStats(_specificStats));
ret->children.push_back(_child->getStats());