diff options
author | Kevin Albertson <kevin.albertson@10gen.com> | 2015-06-08 17:37:48 -0400 |
---|---|---|
committer | David Storch <david.storch@10gen.com> | 2015-06-09 11:34:03 -0400 |
commit | 4a37e349883983236db844bbb10ce786b3f1df0b (patch) | |
tree | d71ce87538bc5cc0500a09e98ec88ffafc84ea22 /src/mongo/db | |
parent | 4a921ef2cc2ed313f5dd50c4e6a4580021bf8a9b (diff) | |
download | mongo-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.cpp | 8 |
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()); |