You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafodion.apache.org by an...@apache.org on 2017/09/07 01:55:08 UTC
[14/30] incubator-trafodion git commit: TRAFODION-2731 CodeCleanup:
Remove obsolete, legacy and unused code
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1522c8cd/core/sql/executor/ex_control.cpp
----------------------------------------------------------------------
diff --git a/core/sql/executor/ex_control.cpp b/core/sql/executor/ex_control.cpp
index 5a7ba4e..3684b1f 100644
--- a/core/sql/executor/ex_control.cpp
+++ b/core/sql/executor/ex_control.cpp
@@ -55,9 +55,7 @@
#include "ex_ddl.h"
#include "ComRtUtils.h"
#include "ComUser.h"
-#ifdef NA_CMPDLL
#include "CmpContext.h"
-#endif // NA_CMPDLL
ex_tcb * ExControlTdb::build(ex_globals * glob)
{
@@ -182,11 +180,9 @@ short ExControlTcb::work()
// Only a STATIC compile will actually affect Arkcmp's context.
- CmpCompileInfo c(buf, usedlen, sqlTextCharSet, NULL, 0, NULL, 0, 0, 0);
+ CmpCompileInfo c(buf, usedlen, sqlTextCharSet, NULL, 0, 0, 0);
size_t dataLen = c.getLength();
-#ifdef NA_CMPDLL
NABoolean saveControl = FALSE; // if save controls in exe ControlInfoTables
-#endif // NA_CMPDLL
char * data = new(getHeap()) char[dataLen];
c.pack(data);
ContextCli *currCtxt = getGlobals()->castToExExeStmtGlobals()->
@@ -194,8 +190,6 @@ short ExControlTcb::work()
ExSqlComp *cmp = NULL;
Int32 cmpStatus = 0;
{
-#ifdef NA_CMPDLL
-
// If use embedded compiler, send the settings to it
if (currCtxt->getSessionDefaults()->callEmbeddedArkcmp() &&
currCtxt->isEmbeddedArkcmpInitialized() && (CmpCommon::context()) &&
@@ -234,7 +228,7 @@ short ExControlTcb::work()
dummyReply = NULL;
}
}
-#endif // NA_CMPDLL
+
// if there is an error using embedded compiler or we are already in the
// embedded compiler, send this to a regular compiler .
if (!currCtxt->getSessionDefaults()->callEmbeddedArkcmp() ||
@@ -279,179 +273,175 @@ short ExControlTcb::work()
getGlobals(), cmp->getDiags());
}
else
-#ifdef NA_CMPDLL
saveControl = TRUE;
-#endif // NA_CMPDLL
} // sendSettingsToCompiler(i) is true
} // i < currCtxt->getNumArkcmps()
} //cmpStatus= 0) || (CmpCommon::context()->getRecursionLevel() > 0
-#ifdef NA_CMPDLL
- if (saveControl)
-#endif // NA_CMPDLL
- {
- // Add control info to executor ControlInfoTable.
- currCtxt->
- getControlArea()->addControl(
- controlTdb().getType(),
- controlTdb().reset_,
- buf, usedlen,
- value[1], len[1],
- value[2], len[2],
- value[3], len[3],
- controlTdb().getControlActionType(),
- ExControlEntry::UPON_ALL,
- controlTdb().isNonResettable());
-
- // reset processing of setOnce cqds if a cqd * reset reset
- // is seen while the setOnce parserflags is set.
- // This indicates that ndcs has sent a cqd * reset reset
- // after setting all the cqds from its DSN.
- if (((currCtxt->getSqlParserFlags() & 0x400000) != 0) &&
- (controlTdb().getType() == DEFAULT_) &&
- (controlTdb().reset_ == -1) &&
- (value[1] != NULL) &&
- (len[1] == 0) &&
- (value[2] != NULL) &&
- (! str_cmp_ne(value[2], "RESET")))
- {
- currCtxt->resetSqlParserFlags(0x400000);
- }
- // Add cqds which are also ssds(set session defaults) to
- // the session defaults table.
- if (controlTdb().getType() == DEFAULT_)
- {
- if (strcmp(value[1], "AUTO_QUERY_RETRY") == 0)
- {
- if (strcmp(value[2], "OFF") == 0)
- currCtxt->getSessionDefaults()->setAqrType(0);
- else if (strcmp(value[2], "SYSTEM") == 0)
- currCtxt->getSessionDefaults()->setAqrType(1);
- else if (strcmp(value[2], "ON") == 0)
- currCtxt->getSessionDefaults()->setAqrType(2);
- }
- else if (strcmp(value[1], "AUTO_QUERY_RETRY_WARNINGS") == 0)
- {
- if (strcmp(value[2], "ON") == 0)
- currCtxt->getSessionDefaults()->setAQRWarnings(1);
- else
- currCtxt->getSessionDefaults()->setAQRWarnings(0);
- }
- else if (strcmp(value[1], "CATALOG") == 0)
- {
- currContext->getSessionDefaults()->
- setCatalog(value[2], strlen(value[2]));
- }
- else if (strcmp(value[1], "DBTR_PROCESS") == 0)
- {
- if (strcmp(value[2], "ON") == 0)
- currContext->getSessionDefaults()->setDbtrProcess(TRUE);
- }
- else if (strcmp(value[1], "IS_SQLCI") == 0)
- {
- if (strcmp(value[2], "ON") == 0)
- currContext->getSessionDefaults()->setMxciProcess(TRUE);
- }
- else if (strcmp(value[1], "NVCI_PROCESS") == 0)
- {
- if (strcmp(value[2], "ON") == 0)
- {
- currContext->getSessionDefaults()->setNvciProcess(TRUE);
- currContext->getSessionDefaults()->setStatisticsViewType(SQLCLI_PERTABLE_STATS);
- }
- }
- else if (strcmp(value[1], "ODBC_PROCESS") == 0)
- {
- if (strcmp(value[2], "ON") == 0)
- {
- currContext->getSessionDefaults()->setOdbcProcess(TRUE);
- currContext->getSessionDefaults()->setStatisticsViewType(SQLCLI_PERTABLE_STATS);
- }
- }
- else if (strcmp(value[1], "MARIAQUEST_PROCESS") == 0)
- {
- if (strcmp(value[2], "ON") == 0)
- {
- currContext->getSessionDefaults()->setMariaQuestProcess(TRUE);
- }
- }
- else if (strcmp(value[1], "JDBC_PROCESS") == 0)
- {
- if (strcmp(value[2], "ON") == 0)
- {
- currContext->getSessionDefaults()->setJdbcProcess(TRUE);
- currContext->getSessionDefaults()->setStatisticsViewType(SQLCLI_PERTABLE_STATS);
- }
- }
- else if (strcmp(value[1], "MODE_SEABASE") == 0)
- {
- if (strcmp(value[2], "ON") == 0)
- currContext->getSessionDefaults()->setModeSeabase(TRUE);
- else
- currContext->getSessionDefaults()->setModeSeabase(FALSE);
- }
- else if (strcmp(value[1], "SCHEMA") == 0)
- {
- currContext->getSessionDefaults()->
- setSchema(value[2], strlen(value[2]));
- }
- else if (strcmp(value[1], "USER_EXPERIENCE_LEVEL") == 0)
- {
- currContext->getSessionDefaults()->
- setUEL(value[2], strlen(value[2]));
- }
- else if (strcmp(value[1], "REDRIVE_CTAS") == 0)
- {
- if (strcmp(value[2], "ON") == 0)
- currContext->getSessionDefaults()->setRedriveCTAS(TRUE);
- else
- currContext->getSessionDefaults()->setRedriveCTAS(FALSE);
- }
- else if (strcmp(value[1], "EXSM_TRACE_FILE_PREFIX") == 0)
- {
- char *prefix = value[2];
- if (prefix != NULL)
- currContext->getSessionDefaults()->
- setExSMTraceFilePrefix(prefix, strlen(prefix));
- }
- else if (strcmp(value[1], "EXSM_TRACE_LEVEL") == 0)
- {
- int lvl = (int) strtoul(value[2], NULL, 10);
- currContext->getSessionDefaults()->
- setExSMTraceLevel(lvl);
- }
- else if (strcmp(value[1], "CALL_EMBEDDED_ARKCMP") == 0)
- {
- if ((strcmp(value[2], "TRUE") == 0) ||
- (strcmp(value[2], "ON") == 0)
- )
- {
- currContext->getSessionDefaults()->setCallEmbeddedArkcmp(TRUE);
- }
- else if ((strcmp(value[2], "FALSE") == 0) ||
- (strcmp(value[2], "OFF") == 0)
- )
- {
- currContext->getSessionDefaults()->setCallEmbeddedArkcmp(FALSE);
- }
- }
- else if (strcmp(value[1], "ESP_IDLE_TIMEOUT") == 0)
- {
- int lvl = (int) strtoul(value[2], NULL, 10);
- currContext->getSessionDefaults()->
- setEspIdleTimeout(lvl);
- }
- else if (strcmp(value[1], "COMPILER_IDLE_TIMEOUT") == 0)
- {
- int lvl = (int) strtoul(value[2], NULL, 10);
- currContext->getSessionDefaults()->
- setCompilerIdleTimeout(lvl);
- }
- }
- }
+ if (saveControl)
+ {
+ // Add control info to executor ControlInfoTable.
+ currCtxt->
+ getControlArea()->addControl(
+ controlTdb().getType(),
+ controlTdb().reset_,
+ buf, usedlen,
+ value[1], len[1],
+ value[2], len[2],
+ value[3], len[3],
+ controlTdb().getControlActionType(),
+ ExControlEntry::UPON_ALL,
+ controlTdb().isNonResettable());
+
+ // reset processing of setOnce cqds if a cqd * reset reset
+ // is seen while the setOnce parserflags is set.
+ // This indicates that ndcs has sent a cqd * reset reset
+ // after setting all the cqds from its DSN.
+ if (((currCtxt->getSqlParserFlags() & 0x400000) != 0) &&
+ (controlTdb().getType() == DEFAULT_) &&
+ (controlTdb().reset_ == -1) &&
+ (value[1] != NULL) &&
+ (len[1] == 0) &&
+ (value[2] != NULL) &&
+ (! str_cmp_ne(value[2], "RESET")))
+ {
+ currCtxt->resetSqlParserFlags(0x400000);
+ }
+
+ // Add cqds which are also ssds(set session defaults) to
+ // the session defaults table.
+ if (controlTdb().getType() == DEFAULT_)
+ {
+ if (strcmp(value[1], "AUTO_QUERY_RETRY") == 0)
+ {
+ if (strcmp(value[2], "OFF") == 0)
+ currCtxt->getSessionDefaults()->setAqrType(0);
+ else if (strcmp(value[2], "SYSTEM") == 0)
+ currCtxt->getSessionDefaults()->setAqrType(1);
+ else if (strcmp(value[2], "ON") == 0)
+ currCtxt->getSessionDefaults()->setAqrType(2);
+ }
+ else if (strcmp(value[1], "AUTO_QUERY_RETRY_WARNINGS") == 0)
+ {
+ if (strcmp(value[2], "ON") == 0)
+ currCtxt->getSessionDefaults()->setAQRWarnings(1);
+ else
+ currCtxt->getSessionDefaults()->setAQRWarnings(0);
+ }
+ else if (strcmp(value[1], "CATALOG") == 0)
+ {
+ currContext->getSessionDefaults()->
+ setCatalog(value[2], strlen(value[2]));
+ }
+ else if (strcmp(value[1], "DBTR_PROCESS") == 0)
+ {
+ if (strcmp(value[2], "ON") == 0)
+ currContext->getSessionDefaults()->setDbtrProcess(TRUE);
+ }
+ else if (strcmp(value[1], "IS_SQLCI") == 0)
+ {
+ if (strcmp(value[2], "ON") == 0)
+ currContext->getSessionDefaults()->setMxciProcess(TRUE);
+ }
+ else if (strcmp(value[1], "NVCI_PROCESS") == 0)
+ {
+ if (strcmp(value[2], "ON") == 0)
+ {
+ currContext->getSessionDefaults()->setNvciProcess(TRUE);
+ currContext->getSessionDefaults()->setStatisticsViewType(SQLCLI_PERTABLE_STATS);
+ }
+ }
+ else if (strcmp(value[1], "ODBC_PROCESS") == 0)
+ {
+ if (strcmp(value[2], "ON") == 0)
+ {
+ currContext->getSessionDefaults()->setOdbcProcess(TRUE);
+ currContext->getSessionDefaults()->setStatisticsViewType(SQLCLI_PERTABLE_STATS);
+ }
+ }
+ else if (strcmp(value[1], "MARIAQUEST_PROCESS") == 0)
+ {
+ if (strcmp(value[2], "ON") == 0)
+ {
+ currContext->getSessionDefaults()->setMariaQuestProcess(TRUE);
+ }
+ }
+ else if (strcmp(value[1], "JDBC_PROCESS") == 0)
+ {
+ if (strcmp(value[2], "ON") == 0)
+ {
+ currContext->getSessionDefaults()->setJdbcProcess(TRUE);
+ currContext->getSessionDefaults()->setStatisticsViewType(SQLCLI_PERTABLE_STATS);
+ }
+ }
+ else if (strcmp(value[1], "MODE_SEABASE") == 0)
+ {
+ if (strcmp(value[2], "ON") == 0)
+ currContext->getSessionDefaults()->setModeSeabase(TRUE);
+ else
+ currContext->getSessionDefaults()->setModeSeabase(FALSE);
+ }
+ else if (strcmp(value[1], "SCHEMA") == 0)
+ {
+ currContext->getSessionDefaults()->
+ setSchema(value[2], strlen(value[2]));
+ }
+ else if (strcmp(value[1], "USER_EXPERIENCE_LEVEL") == 0)
+ {
+ currContext->getSessionDefaults()->
+ setUEL(value[2], strlen(value[2]));
+ }
+ else if (strcmp(value[1], "REDRIVE_CTAS") == 0)
+ {
+ if (strcmp(value[2], "ON") == 0)
+ currContext->getSessionDefaults()->setRedriveCTAS(TRUE);
+ else
+ currContext->getSessionDefaults()->setRedriveCTAS(FALSE);
+ }
+ else if (strcmp(value[1], "EXSM_TRACE_FILE_PREFIX") == 0)
+ {
+ char *prefix = value[2];
+ if (prefix != NULL)
+ currContext->getSessionDefaults()->
+ setExSMTraceFilePrefix(prefix, strlen(prefix));
+ }
+ else if (strcmp(value[1], "EXSM_TRACE_LEVEL") == 0)
+ {
+ int lvl = (int) strtoul(value[2], NULL, 10);
+ currContext->getSessionDefaults()->
+ setExSMTraceLevel(lvl);
+ }
+ else if (strcmp(value[1], "CALL_EMBEDDED_ARKCMP") == 0)
+ {
+ if ((strcmp(value[2], "TRUE") == 0) ||
+ (strcmp(value[2], "ON") == 0)
+ )
+ {
+ currContext->getSessionDefaults()->setCallEmbeddedArkcmp(TRUE);
+ }
+ else if ((strcmp(value[2], "FALSE") == 0) ||
+ (strcmp(value[2], "OFF") == 0)
+ )
+ {
+ currContext->getSessionDefaults()->setCallEmbeddedArkcmp(FALSE);
+ }
+ }
+ else if (strcmp(value[1], "ESP_IDLE_TIMEOUT") == 0)
+ {
+ int lvl = (int) strtoul(value[2], NULL, 10);
+ currContext->getSessionDefaults()->
+ setEspIdleTimeout(lvl);
+ }
+ else if (strcmp(value[1], "COMPILER_IDLE_TIMEOUT") == 0)
+ {
+ int lvl = (int) strtoul(value[2], NULL, 10);
+ currContext->getSessionDefaults()->
+ setCompilerIdleTimeout(lvl);
+ }
+ }
+ }
}
getHeap()->deallocateMemory(data);
-
// all ok. Return EOF.
ex_queue_entry * up_entry = qparent_.up->getTailEntry();
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1522c8cd/core/sql/executor/ex_control.h
----------------------------------------------------------------------
diff --git a/core/sql/executor/ex_control.h b/core/sql/executor/ex_control.h
index 5c4a845..0a05376 100644
--- a/core/sql/executor/ex_control.h
+++ b/core/sql/executor/ex_control.h
@@ -63,16 +63,16 @@ public:
// retrieval of the virtual table function pointer of the class while
// unpacking. An empty constructor is enough.
// ---------------------------------------------------------------------
- NA_EIDPROC ExControlTdb()
+ ExControlTdb()
{}
- NA_EIDPROC virtual ~ExControlTdb()
+ virtual ~ExControlTdb()
{}
// ---------------------------------------------------------------------
// Build a TCB for this TDB. Redefined in the Executor project.
// ---------------------------------------------------------------------
- NA_EIDPROC virtual ex_tcb *build(ex_globals *globals);
+ virtual ex_tcb *build(ex_globals *globals);
private:
// ---------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1522c8cd/core/sql/executor/ex_ddl.cpp
----------------------------------------------------------------------
diff --git a/core/sql/executor/ex_ddl.cpp b/core/sql/executor/ex_ddl.cpp
index b7b4d94..b370a16 100644
--- a/core/sql/executor/ex_ddl.cpp
+++ b/core/sql/executor/ex_ddl.cpp
@@ -49,9 +49,7 @@
#include "ExSqlComp.h"
#include "HeapLog.h"
-#ifdef NA_CMPDLL
#include "CmpContext.h"
-#endif // NA_CMPDLL
#include "ComSmallDefs.h"
#include "ExExeUtil.h"
@@ -205,8 +203,6 @@ short ExDDLTcb::work()
CmpCompileInfo c(ddlTdb().query_, ddlTdb().queryLen_ + 1,
(Lng32)ddlTdb().queryCharSet_,
ddlTdb().objectName_, ddlTdb().objectNameLen_+1,
- masterGlob->getStatement()->recompControlInfo(),
- masterGlob->getStatement()->recompControlInfoLen(),
0, 0);
size_t dataLen = c.getLength();
@@ -253,7 +249,6 @@ short ExDDLTcb::work()
}
}
-#ifdef NA_CMPDLL
// Call either the embedded arkcmp, if exists, or external arkcmp
// but not both
if ( currContext->isEmbeddedArkcmpInitialized() &&
@@ -300,7 +295,6 @@ short ExDDLTcb::work()
}
}
else if (getArkcmp()) // regular arkcmp exists
-#endif
{ // start of calling the standard arkcmp process
cmp = getArkcmp();
@@ -529,9 +523,7 @@ short ExDDLwithStatusTcb::work()
mdi_ = new(getHeap())
CmpDDLwithStatusInfo(ddlTdb().query_, ddlTdb().queryLen_ + 1,
(Lng32)ddlTdb().queryCharSet_,
- ddlTdb().objectName_, ddlTdb().objectNameLen_+1,
- masterGlob->getStatement()->recompControlInfo(),
- masterGlob->getStatement()->recompControlInfoLen());
+ ddlTdb().objectName_, ddlTdb().objectNameLen_+1);
if (ddlTdb().getMDVersion())
mdi_->setGetMDVersion(TRUE);
@@ -868,10 +860,8 @@ ExSqlComp * ExDDLTcb::getArkcmp (void)
short indexIntoCompilerArray = currContext()->getIndexToCompilerArray();
const COM_VERSION compilerVersionOnEntry = (COM_VERSION) currContext()->getVersionOfCompiler();
-#ifdef NA_CMPDLL
if (!currContext()->getNumArkcmps())
return NULL; // no regular compiler exists
-#endif // NA_CMPDLL
if (compilerVersionOnEntry != getCompilerVersion())
{
@@ -988,7 +978,6 @@ short ExDescribeTcb::work()
}
}
#endif
-#ifdef NA_CMPDLL
// Call either the embedded arkcmp, if exists, or external arkcmp
// but not both
if (currContext() && currContext()->isEmbeddedArkcmpInitialized() &&
@@ -1037,7 +1026,6 @@ short ExDescribeTcb::work()
}
else if (getArkcmp()) // regular arkcmp exists
{
-#endif // NA_CMPDLL
// Build request and send to arkcmp. Wait for reply.
// This could be a waited or a nowaited call.
ExSqlComp *cmp = getArkcmp();
@@ -1480,8 +1468,6 @@ short ExProcessVolatileTableTcb::work()
CmpCompileInfo c(pvtTdb().query_, pvtTdb().queryLen_ + 1,
pvtTdb().queryCharSet_,
pvtTdb().objectName_, pvtTdb().objectNameLen_+1,
- masterGlob->getStatement()->recompControlInfo(),
- masterGlob->getStatement()->recompControlInfoLen(),
0, 0);
if (pvtTdb().hbaseDDL())
@@ -1514,133 +1500,132 @@ short ExProcessVolatileTableTcb::work()
size_t dataLen = c.getLength();
char * data = new(getHeap()) char[dataLen];
c.pack(data);
-#ifdef NA_CMPDLL
- // Call either the embedded arkcmp, if exists, or external arkcmp
- // but not both
- if ( currContext->isEmbeddedArkcmpInitialized() &&
- currContext->getSessionDefaults()->callEmbeddedArkcmp()
- && pvtTdb().hbaseDDL() &&
- CmpCommon::context() && (CmpCommon::context()->getRecursionLevel() == 0)
- )
- {
- Int32 embCmpStatus;
- const char *parentQid = masterGlob->getStatement()->
- getUniqueStmtId();
- CmpCommon::context()->sqlSession()->setParentQid(parentQid);
- if (embCmpDiagsArea == NULL)
- embCmpDiagsArea = ComDiagsArea::allocate(getHeap());
- embCmpStatus = CmpCommon::context()->compileDirect(
- data, dataLen,
- currContext->exHeap(),
- SQLCHARSETCODE_UTF8,
- EXSQLCOMP::PROCESSDDL,
- dummyReply, dummyLength,
- currContext->getSqlParserFlags(),
- parentQid, str_len(parentQid),
- embCmpDiagsArea);
- getHeap()->deallocateMemory(data);
- if (dummyReply != NULL)
- currContext->exHeap()->deallocateMemory((void*)dummyReply);
- if (embCmpStatus == ExSqlComp::SUCCESS)
- {
-
- // clear diagsArea of cli context which may have warnings
- // set when calling cli inside the embedded compiler
- if (!currContext->diags().getNumber(DgSqlCode::ERROR_))
- currContext->diags().clear();
-
- }
- else
- {
- handleErrors(pentry_down, embCmpDiagsArea, embCmpStatus);
- //Don't proceed if its an error.
- if (embCmpStatus == ExSqlComp::ERROR)
- {
- step_ = ERROR_;
- break;
- }
-
- }
- }
- else if (getArkcmp()) // regular arkcmp exists
-#endif
- {
- cmp = getGlobals()->castToExExeStmtGlobals()->
- castToExMasterStmtGlobals()->getCliGlobals()->getArkcmp();
-
- // ddl data is already in iso mapping default value.
- // Indicate that.
- // We cannot use the enum SQLCHARSETCODE_ISO_MAPPING out here as that
- // will cause mxcmp to use the default charset as iso88591.
- // So we send the charset of this input string.
- cmpStatus =
- cmp->sendRequest(EXSQLCOMP::PROCESSDDL, data, dataLen,
- TRUE, NULL,
- SQLCHARSETCODE_UTF8,
- TRUE, /*resend, if needed*/
- masterGlob->getStatement()->getUniqueStmtId(),
- masterGlob->getStatement()->getUniqueStmtIdLen());
-
- getHeap()->deallocateMemory(data);
-
- if (cmpStatus != ExSqlComp::SUCCESS)
- {
- // If its an error don't proceed further.
- handleErrors(pentry_down, cmp->getDiags(), (Int32) cmpStatus);
- if (cmpStatus == ExSqlComp::ERROR)
- {
- step_ = ERROR_;
- break;
- }
- }
-
- cmpStatus = cmp->getReply(dummyReply, dummyLength);
- cmp->getHeap()->deallocateMemory((void*)dummyReply);
- if (cmpStatus != ExSqlComp::SUCCESS)
- {
- // If its an error don't proceed further.
- handleErrors(pentry_down, cmp->getDiags(), (Int32) cmpStatus);
- if (cmpStatus == ExSqlComp::ERROR)
- {
- step_ = ERROR_;
- break;
- }
- }
-
- if (cmp->status() != ExSqlComp::FETCHED)
- {
- handleErrors(pentry_down, cmp->getDiags(), (Int32) cmpStatus);
-
- step_ = ERROR_;
- break;
- }
- }
-
- if ((pvtTdb().isCreate()) &&
- (pvtTdb().isSchema()))
- {
- masterGlob->getStatement()->getContext()->
- setVolatileSchemaCreated(TRUE);
- }
- if ((NOT pvtTdb().isCreate()) &&
- (pvtTdb().isSchema()))
- {
- masterGlob->getStatement()->getContext()->
- setVolatileSchemaCreated(FALSE);
- }
-
- if ((pvtTdb().isCreate()) &&
- (pvtTdb().isTable()))
- step_ = ADD_TO_VOL_TAB_LIST_;
- else if ((NOT pvtTdb().isCreate()) &&
- (pvtTdb().isTable()))
- step_ = REMOVE_FROM_VOL_TAB_LIST_;
- else
- step_ = DONE_;
+ // Call either the embedded arkcmp, if exists, or external arkcmp
+ // but not both
+ if ( currContext->isEmbeddedArkcmpInitialized() &&
+ currContext->getSessionDefaults()->callEmbeddedArkcmp()
+ && pvtTdb().hbaseDDL() &&
+ CmpCommon::context() && (CmpCommon::context()->getRecursionLevel() == 0)
+ )
+ {
+ Int32 embCmpStatus;
+ const char *parentQid = masterGlob->getStatement()->
+ getUniqueStmtId();
+ CmpCommon::context()->sqlSession()->setParentQid(parentQid);
+ if (embCmpDiagsArea == NULL)
+ embCmpDiagsArea = ComDiagsArea::allocate(getHeap());
+ embCmpStatus = CmpCommon::context()->compileDirect(
+ data, dataLen,
+ currContext->exHeap(),
+ SQLCHARSETCODE_UTF8,
+ EXSQLCOMP::PROCESSDDL,
+ dummyReply, dummyLength,
+ currContext->getSqlParserFlags(),
+ parentQid, str_len(parentQid),
+ embCmpDiagsArea);
+ getHeap()->deallocateMemory(data);
+ if (dummyReply != NULL)
+ currContext->exHeap()->deallocateMemory((void*)dummyReply);
+ if (embCmpStatus == ExSqlComp::SUCCESS)
+ {
+
+ // clear diagsArea of cli context which may have warnings
+ // set when calling cli inside the embedded compiler
+ if (!currContext->diags().getNumber(DgSqlCode::ERROR_))
+ currContext->diags().clear();
+
+ }
+ else
+ {
+ handleErrors(pentry_down, embCmpDiagsArea, embCmpStatus);
+ //Don't proceed if its an error.
+ if (embCmpStatus == ExSqlComp::ERROR)
+ {
+ step_ = ERROR_;
+ break;
+ }
+
+ }
+ }
+ else if (getArkcmp()) // regular arkcmp exists
+ {
+ cmp = getGlobals()->castToExExeStmtGlobals()->
+ castToExMasterStmtGlobals()->getCliGlobals()->getArkcmp();
+
+ // ddl data is already in iso mapping default value.
+ // Indicate that.
+ // We cannot use the enum SQLCHARSETCODE_ISO_MAPPING out here as that
+ // will cause mxcmp to use the default charset as iso88591.
+ // So we send the charset of this input string.
+ cmpStatus =
+ cmp->sendRequest(EXSQLCOMP::PROCESSDDL, data, dataLen,
+ TRUE, NULL,
+ SQLCHARSETCODE_UTF8,
+ TRUE, /*resend, if needed*/
+ masterGlob->getStatement()->getUniqueStmtId(),
+ masterGlob->getStatement()->getUniqueStmtIdLen());
+
+ getHeap()->deallocateMemory(data);
+
+ if (cmpStatus != ExSqlComp::SUCCESS)
+ {
+ // If its an error don't proceed further.
+ handleErrors(pentry_down, cmp->getDiags(), (Int32) cmpStatus);
+ if (cmpStatus == ExSqlComp::ERROR)
+ {
+ step_ = ERROR_;
+ break;
+ }
+ }
+
+ cmpStatus = cmp->getReply(dummyReply, dummyLength);
+ cmp->getHeap()->deallocateMemory((void*)dummyReply);
+ if (cmpStatus != ExSqlComp::SUCCESS)
+ {
+ // If its an error don't proceed further.
+ handleErrors(pentry_down, cmp->getDiags(), (Int32) cmpStatus);
+ if (cmpStatus == ExSqlComp::ERROR)
+ {
+ step_ = ERROR_;
+ break;
+ }
+ }
+
+ if (cmp->status() != ExSqlComp::FETCHED)
+ {
+ handleErrors(pentry_down, cmp->getDiags(), (Int32) cmpStatus);
+
+ step_ = ERROR_;
+ break;
+ }
+ }
+
+ if ((pvtTdb().isCreate()) &&
+ (pvtTdb().isSchema()))
+ {
+ masterGlob->getStatement()->getContext()->
+ setVolatileSchemaCreated(TRUE);
+ }
+
+ if ((NOT pvtTdb().isCreate()) &&
+ (pvtTdb().isSchema()))
+ {
+ masterGlob->getStatement()->getContext()->
+ setVolatileSchemaCreated(FALSE);
+ }
+
+ if ((pvtTdb().isCreate()) &&
+ (pvtTdb().isTable()))
+ step_ = ADD_TO_VOL_TAB_LIST_;
+ else if ((NOT pvtTdb().isCreate()) &&
+ (pvtTdb().isTable()))
+ step_ = REMOVE_FROM_VOL_TAB_LIST_;
+ else
+ step_ = DONE_;
}
break;
-
+
case ADD_TO_VOL_TAB_LIST_:
{
HashQueue * volTabList = currContext->getVolTabList();
@@ -1933,8 +1918,6 @@ short ExProcessInMemoryTableTcb::work()
CmpCompileInfo c(pimtTdb().query_, pimtTdb().queryLen_ + 1,
pimtTdb().queryCharSet_,
pimtTdb().objectName_, pimtTdb().objectNameLen_+1,
- masterGlob->getStatement()->recompControlInfo(),
- masterGlob->getStatement()->recompControlInfoLen(),
0, 0);
size_t dataLen = c.getLength();
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1522c8cd/core/sql/executor/ex_ddl.h
----------------------------------------------------------------------
diff --git a/core/sql/executor/ex_ddl.h b/core/sql/executor/ex_ddl.h
index ad47ebe..efb3eac 100644
--- a/core/sql/executor/ex_ddl.h
+++ b/core/sql/executor/ex_ddl.h
@@ -69,16 +69,16 @@ public:
// retrieval of the virtual table function pointer of the class while
// unpacking. An empty constructor is enough.
// ---------------------------------------------------------------------
- NA_EIDPROC ExDDLTdb()
+ ExDDLTdb()
{}
- NA_EIDPROC virtual ~ExDDLTdb()
+ virtual ~ExDDLTdb()
{}
// ---------------------------------------------------------------------
// Build a TCB for this TDB. Redefined in the Executor project.
// ---------------------------------------------------------------------
- NA_EIDPROC virtual ex_tcb *build(ex_globals *globals);
+ virtual ex_tcb *build(ex_globals *globals);
private:
// ---------------------------------------------------------------------
@@ -121,16 +121,16 @@ public:
// retrieval of the virtual table function pointer of the class while
// unpacking. An empty constructor is enough.
// ---------------------------------------------------------------------
- NA_EIDPROC ExDDLwithStatusTdb()
+ ExDDLwithStatusTdb()
{}
- NA_EIDPROC virtual ~ExDDLwithStatusTdb()
+ virtual ~ExDDLwithStatusTdb()
{}
// ---------------------------------------------------------------------
// Build a TCB for this TDB. Redefined in the Executor project.
// ---------------------------------------------------------------------
- NA_EIDPROC virtual ex_tcb *build(ex_globals *globals);
+ virtual ex_tcb *build(ex_globals *globals);
private:
// ---------------------------------------------------------------------
@@ -341,16 +341,16 @@ public:
// retrieval of the virtual table function pointer of the class while
// unpacking. An empty constructor is enough.
// ---------------------------------------------------------------------
- NA_EIDPROC ExDescribeTdb()
+ ExDescribeTdb()
{}
- NA_EIDPROC virtual ~ExDescribeTdb()
+ virtual ~ExDescribeTdb()
{}
// ---------------------------------------------------------------------
// Build a TCB for this TDB. Redefined in the Executor project.
// ---------------------------------------------------------------------
- NA_EIDPROC virtual ex_tcb *build(ex_globals *globals);
+ virtual ex_tcb *build(ex_globals *globals);
private:
// ---------------------------------------------------------------------
@@ -444,16 +444,16 @@ public:
// retrieval of the virtual table function pointer of the class while
// unpacking. An empty constructor is enough.
// ---------------------------------------------------------------------
- NA_EIDPROC ExProcessVolatileTableTdb()
+ ExProcessVolatileTableTdb()
{}
- NA_EIDPROC virtual ~ExProcessVolatileTableTdb()
+ virtual ~ExProcessVolatileTableTdb()
{}
// ---------------------------------------------------------------------
// Build a TCB for this TDB. Redefined in the Executor project.
// ---------------------------------------------------------------------
- NA_EIDPROC virtual ex_tcb *build(ex_globals *globals);
+ virtual ex_tcb *build(ex_globals *globals);
private:
// ---------------------------------------------------------------------
@@ -545,16 +545,16 @@ public:
// retrieval of the virtual table function pointer of the class while
// unpacking. An empty constructor is enough.
// ---------------------------------------------------------------------
- NA_EIDPROC ExProcessInMemoryTableTdb()
+ ExProcessInMemoryTableTdb()
{}
- NA_EIDPROC virtual ~ExProcessInMemoryTableTdb()
+ virtual ~ExProcessInMemoryTableTdb()
{}
// ---------------------------------------------------------------------
// Build a TCB for this TDB. Redefined in the Executor project.
// ---------------------------------------------------------------------
- NA_EIDPROC virtual ex_tcb *build(ex_globals *globals);
+ virtual ex_tcb *build(ex_globals *globals);
private:
// ---------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1522c8cd/core/sql/executor/ex_error.h
----------------------------------------------------------------------
diff --git a/core/sql/executor/ex_error.h b/core/sql/executor/ex_error.h
index 0e308d6..a1a07bc 100644
--- a/core/sql/executor/ex_error.h
+++ b/core/sql/executor/ex_error.h
@@ -54,21 +54,18 @@ struct ex_queue_pair;
// attached diagnostics area, then an empty one is allocated in heap "heap",
// and the indicated condition added to it. In either case, a pointer to
// the new condition is returned through parameter "cond".
-NA_EIDPROC
ComDiagsArea *ExRaiseSqlError(CollHeap* heap, ex_queue_entry* req,
ExeErrorCode code,
Lng32 * intParam1 = NULL,
char * stringParam1 = NULL,
ComCondition** cond=NULL);
-NA_EIDPROC
ComDiagsArea *ExRaiseSqlWarning(CollHeap* heap, ex_queue_entry* req,
ExeErrorCode code,
Lng32 * intParam1 = NULL,
char * stringParam1 = NULL,
ComCondition** cond=NULL);
-NA_EIDPROC
void ExHandleArkcmpErrors(ex_queue_pair &qparent,
ex_queue_entry *down_entry,
Lng32 matchNo,
@@ -76,7 +73,6 @@ void ExHandleArkcmpErrors(ex_queue_pair &qparent,
ComDiagsArea *da,
ExeErrorCode err = EXE_INTERNAL_ERROR);
-NA_EIDPROC
void ExHandleErrors(ex_queue_pair &qparent,
ex_queue_entry *down_entry,
Lng32 matchNo,
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1522c8cd/core/sql/executor/ex_esp_frag_dir.cpp
----------------------------------------------------------------------
diff --git a/core/sql/executor/ex_esp_frag_dir.cpp b/core/sql/executor/ex_esp_frag_dir.cpp
index f2ba14f..5627fe2 100644
--- a/core/sql/executor/ex_esp_frag_dir.cpp
+++ b/core/sql/executor/ex_esp_frag_dir.cpp
@@ -1182,9 +1182,7 @@ void ExEspControlMessage::actOnReceive(IpcConnection *connection)
int otherCPU, otherPID, otherNode_unused;
SB_Int64_Type seqNum = -1;
phandle.decompose(otherCPU, otherPID, otherNode_unused
-#ifdef SQ_PHANDLE_VERIFIER
, seqNum
-#endif
);
sm_target_t target;
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1522c8cd/core/sql/executor/ex_ex.cpp
----------------------------------------------------------------------
diff --git a/core/sql/executor/ex_ex.cpp b/core/sql/executor/ex_ex.cpp
index 83fb62f..0e71bd3 100644
--- a/core/sql/executor/ex_ex.cpp
+++ b/core/sql/executor/ex_ex.cpp
@@ -48,24 +48,9 @@
#include "NAError.h"
#include "exp_expr.h"
#include "ExCextdecs.h"
-
-
-#ifndef __EID
#include "logmxevent.h"
-#else // __EID
-#include "ExeDp2.h"
-#endif
-
-// -----------------------------------------------------------------------
-// There is currently a bug in the tandem include file sys/time.h that
-// prevents us to get the definition of gettimeofday from there.
-// -----------------------------------------------------------------------
-// NT Port - vs 01/17/97
-// -----------------------------------------------------------------------
-#if (!defined (__TANDEM) && !defined(__EID) )
extern Int32 gettimeofday(struct timeval *, struct timezone *);
-#endif
// -----------------------------------------------------------------------
// NT Port - GSH 03/18/97
@@ -495,7 +480,6 @@ void ex_tcb::computeNeededPoolInfo(
}
}
-#ifndef __EID
void ex_tcb::mergeStats(ExStatisticsArea *otherStats)
{
ex_globals * glob = getGlobals();
@@ -515,7 +499,6 @@ void ex_tcb::mergeStats(ExStatisticsArea *otherStats)
else
glob->getStatsArea()->merge(otherStats);
}
-#endif
void ex_tcb::cpuLimitExceeded()
{
@@ -668,7 +651,6 @@ short ex_tcb::handleDone(ex_queue_pair *qparent, ComDiagsArea *inDiagsArea)
}
__declspec(dllexport)
-NA_EIDPROC
NABoolean ExExprComputeSpace(ex_tcb * tcb)
{
@@ -678,40 +660,6 @@ NABoolean ExExprComputeSpace(ex_tcb * tcb)
void ex_log_ems( const char *f, Int32 l, const char * m)
{
}
-#if defined(NA_LINUX) && defined(__EID)
-void assert_botch_in_eid( const char *f, Int32 l, const char * m)
-{
- // longjmp to handler if the assert botches in DP2
- void * sessionBufPtr;
- int_32 sessionBufLen;
- Int32 retCode;
- ex_log_ems(f, l, m);
- // testpoint to softdown dp2 before doing longjmp.
- if (DP2_EXECUTOR_IS_TESTPOINT_SET(SoftDownOnInternalError) != 0)
- // DP2_EXECUTOR_PER('test', 'pnts', 011504);
- DP2_EXECUTOR_PER(0x74657374, 0x706e7473, 011504);
- char *envvar;
- envvar = getenv("EID_ABORT_ON_ASSERT");
- if (envvar && *envvar == '1')
- {
- abort();
- }
- retCode = DP2_GET_SESSION_CONTEXT(&sessionBufPtr, &sessionBufLen);
- if (retCode == 0 && sessionBufPtr != EID_NULLP)
- {
- jmp_buf *jmpBufPtr;
- ex_globals * glob;
- SqlSessionData * sqlSessionData = (SqlSessionData *)sessionBufPtr;
- if ((glob = sqlSessionData->getGlobals()) != 0)
- {
- if (glob->IsJmpInScope() && (jmpBufPtr = glob->getJmpBuf()) != 0)
- longjmp(*jmpBufPtr, EXASSERT_FAILURE);
- }
- }
- // retCode = DP2_EXECUTOR_PER('asrt', 'fail', 011504);
- retCode = DP2_EXECUTOR_PER(0x61737274, 0x6661696c, 011504);
-}
-#endif
#pragma nowarn(770) // warning elimination
void assert_botch_longjmp( const char *f, Int32 l, const char * m)
{
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1522c8cd/core/sql/executor/ex_ex.h
----------------------------------------------------------------------
diff --git a/core/sql/executor/ex_ex.h b/core/sql/executor/ex_ex.h
index 8e2b336..eb3b164 100644
--- a/core/sql/executor/ex_ex.h
+++ b/core/sql/executor/ex_ex.h
@@ -41,35 +41,19 @@
#include <setjmp.h>
#include "Platform.h"
-#ifndef __EID
extern jmp_buf ExeBuf;
-#endif
//typedef int (*funcptr) (void *);
typedef Int32 funcptr; // for now
-#if !defined(NA_WINNT) && defined(__EID)
- // The following fn is defined in ex_dp2exe_root.cpp
-NA_EIDPROC short logInternalErrorCode( const char * filename, Int32 line, Lng32 r );
-
-#define logInternalError(r) logInternalErrorCode(__FILE__, __LINE__, (r))
-
-#else
#define logInternalError(r) ((short)r)
-#endif
-NA_EIDPROC
void ex_log_ems( const char *f, Int32 l, const char * m);
-NA_EIDPROC
void assert_botch_longjmp( const char *f, int l, const char * m);
-#ifndef __EID
#define ex_assert(p, msg) if (!(p)) { assert_botch_abend( __FILE__ , __LINE__ , msg); }; // LCOV_EXCL_LINE
-#else
-void assert_botch_in_eid( const char *f, Int32 l, const char * m);
-#define ex_assert(p, msg) if (!(p)) { assert_botch_in_eid( __FILE__ , __LINE__ , msg); }; // LCOV_EXCL_LINE
-#endif
+
class ex_expr; // to be defined
// other classes referenced
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1522c8cd/core/sql/executor/ex_exe_stmt_globals.cpp
----------------------------------------------------------------------
diff --git a/core/sql/executor/ex_exe_stmt_globals.cpp b/core/sql/executor/ex_exe_stmt_globals.cpp
index caa2cdc..ecfbed1 100644
--- a/core/sql/executor/ex_exe_stmt_globals.cpp
+++ b/core/sql/executor/ex_exe_stmt_globals.cpp
@@ -59,7 +59,7 @@
class ComTdbRoot;
-#if !defined(__EID) && defined(_DEBUG) && defined(TRACE_ESP_ACCESS)
+#if defined(_DEBUG) && defined(TRACE_ESP_ACCESS)
#include "ComCextdecs.h"
// Comment in and build to trace an ESPAccess ESP process
@@ -262,7 +262,7 @@ ExExeStmtGlobals::ExExeStmtGlobals(short num_temps,
diagsArea_ = NULL;
resolvedNameList_ = NULL;
-#if !defined(__EID) && defined(_DEBUG) && defined (TRACE_ESP_ACCESS)
+#if defined(_DEBUG) && defined (TRACE_ESP_ACCESS)
espTraceList_ = new(getDefaultHeap()) ESPTraceList(this, getDefaultHeap());
#endif
@@ -372,7 +372,7 @@ void ExExeStmtGlobals::deleteMe(NABoolean fatalError)
// don't be fooled! The next statement does nothing... (don't know why)
deleteMemory(this);
-#if !defined(__EID) && defined(_DEBUG) && defined (TRACE_ESP_ACCESS)
+#if defined(_DEBUG) && defined (TRACE_ESP_ACCESS)
if (espTraceList_)
{
NADELETE(espTraceList_, ESPTraceList, getDefaultHeap());
@@ -598,7 +598,6 @@ ExMasterStmtGlobals::ExMasterStmtGlobals(
statement_ = statement;
rowsAffected_ = 0;
cancelState_ = CLI_CANCEL_TCB_INVALID;
- stmtCntrs_ = NULL;
resultSetInfo_ = NULL;
extractInfo_ = NULL;
verifyESP_ = FALSE;
@@ -981,17 +980,11 @@ void ExMasterStmtGlobals::insertExtractEsp(const IpcProcessId &pid)
Lng32 len = str_len(pidBuf);
const GuaProcessHandle &phandle = pid.getPhandle();
-#if (defined (NA_LINUX) && defined (SQ_NEW_PHANDLE))
Int32 cpu = -1, pin = -1;
-#else
- short cpu = -1, pin = -1;
-#endif // NA_LINUX
Int32 nodeNumber = -1;
SB_Int64_Type seqNum = 0;
Lng32 guaError = phandle.decompose(cpu, pin, nodeNumber
-#ifdef SQ_PHANDLE_VERIFIER
, seqNum
-#endif
);
if (guaError != 0)
{
@@ -1004,11 +997,9 @@ void ExMasterStmtGlobals::insertExtractEsp(const IpcProcessId &pid)
str_cpy_all(esp->phandleText_, pidBuf, len + 1);
esp->cpu_ = cpu;
esp->nodeNumber_ = nodeNumber;
-#ifdef SQ_PHANDLE_VERIFIER
// tbd - parallel extract - extract master executor will need to use
// verifier as part of process name. Need to test this and see if it
// is happening correctly. Maybe defer until we support parallel extract.
-#endif
}
void ExMasterStmtGlobals::insertExtractSecurityKey(const char *key)
@@ -1352,8 +1343,7 @@ void ExEspStmtGlobals::setReplyTag(Int64 transid, short replyTag)
NABoolean ExEspStmtGlobals::restoreTransaction()
{
-#if (defined(NA_GUARDIAN_IPC) || defined(NA_GUARDIAN_MSG))
-#ifndef NA_TMFNOTYETSUPPORTED
+#if (defined(NA_GUARDIAN_IPC))
if (replyTag_ != GuaInvalidReplyTag)
{
// we do have a transaction work request, switch to its transaction
@@ -1372,9 +1362,6 @@ NABoolean ExEspStmtGlobals::restoreTransaction()
getFragment(myHandle_)->getNeedsTransaction();
}
#else
- return TRUE;
-#endif
-#else
// without TMF, just wing it and return TRUE, if browse access
ex_assert(NOT espFragInstanceDir_->
getFragment(myHandle_)->getNeedsTransaction(),
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1522c8cd/core/sql/executor/ex_exe_stmt_globals.h
----------------------------------------------------------------------
diff --git a/core/sql/executor/ex_exe_stmt_globals.h b/core/sql/executor/ex_exe_stmt_globals.h
index 7fc2904..5815eb7 100644
--- a/core/sql/executor/ex_exe_stmt_globals.h
+++ b/core/sql/executor/ex_exe_stmt_globals.h
@@ -52,12 +52,8 @@
#include "ex_frag_inst.h"
#include "Int64.h"
#include "ExCollections.h"
-#ifndef __EID
#include "timeout_data.h"
-#endif
-#if (defined (NA_NSK) || defined(NA_LINUX)) && !defined(__EID)
#include "ex_esp_frag_dir.h"
-#endif
// forward
class SequenceValueGenerator;
@@ -66,7 +62,7 @@ class SequenceValueGenerator;
//
//#define TRACE_ESP_ACCESS 1
-#if !defined(__EID) && defined(_DEBUG) && defined(TRACE_ESP_ACCESS)
+#if defined(_DEBUG) && defined(TRACE_ESP_ACCESS)
class ESPTraceEntry
{
@@ -112,9 +108,9 @@ public:
~ESPTraceList();
- NA_EIDPROC void insertNewTraceEntry(char *msg);
+ void insertNewTraceEntry(char *msg);
- NA_EIDPROC void logESPTraceToFile(char *fn, char *signature, ESPTraceList &traceList);
+ void logESPTraceToFile(char *fn, char *signature, ESPTraceList &traceList);
// Remove all entries the list and call their destructors
void clearAndDestroy();
@@ -171,9 +167,9 @@ public:
// Deletes objects this object points to... does NOT destroy
// this object
- NA_EIDPROC virtual void deleteMe(NABoolean fatalError);
+ virtual void deleteMe(NABoolean fatalError);
- NA_EIDPROC virtual ExExeStmtGlobals * castToExExeStmtGlobals();
+ virtual ExExeStmtGlobals * castToExExeStmtGlobals();
virtual ExMasterStmtGlobals * castToExMasterStmtGlobals();
virtual ExEspStmtGlobals * castToExEspStmtGlobals();
@@ -222,7 +218,7 @@ public:
inline ComDiagsArea *getDiagsArea() const { return diagsArea_; }
void setGlobDiagsArea(ComDiagsArea *da);
-#if !defined(__EID) && defined(_DEBUG) && defined (TRACE_ESP_ACCESS)
+#if defined(_DEBUG) && defined (TRACE_ESP_ACCESS)
inline ESPTraceList *getESPTraceList() const {return espTraceList_; }
void setESPTraceList(ESPTraceList *traceList) {espTraceList_ = traceList;}
#endif
@@ -299,8 +295,6 @@ public:
void setCloseAllOpens(NABoolean v) { closeAllOpens_ = v; }
NABoolean closeAllOpens() { return closeAllOpens_; }
-#ifndef __EID
-
// return TRUE iff this timeout was set, and then put value in timeoutValue
inline NABoolean getLockTimeout( char * tableName, Lng32 & timeoutValue )
{
@@ -325,8 +319,6 @@ public:
inline void yieldMemoryQuota(ULng32 size)
{ unusedBMOsMemoryQuota_ += size; }
-#endif
-
// getStreamTimeout: return TRUE (FALSE) if the stream-timeout was set (was
// not set). If set, the timeoutValue parameter would return that value
virtual NABoolean getStreamTimeout( Lng32 & timeoutValue );
@@ -398,16 +390,14 @@ private:
NABoolean closeAllOpens_;
-#ifndef __EID
// Hold all the dynamicly set timeout data (relevant to this statement)
// (Note: This pointer is NULL when there are no relevant timeouts set.)
TimeoutData * timeouts_;
// memory quota allocation given back by BMOs to be used by other BMOs
ULng32 unusedBMOsMemoryQuota_;
-#endif
-#if !defined(__EID) && defined(_DEBUG) && defined (TRACE_ESP_ACCESS)
+#if defined(_DEBUG) && defined (TRACE_ESP_ACCESS)
ESPTraceList *espTraceList_;
#endif
@@ -465,7 +455,7 @@ public:
// Deletes objects this object points to... does NOT destroy
// this object
- NA_EIDPROC virtual void deleteMe(NABoolean fatalError);
+ virtual void deleteMe(NABoolean fatalError);
virtual ExMasterStmtGlobals * castToExMasterStmtGlobals();
@@ -515,7 +505,7 @@ public:
NABoolean udrRuntimeOptionsChanged() const;
- NA_EIDPROC Int64 getRowsAffected() const {return rowsAffected_;}
+ Int64 getRowsAffected() const {return rowsAffected_;}
void setRowsAffected(Int64 newRows) {rowsAffected_ = newRows;}
inline CliStatement *getStatement() { return statement_; }
@@ -527,14 +517,12 @@ public:
void resetCancelState();
// The following two methods are called in /cli/Statement.cpp :
-#ifndef __EID
// copy timeout data relevant to this stmt (from the global CLI context)
// (This method is called after the statement was fixed up)
void setLocalTimeoutData(ComTdbRoot * rootTdb);
// check if a previous SET TIMEOUT statement affects this fixedup statement
// (This method is called before executing a previously fixedup statement)
NABoolean timeoutSettingChanged();
-#endif
ExRsInfo *getResultSetInfo(NABoolean createIfNecessary = FALSE);
void deleteResultSetInfo();
@@ -544,7 +532,6 @@ public:
IpcProcessId &pid, // OUT
ExRsInfo *&rsInfo); // OUT
-#if (defined (NA_NSK) || defined(NA_LINUX)) && !defined (__EID)
StatsGlobals *getStatsGlobals()
{ return (cliGlobals_ ? cliGlobals_->getStatsGlobals() : NULL); }
Long getSemId()
@@ -558,8 +545,6 @@ public:
Lng32 myNodeNumber() { return (cliGlobals_ ? cliGlobals_->myNodeNumber() : (short)0);}
-#endif
-
inline NABoolean verifyESP() { return verifyESP_; }
inline void setVerifyESP() { verifyESP_ = TRUE; }
inline void resetVerifyESP() { verifyESP_ = FALSE; }
@@ -609,9 +594,6 @@ private:
// stmt was fixed up (speeds up checking that timeout values are up-to-date)
ULng32 localSnapshotOfTimeoutChangeCounter_;
- // Measure stmt counters
- ExMeasStmtCntrs *stmtCntrs_;
-
// Store Procedure Result Set Info
// will always be NULL except for CALL statements that produce result sets.
ExRsInfo *resultSetInfo_;
@@ -737,7 +719,6 @@ public:
virtual void decrementSendTopMsgesOut();
-#if (defined (NA_NSK) || defined(NA_LINUX)) && !defined (__EID)
StatsGlobals *getStatsGlobals()
{ return espFragInstanceDir_->getStatsGlobals(); }
Long getSemId()
@@ -746,7 +727,6 @@ public:
{ return espFragInstanceDir_->getPid();}
pid_t getTid()
{ return espFragInstanceDir_->getTid();}
-#endif
NABoolean isAnESPAccess() {return isAnESPAccess_;}
void setIsAnESPAccess(NABoolean a) { isAnESPAccess_ = a;}
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1522c8cd/core/sql/executor/ex_frag_rt.cpp
----------------------------------------------------------------------
diff --git a/core/sql/executor/ex_frag_rt.cpp b/core/sql/executor/ex_frag_rt.cpp
index f468fd6..f56769c 100644
--- a/core/sql/executor/ex_frag_rt.cpp
+++ b/core/sql/executor/ex_frag_rt.cpp
@@ -55,7 +55,7 @@
#include "ComDistribution.h"
#include "sql_buffer_size.h"
// #include "MXVersion.h"
-#if (defined(NA_GUARDIAN_IPC) || defined(NA_GUARDIAN_MSG) || defined(NA_HSC))
+#if (defined(NA_GUARDIAN_IPC))
#include "ExCextdecs.h"
#endif
@@ -1306,13 +1306,8 @@ void ExRtFragTable::assignPartRangesAndTA(NABoolean /*initial*/)
new(ipcHeap) ExMsgTransId
(ipcHeap,
glob_->getTransid(),
-#if (defined (NA_LINUX) && defined (SQ_NEW_PHANDLE))
(short *)&(inst->usedEsp_->getIpcServer()->
getServerId().getPhandle().phandle_));
-#else
- (short *)inst->usedEsp_->getIpcServer()->
- getServerId().getPhandle().phandle_);
-#endif // NA_LINUX
*workMsg << *msgTransId;
@@ -1764,7 +1759,7 @@ void ExRtFragTable::addLoadRequestToMessage(ExMasterEspMessage *msg,
userID = *((Int32 *) pUserID);
userName = context->getDatabaseUserName();
userNameLen = (Int32) strlen(userName) + 1;
-#if defined(NA_DEBUG_C_RUNTIME)
+#ifdef _DEBUG
if (fragDir_->getType(fragId) == ExFragDir::ESP)
{
NABoolean doDebug = (getenv("DBUSER_DEBUG") ? TRUE : FALSE);
@@ -2093,9 +2088,7 @@ void ExRtFragTable::dumpSMRouteTable()
inst->usedEsp_->getIpcServer()->getServerId();
processId.getPhandle().decompose(cpu, pin, node
-#ifdef SQ_PHANDLE_VERIFIER
, seqNum
-#endif
);
node = ExSM_GetNodeID(cpu);
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1522c8cd/core/sql/executor/ex_globals.cpp
----------------------------------------------------------------------
diff --git a/core/sql/executor/ex_globals.cpp b/core/sql/executor/ex_globals.cpp
index a931391..add53ee 100644
--- a/core/sql/executor/ex_globals.cpp
+++ b/core/sql/executor/ex_globals.cpp
@@ -119,7 +119,6 @@ void ex_globals::deleteMe(NABoolean fatalError)
if (statsArea_)
{
-#ifndef __EID
StatsGlobals *statsGlobals = getStatsGlobals();
if (statsGlobals == NULL)
{
@@ -135,9 +134,6 @@ void ex_globals::deleteMe(NABoolean fatalError)
NADELETE(statsArea_, ExStatisticsArea, statsArea_->getHeap());
statsGlobals->releaseStatsSemaphore(semId, getPid(), savedPriority, savedStopMode);
}
-#else
- NADELETE(statsArea_, ExStatisticsArea, statsArea_->getHeap());
-#endif
}
statsArea_ = NULL;
cleanupTcbs();
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1522c8cd/core/sql/executor/ex_globals.h
----------------------------------------------------------------------
diff --git a/core/sql/executor/ex_globals.h b/core/sql/executor/ex_globals.h
index f835b1a..27e2ae2 100644
--- a/core/sql/executor/ex_globals.h
+++ b/core/sql/executor/ex_globals.h
@@ -70,67 +70,67 @@ class ex_globals : public ExGod
{
public:
- NA_EIDPROC ex_globals(short num_temps,
+ ex_globals(short num_temps,
short create_gui_sched = 0,
Space * space = NULL,
CollHeap * heap = NULL);
// reallocate members
- NA_EIDPROC void reAllocate(short create_gui_sched = 0);
+ void reAllocate(short create_gui_sched = 0);
// to be called instead of a destructor
- NA_EIDPROC virtual void deleteMe(NABoolean fatalError);
+ virtual void deleteMe(NABoolean fatalError);
// operator to delete memory allocated with ::operator new(ex_globals *)
// NOTE: this of course does NOT call the destructor for the object to delete
- NA_EIDPROC void deleteMemory(void *mem);
+ void deleteMemory(void *mem);
- NA_EIDPROC inline ExScheduler * getScheduler() { return sch_; }
+ inline ExScheduler * getScheduler() { return sch_; }
- NA_EIDPROC inline void ** getTempsList() { return tempList_; }
- NA_EIDPROC inline Lng32 getNumTemps() const { return numTemps_; }
- NA_EIDPROC void setNumOfTemps(Lng32 numTemps);
+ inline void ** getTempsList() { return tempList_; }
+ inline Lng32 getNumTemps() const { return numTemps_; }
+ void setNumOfTemps(Lng32 numTemps);
- NA_EIDPROC inline void setSpace(Space * space) {space_ = space;}
- NA_EIDPROC inline Space * getSpace() {return space_;}
+ inline void setSpace(Space * space) {space_ = space;}
+ inline Space * getSpace() {return space_;}
// return a pointer to default heap, which is the heap specified
// as an argument to the constructor
- NA_EIDPROC inline CollHeap *getDefaultHeap() { return heap_; }
+ inline CollHeap *getDefaultHeap() { return heap_; }
- NA_EIDPROC virtual ExExeStmtGlobals * castToExExeStmtGlobals();
- NA_EIDPROC virtual ExEidStmtGlobals * castToExEidStmtGlobals();
+ virtual ExExeStmtGlobals * castToExExeStmtGlobals();
+ virtual ExEidStmtGlobals * castToExEidStmtGlobals();
- NA_EIDPROC inline void setStatsArea(ExStatisticsArea * statsArea)
+ inline void setStatsArea(ExStatisticsArea * statsArea)
{ statsArea_ = statsArea; }
// returns stats area, if allocated AND if stats are enabled
- NA_EIDPROC ExStatisticsArea* getStatsArea()
+ ExStatisticsArea* getStatsArea()
{ return (statsEnabled() ? statsArea_ : NULL); }
// returns stats area, if it were allocated
- NA_EIDPROC ExStatisticsArea* getOrigStatsArea()
+ ExStatisticsArea* getOrigStatsArea()
{ return statsArea_; }
- NA_EIDPROC inline jmp_buf *getJmpBuf() { return &longJmpTgt_; }
- NA_EIDPROC inline void setJmpInScope(NABoolean jmpInScope)
+ inline jmp_buf *getJmpBuf() { return &longJmpTgt_; }
+ inline void setJmpInScope(NABoolean jmpInScope)
{ jmpInScope_ = jmpInScope; }
- NA_EIDPROC inline NABoolean IsJmpInScope() { return jmpInScope_; }
+ inline NABoolean IsJmpInScope() { return jmpInScope_; }
- NA_EIDPROC inline void setEventConsumed(UInt32 *eventConsumed)
+ inline void setEventConsumed(UInt32 *eventConsumed)
{ eventConsumedAddr_ = eventConsumed; }
- NA_EIDPROC inline UInt32 *getEventConsumed()
+ inline UInt32 *getEventConsumed()
{ return eventConsumedAddr_; }
- NA_EIDPROC inline void registerTcb( ex_tcb *newTcb)
+ inline void registerTcb( ex_tcb *newTcb)
{ tcbList_.insert(newTcb); }
- NA_EIDPROC void cleanupTcbs();
+ void cleanupTcbs();
- NA_EIDPROC void testAllQueues();
+ void testAllQueues();
- NA_EIDPROC ExMeasStmtCntrs* getMeasStmtCntrs();
+ ExMeasStmtCntrs* getMeasStmtCntrs();
// get the fragment id, the number of instances for my fragment,
@@ -139,43 +139,39 @@ public:
virtual Lng32 getNumOfInstances() const = 0;
virtual Lng32 getMyInstanceNumber() const = 0;
-NA_EIDPROC
+
inline ULng32 getInjectErrorAtExpr() const
{ return injectErrorAtExprFreq_; }
-NA_EIDPROC
+
inline void setInjectErrorAtExpr(ULng32 cif)
{ injectErrorAtExprFreq_ = cif; }
-NA_EIDPROC
+
inline ULng32 getInjectErrorAtQueue() const
{ return injectErrorAtQueueFreq_; }
-NA_EIDPROC
+
inline void setInjectErrorAtQueue(ULng32 cif)
{ injectErrorAtQueueFreq_ = cif; }
-NA_EIDPROC
const LIST(ex_tcb *) &tcbList() const { return tcbList_; }
-NA_EIDPROC
+
NABoolean computeSpace(){return (flags_ & COMPUTE_SPACE) != 0;};
-NA_EIDPROC
void setComputeSpace(NABoolean v)
{ (v ? flags_ |= COMPUTE_SPACE : flags_ &= ~COMPUTE_SPACE); };
-NA_EIDPROC
+
NABoolean measStmtEnabled(){return (flags_ & MEAS_STMT_ENABLED) != 0;};
-NA_EIDPROC
void setMeasStmtEnabled(NABoolean v)
{ (v ? flags_ |= MEAS_STMT_ENABLED : flags_ &= ~MEAS_STMT_ENABLED); };
-NA_EIDPROC
+
NABoolean statsEnabled() {return (flags_ & STATS_ENABLED) != 0;};
-NA_EIDPROC
void setStatsEnabled(NABoolean v)
{ (v ? flags_ |= STATS_ENABLED : flags_ &= ~STATS_ENABLED); };
// getStreamTimeout: return TRUE (FALSE) if the stream-timeout was set (was
// not set). If set, the timeoutValue parameter would return that value
- NA_EIDPROC virtual NABoolean getStreamTimeout( Lng32 & timeoutValue ) = 0;
+ virtual NABoolean getStreamTimeout( Lng32 & timeoutValue ) = 0;
UInt32 planVersion() {return planVersion_;};
void setPlanVersion(UInt32 pv){planVersion_ = pv; };
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1522c8cd/core/sql/executor/ex_god.h
----------------------------------------------------------------------
diff --git a/core/sql/executor/ex_god.h b/core/sql/executor/ex_god.h
index 1ec8124..9bbe887 100644
--- a/core/sql/executor/ex_god.h
+++ b/core/sql/executor/ex_god.h
@@ -48,7 +48,6 @@
class ExGod : public NABasicObject
{
protected:
-NA_EIDPROC
virtual ~ExGod();
};
#pragma warn(1103) // warning elimination
@@ -57,6 +56,5 @@ NA_EIDPROC
// the next two methods will eventually be removed after all
// executor objects have been derived from ExGod(or something
// similar).
-NA_EIDPROC
void * operator new(size_t size, Space *s);
#endif
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1522c8cd/core/sql/executor/ex_hash_grby.cpp
----------------------------------------------------------------------
diff --git a/core/sql/executor/ex_hash_grby.cpp b/core/sql/executor/ex_hash_grby.cpp
index 325c169..8ce966c 100644
--- a/core/sql/executor/ex_hash_grby.cpp
+++ b/core/sql/executor/ex_hash_grby.cpp
@@ -75,7 +75,7 @@ const char *ex_hash_grby_tcb::HashGrbyPhaseStr[] = {
NABoolean ex_hash_grby_tcb::needStatsEntry()
{
ComTdb::CollectStatsType statsType = getGlobals()->getStatsArea()->getCollectStatsType();
- // stats are collected for ALL and MEASURE options.
+ // stats are collected for ALL and OPERATOR options.
if (statsType == ComTdb::ALL_STATS || statsType == ComTdb::OPERATOR_STATS)
return TRUE;
else
@@ -166,14 +166,10 @@ ex_hash_grby_tcb::ex_hash_grby_tcb(const ex_hash_grby_tdb & hash_grby_tdb,
{
bmoStats_ = NULL;
hashGroupByStats_ = NULL;
-#ifndef __EID
heap_ = new (glob->getDefaultHeap()) NAHeap("Hash Groupby Heap", (NAHeap *)glob->getDefaultHeap());
// set the memory monitor
memMonitor_ = getGlobals()->castToExExeStmtGlobals()->getMemoryMonitor();
-#else
- heap_ = glob->getDefaultHeap();
-#endif
// Copy all expression pointers. This must be done first because
// some of the pointers are used subsequently (i.e. bitMuxExpr_) in
@@ -470,8 +466,6 @@ short ex_hash_grby_tcb::work() {
workReadChild();
} break;
-#ifndef __EID
-
case HASH_GRBY_READ_OF_ROW: {
if (parentQueue_.up->isFull())
return WORK_OK;
@@ -510,8 +504,6 @@ short ex_hash_grby_tcb::work() {
return WORK_CALL_AGAIN;
} break;
-#endif
-
case HASH_GRBY_EVALUATE: {
workEvaluate();
} break;
@@ -654,7 +646,6 @@ short ex_hash_grby_tcb::work() {
// pass it to parent. rc_ has the error code and
// oldState_ tells us in which state the error occured
ComDiagsArea * diags = NULL;
-#ifndef __EID
if(rc_ == EXE_SORT_ERROR)
{
char msg[512];
@@ -678,7 +669,6 @@ short ex_hash_grby_tcb::work() {
msg);
}
else
-#endif
diags = ExRaiseSqlError(heap_, downParentEntry, (ExeErrorCode)-rc_);
downParentEntry->setDiagsArea(diags);
@@ -728,7 +718,6 @@ void ex_hash_grby_tcb::workInitialize() {
ULng32 noOfClusters = 0;
-#ifndef __EID
// We use memUsagePercent_ of the physical memory for the HGB.
ULng32 availableMemory = memMonitor_->getPhysMemInBytes() / 100
* hashGrbyTdb().memUsagePercent_;
@@ -739,19 +728,12 @@ void ex_hash_grby_tcb::workInitialize() {
if ( hashGrbyTdb().memoryQuotaMB() > 10 && // mem quota set? (10MB, 2 B safe)
hashGrbyTdb().memoryQuotaMB() * ONE_MEG < availableMemory )
availableMemory = hashGrbyTdb().memoryQuotaMB() * ONE_MEG ;
-#else
- // in DP2 just use 10 MB
- ULng32 availableMemory = 10 * ONE_MEG;
-#endif
haveSpilled_ = FALSE;
-#if !defined (__EID)
ioTimer_.resetTimer();
-#endif
if (!hashGrbyTdb().isPartialGroup_) {
-#ifndef __EID
// size of inner table (including row headers and hash chains) in bytes
// This may be a very large number, max out at 8 GB and take at
// least 100 KB. Don't completely trust the optimizer ;-)
@@ -788,7 +770,6 @@ void ex_hash_grby_tcb::workInitialize() {
// the extreme case, each cluster has only one bucket and only one buffer
ULng32 maxNoOfClusters = totalBuffers/bucketsPerCluster;
noOfClusters = MINOF(noOfClusters, maxNoOfClusters);
-#endif
}
else {
// partial group by. we need only one cluster. If this cluster is full
@@ -798,8 +779,6 @@ void ex_hash_grby_tcb::workInitialize() {
// Memory to be used for pHGB.
//
-#ifndef __EID
-
// For Partial Groupby in ESP, use a limited amount of memory
// Based on CQD EXE_MEMORY_FOR_PARTIALHGB_MB.
// Default to 100 MB, minimum setting 10 MB
@@ -810,7 +789,6 @@ void ex_hash_grby_tcb::workInitialize() {
} else if(availableMemory < 10 * ONE_MEG) {
availableMemory = 10 * ONE_MEG;
} // LCOV_EXCL_STOP
-#endif
// reset the counter for every run.
partialGroupbyMissCounter_ = 0;
@@ -843,15 +821,12 @@ void ex_hash_grby_tcb::workInitialize() {
buckets_,
bucketCount_,
availableMemory,
-#ifndef __EID
memMonitor_,
hashGrbyTdb().pressureThreshold_,
getGlobals()->castToExExeStmtGlobals(),
-#endif
&rc_,
hashGrbyTdb().isPartialGroup_, // no O/F
hashGrbyTdb().isPartialGroup_,
-#ifndef __EID
hashGrbyTdb().minBuffersToFlush_,
hashGrbyTdb().numInBatch_,
@@ -874,7 +849,6 @@ void ex_hash_grby_tcb::workInitialize() {
0,
0,
0,
-#endif
hashGrbyTdb().initialHashTableSize_,
getStatsEntry()
);
@@ -901,9 +875,7 @@ void ex_hash_grby_tcb::workInitialize() {
break;
}
-#ifndef __EID
clusterDb_->setBMOMaxMemThresholdMB(hashGrbyTdb().getBMOMaxMemThresholdMB());
-#endif
Cluster * cluster = NULL;
ULng32 i;
@@ -1177,11 +1149,7 @@ void ex_hash_grby_tcb::workReadChild() {
}
} else // (distinct) New group, no aggregates
if ( cluster->getState() == Cluster::CHAINED ) // not spilled yet
- #ifdef __EID
- returnResultCurrentRow();
- #else
- returnResultCurrentRow(cluster->getLastDataPointer()); // return this row now up to the parent
- #endif
+ returnResultCurrentRow(cluster->getLastDataPointer()); // return this row now up to the parent
}
else {
// we couldn't insert the row. If we got an error, handle it.
@@ -1242,14 +1210,13 @@ void ex_hash_grby_tcb::workReadChild() {
// remove the row from the child's queue
childQueue_.up->removeHead();
-#ifndef __EID
if ( hashGrbyTdb().logDiagnostics() ) { // LOG
// Report memory quota allocation grabbing while reading child rows
if ( clusterDb_->memoryQuotaMB() > hashGrbyTdb().memoryQuotaMB() ) {
char msg[512];
sprintf(msg, "HGB End reading input (%u). GRABBED additional quota %u MB",
- 0, // NA_64BIT, use instance id later
+ 0,
clusterDb_->memoryQuotaMB() -
hashGrbyTdb().memoryQuotaMB());
// log an EMS event and continue
@@ -1317,8 +1284,6 @@ void ex_hash_grby_tcb::workReadChild() {
// global count of unused memory, so that other BMOs may use this memory
clusterDb_->yieldUnusedMemoryQuota(ofClusterList_, bucketCount_ );
-#endif
-
} break;
case ex_queue::Q_SQLERROR: {
@@ -1452,8 +1417,6 @@ Int32 ex_hash_grby_tcb::workReadChildBitMux() {
}
// LCOV_EXCL_STOP
-#ifndef __EID
-
/////////////////////////////////////////////////////////////////////////////
// read rows from the overflow buffer and aggregate them into the
// hash buffer
@@ -1620,7 +1583,6 @@ void ex_hash_grby_tcb::workSpill() {
// all I/Os are done, go back to the state were we came from
setState(oldState_);
clusterDb_->setClusterToFlush(NULL);
-#ifndef __EID
if ( hashGrbyTdb().logDiagnostics() ) {
Int64 elapsedIOTime = ioTimer_.endTimer(); // stop timing, get current total
if (!haveSpilled_) {
@@ -1633,15 +1595,12 @@ void ex_hash_grby_tcb::workSpill() {
haveSpilled_ = TRUE;
}
}
-#endif
}
else {
numIOChecks_++;
-#ifndef __EID
if ( hashGrbyTdb().logDiagnostics() ) {
ioTimer_.startTimer(); // start accumulating time
}
-#endif
if (rc_)
setState(HASH_GRBY_ERROR);
};
@@ -1664,8 +1623,6 @@ void ex_hash_grby_tcb::workReadBuffer() {
};
};
-#endif
-
/////////////////////////////////////////////////////////////////////////////
// workEvaluate: prepare clusters for next phase
/////////////////////////////////////////////////////////////////////////////
@@ -1701,8 +1658,6 @@ void ex_hash_grby_tcb::workEvaluate() {
}
}
-#ifndef __EID
-
else {
// the cluster is FLUSHED/SPILLED.
@@ -1736,13 +1691,9 @@ void ex_hash_grby_tcb::workEvaluate() {
cluster->releaseAllHashBuffers();
};
-#endif
-
cluster = clusterDb_->getClusterList();
};
-#ifndef __EID
-
// all clusters are now either processed or on the overFlowList.
// Before handling another spilled cluster, try and yield some memory
@@ -1817,7 +1768,6 @@ void ex_hash_grby_tcb::workEvaluate() {
return;
}
-#endif
// no more clusters to process. We are done unless there are bitmux
// rows to return (and aggregation is used, so these rows weren't returned)
if ( bitMuxTable_ && hbAggrExpr_ )
@@ -1887,7 +1837,7 @@ ULng32 ex_hash_grby_tcb::workReturnRows(NABoolean tryToDefrag) {
}
if (resultPool_->get_free_tuple(workAtp_->getTupp(resultRowAtpIndex_),*rowLenPtr))
return 2 ; //WORK_POOL_BLOCKED;
-#if (defined (NA_LINUX) && defined(_DEBUG) && !defined(__EID))
+#if (defined(_DEBUG))
char txt[] = "hashgrpby";
SqlBuffer * buf = resultPool_->getCurrentBuffer();
sql_buffer_pool::logDefragInfo(txt,
@@ -1953,7 +1903,6 @@ ULng32 ex_hash_grby_tcb::workReturnRows(NABoolean tryToDefrag) {
matchCount_++;
upParentEntry->upState.setMatchNo(matchCount_);
-#ifndef __EID
if ( matchCount_ == 1 && haveSpilled_ ) {
// haveSpilled_ indicates that an overflow took place (Only for distinct
// HGB the overflow occurs after the return of the first row, but that
@@ -1963,7 +1912,6 @@ ULng32 ex_hash_grby_tcb::workReturnRows(NABoolean tryToDefrag) {
"HASH GRBY returns first row.",
hashGrbyTdb().getExplainNodeId());
}
-#endif
// insert into parent up queue
parentQueue_.up->insert();
@@ -2084,7 +2032,6 @@ void ex_hash_grby_tcb::workDone() {
parentQueue_.down->removeHead();
-#ifndef __EID
if ( haveSpilled_ && hashGrbyTdb().logDiagnostics() ) {
char msg[256];
Int64 elapsedIOTime = ioTimer_.endTimer();// stop timing, get current total
@@ -2096,7 +2043,6 @@ void ex_hash_grby_tcb::workDone() {
hashGrbyTdb().getExplainNodeId());
numIOChecks_ = 0;
}
-#endif
setState(HASH_GRBY_EMPTY);
parentQueue_.up->insert();
@@ -2116,11 +2062,9 @@ void ex_hash_grby_tcb::workDone() {
};
if (clusterDb_) {
-#ifndef __EID
// Yield memory allocated back to global count of unused memory, so that
// other BMOs may use this memory
clusterDb_->yieldAllMemoryQuota(); // yield all of the alloc memory
-#endif
delete clusterDb_;
clusterDb_ = NULL;
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1522c8cd/core/sql/executor/ex_hash_grby.h
----------------------------------------------------------------------
diff --git a/core/sql/executor/ex_hash_grby.h b/core/sql/executor/ex_hash_grby.h
index 5c06566..ace7ca5 100644
--- a/core/sql/executor/ex_hash_grby.h
+++ b/core/sql/executor/ex_hash_grby.h
@@ -78,16 +78,16 @@ public:
// retrieval of the virtual table function pointer of the class while
// unpacking. An empty constructor is enough.
// ---------------------------------------------------------------------
- NA_EIDPROC ex_hash_grby_tdb()
+ ex_hash_grby_tdb()
{}
- NA_EIDPROC virtual ~ex_hash_grby_tdb()
+ virtual ~ex_hash_grby_tdb()
{} // LCOV_EXCL_LINE
// ---------------------------------------------------------------------
// Build a TCB for this TDB. Redefined in the Executor project.
// ---------------------------------------------------------------------
- NA_EIDPROC virtual ex_tcb *build(ex_globals *globals);
+ virtual ex_tcb *build(ex_globals *globals);
private:
// ---------------------------------------------------------------------
@@ -152,9 +152,7 @@ class ex_hash_grby_tcb : public ex_tcb {
Space * space_;
CollHeap * heap_;
-#ifndef __EID
MemoryMonitor * memMonitor_;
-#endif
const ex_tcb * childTcb_;
ex_queue_pair parentQueue_;
@@ -260,91 +258,64 @@ class ex_hash_grby_tcb : public ex_tcb {
//CIF buffer defragmentation
tupp_descriptor * defragTd_;
-NA_EIDPROC
void workInitialize();
-NA_EIDPROC
void workReadChild();
-NA_EIDPROC
Int32 workReadChildBitMux();
-NA_EIDPROC
void workReadOverFlowRow();
-NA_EIDPROC
void workSpill();
-NA_EIDPROC
void workReadBuffer();
-NA_EIDPROC
void workEvaluate();
-NA_EIDPROC
ULng32 workReturnRows(NABoolean tryToDefrag);
-NA_EIDPROC
void workDone();
-NA_EIDPROC
void workHandleError(atp_struct* atp = NULL);
-NA_EIDPROC
inline void setState(HashGrbyState state) {
oldState_ = state_;
state_ = state;
};
-NA_EIDPROC
inline NABoolean isReadingFromChild() const { return readingChild_; }
-NA_EIDPROC
inline void inReadingFromChild() { readingChild_ = TRUE; }
-NA_EIDPROC
inline void doneReadingFromChild() { readingChild_ = FALSE; }
-NA_EIDPROC
void returnResultCurrentRow(HashRow * dataPointer = NULL);
-NA_EIDPROC
void resetClusterAndReadFromChild(); // Tmobile.
public:
static const char *HashGrbyPhaseStr[];
-NA_EIDPROC
ex_hash_grby_tcb(const ex_hash_grby_tdb & hash_grby_tdb,
const ex_tcb & childTcb,
ex_globals * glob);
-NA_EIDPROC
~ex_hash_grby_tcb();
-NA_EIDPROC
void freeResources(); // free resources
-NA_EIDPROC
void registerSubtasks();
-NA_EIDPROC
short work(); // when scheduled to do work
-NA_EIDPROC
inline ex_hash_grby_tdb & hashGrbyTdb() const;
-NA_EIDPROC
ex_queue_pair getParentQueue() const { return parentQueue_; }
-NA_EIDPROC
virtual const ex_tcb* getChild(Int32 pos) const;
-NA_EIDPROC
virtual Int32 numChildren() const { return 1; }
-NA_EIDPROC
virtual NABoolean needStatsEntry();
-NA_EIDPROC
virtual ExOperStats *doAllocateStatsEntry(CollHeap *heap,
ComTdb *tdb);
@@ -358,7 +329,6 @@ NA_EIDPROC
History : Yeogirl Yun 8/14/95
Initial Revision.
*****************************************************************************/
-NA_EIDPROC
inline const ex_tcb* ex_hash_grby_tcb::getChild(Int32 pos) const {
ex_assert((pos >= 0), ""); // LCOV_EXCL_START
if (pos == 0)
@@ -373,7 +343,6 @@ inline const ex_tcb* ex_hash_grby_tcb::getChild(Int32 pos) const {
//
///////////////////////////////////////////////////////////////////////////
-NA_EIDPROC
inline ex_hash_grby_tdb & ex_hash_grby_tcb::hashGrbyTdb() const {
return (ex_hash_grby_tdb &) tdb;
};
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1522c8cd/core/sql/executor/ex_hashj.cpp
----------------------------------------------------------------------
diff --git a/core/sql/executor/ex_hashj.cpp b/core/sql/executor/ex_hashj.cpp
index 602ce8d..b029975 100644
--- a/core/sql/executor/ex_hashj.cpp
+++ b/core/sql/executor/ex_hashj.cpp
@@ -216,14 +216,13 @@ void ex_hashj_tcb::registerSubtasks()
NABoolean ex_hashj_tcb::needStatsEntry()
{
ComTdb::CollectStatsType statsType = getGlobals()->getStatsArea()->getCollectStatsType();
- // stats are collected for ALL and MEASURE options.
+ // stats are collected for ALL and OPERATOR options.
if (statsType == ComTdb::ALL_STATS || statsType == ComTdb::OPERATOR_STATS)
return TRUE;
else
return FALSE;
}
-
ExOperStats * ex_hashj_tcb::doAllocateStatsEntry(CollHeap *heap, ComTdb *tdb)
{
ExBMOStats *stat;
@@ -1051,7 +1050,6 @@ ExWorkProcRetcode ex_hashj_tcb::workUp() {
if (!da || !da->contains((Lng32) -rc_))
{
ComDiagsArea * diags = NULL;
-#ifndef __EID
if(rc_ == EXE_SORT_ERROR)
{
char msg[512];
@@ -1076,7 +1074,6 @@ ExWorkProcRetcode ex_hashj_tcb::workUp() {
}
else
-#endif
diags = ExRaiseSqlError(heap_, downParentEntry,
(ExeErrorCode) -rc_);
@@ -1479,9 +1476,7 @@ NABoolean ex_hashj_tcb::allocateClusters() {
clusterDb_->setScratchOverflowMode(SCRATCH_DISK);
break;
}
-#ifndef __EID
clusterDb_->setBMOMaxMemThresholdMB(hashJoinTdb().getBMOMaxMemThresholdMB());
-#endif
bucketIdx = 0;
Cluster * cluster = NULL;
ULng32 i;
@@ -1966,7 +1961,6 @@ void ex_hashj_tcb::workEndPhase1() {
return;
}
-#if !defined(__EID)
// Yield memory quota (or if needed, flush another in-memory cluster
// to free more memory for phase 2) .
// first get some information about the clusters (number, sizes, etc.)
@@ -2019,7 +2013,7 @@ void ex_hashj_tcb::workEndPhase1() {
if ( clusterDb_->memoryQuotaMB() > hashJoinTdb().memoryQuotaMB() ) {
char msg[512];
str_sprintf(msg, "HJ End Phase 1 (%d). GRABBED additional quota %d MB",
- 0, // NA_64BIT, use instance id later
+ 0,
clusterDb_->memoryQuotaMB() - hashJoinTdb().memoryQuotaMB());
// log an EMS event and continue
SQLMXLoggingArea::logExecRtInfo(NULL, 0, msg, tdb.getExplainNodeId());
@@ -2030,7 +2024,7 @@ void ex_hashj_tcb::workEndPhase1() {
str_sprintf(msg,
"HJ End Phase 1 (%d). #inner rows: %Ld, #buckets: %d, #clusters: %d, #flushed: %d, total size %d MB, cluster size max- %d MB min- %d, variable size records: %s",
- 0, // NA_64BIT, use instance id later
+ 0,
totalRightRowsRead_,
bucketCount_ , numClusters, numFlushed,
totalSize, maxSize, minSize,
@@ -2040,7 +2034,6 @@ void ex_hashj_tcb::workEndPhase1() {
}
} // if logDiagnostics
-#endif
// all clusters are prepared. Go on with phase 2 of the join
pstate.setPhase(PHASE_2, bmoStats_);
@@ -2355,7 +2348,6 @@ void ex_hashj_tcb::workEndPhase2() {
clusterDb_->yieldUnusedMemoryQuota();
// Log -- end of phase 2
-#if !defined(__EID)
if ( hashJoinTdb().logDiagnostics() /* && clusterDb_->sawPressure() */ ) {
// L O G
// count the number of clusters
@@ -2380,14 +2372,13 @@ void ex_hashj_tcb::workEndPhase2() {
char msg[1024];
str_sprintf(msg,
"HJ End of Phase 2 (%d). Total outer size %d MB, cluster size max- %d MB min- %d MB, variable size records: %s",
- 0, // NA_64BIT, use instance id later
+ 0,
totalSize, maxSize, minSize,
hashJoinTdb().useVariableLength() ? "y" : "n");
// log an EMS event and continue
SQLMXLoggingArea::logExecRtInfo(NULL, 0, msg, tdb.getExplainNodeId());
}
-#endif
// all clusters are prepared. Go on with phase 3 of the join
// set the first inner cluster to read
@@ -2424,7 +2415,6 @@ void ex_hashj_tcb::resetClusterForHashLoop(Cluster *iCluster)
void ex_hashj_tcb::prepareForNextPairOfClusters(Cluster *iCluster)
{
-#if !defined(__EID)
if ( hashJoinTdb().logDiagnostics() /* && clusterDb_->sawPressure() */ ) {
// L O G
Int64 currTime = NA_JulianTimestamp();
@@ -2452,8 +2442,8 @@ void ex_hashj_tcb::prepareForNextPairOfClusters(Cluster *iCluster)
{
str_sprintf(msg,
"HJ Finished cluster (%d) in Phase 3 (%d) with %d Hash-Loop iterations.",
- 0, // NA_64BIT, use some id later (ULng32)iCluster & 0xFFF,
- 0, // NA_64BIT, use some id later (ULng32)clusterDb_ & 0xFFF,
+ 0,
+ 0,
iCluster->numLoops() + 1); // add uncounted last iter
// log an EMS event and continue
SQLMXLoggingArea::logExecRtInfo(NULL, 0, msg, tdb.getExplainNodeId());
@@ -2461,8 +2451,6 @@ void ex_hashj_tcb::prepareForNextPairOfClusters(Cluster *iCluster)
#endif
}
-#endif
-
// we are done with this pair of clusters; delete them and process
// the next pair;
@@ -3137,7 +3125,6 @@ void ex_hashj_tcb::workDone() {
if(!hashJoinTdb().isUniqueHashJoin())
releaseResultTupps();
-#if !defined(__EID)
if ( hashJoinTdb().logDiagnostics() &&
!hashJoinTdb().isUniqueHashJoin()
/* && clusterDb_->sawPressure() */ ) {
@@ -3164,7 +3151,7 @@ void ex_hashj_tcb::workDone() {
#else
str_sprintf(msg,
"HJ Finished Phase 3 (%d)",
- 0 // NA_64BIT, use instance id later
+ 0
);
#endif
@@ -3172,7 +3159,6 @@ void ex_hashj_tcb::workDone() {
SQLMXLoggingArea::logExecRtInfo(NULL, 0, msg, tdb.getExplainNodeId());
}
-#endif
// When Reuse is applied the inner clusters/buckets should be kept!
if ( ! isReuse() ) {
@@ -3743,7 +3729,7 @@ short ExUniqueHashJoinTcb::workReadInner(UInt32 defragLength)
bufferPool_->castToSerial()->setRowLength(dataPointer, defragLength);
}
-#if (defined (NA_LINUX) && defined(_DEBUG) && !defined(__EID))
+#if (defined(_DEBUG))
char txt[] = "hashjU";
sql_buffer_pool::logDefragInfo(txt,bufferPool_->getMaxRowLength(),
ROUND4(defragLength) + sizeof(HashRow),
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1522c8cd/core/sql/executor/ex_hashj.h
----------------------------------------------------------------------
diff --git a/core/sql/executor/ex_hashj.h b/core/sql/executor/ex_hashj.h
index c2e5130..ff5826a 100644
--- a/core/sql/executor/ex_hashj.h
+++ b/core/sql/executor/ex_hashj.h
@@ -71,16 +71,16 @@ public:
// retrieval of the virtual table function pointer of the class while
// unpacking. An empty constructor is enough.
// ---------------------------------------------------------------------
- NA_EIDPROC ex_hashj_tdb()
+ ex_hashj_tdb()
{}
- NA_EIDPROC virtual ~ex_hashj_tdb()
+ virtual ~ex_hashj_tdb()
{}
// ---------------------------------------------------------------------
// Build a TCB for this TDB. Redefined in the Executor project.
// ---------------------------------------------------------------------
- NA_EIDPROC virtual ex_tcb *build(ex_globals *globals);
+ virtual ex_tcb *build(ex_globals *globals);
private:
// ---------------------------------------------------------------------
@@ -171,8 +171,8 @@ public:
static const char *HashJoinPhaseStr[];
- virtual NA_EIDPROC NABoolean needStatsEntry();
- virtual NA_EIDPROC ExOperStats *doAllocateStatsEntry(CollHeap *heap,
+ virtual NABoolean needStatsEntry();
+ virtual ExOperStats *doAllocateStatsEntry(CollHeap *heap,
ComTdb *tdb);
protected:
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1522c8cd/core/sql/executor/ex_io_control.h
----------------------------------------------------------------------
diff --git a/core/sql/executor/ex_io_control.h b/core/sql/executor/ex_io_control.h
index 12e2bd5..8678e57 100644
--- a/core/sql/executor/ex_io_control.h
+++ b/core/sql/executor/ex_io_control.h
@@ -47,48 +47,30 @@
class ControlInfo
{
public:
-NA_EIDPROC
ControlInfo(): ciFlags_(HAS_NOTHING) {};
-NA_EIDPROC
~ControlInfo(){};
-NA_EIDPROC
inline up_state &getUpState();
-NA_EIDPROC
inline down_state &getDownState();
-NA_EIDPROC
+
inline ULng32 getBufferSequenceNumber();
-NA_EIDPROC
+
inline void setBufferSequenceNumber(ULng32 snum);
-NA_EIDPROC
inline NABoolean getIsDiagsAreaPresent() const;
-NA_EIDPROC
inline void setIsDiagsAreaPresent(NABoolean);
-NA_EIDPROC
inline NABoolean getIsDiagsAreaUnpacked() const;
-NA_EIDPROC
inline void setIsDiagsAreaUnpacked(NABoolean);
// an external diags area is one that gets sent outside of the sql_buffer
-NA_EIDPROC
inline NABoolean getIsExtDiagsAreaPresent() const;
-NA_EIDPROC
inline void setIsExtDiagsAreaPresent(NABoolean);
-NA_EIDPROC
inline NABoolean getIsDataRowPresent() const;
-NA_EIDPROC
inline void setIsDataRowPresent(NABoolean);
-NA_EIDPROC
inline NABoolean getIsStatsAreaPresent() const;
-NA_EIDPROC
inline void setIsStatsAreaPresent(NABoolean);
// an external stats area is one that gets sent outside of the sql_buffer
-NA_EIDPROC
inline NABoolean getIsExtStatsAreaPresent() const;
-NA_EIDPROC
inline void setIsExtStatsAreaPresent(NABoolean);
-NA_EIDPROC
inline void resetFlags();
-NA_EIDPROC
inline void copyFlags(const ControlInfo &other);
private:
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1522c8cd/core/sql/executor/ex_key_object.h
----------------------------------------------------------------------
diff --git a/core/sql/executor/ex_key_object.h b/core/sql/executor/ex_key_object.h
index 57a2300..8f1f426 100644
--- a/core/sql/executor/ex_key_object.h
+++ b/core/sql/executor/ex_key_object.h
@@ -51,7 +51,6 @@ class KeyObject : public ExGod
ULng32 keyLength_;
public:
- NA_EIDPROC
KeyObject(ex_expr * lkey_expr, ex_expr * hkey_expr,
ULng32 key_length);
~KeyObject();