diff -ru dbxml-2.3.10-original/dbxml/src/dbxml/optimizer/QueryPlanGenerator.cpp dbxml-2.3.10/dbxml/src/dbxml/optimizer/QueryPlanGenerator.cpp --- dbxml-2.3.10-original/dbxml/src/dbxml/optimizer/QueryPlanGenerator.cpp 2007-01-17 20:13:07.000000000 +0000 +++ dbxml-2.3.10/dbxml/src/dbxml/optimizer/QueryPlanGenerator.cpp 2007-03-22 11:13:19.000000000 +0000 @@ -749,8 +749,8 @@ root = new (mm) ImpliedSchemaNode(ImpliedSchemaNode::ROOT, mm); item->setImpliedSchema(root); - storeInScopeVars(root); } + storeInScopeVars(root); result.join(root); result.operation = new (&memMgr_) PathsQP(result.returnPaths, &memMgr_); @@ -1073,7 +1073,7 @@ void QueryPlanGenerator::storeInScopeVars(ImpliedSchemaNode *root) { // List the in scope vars - VariableIDs vars; + VariableIDs &vars = inScopeVars_[root]; VarStore::MyScope* index = const_cast<VarStore::MyScope*>(varStore_.getCurrentScope()); while(index) { std::vector< std::pair<unsigned int, const XMLCh*> > tmp = index->getVars(); @@ -1086,8 +1086,6 @@ index = const_cast<VarStore::MyScope*>(varStore_.getGlobalScope()); else index = index->getNext(); } - - inScopeVars_[root] = vars; } class ArgHolder {