summaryrefslogtreecommitdiff
path: root/src/mongo/db/exec/near.cpp
diff options
context:
space:
mode:
authorDavid Percy <david.percy@mongodb.com>2014-09-15 15:17:38 -0400
committerBenety Goh <benety@mongodb.com>2014-09-18 14:09:35 -0400
commitccacca83853931e2d03c8670c1745dfac515e119 (patch)
tree34f9166bbfe540febf0e748b49f9e448dbf51000 /src/mongo/db/exec/near.cpp
parent55415503b722848d51fe45fc2de2d47cee4db952 (diff)
downloadmongo-ccacca83853931e2d03c8670c1745dfac515e119.tar.gz
SERVER-15187 Update saved OperationContext in all PlanStages
Every stage that has a field of type OperationContext* should be updating it when ::restoreState(OperationContext*) is called. Otherwise it is retaining a reference to deleted memory. This bug hasn't surfaced before because: 1. the OperationContext used to be stack allocated, so it would have the same address every time 2. mmapv1 doesn't always need to dereference the OperationContext Closes #781 Signed-off-by: Benety Goh <benety@mongodb.com>
Diffstat (limited to 'src/mongo/db/exec/near.cpp')
-rw-r--r--src/mongo/db/exec/near.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/mongo/db/exec/near.cpp b/src/mongo/db/exec/near.cpp
index 21aee43a7f7..53304381eb1 100644
--- a/src/mongo/db/exec/near.cpp
+++ b/src/mongo/db/exec/near.cpp
@@ -273,6 +273,7 @@ namespace mongo {
}
void NearStage::restoreState(OperationContext* opCtx) {
+ _txn = opCtx;
++_stats->common.unyields;
if (_nextInterval) {
_nextInterval->covering->restoreState(opCtx);