Skip to content
This repository was archived by the owner on Jun 7, 2021. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
427 changes: 211 additions & 216 deletions core/sql/cli/CliExpExchange.cpp

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions core/sql/comexe/PartInputDataDesc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,8 @@ Lng32 ExRangePartInputData::evalExpressions(Space * space,
workAtp->getTupp(partRangeExprAtpIndex_) = &td;

if (workAtp->getDiagsArea() != *diags)
workAtp->setDiagsArea(*diags);
workAtp->setDiagsAreax(*diags);

// loop over all expressions, fixing them up and evaluating them
for (Lng32 i = 0; i <= getNumPartitions() AND result == 0; i++)
{
Expand Down
8 changes: 4 additions & 4 deletions core/sql/executor/ExCancel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -502,9 +502,9 @@ void ExCancelTcb::reportError(ComDiagsArea *da, bool addCondition,

if (addCondition)
{
ComDiagsArea *diagsArea =
ComDiagsArea *diagsArea =
ComDiagsArea::allocate(getGlobals()->getDefaultHeap());

*diagsArea << DgSqlCode(-SQLCode);

if (nodeName)
Expand All @@ -518,11 +518,11 @@ void ExCancelTcb::reportError(ComDiagsArea *da, bool addCondition,
}

diagsArea->mergeAfter(*da);
up_entry->setDiagsArea(diagsArea);
up_entry->setDiagsAreax(diagsArea);
da->decrRefCount();
}
else
up_entry->setDiagsArea(da);
up_entry->setDiagsAreax(da);

up_entry->upState.status = ex_queue::Q_SQLERROR;
up_entry->upState.downIndex = qparent_.down->getHeadIndex();
Expand Down
24 changes: 12 additions & 12 deletions core/sql/executor/ExCompoundStmt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ void ExCatpoundStmtTcb::processError(atp_struct *atp, ComDiagsArea *da)
{
ex_queue_entry *pdentry = qparent_.down->getHeadEntry();
ex_queue_entry *puentry = qparent_.up->getTailEntry();
ExCatpoundStmtPrivateState &pstate =
ExCatpoundStmtPrivateState &pstate =
*((ExCatpoundStmtPrivateState*)pdentry->pstate);

// set up error entry for parent up-queue
Expand All @@ -576,10 +576,10 @@ void ExCatpoundStmtTcb::processError(atp_struct *atp, ComDiagsArea *da)
puentry->upState.parentIndex = pdentry->downState.parentIndex;
puentry->upState.downIndex = qparent_.down->getHeadIndex();
puentry->upState.setMatchNo(pstate.rightrows_);
if (da) puentry->setDiagsArea(da);
if (da) puentry->setDiagsAreax(da);

// insert entry into parent's up queue
qparent_.up->insert();
qparent_.up->insert();

// cancel this request and all its children
qparent_.down->cancelRequest(qparent_.down->getHeadIndex());
Expand All @@ -593,17 +593,17 @@ void ExCatpoundStmtTcb::processCardinalityError(ex_queue_entry *centry)
// create error for diags
ComDiagsArea *da = ExRaiseSqlError
(getGlobals()->getDefaultHeap(), centry,
(ExeErrorCode)-EXE_BLOCK_CARDINALITY_VIOLATION);
(ExeErrorCode)-EXE_BLOCK_CARDINALITY_VIOLATION);
processError(centry->getAtp(), da);
} // ExCatpoundStmtTcb::processCardinalityError


//This method is used to raise error -EXE_CS_EOD_ROLLBACK_ERROR or
// warning +EXE_CS_EOD. Raising this error or warning causes further processing of the
// CS to be stopped and if any updates were seen previously in this CS then the
// whole transaction is rolled back. Note that the warning EXE_CS_EOD is actually
//raised as an error here and and attached to a Q_SQLERROR entry. It is converted into a
//warning in the root::fetch or root::oltExecute method. This is done since it
// warning +EXE_CS_EOD. Raising this error or warning causes further processing of the
// CS to be stopped and if any updates were seen previously in this CS then the
// whole transaction is rolled back. Note that the warning EXE_CS_EOD is actually
//raised as an error here and and attached to a Q_SQLERROR entry. It is converted into a
//warning in the root::fetch or root::oltExecute method. This is done since it
//is crucial that this warning be posted and further processing on the offending CS be stopped.
//There is a possibility that warnings are not propogated correctly and we continue processing
//on the CS once the warning has been raised as an actual warning.
Expand All @@ -622,15 +622,15 @@ void ExCatpoundStmtTcb::processEODErrorOrWarning(NABoolean isWarning)
da = ExRaiseSqlError(getGlobals()->getDefaultHeap(), puentry,
(ExeErrorCode)-EXE_CS_EOD_ROLLBACK_ERROR);

puentry->setDiagsArea(da);
puentry->setDiagsAreax(da);
puentry->upState.status = ex_queue::Q_SQLERROR;
puentry->upState.parentIndex = pdentry->downState.parentIndex;
puentry->upState.downIndex = qparent_.down->getHeadIndex();
puentry->upState.setMatchNo((Lng32)0);

qparent_.up->insert();
}

//////////////////////////////////////////////////////////////////////////////
// CatpoundStmtPrivateState methods.
//////////////////////////////////////////////////////////////////////////////
Expand Down
2 changes: 1 addition & 1 deletion core/sql/executor/ExExeUtil.h
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ class ExExeUtilTcb : public ex_tcb

ComDiagsArea *&getDiagsArea() { return diagsArea_; }

void setDiagsArea(ComDiagsArea * d) { diagsArea_ = d; }
void setDiagsAreax(ComDiagsArea * d) { diagsArea_ = d; }

short setSchemaVersion(char * param1);

Expand Down
14 changes: 7 additions & 7 deletions core/sql/executor/ExExeUtilCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -427,8 +427,8 @@ Lng32 ExExeUtilTcb::changeAuditAttribute(char * tableName,
ExMasterStmtGlobals *masterGlob = exeGlob->castToExMasterStmtGlobals();

// set sqlparserflags to allow change of audit attribute
masterGlob->getStatement()->getContext()->setSqlParserFlags(0x400); // ALLOW_AUDIT_CHANGE
masterGlob->getStatement()->getContext()->setSqlParserFlags(0x400); // ALLOW_AUDIT_CHANGE

// make table unaudited
char stmt[500];
strcpy(stmt, "alter ");
Expand All @@ -447,10 +447,10 @@ Lng32 ExExeUtilTcb::changeAuditAttribute(char * tableName,
strcat(stmt, ";");
ComDiagsArea *diagsArea = getDiagsArea();
retcode = cliInterface()->executeImmediate
(stmt, NULL, NULL, TRUE, NULL, 0, &diagsArea);
setDiagsArea(diagsArea);
(stmt, NULL, NULL, TRUE, NULL, 0, &diagsArea);
setDiagsAreax(diagsArea);
masterGlob->getStatement()->getContext()->resetSqlParserFlags(0x400); // ALLOW_AUDIT_CHANGE

if (retcode < 0)
return retcode;

Expand All @@ -465,7 +465,7 @@ Lng32 ExExeUtilTcb::changeAuditAttribute(char * tableName,
}

void ExExeUtilTcb::handleErrors(Lng32 rc)
{
{
cliInterface()->allocAndRetrieveSQLDiagnostics(diagsArea_);
}

Expand All @@ -474,7 +474,7 @@ short ExExeUtilTcb::initializeInfoList(Queue* &infoList)
return cliInterface()->initializeInfoList(infoList, infoListIsOutputInfo_);
}

short ExExeUtilTcb::fetchAllRows(Queue * &infoList,
short ExExeUtilTcb::fetchAllRows(Queue * &infoList,
char * query,
Lng32 numOutputEntries,
NABoolean varcharFormat,
Expand Down
64 changes: 32 additions & 32 deletions core/sql/executor/ExExeUtilExplain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4045,35 +4045,35 @@ short ExExeUtilDisplayExplainComplexTcb::work()
step_ = DONE_;
}
break;

case ERROR_:
{
if (qparent_.up->isFull())
return WORK_OK;

// Return EOF.
ex_queue_entry * up_entry = qparent_.up->getTailEntry();
up_entry->upState.parentIndex =

up_entry->upState.parentIndex =
pentry_down->downState.parentIndex;

up_entry->upState.setMatchNo(0);
up_entry->upState.status = ex_queue::Q_SQLERROR;

ComDiagsArea *diagsArea = up_entry->getDiagsArea();

if (diagsArea == NULL)
diagsArea =
diagsArea =
ComDiagsArea::allocate(this->getGlobals()->getDefaultHeap());

if (getDiagsArea())
diagsArea->mergeAfter(*getDiagsArea());
up_entry->setDiagsArea (diagsArea);

up_entry->setDiagsAreax(diagsArea);

// insert into parent
qparent_.up->insert();

pstate.matches_ = 0;

step_ = DONE_;
Expand All @@ -4087,16 +4087,16 @@ short ExExeUtilDisplayExplainComplexTcb::work()

// Return EOF.
ex_queue_entry * up_entry = qparent_.up->getTailEntry();
up_entry->upState.parentIndex =

up_entry->upState.parentIndex =
pentry_down->downState.parentIndex;

up_entry->upState.setMatchNo(0);
up_entry->upState.status = ex_queue::Q_NO_DATA;

// insert into parent
qparent_.up->insert();

pstate.matches_ = 0;
step_ = EMPTY_;
qparent_.down->removeHead();
Expand Down Expand Up @@ -4258,35 +4258,35 @@ short ExExeUtilDisplayExplainShowddlTcb::work()
step_ = DONE_;
}
break;

case ERROR_:
{
if (qparent_.up->isFull())
return WORK_OK;

// Return EOF.
ex_queue_entry * up_entry = qparent_.up->getTailEntry();
up_entry->upState.parentIndex =

up_entry->upState.parentIndex =
pentry_down->downState.parentIndex;

up_entry->upState.setMatchNo(0);
up_entry->upState.status = ex_queue::Q_SQLERROR;

ComDiagsArea *diagsArea = up_entry->getDiagsArea();

if (diagsArea == NULL)
diagsArea =
diagsArea =
ComDiagsArea::allocate(this->getGlobals()->getDefaultHeap());

if (getDiagsArea())
diagsArea->mergeAfter(*getDiagsArea());
up_entry->setDiagsArea (diagsArea);

up_entry->setDiagsAreax(diagsArea);

// insert into parent
qparent_.up->insert();

pstate.matches_ = 0;

step_ = DONE_;
Expand All @@ -4300,16 +4300,16 @@ short ExExeUtilDisplayExplainShowddlTcb::work()

// Return EOF.
ex_queue_entry * up_entry = qparent_.up->getTailEntry();
up_entry->upState.parentIndex =

up_entry->upState.parentIndex =
pentry_down->downState.parentIndex;

up_entry->upState.setMatchNo(0);
up_entry->upState.status = ex_queue::Q_NO_DATA;

// insert into parent
qparent_.up->insert();

pstate.matches_ = 0;
step_ = EMPTY_;
qparent_.down->removeHead();
Expand Down
15 changes: 8 additions & 7 deletions core/sql/executor/ExExeUtilLoad.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -931,14 +931,14 @@ ExWorkProcRetcode ExExeUtilAqrWnrInsertTcb::work()
{
ComDiagsArea * da = ComDiagsArea::allocate(
getGlobals()->getDefaultHeap());
pentry_up->setDiagsArea(da);
pentry_up->setDiagsAreax(da);
}
pentry_up->getDiagsArea()->mergeAfter(*getDiagsArea());
getDiagsArea()->clear();
SQL_EXEC_ClearDiagnostics(NULL);
}
pentry_up->upState.status = ex_queue::Q_SQLERROR;
pentry_up->upState.parentIndex =
pentry_up->upState.parentIndex =
pentry_down->downState.parentIndex;
pentry_up->upState.downIndex = qparent_.down->getHeadIndex();
qparent_.up->insert();
Expand All @@ -953,13 +953,13 @@ ExWorkProcRetcode ExExeUtilAqrWnrInsertTcb::work()
pentry_up->upState.parentIndex = pentry_down->downState.parentIndex;
pentry_up->upState.setMatchNo(0);
pentry_up->upState.status = ex_queue::Q_NO_DATA;

// insert into parent
qparent_.up->insert();

SETSTEP(INITIAL_);
qparent_.down->removeHead();

break;
}
} // switch
Expand Down Expand Up @@ -1371,7 +1371,7 @@ short ExExeUtilHBaseBulkLoadTcb::work()
&diagsArea);
if (parserFlagSet)
masterGlob->getStatement()->getContext()->resetSqlParserFlags(0x20000);
setDiagsArea(diagsArea);
setDiagsAreax(diagsArea);
if (cliRC < 0)
{
rowsAffected_ = 0;
Expand Down Expand Up @@ -1854,8 +1854,9 @@ void ExExeUtilHBaseBulkUnLoadTcb::createHdfsFileError(Int32 hdfsClientRetCode)
ExRaiseSqlError(getHeap(), &diagsArea, (ExeErrorCode)(8447), NULL,
NULL, NULL, NULL, errorMsg, (char *)GetCliGlobals()->getJniErrorStr());
ex_queue_entry *pentry_up = qparent_.up->getTailEntry();
pentry_up->setDiagsArea(diagsArea);
pentry_up->setDiagsAreax(diagsArea);
}

////////////////////////////////////////////////////////////////
// Constructor for class ExExeUtilHbaseLoadTcb
///////////////////////////////////////////////////////////////
Expand Down
Loading