LimitPlanNode::~LimitPlanNode() { delete limitExpression; if (!isInline()) { delete getOutputTable(); setOutputTable(NULL); } }
TupleExtractor(NValue value) : m_table(getOutputTable(value)), m_iterator(m_table->iterator()), m_tuple(m_table->schema()), m_null_tuple(m_table->schema()), m_size(m_table->activeTupleCount()) {}
string AbstractPlanNode::debug(const string& spacer) const { std::ostringstream buffer; buffer << spacer << "* " << debug() << "\n"; std::string info_spacer = spacer + " |"; buffer << debugInfo(info_spacer); // // Inline PlanNodes // if (!m_inlineNodes.empty()) { buffer << info_spacer << "Inline Plannodes: " << m_inlineNodes.size() << "\n"; string internal_spacer = info_spacer + " "; map<PlanNodeType, AbstractPlanNode*>::const_iterator it; for (it = m_inlineNodes.begin(); it != m_inlineNodes.end(); it++) { buffer << info_spacer << "Inline " << planNodeToString(it->second->getPlanNodeType()) << ":\n"; buffer << it->second->debugInfo(internal_spacer); } } // // Output table // Table* outputTable = getOutputTable(); buffer << info_spacer << "Output table:\n"; if (outputTable != NULL) { buffer << outputTable->debug(spacer + " "); } else { buffer << " " << info_spacer << "<NULL>\n"; } // // Input tables // for (int i = 0; i < getInputTableCount(); ++i) { Table* inputTable = getInputTable(i); buffer << info_spacer << "Input table " << i << ":\n"; if (inputTable != NULL) { buffer << inputTable->debug(spacer + " "); } else { buffer << " " << info_spacer << "<NULL>\n"; } } // // Traverse the tree // string child_spacer = spacer + " "; for (int ctr = 0, cnt = static_cast<int>(m_children.size()); ctr < cnt; ctr++) { buffer << child_spacer << m_children[ctr]->getPlanNodeType() << "\n"; buffer << m_children[ctr]->debug(child_spacer); } return (buffer.str()); }
MaterializePlanNode::~MaterializePlanNode() { delete getOutputTable(); setOutputTable(NULL); }
UnionPlanNode::~UnionPlanNode() { delete getOutputTable(); setOutputTable(NULL); }
/* * If the output table needs to be cleared then this SeqScanNode is for an executor that created * its own output table rather then forwarding a reference to the persistent table being scanned. * It still isn't necessarily safe to delete the output table since an inline projection node/executor * may have created the table so check if there is an inline projection node. * * This is a fragile approach to determining whether or not to delete the output table. Maybe * it is safer to have the inline nodes be deleted first and set the output table of the * enclosing plannode to NULL so the delete can be safely repeated. */ SeqScanPlanNode::~SeqScanPlanNode() { if (needsOutputTableClear() && getInlinePlanNode(PLAN_NODE_TYPE_PROJECTION) == NULL) { delete getOutputTable(); setOutputTable(NULL); } }