summaryrefslogtreecommitdiff
path: root/src/mongo/db/query/plan_cache.cpp
diff options
context:
space:
mode:
authorDavid Storch <david.storch@10gen.com>2014-01-02 13:32:17 -0500
committerMatt Kangas <matt.kangas@mongodb.com>2014-01-03 16:47:04 -0500
commitc321c9c0b668c8006e3a43971cbf6e0e37778efb (patch)
treee5bcf8ce1981433f6f8125eecc3a511f7754c4dc /src/mongo/db/query/plan_cache.cpp
parentcd69950fab2cb1f55b87300bfd88218f49500da5 (diff)
downloadmongo-c321c9c0b668c8006e3a43971cbf6e0e37778efb.tar.gz
SERVER-10564 cache collection scan query plans
Signed-off-by: Matt Kangas <matt.kangas@mongodb.com>
Diffstat (limited to 'src/mongo/db/query/plan_cache.cpp')
-rw-r--r--src/mongo/db/query/plan_cache.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/mongo/db/query/plan_cache.cpp b/src/mongo/db/query/plan_cache.cpp
index aa74f9ac159..f679e50b04c 100644
--- a/src/mongo/db/query/plan_cache.cpp
+++ b/src/mongo/db/query/plan_cache.cpp
@@ -283,8 +283,12 @@ namespace mongo {
SolutionCacheData* SolutionCacheData::clone() const {
SolutionCacheData* other = new SolutionCacheData();
- other->tree.reset(this->tree->clone());
- other->wholeIXSoln = this->wholeIXSoln;
+ if (NULL != this->tree.get()) {
+ // 'tree' could be NULL if the cached solution
+ // is a collection scan.
+ other->tree.reset(this->tree->clone());
+ }
+ other->solnType = this->solnType;
other->wholeIXSolnDir = this->wholeIXSolnDir;
return other;
}