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:22 UTC
[28/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/cli/Cli.cpp
----------------------------------------------------------------------
diff --git a/core/sql/cli/Cli.cpp b/core/sql/cli/Cli.cpp
index a25a31b..c6b9ea4 100644
--- a/core/sql/cli/Cli.cpp
+++ b/core/sql/cli/Cli.cpp
@@ -413,16 +413,6 @@ static Lng32 CliPrologue(CliGlobals * cliGlobals,
ContextCli * context = cliGlobals->currContext();
ComDiagsArea & diags = context->diags();
- // load the module, if specified and not already loaded
- if ((module) &&
- (module->module_name != 0) &&
- (!context->moduleAdded(module)))
- {
- retcode = SQLCLI_AddModule(cliGlobals, module);
- if (isERROR(retcode))
- return SQLCLI_ReturnCode(cliGlobals->currContext(),retcode);
- }
-
// If this is not a recursive CLI call, inherit the current
// process transid into this context. (We don't want to
// inherit the current process transid if this is a recursive
@@ -604,28 +594,28 @@ static Lng32 getNumericHostVarInfo(Descriptor *desc,
(Lng32*) &hv_ptr,
NULL, 0, NULL, 0);
if (retcode != 0)
- return SQLCLI_ReturnCode(desc->getContext(),retcode);//LCOV_EXCL_LINE
+ return SQLCLI_ReturnCode(desc->getContext(),retcode);
retcode = desc->getDescItem(desc_entry,
SQLDESC_LENGTH,
(Lng32*) &hv_length,
NULL, 0, NULL, 0);
if (retcode != 0)
- return SQLCLI_ReturnCode(desc->getContext(),retcode);//LCOV_EXCL_LINE
+ return SQLCLI_ReturnCode(desc->getContext(),retcode);
retcode = desc->getDescItem(desc_entry,
SQLDESC_TYPE_FS,
(Lng32*) &hv_type,
NULL, 0, NULL, 0);
if (retcode != 0)
- return SQLCLI_ReturnCode(desc->getContext(),retcode);//LCOV_EXCL_LINE
+ return SQLCLI_ReturnCode(desc->getContext(),retcode);
retcode = desc->getDescItem(desc_entry,
SQLDESC_IND_PTR,
(Lng32*) &ind_ptr,
NULL, 0, NULL, 0);
if (retcode != 0)
- return SQLCLI_ReturnCode(desc->getContext(),retcode);//LCOV_EXCL_LINE
+ return SQLCLI_ReturnCode(desc->getContext(),retcode);
// the host variable must have a scale of 0
Lng32 hv_scale;
@@ -634,7 +624,7 @@ static Lng32 getNumericHostVarInfo(Descriptor *desc,
(Lng32*) &hv_scale,
NULL, 0, NULL, 0);
if (retcode != 0)
- return SQLCLI_ReturnCode(desc->getContext(),retcode);//LCOV_EXCL_LINE
+ return SQLCLI_ReturnCode(desc->getContext(),retcode);
// $$$$ Enable this after scale got initialized
// if (hv_scale != 0)
// return -1;
@@ -712,7 +702,7 @@ static Lng32 InputValueFromNumericHostvar(Descriptor *desc,
indLength,
indType);
if (retcode)
- return SQLCLI_ReturnCode(desc->getContext(),retcode);//LCOV_EXCL_LINE
+ return SQLCLI_ReturnCode(desc->getContext(),retcode);
expRetcode = convDoIt((char *) hvPtr,
hvLength,
@@ -729,7 +719,7 @@ static Lng32 InputValueFromNumericHostvar(Descriptor *desc,
heap,
&diagsArea);
if (expRetcode != ex_expr::EXPR_OK)
- return ERROR;//LCOV_EXCL_LINE
+ return ERROR;
//LCOV_EXCL_START - rare error check
if (indPtr)
{
@@ -790,7 +780,7 @@ static Lng32 OutputValueIntoNumericHostvar(Descriptor *desc,
indLength,
indType);
if (retcode)
- return ERROR;//LCOV_EXCL_LINE
+ return ERROR;
if (hvType >= REC_MIN_NUMERIC && hvType <= REC_MAX_NUMERIC)
{
@@ -848,53 +838,6 @@ static Lng32 OutputValueIntoNumericHostvar(Descriptor *desc,
return SUCCESS;
}
-Lng32 SQLCLI_AddModule(/*IN*/ CliGlobals * cliGlobals,
- /*IN*/ const SQLMODULE_ID * module_id)
-{
- Lng32 retcode;
-
-
- ContextCli & currContext = *(cliGlobals->currContext());
- ComDiagsArea & diags = currContext.diags();
- //LCOV_EXCL_START
- if (!module_id || !(module_id->module_name))
- {
- diags << DgSqlCode(-CLI_NO_MODULE_NAME);
- return SQLCLI_ReturnCode(&currContext,-CLI_NO_MODULE_NAME);
- }
-
- if (currContext.moduleAdded(module_id))
- {
- diags << DgSqlCode(-CLI_MODULE_ALREADY_ADDED);
- return SQLCLI_ReturnCode(&currContext,-CLI_MODULE_ALREADY_ADDED);
- }
- //LCOV_EXCL_STOP
-
- // create initial context, if first call, don't add module because
- // that would cause infinite recursion
- retcode = CliPrologue(cliGlobals,NULL);
- if (isERROR(retcode))
- return retcode;//LCOV_EXCL_LINE
-
- retcode = currContext.addModule(module_id,
- TRUE /*do ts check*/,
- TRUE /*unpack tdbs*/,
- (cliGlobals->ossProcess() ?
- cliGlobals->programDir() :
- NULL)
- );
- //LCOV_EXCL_START
- if (isERROR(retcode))
- {
- diags << DgSqlCode(- CLI_ADD_MODULE_ERROR);
- return SQLCLI_ReturnCode(&currContext,-CLI_ADD_MODULE_ERROR);
- }
- //LCOV_EXCL_STOP
-
- return SUCCESS;
-}
-
-
Lng32 SQLCLI_GetDiskMaxSize (
/*IN*/ CliGlobals *cliGlobals,
/*IN*/ char *volname,
@@ -1047,7 +990,7 @@ Lng32 SQLCLI_AllocDesc(/*IN*/ CliGlobals * cliGlobals,
/* is "desc_handle" */
retcode = currContext.allocateDesc(desc_id, maxEntries);
if (isERROR(retcode))
- return SQLCLI_ReturnCode(&currContext,retcode);//LCOV_EXCL_LINE
+ return SQLCLI_ReturnCode(&currContext,retcode);
return CliEpilogue(cliGlobals, NULL);
}
@@ -1069,7 +1012,7 @@ Lng32 SQLCLI_AllocStmt(/*IN*/ CliGlobals * cliGlobals,
// create initial context, if first call, and add module, if any.
retcode = CliPrologue(cliGlobals,statement_id->module);
if (isERROR(retcode))
- return retcode;//LCOV_EXCL_LINE
+ return retcode;
ContextCli & currContext = *(cliGlobals->currContext());
ComDiagsArea & diags = currContext.diags();
@@ -1080,85 +1023,6 @@ Lng32 SQLCLI_AllocStmt(/*IN*/ CliGlobals * cliGlobals,
/* return the statement handle in statement_id, if name mode */
/* is "stmt_handle" */
-#if defined(MULTIPLE_CURSORS_PER_STATEMENT) && defined(KLUGE_CURSOR)
- // kluge!!! - to get around problems with our SQL preprocessor/arkcmp
- // until they can get around to creating empty statements.
- // For now in ContextCli::addModule(), when a
- // <dynamic declare cursor> (e.g. DECLARE C1 CURSOR FOR S1;)
- // is loaded, we create an empty dynamic statement (e.g.
- // we allocate an empty dynamic statement for "S1") AND
- // we create a static 'cursor' statement. The preprocessor
- // always generates an AllocStmt() for a PREPARE and this
- // AllocStmt() gets an error, since we've already allocated
- // an empty statement... Prior to this work, it allocated
- // a single statement with a cursor name, which still gave
- // us an error with the AllocStmt(), AND it didn't support
- // having more than one cursor per statement.
- //
- // Ideally, the preprocessor should generate an empty statement into
- // the module definition file, and arkcmp should be able to parse this
- // empty statement and create an empty statement entry in the compiled
- // module file. When this happens, we will need to a) modify the
- // preprocessor so that it generates the empty statement into the module
- // definition file, b) NOT generate an AllocStmt() call for every prepare,
- // c) recognize the possibility that there could be multiple prepare
- // statements which use the same statement name, so it does not generate
- // multiple empty statements, but instead generates only one.
- // Also, when this happens ContextCli::addModule() should be modified to
- // NOT create the extra dynamic statement for each <dynamic declare cursor>.
- // It would also be nice if the preprocessor instead of generating
- // <declare cursor> (e.g. DECLARE C1 CURSOR FOR SELECT * FROM T1;) statements
- // as they are done today with the statement name and the cursor name
- // being the same, instead it might be better to do the
- // following: a) generate an 'internal' statement name for the
- // hardcoded statement (e.g. SELECT * FROM T1;) and putting this into
- // the module definition file. Then the cursor statement could be
- // rewritten in the module file to read...
- // DECLARE C1 CURSOR FOR <internal_name>.
- //
- // Anyway... back to the kluge...
- // we are looking to ignore AllocStmt calls being done for a prepare...
- // where we have already created an empty statement during
- // ContextCli::addModule()
- //LCOV_EXCL_START - embedded cursor declare - not supported for SQ
- if (statement_id->name_mode == stmt_name)
- {
- Statement * stmt = currContext.getStatement(statement_id);
- // if there is a statement
- // AND it is a DYNAMIC statement
- if (stmt && stmt->allocated())
- {
- // now...
- // if there is a cursor declared or allocated for the statement...
- // we don't need to allocate it or alarm anyone with an error...
- // this is our special case...
-
- Statement * tmpStmt;
- HashQueue * stmtList = currContext.getCursorList();
- stmtList->position();
- while (tmpStmt = (Statement *)stmtList->getNext())
- {
- if (statement_id->module &&
- statement_id->module->module_name &&
- tmpStmt->getModuleId()->module_name &&
-
- isEqualByName(statement_id->module,
- tmpStmt->getModuleId()) &&
-
- tmpStmt->getCursorName() &&
- tmpStmt->getIdentifier() &&
-
- !isEqualByName(tmpStmt->getCursorName(), statement_id) &&
- isEqualByName(tmpStmt->getStmtId(), statement_id)
- ) {
- return SUCCESS;
- }
- }
- }
- //LCOV_EXCL_STOP
- }
-#endif
-
retcode = currContext.allocateStmt(statement_id, Statement::DYNAMIC_STMT);
if (isERROR(retcode))
return SQLCLI_ReturnCode(&currContext,retcode);
@@ -1421,39 +1285,6 @@ Lng32 SQLCLI_DeleteContext(/*IN*/ CliGlobals * cliGlobals,
Lng32 SQLCLI_DropModule(/*IN*/ CliGlobals * cliGlobals,
/*IN*/ const SQLMODULE_ID * module_id)
{
- Lng32 retcode;
-
-
- // create initial context, if first call, don't add module because
- // we are trying to drop it.
- retcode = CliPrologue(cliGlobals,NULL);
- if (isERROR(retcode))
- return retcode;
-
- ContextCli & currContext = *(cliGlobals->currContext());
- ComDiagsArea & diags = currContext.diags();
-
- if (!module_id || !(module_id->module_name))
- {
- diags << DgSqlCode(-CLI_NO_MODULE_NAME);
- return SQLCLI_ReturnCode(&currContext,-CLI_NO_MODULE_NAME);
- }
-
- if (! currContext.moduleAdded(module_id))
- {
- // no module, nothing to be done.
- // Should we return an error instead???
- return SUCCESS;
- }
-
- retcode = currContext.dropModule(module_id);
- if (isERROR(retcode))
- {
- // TBD: change to DROP_MODULE_ERROR
- diags << DgSqlCode(- CLI_ADD_MODULE_ERROR);
- return SQLCLI_ReturnCode(&currContext,-CLI_ADD_MODULE_ERROR);
- }
-
return SUCCESS;
}
@@ -1586,31 +1417,7 @@ Lng32 SQLCLI_SetUdrRuntimeOptions_Internal(/*IN*/ CliGlobals *cliGlobals,
return SQLCLI_ReturnCode(&currContext, retcode);
}
-//LCOV_EXCL_START
-Lng32 SQLCLI_DecodeAndFormatKey(
- CliGlobals *cliGlobals,
- void * RCB_Pointer_Addr, // in
- void * KeyAddr, // in
- Int32 KeyLength, // in
- void * DecodedKeyBufAddr, // in/out: where decoded key to be returned
- void * FormattedKeyBufAddr, // in/out: formatted key to be returned
- Int32 FormattedKeyBufLen, // in
- Int32 * NeededKeyBufLen) // out: required buffer size to be returned
-
-{
- return FEBADRECDESC; // Error
-}
-Lng32 SQLCLI_GetPartitionKeyFromRow(
- CliGlobals *cliGlobals, // in
- void * RCB_Pointer_Addr, // in
- void * Row_Addr, // in
- Int32 Row_Length, // in
- void * KeyAddr, // in/out
- Int32 KeyLength) // in
-{
- return FEBADKEYDESC;
-}
//LCOV_EXCL_STOP
Lng32 SQLCLI_DeallocDesc(/*IN*/ CliGlobals * cliGlobals,
/*IN*/ SQLDESC_ID * desc_id)
@@ -3002,12 +2809,10 @@ Lng32 SQLCLI_PerformTasks(
Descriptor * input_desc = NULL;
Descriptor * output_desc = NULL;
-#ifdef NA_64BIT
va_list cpy;
if (num_input_ptr_pairs || num_output_ptr_pairs)
va_copy(cpy, ap);
-#endif
if (tasks & CLI_PT_GET_INPUT_DESC)
{
@@ -3041,28 +2846,13 @@ Lng32 SQLCLI_PerformTasks(
if ((setPtrs) && (num_input_ptr_pairs > 0))
{
/* descriptor must exist */
- //LCOV_EXCL_START
if (!input_desc)
{
diags << DgSqlCode(-CLI_DESC_NOT_EXISTS);
return SQLCLI_ReturnCode(&currContext,-CLI_DESC_NOT_EXISTS);
}
- //LCOV_EXCL_STOP
-/*
-#ifdef NA_64BIT
- // dg64 - the old way won't compile on 64-bit
- va_list cpy;
- va_copy(cpy, ap);
- va_end(ap);
-#endif
-*/
retcode = local_SetDescPointers(input_desc, 1,
-#ifdef NA_64BIT
- // dg64 - the old way won't compile on 64-bit
num_input_ptr_pairs, &cpy, input_ptr_pairs);
-#else
- num_input_ptr_pairs, &ap, input_ptr_pairs);
-#endif
if (isERROR(retcode))
return SQLCLI_ReturnCode(&currContext,retcode);
}
@@ -3109,12 +2899,7 @@ Lng32 SQLCLI_PerformTasks(
}
retcode = local_SetDescPointers(output_desc, 1,
-#ifdef NA_64BIT
- // dg64 - the old way won't compile on 64-bit
num_output_ptr_pairs, &cpy, output_ptr_pairs);
-#else
- num_output_ptr_pairs, &ap, output_ptr_pairs);
-#endif
if (isERROR(retcode))
return SQLCLI_ReturnCode(&currContext,retcode);
}
@@ -3311,14 +3096,6 @@ Lng32 SQLCLI_PerformTasks(
stmt->aqrStmtInfo()->setRetryFirstFetch(FALSE);
retcode = stmt->fetch(cliGlobals, output_desc, diags, TRUE);
-
- // update Measure if enabled.
- if (stmt->getRootTdb()&&
- ((ComTdb*)stmt->getRootTdb())->getCollectStatsType() == ComTdb::MEASURE_STATS &&
- stmt->getGlobals()->getMeasStmtCntrs())
- {
- stmt->getGlobals()->getMeasStmtCntrs()->incCalls(1);
- }
if (isERROR(retcode))
{
@@ -3396,16 +3173,6 @@ Lng32 SQLCLI_PerformTasks(
cliGlobals->setPriorityChanged(FALSE);
}
}
- else
- // update Measure elapsed time if Measure enabled.
- if (stmt->getRootTdb() &&
- ((ComTdb*)stmt->getRootTdb())->getCollectStatsType() == ComTdb::MEASURE_STATS &&
- stmt->getGlobals()->getMeasStmtCntrs() != NULL)
- {
- stmt->getGlobals()->getMeasStmtCntrs()->
- incElapseBusyTime(NA_JulianTimestamp() - startTime);
-
- }
if (tasks & CLI_PT_SPECIAL_END_PROCESS)
{
@@ -4589,7 +4356,7 @@ static Lng32 getStmtInfo(
/*IN*/ ComDiagsArea & diags,
/*IN*/ Statement * stmt,
/*IN* (SQLDIAG_STMT_INFO_ITEM_ID) */ Lng32 what_to_get,
- /*OUT OPTIONAL*/ void * numeric_value, // NA_64BIT
+ /*OUT OPTIONAL*/ void * numeric_value,
/*OUT OPTIONAL*/ char * string_value,
/*IN OPTIONAL*/ Lng32 max_string_len,
/*OUT OPTIONAL*/ Lng32 * len_of_item)
@@ -4626,7 +4393,7 @@ static Lng32 getStmtInfo(
rowCount = stmt->getRowsAffected(); // returns Int64
else
rowCount = diags.getRowCount(); // returns ComDiagBigInt
- if ( rowCount > LONG_MAX) // NA_64BIT - could be no-op
+ if ( rowCount > LONG_MAX)
return EXE_NUMERIC_OVERFLOW;
*(Int64*)numeric_value = rowCount;
break;
@@ -4646,7 +4413,7 @@ static Lng32 getStmtInfo(
{
rowCount = diags.getValueFromRowsetRowCountArray(i);
assert ( rowCount != -1 ); // accessing a row count array element that was never set.
- if ( rowCount > INT_MAX) // NA_64BIT - rowset row count < 2^32
+ if ( rowCount > INT_MAX)
return EXE_NUMERIC_OVERFLOW;
((Lng32 *)numeric_value)[i] = (Lng32) rowCount;
}
@@ -4663,7 +4430,7 @@ static Lng32 getStmtInfo(
case SQLDIAG_COST:
{
double temp_double = diags.getCost();
- if(((double) INT_MAX) <= temp_double) // NA_64BIT - revisit here
+ if(((double) INT_MAX) <= temp_double)
{
*(Lng32 *)numeric_value = INT_MAX;
}
@@ -4680,7 +4447,7 @@ static Lng32 getStmtInfo(
case SQLDIAG_FIRST_FSCODE:
case SQLDIAG_LAST_FSCODE:
case SQLDIAG_LAST_SYSKEY:
- *(Lng32 *)numeric_value = 0; // NA_64BIT - safe to assume Lng32
+ *(Lng32 *)numeric_value = 0;
break;
default:
@@ -4941,7 +4708,7 @@ Lng32 SQLCLI_GetDiagnosticsStmtInfo2(
/*IN*/ CliGlobals * cliGlobals,
/*IN OPTIONAL*/ SQLSTMT_ID * statement_id,
/*IN* (SQLDIAG_STMT_INFO_ITEM_ID) */ Lng32 what_to_get,
- /*OUT OPTIONAL*/ void * numeric_value, // NA_64BIT
+ /*OUT OPTIONAL*/ void * numeric_value,
/*OUT OPTIONAL*/ char * string_value,
/*IN OPTIONAL*/ Lng32 max_string_len,
/*OUT OPTIONAL*/ Lng32 * len_of_item)
@@ -5625,39 +5392,6 @@ Lng32 SQLCLI_GetMainSQLSTATE(/*IN*/ CliGlobals * cliGlobals,
return -1;
}
-
-Lng32 SQLCLI_GetPfsSize(/*IN*/ CliGlobals * cliGlobals,
- /*OUT*/ Int32 *pfsSize,
- /*OUT*/ Int32 *pfsCurUse,
- /*OUT*/ Int32 *pfsMaxUse)
-{
- Lng32 retcode = 0;
- // create initial context, if first call, don't add module because
- // that would cause infinite recursion
- retcode = CliPrologue(cliGlobals,NULL);
- if (isERROR(retcode))
- return retcode;
-
- ContextCli & currContext = *(cliGlobals->currContext());
- ComDiagsArea & diags = currContext.diags();
- return retcode;
-}
-
-Lng32 SQLCLI_CleanUpPfsResources(/*IN*/ CliGlobals * cliGlobals)
-{
- Lng32 retcode = 0;
-
- // create initial context, if first call, don't add module because
- // that would cause infinite recursion
- retcode = CliPrologue(cliGlobals,NULL);
- if (isERROR(retcode))
- return retcode;
-
- ContextCli & currContext = *(cliGlobals->currContext());
- ComDiagsArea & diags = currContext.diags();
- return retcode;
-}
-
/////////////////////////////////////////////////////////////////
// if sql_source->name_mode is string_data, then
// sql_source->identifier points to the sql_source string and
@@ -7330,27 +7064,19 @@ Lng32 SQLCLI_SetDescPointers(/*IN*/ CliGlobals * cliGlobals,
ComDiagsArea & diags = currContext.diags();
Descriptor * desc = currContext.getDescriptor(desc_id);
- //LCOV_EXCL_START
+
/* descriptor must exist */
if (!desc)
{
diags << DgSqlCode(-CLI_DESC_NOT_EXISTS);
return SQLCLI_ReturnCode(&currContext,-CLI_DESC_NOT_EXISTS);
}
- //LCOV_EXCL_STOP
-
-#ifdef NA_64BIT
- // dg64 - the old way won't compile on 64-bit
- va_list cpy;
- va_copy(cpy, ap);
- va_end(ap);
-#endif
-#ifdef NA_64BIT
- // dg64 - the old way won't compile on 64-bit
+
+ va_list cpy;
+ va_copy(cpy, ap);
+ va_end(ap);
+
retcode = local_SetDescPointers(desc, starting_entry, num_ptr_pairs, &cpy, ptr_pairs);
-#else
- retcode = local_SetDescPointers(desc, starting_entry, num_ptr_pairs, &ap, ptr_pairs);
-#endif
va_end(ap);
return SQLCLI_ReturnCode(&currContext,retcode);
@@ -7953,26 +7679,7 @@ Lng32 SQLCLI_MergeDiagnostics(/*IN*/ CliGlobals * cliGlobals,
newDiags.mergeAfter(cliGlobals->currContext()->diags());
return SUCCESS;
}
-// In this call, the caller can set either mxcmpVersion or nodeName but not both
-Lng32 SQLCLI_SetCompilerVersion_Internal(CliGlobals *cliGlobals, short mxcmpVersion, char *nodeName)
-{
- Lng32 retcode= 0;
- return retcode;
-
-}
-
-// In this call, the caller can get the mxcmpVersion for the local node or for a remote node if nodeName is passed in.
-Lng32 SQLCLI_GetCompilerVersion_Internal(CliGlobals *cliGlobals, short &mxcmpVersion, char *nodeName)
-{
- Lng32 retcode= 0;
- mxcmpVersion = COM_VERS_COMPILER_VERSION;
- return retcode;
-
-}
-//LCOV_EXCL_STOP
-
-//LCOV_EXCL_START
// For internal use only -- do not document!
static Lng32 GetStatement_Internal(/*IN*/ CliGlobals * cliGlobals,
/*INOUT*/ Statement ** statement_ptr,
@@ -7998,21 +7705,6 @@ static Lng32 GetStatement_Internal(/*IN*/ CliGlobals * cliGlobals,
currContext.getStatementList()->setSequentialAdd(sequentialAdd);
}
- if ((statement_id->module) &&
- (statement_id->module->module_name) &&
- (! currContext.moduleAdded(statement_id->module)))
- {
- retcode = currContext.addModule(statement_id->module,
- FALSE /*no ts check*/,
- FALSE /*do not unpack*/,
- NULL);
- if (isERROR(retcode))
- {
- diags << DgSqlCode(- CLI_ADD_MODULE_ERROR);
- return SQLCLI_ReturnCode(&currContext,-CLI_ADD_MODULE_ERROR);
- }
- }
-
Statement * stmt = NULL;
if (getnext)
@@ -8031,27 +7723,6 @@ static Lng32 GetStatement_Internal(/*IN*/ CliGlobals * cliGlobals,
return SUCCESS;
}
-// For internal use only -- do not document!
-Lng32 SQLCLI_AttachCodeToStatement_Internal(CliGlobals * cliGlobals,
- SQLSTMT_ID * statement_id,
- ComDiagsArea & comDiagsArea,
- char *generated_code,
- ULng32 gen_code_len)
-{
- // this call is not supported.
- comDiagsArea << DgSqlCode(-CLI_INTERNAL_ERROR);
- return ERROR;
-}
-
-// For internal use only -- do not document!
-Lng32 SQLCLI_IsTransactionStarted_Internal(CliGlobals * cliGlobals)
-{
-// return ( cliGlobals->currContext()->
-// getTransaction()->isTransactionStarted() == TRUE ? 1 : 0 );
- return 0;
-}
-
-
//Function to get the length of the desc_items array
//returns the length if no error occurs, if error_occurred
//is 1 on return then return value indicates error
@@ -8250,566 +7921,6 @@ Lng32 SQLCLI_GetParserFlagsForExSqlComp_Internal(
return 0;
}
-//LCOV_EXCL_START
-Lng32 SQLCLI_GetVersion_Internal
-(/*IN*/ CliGlobals * cliGlobals,
- /*IN*/ Lng32 versionType,
- /*OUT*/ Lng32 * versionValue,
- /*IN OPTIONAL*/ const char * nodeName,
- /*IN OPTIONAL*/ const SQLMODULE_ID * module_id,
- /*IN OPTIONAL*/ const SQLSTMT_ID * statement_id)
-{
- Lng32 retcode = 0;
-
-
- // create initial context, if first call, don't add module because
- // that would cause infinite recursion
- retcode = CliPrologue(cliGlobals,NULL);
- if (isERROR(retcode))
- return retcode;
-
- ContextCli & currContext = *(cliGlobals->currContext());
- ComDiagsArea & diags = currContext.diags();
-
- if ((versionType == SQLCLIDEV_MODULE_VERSION) ||
- (versionType == SQLCLIDEV_STATIC_STMT_PLAN_VERSION) ||
- (versionType == SQLCLIDEV_DYN_STMT_PLAN_VERSION) ||
- (versionType == SQLCLIDEV_MODULE_VPROC_VERSION))
- {
- SQLMODULE_ID * module_id_ptr = NULL;
-
- module_id_ptr = (SQLMODULE_ID*)module_id;
-
- if (versionType != SQLCLIDEV_DYN_STMT_PLAN_VERSION)
- {
- if (module_id_ptr)
- {
- if (!(module_id_ptr->module_name))
- {
- diags << DgSqlCode(-CLI_NO_MODULE_NAME);
- return SQLCLI_ReturnCode(&currContext,-CLI_NO_MODULE_NAME);
- }
-
- if (! currContext.moduleAdded(module_id_ptr))
- {
- //diags << DgSqlCode(-CLI_MODULE_ALREADY_ADDED);
- //return SQLCLI_ReturnCode(&currContext,-CLI_MODULE_ALREADY_ADDED);
- //}
-
- retcode = currContext.addModule(module_id_ptr,
- FALSE /*no ts check*/,
- TRUE /*unpack tdbs*/,
- (cliGlobals->ossProcess() ?
- cliGlobals->programDir() :
- NULL)
- );
-
- if (isERROR(retcode))
- {
- diags << DgSqlCode(- CLI_ADD_MODULE_ERROR);
- return SQLCLI_ReturnCode(&currContext,-CLI_ADD_MODULE_ERROR);
- }
- }
- }
- }
-
- if (versionType == SQLCLIDEV_MODULE_VPROC_VERSION)
- {
- Module * module = currContext.getModule(module_id_ptr);
- if (module == NULL)
- {
- diags << DgSqlCode(- CLI_INTERNAL_ERROR);
- return ERROR;
- }
-
- if (versionValue)
- {
- if (module->getVproc())
- strcpy((char *)versionValue, module->getVproc());
- else
- strcpy((char *)versionValue, "\0");
- }
- }
- else if (versionType == SQLCLIDEV_MODULE_VERSION)
- {
- Module * module = currContext.getModule(module_id_ptr);
- if (module == NULL)
- {
- diags << DgSqlCode(- CLI_INTERNAL_ERROR);
- return ERROR;
- }
-
- if (versionValue)
- *versionValue = (Lng32)module->getVersion();
- }
- else
- {
- Statement * stmt = currContext.getStatement((SQLSTMT_ID*)statement_id);
- if ((!stmt) ||
- (! stmt->getRootTdb()))
- {
- diags << DgSqlCode(-CLI_STMT_NOT_EXISTS);
- return SQLCLI_ReturnCode(&currContext,-CLI_STMT_NOT_EXISTS);
- }
-
- if (versionValue)
- *versionValue = (Lng32)stmt->getRootTdb()->getPlanVersion();
- }
- } // module version
- else if (versionType == SQLCLIDEV_SYSTEM_VERSION)
- {
- diags << DgSqlCode(-4222)
- << DgString0("MXV");
- return ERROR;
- }
-
- return retcode;
-}
-
- // Arrays are used, not ptrs, so that sizeof can be used instead
- // of strlen.
-static const char SmdLocEnvVarName[] = "SQLMX_SMD_LOCATION";
-static const char SmdLocDefaultSubvol [] = ".ZSD0";
-static const Lng32 VolSubvolSize = 18; // '$' + VOLNAME + '.' +
- // SUBVOL + null-terminator
-
-static char *getSMDLocFromEnvVarWithNodeName(
- CliGlobals * cliGlobals,
- const char * nodeName ) // w/o leading backslash
-{
- // Use the null-terminated nodename passed in to form the name of an env var.
- // of the form SQLMX_SMD_LOCATION_<nodename>.
- char smdEnvVarNameWithNodeName[ sizeof SmdLocEnvVarName
- + 1 // "_"
- + 8 // node name
- ]; // null term already counted in sizeof
- str_cpy_all(smdEnvVarNameWithNodeName, SmdLocEnvVarName,
- sizeof SmdLocEnvVarName - 1); // omit null terminator
-
- smdEnvVarNameWithNodeName[ sizeof SmdLocEnvVarName -1 ] = '_';
-
-#pragma nowarn(1506) // warning elimination
- Int32 nodeNameLen = strlen(nodeName) + 1; // include null_terminator.
-#pragma warn(1506) // warning elimination
- if (nodeNameLen > 8) // 8 because leading \ has been
- nodeNameLen = 8; // stripped off.
-
- str_cpy_all(&smdEnvVarNameWithNodeName[ sizeof SmdLocEnvVarName ],
- nodeName,
- nodeNameLen);
-
- return cliGlobals->getEnv(smdEnvVarNameWithNodeName);
-}
-
-static NABoolean useSMDLocFromEnvVar( char * outputSMDLoc,
- const char * envVarPtr,
- Lng32 &length,
- NABoolean &noSubvol
- )
-{
- // This function performs three tasks:
- // 1. determines if the SMD subvol is included in the input envVarPtr,
- // because the callers need to know whether to supply the
- // SmdLocDefaultSubvol if it wasn't.
- // 2. determine if the input envVarPtr's string value, along
- /// with the SmdLocDefaultSubvol (if necessary) will exceed
- // the length of outputSMDLoc, given by the constant VolSubvolSize.
- // If it will exceed, then this function returns an error.
- // 3. Otherwise, the envVarPtr string is copied to the outputSMDLoc.
- // It is up to the caller to copy the subvol part if no subvol
- // was present in the envVarPtr.
-
- Lng32 lengthIncludingSubvol;
- length = str_len(envVarPtr);
- if (memchr(envVarPtr, '.', length) == NULL)
- {
- noSubvol = TRUE;
-#pragma nowarn(1506) // warning elimination
- lengthIncludingSubvol = length + sizeof SmdLocDefaultSubvol;
-#pragma warn(1506) // warning elimination
- }
- else
- {
- noSubvol = FALSE;
- lengthIncludingSubvol = length;
- }
-
- if ( lengthIncludingSubvol >= VolSubvolSize )
- return TRUE; // error.
- str_cpy_all(outputSMDLoc, envVarPtr, length);
- outputSMDLoc[length] = 0;
- return FALSE; // no error.
-}
-
-static void useSMDLocFromDefine( char * outputSMDLoc,
- Lng32 &SMDLocNameLength )
-{
-}
-
-// This function encapsultates the error reporting for FS errors
-// that can happen when ComRtGetMXSysVolName is called.
-static Lng32 handleCallToComRtGetMXSysVolName(
- char *sysCatBuffer, /* out */
- Lng32 inputBufferLength, /* in */
- Lng32 *sysCatLength, /* out */
- const char *nodeName, /* in */
- NABoolean fakeReadError, /* in */
- NABoolean fakeCorruptAnchorError, /* in */
- Lng32 *fsError /* out */
- )
-{
- Lng32 retcode = 0;
- return retcode;
-}
-//LCOV_EXCL_STOP
-
-// For internal use only -- do not document!
-//
-// returns pointer pointing to the Tandem System Volume name
-// (NULL-terminated) cached in the Executor dynamic global
-// memory area.
-//
-// If it cannot find the name in globals, NULL is returned. Callers must
-// check for NULL and terminate if found.
-//
-
-// For internal use only -- do not document!
-
-Lng32 SQLCLI_GetSystemVolume_Internal(
- /*IN*/ CliGlobals * cliGlobals,
- /*INOUT*/ char * SMDlocation,
- /*INOUT*/ Lng32 *fsError)
-{
- Lng32 retcode = 0;
- Lng32 length = 0;
- Lng32 SMDLocNameLength = 0;
-
- // Very first time the SMD Location is uninitialized in CliGlobals. In this
- // case the location is acquired from
- // the environment variable SQLMX_SMD_LOCATION defined in the
- // $TRAF_HOME/etc/ms.env configuration file
- // (The SQLMX_SMD_LOCATION value should contain a valid volume name only;
- // for example: SQLMX_SMD_LOCATION='$DATA2' - The default volume name
- // $SYSTEM is used when SQLMX_SMD_LOCATION is not defined or when the
- // specified volume name is not valid)
- // and the SMD location in CliGlobals is set.
-
- if (cliGlobals->isSysVolNameInitialized() == FALSE)
- {
- char *pVolName = cliGlobals->getSysVolName();
- NABoolean addSubvol = FALSE;
-
- NAString nameVolume(cliGlobals->currContext()->exCollHeap());
-
- nameVolume = getTandemSysVol();
-
- if (!nameVolume.isNull())
- {
- nameVolume.toUpper();
- length = nameVolume.length();
- str_cpy_all(pVolName, nameVolume.data(), length);
- }
- addSubvol = TRUE;
-
-
- // If caller did not specify the subvolume, then attach ZSD0
- if (addSubvol)
- {
- str_cpy_all((pVolName+length), SmdLocDefaultSubvol, sizeof SmdLocDefaultSubvol);
- length += sizeof SmdLocDefaultSubvol - 1;
- }
- ComRt_Upshift (pVolName);
- cliGlobals->setSysVolNameIsInitialized();
- }
- else
- {
- length = str_len(cliGlobals->getSysVolName());
- }
-
- memcpy(SMDlocation, cliGlobals->getSysVolName(), length + 1);
-
- return 0;
-}
-
-// For internal use only -- do not document!
-
-//LCOV_EXCL_START
-const char *const *const SQLCLI_GetListOfVolumes_Internal()
-{
- // this method not supported on NSK platform
- return NULL;
-
-} // SQLCLI_GetListOfVolumes_Internal()
-
-//LCOV_EXCL_STOP
-// returns TRUE if the volume component is 7 chars (not including $)
-// for examples: $CHAR777
-bool SQLCLI_IsVolume7Chars_Internal (const char *const fileName)
-{
- char *dollarPtr;
- char *dotPtr;
- short volNameLen;
-
- dollarPtr = (char * ) strchr(fileName, '$');
- if (dollarPtr == NULL)
- return FALSE;
-
- dotPtr = (char * ) strchr(dollarPtr, '.');
- if (dotPtr == NULL)
- volNameLen = (short) strlen(dollarPtr);
- else
- volNameLen = (short) (dotPtr - dollarPtr);
-
- if (volNameLen > 7)
- return TRUE;
-
- return FALSE;
-}
-//LCOV_EXCL_START
-// returns TRUE if the volume name is $SYSTEM
-bool SQLCLI_IsSystemVolume_Internal (const char *const fileName)
-{
- char *dollarPtr;
-
- dollarPtr = (char * ) strchr(fileName, '$');
- if ((dollarPtr != NULL) &&
- (strlen(dollarPtr) >= 7) &&
- (TOUPPER(dollarPtr[1]) == 'S') &&
- (TOUPPER(dollarPtr[2]) == 'Y') &&
- (TOUPPER(dollarPtr[3]) == 'S') &&
- (TOUPPER(dollarPtr[4]) == 'T') &&
- (TOUPPER(dollarPtr[5]) == 'E') &&
- (TOUPPER(dollarPtr[6]) == 'M') &&
- ((dollarPtr[7] == '.') || (dollarPtr[7] == '\0')) )
- return TRUE;
-
- return FALSE;
-}
-
-
-//This method returns n (numOfVols) number of volume names in callers memory
-//pointed by volName. If this method cannnot generate n(numOfVols) number
-//of volume names, then numOfVols will be updated to the actual number of volume
-//names generated. The caller of this method is supposed to allocate
-//memory for the volume names to be returned and also provide the number
-//volume names the caller wants.
-Lng32 SQLCLI_GetListOfAuditedVolumes_Internal(CliGlobals *cliGlobals,
- char **volNames,
- Lng32 *numOfVols)
-{
-
- CollHeap * heap;
- NABoolean retValue = 0;
- Int32 volCount = 0;
-
-
- heap = cliGlobals->currContext()->exCollHeap();
-
-
-NABoolean seenAtleastOneDisk = FALSE;
-
- for (Int32 i=0; i < *numOfVols; i++)
- {
- short volNameLen = 0;
- retValue = SQL_EXEC_GetDefaultVolume_Internal(volNames[i],
- 9,
- volNameLen);
-
- if (retValue)
- {
- if (!seenAtleastOneDisk)
- {
- return 1;
- }
- else
- break;
- }
- else
- {
- volCount++;
- seenAtleastOneDisk = TRUE;
- }
- }
-
-
- *numOfVols = volCount;
-
-return 0;
-}
-
-Lng32 SQLCLI_GetNumOfQualifyingVolumes_Internal(CliGlobals *cliGlobals,
- const char *nodeName,
- Lng32 *numOfVols)
-{
- if (nodeName)
- {
- // if the volumes info for this node is already cached do not
- // call sort and return the saved info to the caller.
- if (cliGlobals->getNodeName() &&
- strcmp(nodeName, cliGlobals->getNodeName()) == 0)
- {
- Lng32 numOfVolumes = cliGlobals->getNumOfQualifyingVols();
-
- if (numOfVolumes > 0)
- {
- *numOfVols = numOfVolumes;
- return 0;
- }
- }
-
- CollHeap * heap = cliGlobals->currContext()->exCollHeap();
- NABoolean retValue = 0;
-
-
- // VO, Oct. 2007: For the benefit of POS locations for metadata on NT
- const char * const * const listOfVols = SQLCLI_GetListOfVolumes_Internal();
- // Call clearQualifiedDiskInfo() to remove any previous information
- // that is stored in the cliGlobals.
- cliGlobals->clearQualifiedDiskInfo();
- cliGlobals->setNodeName(nodeName);
- *numOfVols = 0;
-
- // Add qualified disk info for all useful NT datavols. Fake the capacity,
- // freespace and fragment information.
- for (Int32 numOfDisks=0;listOfVols[numOfDisks] != NULL;numOfDisks++)
- {
- short fsErr;
- if (SQL_EXEC_IsVolumeUseful_Internal (listOfVols[numOfDisks], fsErr))
- {
- (*numOfVols)++;
- cliGlobals->addQualifiedDiskInfo(
- listOfVols[numOfDisks],
- 0,
- 100,
- 100,
- 50);
- }
- }
-
-
- }
- else
- return -1;
-
- return 0;
-}
-
-// Before calling this method the user has to call the other CLI method
-// SQL_EXEC_GetNumOfQualifyingVolumes_Internal to get the number of volumes
-// so the right amount of memory is allocated for parameters volNames and
-// cpuNums to get the volume names and its corresponding cpu numbers.
-Lng32 SQLCLI_GetListOfQualifyingVolumes_Internal(CliGlobals *cliGlobals,
- const char *nodeName,
- Lng32 numOfVols,
- char **volNames,
- Lng32 *cpuNums,
- Lng32 *capacities,
- Lng32 *freespaces,
- Lng32 *largestFragments)
-{
- if (nodeName)
- {
- if (cliGlobals->getNodeName() &&
- strcmp(nodeName, cliGlobals->getNodeName()) == 0)
- {
- Lng32 numOfVolumes = cliGlobals->getNumOfQualifyingVols();
-
- // If there aren't any stored volumes or the caller didn't
- // allocate enough memory to pass all of the stored values,
- // return an error.
- if (numOfVolumes == 0 || numOfVolumes > numOfVols)
- return -1;
-
- for (Lng32 i=0; i < numOfVolumes; i++)
- {
- strcpy(volNames[i], cliGlobals->getQualifyingVolume(i));
- cpuNums[i] = cliGlobals->getCpuNumberForVol(i);
- capacities[i] = cliGlobals->getCapacityForVol(i);
- freespaces[i] = cliGlobals->getFreespaceForVol(i);
- largestFragments[i] = cliGlobals->getLargestFragmentForVol(i);
- }
- }
- else
- {
- return -1;
- }
- }
- else
- return -1;
-
- return 0;
-}
-
-
-short SQLCLI_GetDefaultVolume_Internal(char *const outBuf,
- const short outBufMaxLen,
- short &defaultVolLen)
-{
- CliGlobals *exec_globals = GetCliGlobals();
-
- if (exec_globals->getDefaultVolSeed() == 0)
- { // if first time, sets up for random number generator
- exec_globals->setDefaultVolSeed((UInt32)time(NULL));
- srand((UInt32)exec_globals->getDefaultVolSeed());
- }
-
- size_t randIndex = 0;
- const char *const *pVolNames = NULL;
- LIST(char*) *pAuditedVols = NULL;
- const Int32 MAX_NUM_OF_TRIES = 2;
- for (Int32 numOfTries = 1; numOfTries <= MAX_NUM_OF_TRIES; numOfTries++)
- {
- pVolNames = SQL_EXEC_GetListOfVolumes_Internal();
- if (pVolNames == NULL OR pVolNames[0] == NULL)
- {
- if (numOfTries >= MAX_NUM_OF_TRIES)
- return 2; // There are not any DP2 volumes in the cluster
- // The list of DP2 volumes in the cache may be out-of-date.
- // Refreshes it by setting the ListOfVolNamesCacheTime to 0.
- // and then calling SQL_EXEC_GetListOfVolumes_Internal().
- exec_globals->setListOfVolNamesCacheTime((_int64)0);
- continue;
- }
-
- pAuditedVols = (LIST(char*) *) exec_globals->getListOfAuditedVols();
- while (pAuditedVols->entries() > 0)
- {
- randIndex = rand() % pAuditedVols->entries();
- short fsErr = 0;
- if (SQL_EXEC_IsVolumeUseful_Internal(pAuditedVols
- ->operator[](randIndex),
- fsErr))
- break;
- pAuditedVols->removeAt(randIndex);
- }
- if (pAuditedVols->entries() == 0)
- {
- if (numOfTries >= MAX_NUM_OF_TRIES)
- return 3; // There are not any audited DP2 volumes in the cluster
- // The list of DP2 volumes in the cache may be out-of-date.
- // Refreshes it by setting the ListOfVolNamesCacheTime to 0
- // and then calling SQL_EXEC_GetListOfVolumes_Internal().
- exec_globals->setListOfVolNamesCacheTime((_int64)0);
- continue;
- }
- } // for (Int32 numOfTries...
-
- char *pVol = pAuditedVols->operator[](randIndex);
- size_t volLen = str_len(pVol);
- if (volLen + 1 > (size_t) outBufMaxLen)
- return 1; // Output buffer too small
-
- str_cpy_all( outBuf
- , pVol
- , volLen + 1 // including NULL terminator
- );
- defaultVolLen = volLen;
-
- return 0; // Successful
-
-} // SQL_EXEC_GetDefaultVolume_Internal()
-//LCOV_EXCL_STOP
-
Lng32 SQLCLI_OutputValueIntoNumericHostvar(
/*IN*/ CliGlobals * cliGlobals,
/*IN*/ SQLDESC_ID * output_descriptor,
@@ -8894,7 +8005,6 @@ Lng32 SQLCLI_SetErrorCodeInRTS(
return retcode;
}
-
Lng32 SQLCLI_LocaleToUTF8 (
CliGlobals *cliGlobals,
Int32 conv_charset,
@@ -9031,7 +8141,6 @@ Lng32 SQLCLI_UTF8ToLocale(
return error;
}
-//LCOV_EXCL_START
Lng32 SQLCLI_UTF16ToLocale (
CliGlobals *cliGlobals,
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1522c8cd/core/sql/cli/Cli.h
----------------------------------------------------------------------
diff --git a/core/sql/cli/Cli.h b/core/sql/cli/Cli.h
index ae322d5..0a1ca29 100644
--- a/core/sql/cli/Cli.h
+++ b/core/sql/cli/Cli.h
@@ -101,9 +101,6 @@ struct DiagsConditionItem {
extern "C"
{
- Lng32 SQLCLI_AddModule(/*IN*/ CliGlobals * cliGlobals,
- /*IN*/ const SQLMODULE_ID * module_name);
-
Lng32 SQLCLI_AllocDesc(/*IN*/ CliGlobals * cliGlobals,
/*INOUT*/ SQLDESC_ID * desc_id,
@@ -328,7 +325,7 @@ Lng32 SQLCLI_ExecDirect2(/*IN*/ CliGlobals * cliGlobals,
/*IN*/ CliGlobals * cliGlobals,
/*IN OPTIONAL*/ SQLSTMT_ID * statement_id,
/*IN* (SQLDIAG_STMT_INFO_ITEM_ID) */ Lng32 what_to_get,
- /*OUT OPTIONAL*/ void * numeric_value, /* NA_64BIT */
+ /*OUT OPTIONAL*/ void * numeric_value,
/*OUT OPTIONAL*/ char * string_value,
/*IN OPTIONAL*/ Lng32 max_string_len,
/*OUT OPTIONAL*/ Lng32 * len_of_item);
@@ -360,7 +357,7 @@ Lng32 SQLCLI_ExecDirect2(/*IN*/ CliGlobals * cliGlobals,
Lng32 SQLCLI_GetSQLCODE(/*IN*/ CliGlobals * cliGlobals,
/*OUT*/ Lng32 * theSQLCODE);
-SQLCLI_LIB_FUNC Lng32 SQLCLI_GetDiagnosticsCondInfo2(
+ Lng32 SQLCLI_GetDiagnosticsCondInfo2(
/*IN*/ CliGlobals * cliGlobals,
/*IN* (SQLDIAG_COND_INFO_ITEM_ID) */ Lng32 what_to_get,
/*IN*/ Lng32 conditionNum,
@@ -369,7 +366,7 @@ SQLCLI_LIB_FUNC Lng32 SQLCLI_GetDiagnosticsCondInfo2(
/*IN OPTIONAL */ Lng32 max_string_len,
/*OUT OPTIONAL*/ Lng32 * len_of_item);
-SQLCLI_LIB_FUNC Lng32 SQLCLI_GetDiagnosticsCondInfo3 (
+ Lng32 SQLCLI_GetDiagnosticsCondInfo3 (
/*IN*/ CliGlobals * cliGlobals,
/*IN*/ Lng32 no_of_condition_items,
/*IN*/ SQLDIAG_COND_INFO_ITEM_VALUE
@@ -437,15 +434,6 @@ SQLCLI_LIB_FUNC Lng32 SQLCLI_GetDiagnosticsCondInfo3 (
/*OUT*/ Int32 *pfsMaxUse);
Lng32 SQLCLI_CleanUpPfsResources(/*IN*/ CliGlobals *cliGlobals);
-
- Lng32 SQLCLI_GetVersion_Internal
- (/*IN*/ CliGlobals * cliGlobals,
- /*IN*/ Lng32 versionType,
- /*OUT*/ Lng32 * versionValue,
- /*IN OPTIONAL*/ const char * nodeName,
- /*IN OPTIONAL*/ const SQLMODULE_ID * module_name,
- /*IN OPTIONAL*/ const SQLSTMT_ID * statement_id);
-
Lng32 SQLCLI_PerformTasks(
/*IN*/ CliGlobals * cliGlobals,
/*IN*/ULng32 tasks,
@@ -656,7 +644,6 @@ Lng32 SQLCLI_SetAuthID(
/*?*/ SQLSTMT_ID * statement_id,
/*?*/ Int64 & rowsAffected);
-//#ifdef NA_NSK
//Function to get the length of the desc_items array
//returns the length if no error occurs, if error_occurred
//is 1 on return then return value indicates error
@@ -690,7 +677,6 @@ Lng32 SQLCLI_OutputValueIntoNumericHostvar(
/*IN*/ Lng32 desc_entry,
/*IN*/ Lng32 value);
-//#endif /* NA_NSK */
Lng32 SQLCLI_GetSystemVolume_Internal(
/*IN*/ CliGlobals * cliGlobals,
/*INOUT*/ char * SMDLocation,
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1522c8cd/core/sql/cli/CliDefs.h
----------------------------------------------------------------------
diff --git a/core/sql/cli/CliDefs.h b/core/sql/cli/CliDefs.h
index 709f1d0..d70e1b4 100644
--- a/core/sql/cli/CliDefs.h
+++ b/core/sql/cli/CliDefs.h
@@ -41,9 +41,6 @@
// -----------------------------------------------------------------------
-# ifdef ERROR
-# undef ERROR
-# endif
enum RETCODE
{
SUCCESS = 0, SQL_EOF = 100, ERROR = -1, WARNING = 1,
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1522c8cd/core/sql/cli/CliDll.cpp
----------------------------------------------------------------------
diff --git a/core/sql/cli/CliDll.cpp b/core/sql/cli/CliDll.cpp
index 4cfb249..f98e94c 100644
--- a/core/sql/cli/CliDll.cpp
+++ b/core/sql/cli/CliDll.cpp
@@ -34,47 +34,3 @@
*****************************************************************************
*/
-
-// This file is home to InitApp() which is called when the DLL is loaded.
-//
-// This DLL is the *only* one which needs InitApp()!
-// In particular,
-// basic/BasicDll.cpp exp/ExpDll.cpp export/ExportDll.cpp
-// do *not* need it!
-
-
-#include "Platform.h"
-
-
-#include "cli_stdh.h"
-#include "ex_transaction.h"
-#include <stdarg.h>
-
-// Only if we're building a DLL do we need to include the stuff below;
-// otherwise, just ignore them.
-#if defined(CLI_DLL) || defined(CLI_LIB)
- #include "NABoolean.h"
-// #include "UtilInt.h"
- #include "catnames.h"
- #include "SqlciEnv.h" // only reason why we need sqlcilib in DLL.
- #include "StoredProcInterface.h" // to export the interface.
-
- #include <setjmp.h>
- SQLEXPORT_LIB_FUNC jmp_buf ExportJmpBuf;
- extern "C"
- {
- SQLCLI_LIB_FUNC void InitApp(Int32 *argc, char *argv[]) {}
- }
-
- // stub functions used only in case CLI is built as a DLL.
- #if defined(CLI_DLL)
-
- // Stub for UNUSED virtual ../optimizer/SynthType.cpp function
- // (pulled in by ../sqlci/Formatter.cpp).
- #include "NAType.h"
- NABoolean NAType::isComparable(const NAType &, ItemExpr *, NABoolean) const
- { return FALSE; }
- #endif
-
-#endif
-
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1522c8cd/core/sql/cli/CliExpExchange.cpp
----------------------------------------------------------------------
diff --git a/core/sql/cli/CliExpExchange.cpp b/core/sql/cli/CliExpExchange.cpp
index 953fc8b..1713409 100644
--- a/core/sql/cli/CliExpExchange.cpp
+++ b/core/sql/cli/CliExpExchange.cpp
@@ -48,9 +48,6 @@
#include "cli_stdh.h"
#include "exp_datetime.h"
#include "exp_interval.h"
-#if defined( NA_SHADOWCALLS )
-#include "sqlclisp.h" //shadow
-#endif
#include "exp_expr.h"
#include "ExRLE.h"
@@ -465,9 +462,9 @@ Descriptor::BulkMoveStatus Descriptor::checkBulkMoveStatusV1(
// if (! getenv("DOSLOWBULKMOVE"))
// return BULK_MOVE_OFF;
if (getenv("BULKMOVEOFF"))
- return BULK_MOVE_OFF;//LCOV_EXCL_LINE
+ return BULK_MOVE_OFF;
else if (getenv("BULKMOVEDISALLOWED"))
- return BULK_MOVE_DISALLOWED;//LCOV_EXCL_LINE
+ return BULK_MOVE_DISALLOWED;
#endif
desc_struct &descItem = desc[entry - 1]; // Zero base
@@ -1068,9 +1065,6 @@ InputOutputExpr::outputValues(atp_struct *atp,
Lng32 targetPrecision;
char * targetVarPtr = NULL;
char * targetIndPtr = NULL;
-#if defined( NA_SHADOWCALLS )
- char * bimodalIndPtr = NULL;
-#endif
char * targetVCLen = NULL;
short targetVCLenSize = 0;
@@ -1410,12 +1404,7 @@ InputOutputExpr::outputValues(atp_struct *atp,
if (tempTarget && output_desc->rowwiseRowset() && (NOT output_desc->rowwiseRowsetDisabled()))
tempTarget = tempTarget + output_desc->getCurrRowOffsetInRowwiseRowset();
-#if defined( NA_SHADOWCALLS )
- bimodalIndPtr = (char *)tempTarget;
- targetIndPtr = SqlCliSp_GetBufPtr(bimodalIndPtr, FALSE);
-#else
targetIndPtr = (char *)tempTarget;
-#endif
if ((operand->getVCIndicatorLength()) && (sourceVCLenInd)) {
if (operand->getVCIndicatorLength() == sizeof(short))