Permalink
Browse files

Fixed logic in IndexScanExecutor where it doesn't check for a null in…

…dex handle until after it uses it...
  • Loading branch information...
apavlo committed May 22, 2014
1 parent 61f230d commit 4b35b9899ab77869f25d6cac85549843c1876534
Showing with 6 additions and 6 deletions.
  1. +6 −6 src/ee/executors/indexscanexecutor.cpp
@@ -267,18 +267,18 @@ bool IndexScanExecutor::p_init(AbstractPlanNode *abstractNode,
// We'll throw an error if the index is missing
//
m_index = m_targetTable->index(m_node->getTargetIndexName());
m_searchKey = TableTuple(m_index->getKeySchema());
m_searchKeyBackingStore = new char[m_index->getKeySchema()->tupleLength()];
m_searchKey.moveNoHeader(m_searchKeyBackingStore);
if (m_index == NULL)
{
if (m_index == NULL) {
VOLT_ERROR("Failed to retreive index '%s' from table '%s' for PlanNode"
" '%s'", m_node->getTargetIndexName().c_str(),
m_targetTable->name().c_str(), m_node->debug().c_str());
delete [] m_searchKeyBackingStore;
// delete [] m_searchKeyBackingStore;
delete [] m_projectionExpressions;
return false;
}
m_searchKey = TableTuple(m_index->getKeySchema());
m_searchKeyBackingStore = new char[m_index->getKeySchema()->tupleLength()];
m_searchKey.moveNoHeader(m_searchKeyBackingStore);
m_tuple = TableTuple(m_targetTable->schema());
if (m_node->getEndExpression() != NULL)

0 comments on commit 4b35b98

Please sign in to comment.