diff --git a/dbcon/ddlpackageproc/ddlpackageprocessor.cpp b/dbcon/ddlpackageproc/ddlpackageprocessor.cpp index bf27af32f..533274be8 100644 --- a/dbcon/ddlpackageproc/ddlpackageprocessor.cpp +++ b/dbcon/ddlpackageproc/ddlpackageprocessor.cpp @@ -562,8 +562,19 @@ void DDLPackageProcessor::createFiles(CalpontSystemCatalog::TableName aTableName { SUMMARY_INFO("DDLPackageProcessor::createFiles"); boost::shared_ptr systemCatalogPtr = - CalpontSystemCatalog::makeCalpontSystemCatalog(1); + CalpontSystemCatalog::makeCalpontSystemCatalog(1); CalpontSystemCatalog::RIDList ridList = systemCatalogPtr->columnRIDs(aTableName); + CalpontSystemCatalog::OID tableAUXColOid = + systemCatalogPtr->tableAUXColumnOID(aTableName); + + if (tableAUXColOid > 3000) + { + CalpontSystemCatalog::ROPair auxRoPair; + auxRoPair.rid = 0; + auxRoPair.objnum = tableAUXColOid; + ridList.push_back(auxRoPair); + } + fWEClient->addQueue(uniqueId); CalpontSystemCatalog::ColType colType; ByteStream bytestream; diff --git a/dbcon/ddlpackageproc/droppartitionprocessor.cpp b/dbcon/ddlpackageproc/droppartitionprocessor.cpp index 83894f83c..6daa1960d 100644 --- a/dbcon/ddlpackageproc/droppartitionprocessor.cpp +++ b/dbcon/ddlpackageproc/droppartitionprocessor.cpp @@ -70,6 +70,7 @@ DropPartitionProcessor::DDLResult DropPartitionProcessor::processPackage( } std::vector oidList; + CalpontSystemCatalog::OID tableAuxColOid; CalpontSystemCatalog::RIDList tableColRidList; CalpontSystemCatalog::DictOIDList dictOIDList; execplan::CalpontSystemCatalog::ROPair roPair; @@ -231,6 +232,7 @@ DropPartitionProcessor::DDLResult DropPartitionProcessor::processPackage( userTableName.table = dropPartitionStmt.fTableName->fName; tableColRidList = systemCatalogPtr->columnRIDs(userTableName); + tableAuxColOid = systemCatalogPtr->tableAUXColumnOID(userTableName); dictOIDList = systemCatalogPtr->dictOIDs(userTableName); @@ -241,6 +243,11 @@ DropPartitionProcessor::DDLResult DropPartitionProcessor::processPackage( oidList.push_back(tableColRidList[i].objnum); } + if (tableAuxColOid > 3000) + { + oidList.push_back(tableAuxColOid); + } + for (unsigned i = 0; i < dictOIDList.size(); i++) { if (dictOIDList[i].dictOID > 3000) diff --git a/dbcon/ddlpackageproc/markpartitionprocessor.cpp b/dbcon/ddlpackageproc/markpartitionprocessor.cpp index 55487ce9d..1e90aaf0d 100644 --- a/dbcon/ddlpackageproc/markpartitionprocessor.cpp +++ b/dbcon/ddlpackageproc/markpartitionprocessor.cpp @@ -64,6 +64,7 @@ MarkPartitionProcessor::DDLResult MarkPartitionProcessor::processPackage( } std::vector oidList; + CalpontSystemCatalog::OID tableAuxColOid; CalpontSystemCatalog::RIDList tableColRidList; CalpontSystemCatalog::DictOIDList dictOIDList; std::string processName("DDLProc"); @@ -193,6 +194,7 @@ MarkPartitionProcessor::DDLResult MarkPartitionProcessor::processPackage( userTableName.table = markPartitionStmt.fTableName->fName; tableColRidList = systemCatalogPtr->columnRIDs(userTableName); + tableAuxColOid = systemCatalogPtr->tableAUXColumnOID(userTableName); dictOIDList = systemCatalogPtr->dictOIDs(userTableName); @@ -203,6 +205,11 @@ MarkPartitionProcessor::DDLResult MarkPartitionProcessor::processPackage( oidList.push_back(tableColRidList[i].objnum); } + if (tableAuxColOid > 3000) + { + oidList.push_back(tableAuxColOid); + } + for (unsigned i = 0; i < dictOIDList.size(); i++) { if (dictOIDList[i].dictOID > 3000) diff --git a/dbcon/ddlpackageproc/restorepartitionprocessor.cpp b/dbcon/ddlpackageproc/restorepartitionprocessor.cpp index cb535d302..3eea6ae7d 100644 --- a/dbcon/ddlpackageproc/restorepartitionprocessor.cpp +++ b/dbcon/ddlpackageproc/restorepartitionprocessor.cpp @@ -64,6 +64,7 @@ RestorePartitionProcessor::DDLResult RestorePartitionProcessor::processPackage( } std::vector oidList; + CalpontSystemCatalog::OID tableAuxColOid; CalpontSystemCatalog::RIDList tableColRidList; CalpontSystemCatalog::DictOIDList dictOIDList; std::string processName("DDLProc"); @@ -195,6 +196,7 @@ RestorePartitionProcessor::DDLResult RestorePartitionProcessor::processPackage( userTableName.table = restorePartitionStmt.fTableName->fName; tableColRidList = systemCatalogPtr->columnRIDs(userTableName); + tableAuxColOid = systemCatalogPtr->tableAUXColumnOID(userTableName); dictOIDList = systemCatalogPtr->dictOIDs(userTableName); @@ -205,6 +207,11 @@ RestorePartitionProcessor::DDLResult RestorePartitionProcessor::processPackage( oidList.push_back(tableColRidList[i].objnum); } + if (tableAuxColOid > 3000) + { + oidList.push_back(tableAuxColOid); + } + for (unsigned i = 0; i < dictOIDList.size(); i++) { if (dictOIDList[i].dictOID > 3000) diff --git a/dbcon/joblist/tuple-bps.cpp b/dbcon/joblist/tuple-bps.cpp index f2b173b77..6db872004 100644 --- a/dbcon/joblist/tuple-bps.cpp +++ b/dbcon/joblist/tuple-bps.cpp @@ -577,7 +577,6 @@ TupleBPS::TupleBPS(const pColScanStep& rhs, const JobInfo& jobInfo) : BatchPrimi if (dbrm.getExtents(fOidAux, extentsAux)) throw runtime_error("TupleBPS::TupleBPS BRM extent lookup failure (1)"); - idbassert(!extentsAux.empty()); sort(extentsAux.begin(), extentsAux.end(), BRM::ExtentSorter()); extentsMap[fOidAux] = tr1::unordered_map(); diff --git a/writeengine/redistribute/we_redistributeworkerthread.cpp b/writeengine/redistribute/we_redistributeworkerthread.cpp index 822caff24..da3199ed9 100644 --- a/writeengine/redistribute/we_redistributeworkerthread.cpp +++ b/writeengine/redistribute/we_redistributeworkerthread.cpp @@ -308,6 +308,7 @@ int RedistributeWorkerThread::buildEntryList() boost::shared_ptr csc = CalpontSystemCatalog::makeCalpontSystemCatalog(0); const CalpontSystemCatalog::TableName table = csc->tableName(fPlanEntry.table); CalpontSystemCatalog::RIDList cols = csc->columnRIDs(table, true); + CalpontSystemCatalog::OID tableAuxColOid = csc->tableAUXColumnOID(table); for (CalpontSystemCatalog::RIDList::iterator i = cols.begin(); i != cols.end(); i++) fOids.push_back(i->objnum); @@ -317,6 +318,11 @@ int RedistributeWorkerThread::buildEntryList() for (CalpontSystemCatalog::DictOIDList::iterator i = dicts.begin(); i != dicts.end(); i++) fOids.push_back(i->dictOID); + if (tableAuxColOid > 3000) + { + fOids.push_back(tableAuxColOid); + } + bool firstOid = true; // for adding segments, all columns have the same lay out. uint16_t source = fPlanEntry.source; uint16_t target = fPlanEntry.destination; diff --git a/writeengine/server/we_ddlcommandproc.cpp b/writeengine/server/we_ddlcommandproc.cpp index 7bbcec1b5..85d465780 100644 --- a/writeengine/server/we_ddlcommandproc.cpp +++ b/writeengine/server/we_ddlcommandproc.cpp @@ -1308,7 +1308,6 @@ uint8_t WE_DDLCommandProc::deleteSyscolumn(ByteStream& bs, std::string& err) { int rc = 0; uint32_t sessionID, tmp32; - ; int txnID; string schema, tablename; bs >> sessionID; diff --git a/writeengine/server/we_dmlcommandproc.cpp b/writeengine/server/we_dmlcommandproc.cpp index bedac4e81..9732b1128 100644 --- a/writeengine/server/we_dmlcommandproc.cpp +++ b/writeengine/server/we_dmlcommandproc.cpp @@ -962,7 +962,7 @@ uint8_t WE_DMLCommandProc::processBatchInsert(messageqcpp::ByteStream& bs, std:: if (tableAUXColOid > 3000) { rc = BRMWrapper::getInstance()->getDbRootHWMInfo(tableAUXColOid, dbRootHWMInfoColVec[ridList.size()]); - colWidths.push_back(1); + colWidths.push_back(execplan::AUX_COL_WIDTH); dctnryStoreOids[ridList.size()] = 0; CalpontSystemCatalog::ROPair auxRoPair; auxRoPair.rid = ridList.back().rid + 1; @@ -2300,47 +2300,6 @@ uint8_t WE_DMLCommandProc::commitBatchAutoOn(messageqcpp::ByteStream& bs, std::s fWEWrapper.setIsInsert(true); fWEWrapper.setBulkFlag(true); - std::map oids; - boost::shared_ptr systemCatalogPtr = - CalpontSystemCatalog::makeCalpontSystemCatalog(sessionId); - - CalpontSystemCatalog::TableName aTableName = systemCatalogPtr->tableName(tableOid); - CalpontSystemCatalog::RIDList ridList; - - try - { - ridList = systemCatalogPtr->columnRIDs(aTableName, true); - } - catch (std::exception& ex) - { - err = ex.what(); - rc = 1; - return rc; - } - - for (unsigned i = 0; i < ridList.size(); i++) - { - oids[ridList[i].objnum] = ridList[i].objnum; - } - - CalpontSystemCatalog::DictOIDList dictOids; - - try - { - dictOids = systemCatalogPtr->dictOIDs(aTableName); - } - catch (std::exception& ex) - { - err = ex.what(); - rc = 1; - return rc; - } - - for (unsigned i = 0; i < dictOids.size(); i++) - { - oids[dictOids[i].dictOID] = dictOids[i].dictOID; - } - fWEWrapper.setTransId(txnID); fWEWrapper.setIsInsert(false);