summaryrefslogtreecommitdiff
path: root/src/mongo/db/exec/fetch.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/fetch.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/fetch.cpp')
-rw-r--r--src/mongo/db/exec/fetch.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/mongo/db/exec/fetch.cpp b/src/mongo/db/exec/fetch.cpp
index 5e42d09e21d..62be74eda40 100644
--- a/src/mongo/db/exec/fetch.cpp
+++ b/src/mongo/db/exec/fetch.cpp
@@ -119,6 +119,7 @@ namespace mongo {
}
void FetchStage::restoreState(OperationContext* opCtx) {
+ _txn = opCtx;
++_commonStats.unyields;
_child->restoreState(opCtx);
}