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/19 22:25:20 UTC
[2/9] incubator-trafodion git commit: code cleanup, commit #1
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/b952c0d5/core/sql/sqlci/SqlciUsage.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlci/SqlciUsage.cpp b/core/sql/sqlci/SqlciUsage.cpp
deleted file mode 100644
index 9eff6ea..0000000
--- a/core/sql/sqlci/SqlciUsage.cpp
+++ /dev/null
@@ -1,889 +0,0 @@
-/********************************************************************
-//
-// @@@ START COPYRIGHT @@@
-//
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-//
-// @@@ END COPYRIGHT @@@
-********************************************************************/
-
-/* -*-C++-*-
- *****************************************************************************
- *
- * File: SqlciUsage.cpp
- * Description: Methods to return table and module usage info.
- *
- *
- * Created: 1/15/2003
- * Language: C++
- * Status:
- *
- *
- *
- *
- *****************************************************************************
- */
-
-#include <stdio.h>
-#include <iostream>
-#include <stdlib.h>
-#include <unistd.h>
-#define ACCESS access
-#define RW_ACCESS 6
-#include <errno.h>
-#include "Platform.h"
-#include "ComCextdecs.h"
-#include "str.h"
-#include "NAString.h"
-#include "sqlcmd.h"
-#include "SqlciError.h"
-
-
-extern volatile Int32 breakReceived;
-
-Usage::Usage(char * module_dir, char * module, char * table,
- NABoolean noe)
- : SqlCmd(SqlCmd::USAGE_TYPE, NULL),
- moduleDir_(NULL), module_(NULL), table_(NULL),
- noe_(noe)
-{
-
- if (module_dir)
- {
- moduleDir_ = new char[strlen(module_dir)+1];
- strcpy(moduleDir_, module_dir);
- }
- else
- {
- moduleDir_ = new char[strlen("c:/tdm_sqlmodules")+1];
- strcpy(moduleDir_, "c:/tdm_sqlmodules");
- }
-
- if (module)
- {
- module_ = new char[strlen(module)+1];
- strcpy(module_, module);
- }
- else
- {
- module_ = new char[strlen("*") + 1];
- strcpy(module_, "*");
- }
-
- if (table)
- {
- table_ = new char[strlen(table)+1];
- strcpy(table_, table);
- }
- else
- {
- table_ = NULL;
- }
-}
-
-Usage::~Usage()
-{
- delete moduleDir_;
- delete module_;
- delete table_;
-}
-
-class ErrorModule
-{
-public:
- ErrorModule(const char * modName, Int32 error);
- ~ErrorModule();
-
- char * getModName() { return modName_; }
- Int32 getError() { return error_;}
-
-private:
- char * modName_;
- Int32 error_;
-};
-
-ErrorModule::ErrorModule(const char * modName, Int32 error)
- : error_(error)
-{
- modName_ = new char[strlen(modName) + 1];
- strcpy(modName_, modName);
-}
-
-ErrorModule::~ErrorModule()
-{
- delete modName_;
-}
-
-#pragma nowarn(1313) // warning elimination
-static const char * moduleUsageQuery[] =
-{
- " select distinct ",
- " case ",
-
- " when operator = 'FILE_SCAN' ",
- " then 'Table: ' || substring(description FROM position('scan_type: file_scan ' IN description) + 21 ",
- " FOR (position(' ' IN substring(description FROM position('scan_type: file_scan ' IN description) + 21)) ",
- " )) ",
-
- " when operator = 'INDEX_SCAN' ",
- " then 'Index: ' || substring(description FROM position('scan_type: index_scan ' IN description) + 22 ",
- " FOR (position(' ' IN substring(description FROM position('scan_type: index_scan ' IN description) + 22)) ",
- " )) ",
-
- " when operator = 'FILE_SCAN_UNIQUE' ",
- " then 'Table: ' || substring(description FROM position('scan_type: file_scan_unique ' IN description) + 28 ",
- " FOR (position(' ' IN substring(description FROM position('scan_type: file_scan_unique ' IN description) + 28)) ",
- " )) ",
-
- " when operator = 'INDEX_SCAN_UNIQUE' ",
- " then 'Index: ' || substring(description FROM position('scan_type: index_scan_unique ' IN description) + 29 ",
- " FOR (position(' ' IN substring(description FROM position('scan_type: index_scan_unique ' IN description) + 29)) ",
- " )) ",
-
- " when operator = 'UNIQUE_UPDATE' ",
- " then ",
- " case ",
- " when position('iud_type: index_' IN description) > 0 ",
- " then 'Index: ' || substring(description from position('iud_type: index_unique_update ' IN description) + 30 ",
- " FOR (position(' ' IN substring(description FROM position('iud_type: index_unique_update ' IN description) + 30)))) ",
-
- " else 'Table: ' || substring(description from position('iud_type: unique_update ' IN description) + 24 ",
- " FOR (position(' ' IN substring(description FROM position('iud_type: unique_update ' IN description) + 24)))) ",
- " end ",
-
- " when operator = 'CURSOR_UPDATE' ",
- " then ",
- " case ",
- " when position('iud_type: index_' IN description) > 0 ",
- " then 'Index: ' || substring(description from position('iud_type: index_cursor_update ' IN description) + 30 ",
- " FOR (position(' ' IN substring(description FROM position('iud_type: index_cursor_update ' IN description) + 30)))) ",
-
- " else 'Table: ' || substring(description from position('iud_type: cursor_update ' IN description) + 24 ",
- " FOR (position(' ' IN substring(description FROM position('iud_type: cursor_update ' IN description) + 24)))) ",
- " end ",
-
- " when operator = 'SUBSET_UPDATE' ",
- " then ",
- " case ",
- " when position('iud_type: index_' IN description) > 0 ",
- " then 'Index: ' || substring(description from position('iud_type: index_subset_update ' IN description) + 30 ",
- " FOR (position(' ' IN substring(description FROM position('iud_type: index_subset_update ' IN description) + 30)))) ",
-
- " else 'Table: ' || substring(description from position('iud_type: subset_update ' IN description) + 24 ",
- " FOR (position(' ' IN substring(description FROM position('iud_type: subset_update ' IN description) + 24)))) ",
- " end ",
-
- " when operator = 'UNIQUE_DELETE' ",
- " then ",
- " case ",
- " when position('iud_type: index_' IN description) > 0 ",
- " then 'Index: ' || substring(description from position('iud_type: index_unique_delete ' IN description) + 30 ",
- " FOR (position(' ' IN substring(description FROM position('iud_type: index_unique_delete ' IN description) + 30)))) ",
-
- " else 'Table: ' || substring(description from position('iud_type: unique_delete ' IN description) + 24 ",
- " FOR (position(' ' IN substring(description FROM position('iud_type: unique_delete ' IN description) + 24)))) ",
- " end ",
-
- " when operator = 'CURSOR_DELETE' ",
- " then ",
- " case ",
- " when position('iud_type: index_' IN description) > 0 ",
- " then 'Index: ' || substring(description from position('iud_type: index_cursor_delete ' IN description) + 30 ",
- " FOR (position(' ' IN substring(description FROM position('iud_type: index_cursor_delete ' IN description) + 30)))) ",
-
- " else 'Table: ' || substring(description from position('iud_type: cursor_delete ' IN description) + 24 ",
- " FOR (position(' ' IN substring(description FROM position('iud_type: cursor_delete ' IN description) + 24)))) ",
- " end ",
-
- " when operator = 'SUBSET_DELETE' ",
- " then ",
- " case ",
- " when position('iud_type: index_' IN description) > 0 ",
- " then 'Index: ' || substring(description from position('iud_type: index_subset_delete ' IN description) + 30 ",
- " FOR (position(' ' IN substring(description FROM position('iud_type: index_subset_delete ' IN description) + 30)))) ",
-
- " else 'Table: ' || substring(description from position('iud_type: subset_delete ' IN description) + 24 ",
- " FOR (position(' ' IN substring(description FROM position('iud_type: subset_delete ' IN description) + 24)))) ",
- " end ",
-
- " when operator = 'INSERT' ",
- " then ",
- " case ",
- " when position('iud_type: index_' IN description) > 0 ",
- " then 'Index: ' || substring(description from position('iud_type: index_insert ' IN description) + 23 ",
- " FOR (position(' ' IN substring(description FROM position('iud_type: index_insert ' IN description) + 23)))) ",
-
- " else 'Table: ' || substring(description from position('iud_type: insert ' IN description) + 17 ",
- " FOR (position(' ' IN substring(description FROM position('iud_type: insert ' IN description) + 17)))) ",
- " end ",
-
- " end ",
- " from table(explain('%s', '%%')) ",
- " where operator in ('FILE_SCAN', 'FILE_SCAN_UNIQUE', ",
- " 'INDEX_SCAN', 'INDEX_SCAN_UNIQUE', ",
- " 'UNIQUE_UPDATE', 'CURSOR_UPDATE', 'SUBSET_UPDATE', ",
- " 'UNIQUE_DELETE', 'CURSOR_DELETE', 'SUBSET_DELETE', ",
- " 'INSERT') ",
- " order by 1;"
-};
-
-static const char * tableUsageQuery[] =
-{
- " select [first 1] operator ",
-
- " from table(explain('%s', '%%')) ",
- " where ",
- " ( ",
- " operator in ('INDEX_SCAN', 'INDEX_SCAN_UNIQUE') ",
- " and ",
-
- " ( ",
- " case ",
- " when operator = 'INDEX_SCAN' ",
- " then substring(description FROM position('scan_type: index_scan ' IN description) + 22 ",
- " FOR (position(' ' IN substring(description FROM position('scan_type: index_scan ' IN description) + 22)) ",
- " )) ",
-
- " when operator = 'INDEX_SCAN_UNIQUE' ",
- " then substring(description FROM position('scan_type: index_scan_unique ' IN description) + 29 ",
- " FOR (position(' ' IN substring(description FROM position('scan_type: index_scan_unique ' IN description) + 29)) ",
- " )) ",
- " end ",
- " LIKE '%s(%%' ",
-
- " or ",
-
- " case ",
- " when operator = 'INDEX_SCAN' ",
- " then substring(description FROM position('scan_type: index_scan ' IN description) + 22 ",
- " FOR (position(' ' IN substring(description FROM position('scan_type: index_scan ' IN description) + 22)) ",
- " )) ",
-
- " when operator = 'INDEX_SCAN_UNIQUE' ",
- " then substring(description FROM position('scan_type: index_scan_unique ' IN description) + 29 ",
- " FOR (position(' ' IN substring(description FROM position('scan_type: index_scan_unique ' IN description) + 29)) ",
- " )) ",
- " end ",
- " LIKE '%%(%s)%%' ",
- " ) ",
- " ) ",
-
- " or ",
-
- " ( ",
- " operator in ('FILE_SCAN', 'FILE_SCAN_UNIQUE', ",
- " 'UNIQUE_UPDATE', 'CURSOR_UPDATE', 'SUBSET_UPDATE', ",
- " 'UNIQUE_DELETE', 'CURSOR_DELETE', 'SUBSET_DELETE', ",
- " 'INSERT') ",
-
- " and ",
-
- " case ",
-
- " when operator = 'FILE_SCAN' ",
- " then substring(description FROM position('scan_type: file_scan ' IN description) + 21 ",
- " FOR (position(' ' IN substring(description FROM position('scan_type: file_scan ' IN description) + 21)) ",
- " )) ",
-
- " when operator = 'FILE_SCAN_UNIQUE' ",
- " then substring(description FROM position('scan_type: file_scan_unique ' IN description) + 28 ",
- " FOR (position(' ' IN substring(description FROM position('scan_type: file_scan_unique ' IN description) + 28)) ",
- " )) ",
-
- " when operator = 'UNIQUE_UPDATE' ",
- " then ",
- " case ",
- " when position('iud_type: index_' IN description) > 0 ",
- " then substring(description from position('iud_type: index_unique_update ' IN description) + 30 ",
- " FOR (position(' ' IN substring(description FROM position('iud_type: index_unique_update ' IN description) + 30)))) ",
-
- " else substring(description from position('iud_type: unique_update ' IN description) + 24 ",
- " FOR (position(' ' IN substring(description FROM position('iud_type: unique_update ' IN description) + 24)))) ",
- " end ",
-
- " when operator = 'CURSOR_UPDATE' ",
- " then ",
- " case ",
- " when position('iud_type: index_' IN description) > 0 ",
- " then substring(description from position('iud_type: index_cursor_update ' IN description) + 30 ",
- " FOR (position(' ' IN substring(description FROM position('iud_type: index_cursor_update ' IN description) + 30)))) ",
-
- " else substring(description from position('iud_type: cursor_update ' IN description) + 24 ",
- " FOR (position(' ' IN substring(description FROM position('iud_type: cursor_update ' IN description) + 24)))) ",
- " end ",
-
- " when operator = 'SUBSET_UPDATE' ",
- " then ",
- " case ",
- " when position('iud_type: index_' IN description) > 0 ",
- " then substring(description from position('iud_type: index_subset_update ' IN description) + 30 ",
- " FOR (position(' ' IN substring(description FROM position('iud_type: index_subset_update ' IN description) + 30)))) ",
-
- " else substring(description from position('iud_type: subset_update ' IN description) + 24 ",
- " FOR (position(' ' IN substring(description FROM position('iud_type: subset_update ' IN description) + 24)))) ",
- " end ",
-
- " when operator = 'UNIQUE_DELETE' ",
- " then ",
- " case ",
- " when position('iud_type: index_' IN description) > 0 ",
- " then substring(description from position('iud_type: index_unique_delete ' IN description) + 30 ",
- " FOR (position(' ' IN substring(description FROM position('iud_type: index_unique_delete ' IN description) + 30)))) ",
-
- " else substring(description from position('iud_type: unique_delete ' IN description) + 24 ",
- " FOR (position(' ' IN substring(description FROM position('iud_type: unique_delete ' IN description) + 24)))) ",
- " end ",
-
- " when operator = 'CURSOR_DELETE' ",
- " then ",
- " case ",
- " when position('iud_type: index_' IN description) > 0 ",
- " then substring(description from position('iud_type: index_cursor_delete ' IN description) + 30 ",
- " FOR (position(' ' IN substring(description FROM position('iud_type: index_cursor_delete ' IN description) + 30)))) ",
-
- " else substring(description from position('iud_type: cursor_delete ' IN description) + 24 ",
- " FOR (position(' ' IN substring(description FROM position('iud_type: cursor_delete ' IN description) + 24)))) ",
- " end ",
-
- " when operator = 'SUBSET_DELETE' ",
- " then ",
- " case ",
- " when position('iud_type: index_' IN description) > 0 ",
- " then substring(description from position('iud_type: index_subset_delete ' IN description) + 30 ",
- " FOR (position(' ' IN substring(description FROM position('iud_type: index_subset_delete ' IN description) + 30)))) ",
-
- " else substring(description from position('iud_type: subset_delete ' IN description) + 24 ",
- " FOR (position(' ' IN substring(description FROM position('iud_type: subset_delete ' IN description) + 24)))) ",
- " end ",
-
- " when operator = 'INSERT' ",
- " then ",
- " case ",
- " when position('iud_type: index_' IN description) > 0 ",
- " then substring(description from position('iud_type: index_insert ' IN description) + 23 ",
- " FOR (position(' ' IN substring(description FROM position('iud_type: index_insert ' IN description) + 23)))) ",
-
- " else substring(description from position('iud_type: insert ' IN description) + 17 ",
- " FOR (position(' ' IN substring(description FROM position('iud_type: insert ' IN description) + 17)))) ",
- " end ",
- " end ",
-
- " = '%s' ",
- " ) ",
-
- " ;"
-};
-#pragma warn(1313) // warning elimination
-
-short Usage::process(SqlciEnv * sqlci_env)
-{
- short retcode = 0;
- Lng32 error = 0;
-
- NAString cmd;
-
- // a temporary file where the modules will be listed.
- // The filename will be of the form: __mxci_usage__<juliantimestamp>
- // This temp file will be created in /tmp, if it exists. If not, then
- // it will be created in moduleDir_. If it cannot be written and read
- // in one of these two dirs, an error will be returned.
-
- NAString tempFile;
- // check for RW access in /tmp dir.
- tempFile = "/tmp";
- Int32 rc = ACCESS(tempFile, RW_ACCESS);
- if (rc == -1)
- {
- // now try module dir
- tempFile = moduleDir_;
- rc = ACCESS(tempFile, RW_ACCESS);
- ErrorParam ep_tmp("/tmp");
- ErrorParam ep_md(tempFile);
- if (rc == -1)
- {
- SqlciError (2087,
- &ep_tmp,
- (ErrorParam *) 0
- );
- SqlciError (2087,
- &ep_md,
- (ErrorParam *) 0
- );
- return 0;
- }
- }
-
- Int64 ts = NA_JulianTimestamp();
- char tsBuf[100];
- convertInt64ToAscii(ts, tsBuf);
-
- // tempFile = NAString(moduleDir_) + "/" + "__mxci_usage__" + tsBuf;
- tempFile = tempFile + "/" + "__mxci_usage__" + tsBuf;
-
- // remove the temporary file, if it exists
- cmd = "rm -f " + tempFile;
- system(cmd);
-
- // insert a backslash in front of any '$', single or double quote.
- // We are not handling any quoted double/single quotes.
- char * tempModule = new char[strlen(module_) * 2 + 1];
- UInt32 i = 0;
- Int32 j = 0;
- while (i < strlen(module_))
- {
- if ((module_[i] == '"') ||
- (module_[i] == '\'') ||
- (module_[i] == '$'))
- {
- tempModule[j++] = '\\';
- }
- tempModule[j++] = module_[i++];
- }
- tempModule[j] = 0;
-
- // 'ls' the modules.
- NAString module(tempModule);
- NAString modDir;
- NABoolean modDirContainsWildcard = FALSE;
- {
- modDir = moduleDir_;
- if (modDir.contains('*'))
- modDirContainsWildcard = TRUE;
- }
-
- if ((module == "*") || (module == "*.*") || (module == "*.*.*"))
- {
- if (modDirContainsWildcard)
- cmd = "find " + modDir + " -type f > " + tempFile;
- else
- cmd = "ls " + modDir + " > " + tempFile;
- }
- else
- {
- if (modDirContainsWildcard)
- cmd = "find " + modDir + " -type f -name \"" + module + "\" > " + tempFile;
-
- else
- cmd = "ls " + modDir + "/" + module + " > " + tempFile;
- }
-
- system(cmd);
-
- // read each module name from the temp file and process it.
- FILE * file_stream = fopen(tempFile, "r");
- if (! file_stream)
- {
- SqlciError (SQLCI_OBEY_FOPEN_ERROR,
- new ErrorParam (errno),
- new ErrorParam (tempFile),
- (ErrorParam *) 0
- );
- return 0;
- }
-
- char buf[2000];
- char * ok;
-
- char outBuf[200];
-
- Logfile *log = sqlci_env->get_logfile();
-
- SqlciList<ErrorModule> * errModList = new SqlciList<ErrorModule>;
-
- Int32 maxModNameLen = 0;
- NABoolean displayObjectName = TRUE;
-
- NABoolean done = FALSE;
- NABoolean usageInfoFound = FALSE;
- while (NOT done)
- {
- ok = fgets(buf, 2000, file_stream);
- if (feof(file_stream))
- {
- done = TRUE;
- continue;
- }
-
- if (! ok)
- {
- SqlciError (SQLCI_OBEY_FOPEN_ERROR,
- new ErrorParam (errno),
- new ErrorParam (tempFile),
- (ErrorParam *) 0
- );
- delete errModList;
- return 0;
- }
-
- // nuke the EOL character.
- buf[strlen(buf)-1]=0;
- //soln:10-050829-0917
- NAString modName;
-
- // if module parameter is omitted, then the names are displayed with
- // "ls <dir>" command. This command will NOT prepend the dir name.
- // So no need to skip the dirname out of the name returned in 'buf'.
- if ((module == '*') || (module == "*.*") || (module == "*.*.*") ||
- (modDirContainsWildcard))
- modName = buf;
- else
- modName = &buf[strlen(moduleDir_) + 1];
-
- // do not read files of length 0 or any file which starts with
- // "__mxci_usage__". The latter are internal temp files.
- if ((strlen(buf) <= 0) ||
- (strncmp(modName.data(), "__mxci_usage__", strlen("__mxci_usage__") == 0)))
- continue;
- //soln:10-050829-0917 Begin
- // if the modName is not a 3-part name, skip this file. It is
- // not a module name.
- size_t pos = 0;
- Int32 noOfDots = 0;
- while (pos != NA_NPOS)
- {
- pos = modName.index(".", pos);
- if (pos != NA_NPOS)
- {
- noOfDots++;
- pos++;
- }
- }
-
- if (noOfDots != 2)
- continue;
-
- // create a new context in which the embedded statement will be
- // loaded and DUO'ed from.
- SQLCTX_HANDLE ctxtHandle;
- error = SQL_EXEC_CreateContext(&ctxtHandle,
- NULL, // char *sqlAuthId
- 0 // Int32 suppressAutoXact
- );
- if (error)
- {
- HandleCLIError(error, sqlci_env);
-
- return 0;
- }
-
- SQLCTX_HANDLE prevCtxtHandle;
- error = SQL_EXEC_SwitchContext(ctxtHandle, &prevCtxtHandle);
- if (error)
- {
- HandleCLIError(error, sqlci_env);
-
- return 0;
- }
-//soln:10-050829-0917 End
-
- Int32 usage_query_size = 0;
- Int32 usage_qry_array_size = 0;
- if (table_)
- usage_qry_array_size =
- sizeof(tableUsageQuery) / sizeof(char*);
- else
- usage_qry_array_size =
- sizeof(moduleUsageQuery) / sizeof(char*);
-
- const char ** usageQuery = NULL;
- if (table_)
- usageQuery = tableUsageQuery;
- else
- usageQuery = moduleUsageQuery;
-
- Int32 i = 0;
- for (i = 0; i < usage_qry_array_size; i++)
- {
- Int32 j = 0;
- const char * usage_frag = usageQuery[i];
-#pragma warning (disable : 4018) //warning elimination
- while ((j < strlen(usageQuery[i])) &&
- (usage_frag[j] == ' '))
- j++;
- if (j < strlen(usageQuery[i]))
- usage_query_size += strlen(&usage_frag[j]);
-#pragma warning (default : 4018) //warning elimination
- }
-
- char * source_fmt = new char[usage_query_size + 100];
- source_fmt[0] = 0;
- for (i = 0; i < usage_qry_array_size; i++)
- {
- Int32 j = 0;
- const char * usage_frag = usageQuery[i];
-#pragma warning (disable : 4018) //warning elimination
- while ((j < strlen(usageQuery[i])) &&
- (usage_frag[j] == ' '))
- j++;
-
- if (j < strlen(usageQuery[i]))
- strcat(source_fmt, &usage_frag[j]);
-#pragma warning (default : 4018) //warning elimination
- }
-
- char * sqlStrBuf = NULL;
- NAString fullyQualifiedModName;
-
- if (modDirContainsWildcard)
- fullyQualifiedModName = modName;
- else
- fullyQualifiedModName = modName;
-
- if (table_)
- sqlStrBuf = new char[usage_query_size + strlen(fullyQualifiedModName.data()) + 3 * strlen(table_) + 50];
- else
- sqlStrBuf = new char[usage_query_size + strlen(fullyQualifiedModName.data()) + 50];
-
- if (table_)
- sprintf(sqlStrBuf, source_fmt, fullyQualifiedModName.data(), table_, table_, table_);
- else
- sprintf(sqlStrBuf, source_fmt, fullyQualifiedModName.data());
-
- SqlCmd sqlCmd(SqlCmd::DML_TYPE, sqlStrBuf);
- PrepStmt * prepStmt = new PrepStmt("__MXCI_USAGE__");
-
- sqlCmd.clearCLIDiagnostics();
-
- retcode = sqlCmd.do_prepare(sqlci_env, prepStmt, get_sql_stmt(),
- FALSE);
-
- Logfile *log = sqlci_env->get_logfile();
- Int32 numParams = 0;
- char * paramArray[10];
- retcode = sqlCmd.doExec(sqlci_env,
- prepStmt->getStmt(),
- prepStmt,
- numParams,
- paramArray,
- NULL,
- FALSE);
- if (retcode < 0)
- {
- if ((retcode == -8834) ||
- (retcode == -8808) ||
- (retcode == -8809) ||
- ((retcode <= -8860) &&
- (retcode >= -8866)))
- {
- ErrorModule * em = new ErrorModule(modName.data(), retcode);
- errModList->append(em);
-#pragma warning (disable : 4018) //warning elimination
- if (strlen(modName.data()) > maxModNameLen)
-#pragma nowarn(1506) // warning elimination
- maxModNameLen = strlen(modName.data());
-#pragma warn(1506) // warning elimination
-#pragma warning (default : 4018) //warning elimination
- }
- else
- {
- error = retcode;
- HandleCLIError(error, sqlci_env);
-
- SqlciError (15992, (ErrorParam *) 0);
- }
- }
-
- // retcode = SQL_Success;
- NABoolean displayModuleName = TRUE;
- NABoolean firstTime = TRUE;
- while ((retcode >= 0) &&
- (retcode != SQL_Eof))
- {
- retcode = sqlCmd.doFetch(sqlci_env,
- prepStmt->getStmt(),
- prepStmt,
- FALSE);
- if (retcode < 0)
- {
- if ((retcode == -8834) ||
- (retcode == -8808) ||
- (retcode == -8809) ||
- ((retcode <= -8860) &&
- (retcode >= -8866)))
- {
- ErrorModule * em = new ErrorModule(modName.data(), retcode);
- errModList->append(em);
-#pragma warning (disable : 4018) //warning elimination
- if (strlen(modName.data()) > maxModNameLen)
-#pragma nowarn(1506) // warning elimination
- maxModNameLen = strlen(modName.data());
-#pragma warn(1506) // warning elimination
-#pragma warning (default : 4018) //warning elimination
- }
- else
- {
- error = retcode;
- HandleCLIError(error, sqlci_env);
-
- SqlciError (15992, (ErrorParam *) 0);
- }
- }
- else if ((firstTime) &&
- (retcode == SQL_Eof))
- {
- //SqlciError (-15992, (ErrorParam *) 0);
- }
- firstTime = FALSE;
-
- if ((retcode != SQL_Eof) &&
- (retcode >= 0))
- {
- usageInfoFound = TRUE;
- if (table_)
- {
- if (displayObjectName)
- {
- displayObjectName = FALSE;
- sprintf(outBuf, "\n \nObject: %s\n", table_);
- log->WriteAll(outBuf);
- }
-
- sqlCmd.displayRow(sqlci_env, prepStmt);
- NAString oper(prepStmt->outputBuf());
- oper = oper.strip();
- char format[100];
- if ((oper == "FILE_SCAN") ||
- (oper == "FILE_SCAN_UNIQUE"))
- {
- sprintf(format, " Table: %%-" PFSZ "s Module: %%s", strlen(table_));
- sprintf(outBuf, format, table_, modName.data());
- }
- else if ((oper == "INDEX_SCAN") ||
- (oper == "INDEX_SCAN_UNIQUE"))
- {
- sprintf(format, " Index: %%-" PFSZ "s Module: %%s", strlen(table_));
- sprintf(outBuf, format, table_, modName.data());
- }
- else
- {
- sprintf(format, " Object: %%-" PFSZ "s Module: %%s", strlen(table_));
- sprintf(outBuf, format, table_, modName.data());
- }
-
- log->WriteAll(outBuf);
- }
- else
- {
- if (displayModuleName)
- {
- displayModuleName = FALSE;
- sprintf(outBuf, "\n \nModule: %s\n", modName.data());
- log->WriteAll(outBuf);
- }
-
- sqlCmd.displayRow(sqlci_env, prepStmt);
- NAString inTableName(prepStmt->outputBuf());
- NAString outTableName;
- size_t start = 0;
- size_t end = 0;
- if (inTableName.index("Table: ", 0) == 0)
- {
- start = inTableName.index(" ");
- outTableName = inTableName(start+1, inTableName.length() - start -1);
- end = outTableName.index(" ");
- outTableName = outTableName(0, end);
- outTableName = " Table: " + outTableName;
- }
- else if (inTableName.index("Index: ") == 0)
- {
- start = inTableName.index(" ");
- outTableName = inTableName(start+1, inTableName.length() - start -1);
- end = outTableName.index(")");
- if (end != NA_NPOS)
- {
- outTableName = outTableName(0, end+1);
- }
- else
- {
- size_t lParen = outTableName.index("(");
- end = outTableName.index(" ");
- outTableName = outTableName(0, end);
- if (lParen != NA_NPOS)
- outTableName += ")";
- }
- outTableName = " Index: " + outTableName;
- }
- else
- {
- outTableName = " Object: " + inTableName;
- }
-
- log->WriteAll(outTableName.data());
- } // else
- }
- } // while (retcode >= 0)
-
- if (retcode >= 0)
- retcode = (short)SQL_EXEC_CloseStmt(prepStmt->getStmt());
-
- if (prepStmt)
- sqlCmd.deallocate(sqlci_env, prepStmt);
- delete sqlStrBuf;
-
- if (breakReceived)
- done = TRUE;
- // switch back to original context.
- error = SQL_EXEC_SwitchContext(prevCtxtHandle, NULL);
- if (error < 0)
- {
- HandleCLIError(error, sqlci_env);
- }
-
- // and drop the new context that was created
- error = SQL_EXEC_DropContext(ctxtHandle);
- if (error < 0)
- {
- HandleCLIError(error, sqlci_env);
- }
- } // while (NOT done)
-
- if ((retcode >= 0) &&
- (NOT usageInfoFound))
- SqlciError (-15992, (ErrorParam *) 0); // issue a warning.
-
- // print out the modules which got errors
- ErrorModule * em = errModList->getFirst();
- if (em)
- {
- sprintf(outBuf, "\n\nModules not loaded:\n");
- log->WriteAll(outBuf);
- }
-
- char format[100];
- sprintf(format, " Module: %%-%ds Error: %%d", maxModNameLen);
- while (em)
- {
- sprintf(outBuf, format, em->getModName(), em->getError());
- log->WriteAll(outBuf);
-
- em = errModList->getNext();
- }
-
- log->WriteAll("");
-
- fclose(file_stream);
-
- // remove the temporary file
- cmd = "rm -f " + tempFile;
- system(cmd);
-
- delete errModList;
-
- return 0;
-}
-
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/b952c0d5/core/sql/sqlci/SqlciUtil.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlci/SqlciUtil.cpp b/core/sql/sqlci/SqlciUtil.cpp
deleted file mode 100644
index 28432f7..0000000
--- a/core/sql/sqlci/SqlciUtil.cpp
+++ /dev/null
@@ -1,59 +0,0 @@
-/**********************************************************************
-// @@@ START COPYRIGHT @@@
-//
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-//
-// @@@ END COPYRIGHT @@@
-//
-**********************************************************************/
-/* -*-C++-*-
- *****************************************************************************
- *
- * File: SqlciUtil.cpp
- * Description:
- *
- *
- * Created: 11/12/2005
- * Language: C++
- * Status: $State: Exp $
- *
- *
- *
- *
- *****************************************************************************
- */
-
-
-#include "SqlciUtil.h"
-#include "SqlciEnv.h"
-#include "SqlciError.h"
-extern ComDiagsArea sqlci_DA;
-
-UtilCmd::UtilCmd(const UtilCmdType commandType, char * argument)
- : SqlciNode(SqlciNode::UTIL_CMD_TYPE),
- commandType_(commandType)
-{
- argument_ = new char[strlen(argument)+1];
- strcpy(argument_, argument);
-};
-
-short UtilCmd::process(SqlciEnv * sqlciEnv)
-{
- return 0;
-}
-
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/b952c0d5/core/sql/sqlci/SqlciUtil.h
----------------------------------------------------------------------
diff --git a/core/sql/sqlci/SqlciUtil.h b/core/sql/sqlci/SqlciUtil.h
deleted file mode 100644
index de6c4d7..0000000
--- a/core/sql/sqlci/SqlciUtil.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/**********************************************************************
-// @@@ START COPYRIGHT @@@
-//
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-//
-// @@@ END COPYRIGHT @@@
-//
-**********************************************************************/
-/* -*-C++-*-
- *****************************************************************************
- *
- * File: SqlciUtil.h
- * RCS: $Id: SqlciUtil.h,v 1.4 1997/07/12 18:02:40 Exp $
- * Description: Declarations for utilities commands
- *
- *
- * Created: 1/10/95
- * Language: C++
- * Status: $State: Exp $
- *
- *
- *
- *
- *****************************************************************************
- */
-
-#ifndef UTILCMD_H
-#define UTILCMD_H
-
-#include "SqlciNode.h"
-#include "SqlciList_templ.h"
-
-class PrepStmt;
-class SqlCmd;
-class IpcServer;
-
-class UtilCmd : public SqlciNode {
-public:
-enum UtilCmdType {
- NONE
-};
-
-private:
- UtilCmdType commandType_;
- char *argument_;
-public:
- UtilCmd(UtilCmdType, char * argument);
- ~UtilCmd(){};
- short process(SqlciEnv * sqlciEnv);
- NABoolean isAllowedInSIP() { return FALSE; } ;
- NABoolean isAllowedInRWMode() {return TRUE; };
- NABoolean isAllowedInCSMode() {return FALSE; } ;
-protected:
- char * getArgument() { return argument_;}
-};
-
-#endif
-
-
-
-
-
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/b952c0d5/core/sql/sqlci/UtilInt.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlci/UtilInt.cpp b/core/sql/sqlci/UtilInt.cpp
deleted file mode 100644
index 7ca530b..0000000
--- a/core/sql/sqlci/UtilInt.cpp
+++ /dev/null
@@ -1,86 +0,0 @@
-/**********************************************************************
-// @@@ START COPYRIGHT @@@
-//
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-//
-// @@@ END COPYRIGHT @@@
-//
-**********************************************************************/
-/* -*-C++-*-
- *****************************************************************************
- *
- * File: UtilInt.C
- * RCS: $Id: UtilInt.cpp,v 1.2.18.1 1998/07/08 21:48:22 Exp $
- * Description:
- *
- *
- * Created: March 24, 95
- * Modified: $ $Date: 1998/07/08 21:48:22 $ (GMT)
- * Language: C++
- * Status: Experimental
- *
- *
- *
- *
- *****************************************************************************
- */
-
-// -----------------------------------------------------------------------
-// Change history:
-//
-// $Log: UtilInt.cpp,v $
-// Revision 1.2.18.1 1998/07/08 21:48:22
-// Merge of FCS0612 into NSKPORT_971208
-//
-// Revision 1.3 1998/05/13 18:40:48
-// Merged OLT0506 into FCS.
-//
-// Revision 1.2.34.1 1998/04/22 23:44:11
-// changes related to new NAString class; memory leaks fixed
-//
-// Revision 1.2 1997/04/23 00:31:20
-// Merge of MDAM/Costing changes into SDK thread
-//
-// Revision 1.1.1.1.2.1 1997/04/11 23:25:08
-// Checking in partially resolved conflicts from merge with MDAM/Costing
-// thread. Final fixes, if needed, will follow later.
-//
-// Revision 1.3.4.1 1997/04/10 18:33:32
-// *** empty log message ***
-//
-// Revision 1.1.1.1 1997/03/28 01:39:46
-// These are the source files from SourceSafe.
-//
-//
-// 5 1/22/97 11:04p
-// Merged UNIX and NT versions.
-//
-// 3 1/14/97 4:55a
-// Merged UNIX and NT versions.
-// Revision 1.3 1996/04/05 20:08:03
-// Included the standard banner with RCS strings.
-//
-// Revision 1.2 1995/08/30 22:50:27
-// Implement break.
-//
-// Revision 1.1 1995/07/17 21:59:16
-// Initial revision
-//
-//
-// -----------------------------------------------------------------------
-
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/b952c0d5/core/sql/sqlci/UtilInt.h
----------------------------------------------------------------------
diff --git a/core/sql/sqlci/UtilInt.h b/core/sql/sqlci/UtilInt.h
deleted file mode 100644
index c0478c4..0000000
--- a/core/sql/sqlci/UtilInt.h
+++ /dev/null
@@ -1,44 +0,0 @@
-#ifndef UTILINT_H
-#define UTILINT_H
-/* -*-C++-*-
- *****************************************************************************
- *
- * File: UtilInt.h
- * RCS: $Id: UtilInt.h,v 1.2.18.1 1998/07/08 21:48:23 Exp $
- * Description:
- *
- *
- * Created: 4/15/95
- * Modified: $ $Date: 1998/07/08 21:48:23 $ (GMT)
- * Language: C++
- * Status: $State: Exp $
- *
- *
-// @@@ START COPYRIGHT @@@
-//
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-//
-// @@@ END COPYRIGHT @@@
- *
- *
- *****************************************************************************
- */
-
-obsolete file, should not be included
-
-#endif
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/b952c0d5/core/sql/sqlci/UtilMsg.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlci/UtilMsg.cpp b/core/sql/sqlci/UtilMsg.cpp
deleted file mode 100644
index 276d066..0000000
--- a/core/sql/sqlci/UtilMsg.cpp
+++ /dev/null
@@ -1,69 +0,0 @@
-/* -*-C++-*-
- *****************************************************************************
- *
- * File: UtilMsg.C
- * RCS: $Id: UtilMsg.cpp,v 1.2 1997/04/23 00:31:23 Exp $
- * Description:
- *
- *
- * Created: 4/15/95
- * Modified: $ $Date: 1997/04/23 00:31:23 $ (GMT)
- * Language: C++
- * Status: $State: Exp $
- *
- *
-// @@@ START COPYRIGHT @@@
-//
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-//
-// @@@ END COPYRIGHT @@@
- *
- *
- *****************************************************************************
- */
-
-// -----------------------------------------------------------------------
-// Change history:
-//
-// $Log: UtilMsg.cpp,v $
-// Revision 1.2 1997/04/23 00:31:23
-// Merge of MDAM/Costing changes into SDK thread
-//
-// Revision 1.1.1.1.2.1 1997/04/11 23:25:11
-// Checking in partially resolved conflicts from merge with MDAM/Costing
-// thread. Final fixes, if needed, will follow later.
-//
-// Revision 1.3.4.1 1997/04/10 18:33:35
-// *** empty log message ***
-//
-// Revision 1.1.1.1 1997/03/28 01:39:46
-// These are the source files from SourceSafe.
-//
-//
-// 5 1/22/97 11:04p
-// Merged UNIX and NT versions.
-//
-// 3 1/14/97 4:55a
-// Merged UNIX and NT versions.
-// Revision 1.3 1996/05/31 21:16:10
-// no change
-//
-// Revision 1.2 1996/04/05 20:08:03
-// Included the standard banner with RCS strings.
-//
-
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/b952c0d5/core/sql/sqlci/UtilMsg.h
----------------------------------------------------------------------
diff --git a/core/sql/sqlci/UtilMsg.h b/core/sql/sqlci/UtilMsg.h
deleted file mode 100644
index 1c7f5f6..0000000
--- a/core/sql/sqlci/UtilMsg.h
+++ /dev/null
@@ -1,45 +0,0 @@
-#ifndef UTILMSG_H
-#define UTILMSG_H
-
-/* -*-C++-*-
- *****************************************************************************
- *
- * File: UtilMsg.h
- * RCS: $Id: UtilMsg.h,v 1.2 1997/04/23 00:31:25 Exp $
- * Description:
- *
- *
- * Created: 4/15/95
- * Modified: $ $Date: 1997/04/23 00:31:25 $ (GMT)
- * Language: C++
- * Status: $State: Exp $
- *
- *
-// @@@ START COPYRIGHT @@@
-//
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-//
-// @@@ END COPYRIGHT @@@
- *
- *
- *****************************************************************************
- */
-
- obsolete file,should not be included
-
-#endif /* UTILMSG_H */
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/b952c0d5/core/sql/sqlci/immudefs.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlci/immudefs.cpp b/core/sql/sqlci/immudefs.cpp
deleted file mode 100644
index 130105a..0000000
--- a/core/sql/sqlci/immudefs.cpp
+++ /dev/null
@@ -1,156 +0,0 @@
-/**********************************************************************
-// @@@ START COPYRIGHT @@@
-//
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-//
-// @@@ END COPYRIGHT @@@
-//
-**********************************************************************/
-/* -*-C++-*-
- *****************************************************************************
- *
- * File: immudefs.C
- * RCS: $Id: immudefs.cpp,v 1.2 1997/04/23 00:31:30 Exp $
- * Description:
- * Simulated functions for IMMU calls.
- *
- * Created: 2/23/96
- * Modified: $ $Date: 1997/04/23 00:31:30 $ (GMT)
- * Language: C++
- * Status: $State: Exp $
- *
- *
- *
- *
- *****************************************************************************
- */
-
-// -----------------------------------------------------------------------
-// Change history:
-//
-// $Log: immudefs.cpp,v $
-// Revision 1.2 1997/04/23 00:31:30
-// Merge of MDAM/Costing changes into SDK thread
-//
-// Revision 1.1.1.1.2.1 1997/04/11 23:25:14
-// Checking in partially resolved conflicts from merge with MDAM/Costing
-// thread. Final fixes, if needed, will follow later.
-//
-// Revision 1.4.4.1 1997/04/10 18:33:38
-// *** empty log message ***
-//
-// Revision 1.1.1.1 1997/03/28 01:39:42
-// These are the source files from SourceSafe.
-//
-//
-// 6 1/22/97 11:04p
-// Merged UNIX and NT versions.
-//
-// 4 1/14/97 4:55a
-// Merged UNIX and NT versions.
-// Revision 1.4 1996/10/11 23:32:33
-// Modified the functions for error generation to use ComDiags.
-//
-// Revision 1.3 1996/05/31 21:16:10
-// no change
-//
-// Revision 1.2 1996/04/05 20:08:03
-// Included the standard banner with RCS strings.
-//
-
-#include <string.h>
-
-#include "immudefs.h"
-#include "Platform.h"
-
-// All the following functions are required for
-// sun objects only. For OSS objects, these functions
-// are available in the system library.
-
-
-_tal _extensible short IMMU_OPEN_(
- char _far *Fname, /* Message File Name. IN */
- short Flen, /* Message File Length IN */
- short _far *Fnum, /* Message File Number. OUT */
- char _far *ProdNum, /* Tandem Product Number. IN */
- short _far *SpecialSymbol, /* Special Symbol. OU */
- short _far *Language /* Optional OU */
- )
-{
- return 0 ;
-}
-
-_tal _extensible short IMMU_READ_FORMAT_(
- short Fnum, /* Message File Number. IN */
- struct IMMUkey_def _far *Key, /* Access Key. IN */
- char _far *Msg, /* Message. IN */
- short MaxLen, /* Maximum Length to Return. IN */
- short _far *Len, /* Opt */ /* Actual Length Returned. I/O */
- short SpecialSymbol,/* Opt */ /* Special Symbol. IN */
- short _far *MoreLines, /* Opt */ /* Indicates more lines for msg. O*/
- char _far *Parm1, /* Opt */ /* Substitutable Parmeter. IN */
- char _far *Parm2, /* Opt */ /* Substitutable Parmeter. IN */
- char _far *Parm3, /* Opt */ /* Substitutable Parmeter. IN */
- char _far *Parm4, /* Opt */ /* Substitutable Parmeter. IN */
- char _far *Parm5 /* Opt */ /* Substitutable Parmeter. IN */
- )
-{
-
-
- strcpy (Msg, "\nSorry, the HELP messages will be available only when we move to OSS" ) ;
- *Len = 68 ;
- *MoreLines = 0 ;
-
- return 0 ;
-}
-
-_tal _extensible short IMMU_FORMAT_(
- short SpecialSymbol, /* Special Symbol IN */
- char _far *Msg, /* Message. I/O*/
- short MaxLen, /* Maximum Length to Return. IN */
- short _far *Len, /* Opt */ /* Actual Length Returned. I/O*/
- char _far *Parm1, /* Substitutable Parameter. IN */
- char _far *Parm2, /* Opt */ /* Substitutable Parameter. IN */
- char _far *Parm3, /* Opt */ /* Substitutable Parameter. IN */
- char _far *Parm4, /* Opt */ /* Substitutable Parameter. IN */
- char _far *Parm5 /* Opt */ /* Substitutable Parameter. IN */
- )
-{
- return 0 ;
-}
-
-_tal _extensible short IMMU_MESSAGE_FILE_ERROR_(
- short _far *Fname, /* Name of Message File. IN */
- short Flen, /* Length of Message File. IN */
- short Error, /* Error Which Occurred. IN */
- char _far *Msg, /* Message. OUT*/
- short MaxLen, /* Maximum Length to Return. IN */
- short _far *Len, /* Opt */ /* Actual Length Returned. OUT*/
- struct IMMUkey_def _far *Key /* Opt */ /* Access Key. IN */
- )
-{
- return 0 ;
-}
-
-_tal _extensible short IMMU_CLOSE_(
- short Fnum /* Message File Number. IN */
- )
-{
- return 0 ;
-}
-
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/b952c0d5/core/sql/sqlci/immudefs.h
----------------------------------------------------------------------
diff --git a/core/sql/sqlci/immudefs.h b/core/sql/sqlci/immudefs.h
deleted file mode 100644
index 6d577f0..0000000
--- a/core/sql/sqlci/immudefs.h
+++ /dev/null
@@ -1,185 +0,0 @@
-#ifndef IMMUDEFS_H
-#define IMMUDEFS_H
-
-/* -*-C++-*-
- *****************************************************************************
- *
- * File: immudefs.h
- * RCS: $Id: immudefs.h,v 1.2 1997/04/23 00:31:32 Exp $
- * Description:
- * C form of IMMUDEFS.
- *
- * Created: 2/20/96
- * Modified: $ $Date: 1997/04/23 00:31:32 $ (GMT)
- * Language: C++
- * Status: $State: Exp $
- *
- *
-// @@@ START COPYRIGHT @@@
-//
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-//
-// @@@ END COPYRIGHT @@@
- *
- *
- *****************************************************************************
- */
-
-// -----------------------------------------------------------------------
-// Change history:
-//
-// $Log: immudefs.h,v $
-// Revision 1.2 1997/04/23 00:31:32
-// Merge of MDAM/Costing changes into SDK thread
-//
-// Revision 1.1.1.1.2.1 1997/04/11 23:25:16
-// Checking in partially resolved conflicts from merge with MDAM/Costing
-// thread. Final fixes, if needed, will follow later.
-//
-// Revision 1.4.4.1 1997/04/10 18:33:40
-// *** empty log message ***
-//
-// Revision 1.1.1.1 1997/03/28 01:39:42
-// These are the source files from SourceSafe.
-//
-//
-// Revision 1.3 1996/05/31 21:35:57
-// no change
-//
-// Revision 1.2 1996/04/05 20:19:10
-// Included the standard banner with RCS strings.
-//
-
-#include "Platform.h"
-
-// Required only for sunobj builds
-#define _tal
-#define _far
-#define _extensible
-
-
-enum {
- IMMUerr_successful = 0, /* Processing was successful. */
- IMMUerr_message_truncated = -1, /* Message was too large for buffer. */
- IMMUerr_invalid_key = -2, /* An invalid key was passed. */
- IMMUerr_missing_param = -3, /* Required parameter missing. */
- IMMUerr_not_KS_file = -4, /* Not key-sequenced file. */
- IMMUerr_incompatible_version = -5, /* Incompatible Record version format. */
- IMMUerr_wrong_message_file = -6, /* Message file not for Product Number. */
- IMMUerr_invalid_message_file = -7, /* Invalid data detected in file. */
- IMMUerr_file_not_open = -8 /* Tried to close unopened file. */
- } ;
-
-enum {
- len_RecordType = 2, /* Length of Record Type field */
- len_ProductNum = 8, /* Length of product number field */
- len_HelpTopic = 31, /* Length of help field */
- len_Keyword = 31 /* Length of keyword field */
- } ;
-
-struct IMMUkey_def {
- /* Key fields */
- char IMMUkey_product_number[len_ProductNum];
- /* Product Number and Version */
-
- char IMMUkey_record_type[len_RecordType];
- /* Record Type */
- /* VR: Version Record */
- /* ER: Error Record */
- /* HL: Help Record */
- /* KY: Keyword Record */
-
- short IMMUkey_key_field1; /* If VR then doesn't matter */
- /* If ER then Error Number */
- /* If HL then doesn't matter */
- /* If KY then doesn't matter */
-
- short IMMUkey_key_field2; /* If VR then doesn't matter */
- /* If ER then Line Number */
- /* If HL then Line Number */
- /* If KY then Alias Number */
-
- char IMMUkey_key_field3[len_HelpTopic];
- /* If VR then doesn't matter */
- /* If ER then doesn't matter */
- /* If HL then Help Topic */
- /* If KY then Known Keyword */
- char _filler;
- } ;
-
-struct IMMU_filename {
- short length;
- char * file_name;
- } ;
-
-/* */
-/* New interface procedures for D00 release. */
-/* */
-
-_tal _extensible short IMMU_OPEN_(
- char _far *Fname, /* Message File Name. IN */
- short Flen, /* Message File Length IN */
- short _far *Fnum, /* Message File Number. OUT */
- char _far *ProdNum, /* Tandem Product Number. IN */
- short _far *SpecialSymbol, /* Special Symbol. OU */
- short _far *Language /* Opt */ /* Language. OU */
- );
-
-_tal _extensible short IMMU_READ_FORMAT_(
- short Fnum, /* Message File Number. IN */
- struct IMMUkey_def _far *Key, /* Access Key. IN */
- char _far *Msg, /* Message. IN */
- short MaxLen, /* Maximum Length to Return. IN */
- short _far *Len, /* Opt */ /* Actual Length Returned. I/O */
- short SpecialSymbol,/* Opt */ /* Special Symbol. IN */
- short _far *MoreLines, /* Opt */ /* Indicates more lines for msg. O*/
- char _far *Parm1, /* Opt */ /* Substitutable Parmeter. IN */
- char _far *Parm2, /* Opt */ /* Substitutable Parmeter. IN */
- char _far *Parm3, /* Opt */ /* Substitutable Parmeter. IN */
- char _far *Parm4, /* Opt */ /* Substitutable Parmeter. IN */
- char _far *Parm5 /* Opt */ /* Substitutable Parmeter. IN */
- );
-
-_tal _extensible short IMMU_FORMAT_(
- short SpecialSymbol, /* Special Symbol IN */
- char _far *Msg, /* Message. I/O*/
- short MaxLen, /* Maximum Length to Return. IN */
- short _far *Len, /* Opt */ /* Actual Length Returned. I/O*/
- char _far *Parm1, /* Substitutable Parameter. IN */
- char _far *Parm2, /* Opt */ /* Substitutable Parameter. IN */
- char _far *Parm3, /* Opt */ /* Substitutable Parameter. IN */
- char _far *Parm4, /* Opt */ /* Substitutable Parameter. IN */
- char _far *Parm5 /* Opt */ /* Substitutable Parameter. IN */
- );
-
-_tal _extensible short IMMU_MESSAGE_FILE_ERROR_(
- short _far *Fname, /* Name of Message File. IN */
- short Flen, /* Length of Message File. IN */
- short Error, /* Error Which Occurred. IN */
- char _far *Msg, /* Message. OUT*/
- short MaxLen, /* Maximum Length to Return. IN */
- short _far *Len, /* Opt */ /* Actual Length Returned. OUT*/
- struct IMMUkey_def _far *Key /* Opt */ /* Access Key. IN */
- );
-
-
-_tal _extensible short IMMU_CLOSE_(
- short Fnum /* Message File Number. IN */
- );
-
-#endif /* IMMUDEFS_H */
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/b952c0d5/core/sql/sqlci/sqlci_lex.ll
----------------------------------------------------------------------
diff --git a/core/sql/sqlci/sqlci_lex.ll b/core/sql/sqlci/sqlci_lex.ll
index 18b7f48..4299a1c 100755
--- a/core/sql/sqlci/sqlci_lex.ll
+++ b/core/sql/sqlci/sqlci_lex.ll
@@ -54,18 +54,12 @@
#include <stdlib.h>
#include <iostream>
#include "SqlciCmd.h"
-#include "SqlciRWCmd.h"
#include "str.h"
#include "Sqlci.h"
-#pragma warning (disable : 4005) //warning elimination
-#pragma nowarn(140) // warning elimination
#define yylval sqlcilval
#define yyerror sqlcierror
#include "sqlci_yacc.h"
-#pragma warn(140) // warning elimination
-#pragma warning (default : 4005) //warning elimination
#include "SqlciParseGlobals.h"
-#pragma nowarn(1506) //warning elimination
static int token_to_return;
@@ -257,19 +251,8 @@ B [ \t\n]+
[Ll][Oo][Aa][Dd] return_IDENT_or_TOKEN(LOADtoken, 0);
[Mm][Ee][Rr][Gg][Ee] return_IDENT_or_TOKEN(MERGEtoken, 0);
[Mm][Ee][Tt][Aa][Dd][Aa][Tt][Aa] return_IDENT_or_TOKEN(METADATAtoken, 0);
-[Mm][Aa][Ii][Nn][Tt][Aa][Ii][Nn] return_IDENT_or_TOKEN(MAINTAINtoken, 0);
[Mm][Aa][Pp] return_IDENT_or_TOKEN(MAPtoken, 0);
[Mm][Oo][Dd][Ii][Ff][Yy] return_IDENT_or_TOKEN(MODIFY, 0);
-[Mm][Oo][Dd][Uu][Ll][Ee] {
- return_IDENT_or_TOKEN(MODULE, 0);
- }
-[Mm][Oo][Dd][Uu][Ll][Ee][Ss] {
- return_IDENT_or_TOKEN(MODULES, 0);
- }
-[Mm][Oo][Dd][Uu][Ll][Ee][_][Dd][Ii][Rr] {
- return_IDENT_or_TOKEN(MODULE_DIR, 0);
- }
-[No][Oo][Ee] return_IDENT_or_TOKEN(NOEtoken, 0);
[Oo][Bb][Ee][Yy] {
BEGIN FNAME;
return_IDENT_or_TOKEN (OBEY, 0);
@@ -290,8 +273,6 @@ B [ \t\n]+
[Ee][Xx][Ii][Tt] return_IDENT_or_TOKEN(EXIT, 0);
[Ff][Cc] return_IDENT_or_TOKEN(FC, -1);
[Ff][Oo][Rr] return_IDENT_or_TOKEN(FORtoken, 0);
-[Rr][Ee][Oo][Rr][Gg] return_IDENT_or_TOKEN(REORGtoken, 0);
-[Rr][Ee][Oo][Rr][Gg][Aa][Nn][Ii][Zz][Ee] return_IDENT_or_TOKEN(REORGtoken, 0);
[Rr][Ee][Pp][Ll][Ii][Cc][Aa][Tt][Ee] return_IDENT_or_TOKEN(REPLICATEtoken, 0);
[[Cc][Pp][Uu] return_IDENT_or_TOKEN(CPU, 0);
[Pp][Ii][Dd] return_IDENT_or_TOKEN(PID, 0);
@@ -305,21 +286,6 @@ B [ \t\n]+
return_IDENT_or_TOKEN(LOG, 0);
}
-[Hh][Ee][Ll][Pp] {
- SqlciParse_SyntaxErrorCleanup = -1;
- if (SqlciParse_IdentifierExpected)
- {
- if (yylval.stringval_type)
- delete [] yylval.stringval_type;
- yylval.stringval_type = new char[5];
- strcpy(yylval.stringval_type, "HELP");
- token_to_return = IDENTIFIER ;
- }
- else
- token_to_return = HELP;
- SqlciParse_IdentifierExpected = -1;
- return (token_to_return);
- }
[Hh][Ii][Ss][Tt][Oo][Rr][Yy] return_IDENT_or_TOKEN(HISTORY, 0);
[Rr][Ee][Ss][Ee][Tt] return_IDENT_or_TOKEN(RESET, 0);
[Ss][Ee][Tt]{B}[Tt][Aa][Bb][Ll][Ee] return_IDENT_or_TOKEN(SET_TABLEtoken, 0);
@@ -327,13 +293,11 @@ B [ \t\n]+
[Ss][Ee][Tt] return_IDENT_or_TOKEN(SETtoken, 0);
[Ss][Ee][Tt][Ee][Nn][Vv] return_IDENT_or_TOKEN(SETENV, 0);
[Ll][Ii][Ss][Tt]_[Cc][Oo][Uu][Nn][Tt] return_IDENT_or_TOKEN(LISTCOUNT, 0);
-[Ll][Ii][Ss][Tt] return_IDENT_or_TOKEN(LISTX, 0);
[Ff][Ii][Rr][Ss][Tt] return_IDENT_or_TOKEN(FIRST, 0);
[Nn][Ee][Xx][Tt] return_IDENT_or_TOKEN(NEXT, 0);
[Rr][Ee][Pp][Oo][Rr][Tt] return_IDENT_or_TOKEN(REPORT, 0);
[Ss][Qq][Ll] return_IDENT_or_TOKEN(SQL, 0);
[Cc][Aa][Nn][Cc][Ee][ll] return_IDENT_or_TOKEN(CANCEL, 0);
-[Mm][Xx][Cc][Ss] return_IDENT_or_TOKEN(MXCS, 0);
[Mm][Oo][Dd][Ee] return_IDENT_or_TOKEN(MODE,0);
[Ww][Aa][Rr][Nn][Ii][Nn][Gg][Ss] return_IDENT_or_TOKEN(VERBOSE, 0);
[Pp][Aa][Rr][Aa][Mm] return_IDENT_or_TOKEN(PARAM, 0);
@@ -344,7 +308,6 @@ B [ \t\n]+
[Pp][Uu][Rr][Gg][Ee][Dd][Aa][Tt][Aa] return_IDENT_or_TOKEN(PURGEDATA, 0);
[Pp][Oo][Pp][Uu][Ll][Aa][Tt][Ee] return_IDENT_or_TOKEN(POPULATE, 0);
[Vv][Aa][Ll][Ii][Dd][Aa][Tt][Ee] return_IDENT_or_TOKEN(VALIDATEtoken, 0);
-[Rr][Ee][Cc][Oo][Vv][Ee][Rr] return_IDENT_or_TOKEN(RECOVER, 0);
[Rr][Ee][Ff][Rr][Ee][Ss][Hh] return_IDENT_or_TOKEN(REFRESH, 0); /* MV - REFRESH utility */
[Rr][Ee][Pp][Oo][Ss][Ii][Tt][Oo][Rr][Yy] return_IDENT_or_TOKEN(REPOSITORYtoken, 0);
[Rr][Oo][Ww][Ss][Ee][Tt] return_IDENT_or_TOKEN(ROWSETtoken, 0);
@@ -377,19 +340,6 @@ B [ \t\n]+
[Vv][Aa][Ll][Uu][Ee][Ss] return_IDENT_or_TOKEN(VALUES, 0);
[Vv][Ee][Rr][Ss][Ii][Oo][Nn] return_IDENT_or_TOKEN(VERSIONtoken, 0);
[Cc][Rr][Ee][Aa][Tt][Ee] return_IDENT_or_TOKEN(CREATE, 0);
-[Ll][Aa][Bb][Ee][Ll][_][Cc][Rr][Ee][Aa][Tt][Ee] {
- return_IDENT_or_TOKEN(LABEL_CREATE, 0);
- }
-[Ll][Aa][Bb][Ee][Ll][_][Dd][Rr][Oo][Pp] {
- return_IDENT_or_TOKEN(LABEL_DROP, 0);
- }
-
-[Ll][Aa][Bb][Ee][Ll][_][Aa][Ll][Tt][Ee][Rr] {
- return_IDENT_or_TOKEN(LABEL_ALTER, 0);
- }
-[Ll][Aa][Bb][Ee][Ll][_][Pp][Uu][Rr][Gg][Ee][Dd][Aa][Tt][Aa] {
- return_IDENT_or_TOKEN(LABEL_PURGEDATA, 0);
- }
[Aa][Ll][Tt][Ee][Rr] return_IDENT_or_TOKEN(ALTER, 0);
[Dd][Rr][Oo][Pp] return_IDENT_or_TOKEN(DROP, 0);
[Ll][Oo][Cc][Kk] return_IDENT_or_TOKEN(LOCK, 0);
@@ -433,8 +383,6 @@ B [ \t\n]+
[Ii][Nn][Ff][Ee][Rr]_[Cc][Hh][Aa][Rr][Ss][Ee][Tt] return_IDENT_or_TOKEN(INFER_CHARSET, 0);
[Rr][Ee][Ss][Uu][Ll][Tt] return_IDENT_or_TOKEN(RESULT, 0);
[Qq][Uu][Ii][Ee][Ss][Cc][Ee] return_IDENT_or_TOKEN(QUIESCE, 0);
-[Dd][Oo][Ww][Nn][Gg][Rr][Aa][Dd][Ee] return_IDENT_or_TOKEN(DOWNGRADEtoken, 0);
-[Uu][Pp][Gg][Rr][Aa][Dd][Ee] return_IDENT_or_TOKEN(UPGRADEtoken, 0);
[Aa][Cc][Tt][Ii][Vv][Ee] return_IDENT_or_TOKEN(ACTIVEtoken, 0);
[Aa][Cc][Cc][Uu][Mm][Uu][Ll][Aa][Tt][Ee][Dd] return_IDENT_or_TOKEN(ACCUMULATEDtoken, 0);
[Pp][Ee][Rr][Tt][Aa][Bb][Ll][Ee] return_IDENT_or_TOKEN(PERTABLEtoken, 0);
@@ -518,26 +466,6 @@ B [ \t\n]+
return_IDENT_or_TOKEN(DQUOTED_STRING, 0);
}
-[=][A-Za-z][A-Za-z0-9_\$]* {
- if (yylval.stringval_type)
- delete [] yylval.stringval_type;
- yylval.stringval_type = new char[strlen(yytext) + 1];
- strcpy(yylval.stringval_type, yytext);
- SqlciParse_IdentifierExpected = 0;
-
- return(DEFINE_NAME);
- }
-[=][_][A-Za-z][A-Za-z0-9_\$]* {
- if (yylval.stringval_type)
- delete [] yylval.stringval_type;
- yylval.stringval_type = new char[strlen(yytext) + 1];
- strcpy(yylval.stringval_type, yytext);
- SqlciParse_IdentifierExpected = 0;
-
- return(DEFINE_NAME);
- }
-
-
[A-Za-z_][A-Za-z0-9_.]* {
yylval.stringval_type = new char[strlen(yytext)+1];
strcpy(yylval.stringval_type, yytext);
@@ -578,14 +506,6 @@ B [ \t\n]+
return(NODE_VOL_NAME);
}
-\\{G} {
- if (yylval.stringval_type)
- delete [] yylval.stringval_type;
- yylval.stringval_type = new char[strlen(yytext)+1];
- strcpy(yylval.stringval_type, yytext);
- return(NODE_NAME);
- }
-
\\{G}\.[0-9]*\,[0-9]* {
if (yylval.stringval_type)
delete [] yylval.stringval_type;
@@ -611,8 +531,7 @@ B [ \t\n]+
. {SqlciParse_IdentifierExpected = 0; return(ERROR_STMT);};
%%
-#pragma warn(1506) //warning elimination
-#pragma nowarn(262) //warning elimination
+
#ifdef NA_FLEXBUILD
void SqlciLexReinit()
{