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:21 UTC

[3/9] incubator-trafodion git commit: code cleanup, commit #1

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/b952c0d5/core/sql/sqlci/SqlciEnv.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlci/SqlciEnv.cpp b/core/sql/sqlci/SqlciEnv.cpp
index a071f27..84bb9ba 100644
--- a/core/sql/sqlci/SqlciEnv.cpp
+++ b/core/sql/sqlci/SqlciEnv.cpp
@@ -58,8 +58,6 @@
 #include "sqlcmd.h"
 #include "SQLCLIdev.h"
 #include "InputStmt.h"
-#include "SqlciRWCmd.h"
-#include "SqlciCSCmd.h"
 #include "CmpCommon.h"
 #include "ComDiags.h"
 #include "copyright.h"
@@ -202,7 +200,6 @@ BOOL CtrlHandler(DWORD ctrlType) {
 // The signal interrupt handler.  When break is hit, this function
 // will be called.
 
-#pragma nowarn(770)   // warning elimination 
 void interruptHandler (Int32 signalType)
 {
    void (*intHandler_addr) (Int32);
@@ -276,7 +273,6 @@ SqlciEnv::SqlciEnv(short serv_type, NABoolean macl_rw_flag)
   prepared_stmts = new SqlciList<PrepStmt>;
   param_list = new SqlciList<Param>;
   pattern_list = new SqlciList<Param>;
-  define_list = new SqlciList<Define>;
   envvar_list = new SqlciList<Envvar>;
   cursorList_ = new SqlciList<CursorStmt>;
   sqlci_stats = new SqlciStats();
@@ -301,9 +297,6 @@ SqlciEnv::SqlciEnv(short serv_type, NABoolean macl_rw_flag)
 
   userNameFromCommandLine_ = "";
 
-  report_env = new SqlciRWEnv(); // initialize the report writer environment variable
-  cs_env = new SqlciCSEnv(); // initialize the macl environment variable.
-
   // A break flag macl_rw_flag was added to the constructor in order for the SqlciEnv
   // constructor not to call the MACL & Report Writer Constructors
   // when the SqlciEnv constructor is called after a break key is hit.
@@ -367,7 +360,6 @@ SqlciEnv::~SqlciEnv()
   delete param_list;
   delete pattern_list;
   delete cursorList_;
-  delete define_list;
   delete envvar_list;
   delete sqlci_stats;
   sqlci_stmts = 0;
@@ -592,21 +584,11 @@ static void SqlciEnv_prologue_to_run(SqlciEnv *sqlciEnv)
   // Protect our startup CQDs and SET SCHEMA (from any SQL_MXCI_INITIALIZATION)
   // from being RESET.  User may still manually alter them, of course.
   //
-
-
-
-
   SqlCmd::executeQuery("CONTROL QUERY DEFAULT * RESET RESET;", sqlciEnv);
 
-
-
-
   // tell CLI that datetime & interval values are to be input/output in internal format.
   SqlCmd::executeQuery("SET SESSION DEFAULT INTERNAL_FORMAT_IO 'ON';", sqlciEnv);
 
-  // get the defaults
-  Define::getDefaults(sqlciEnv->defaultSubvol());
-
   // get sqlmx_terminal_charset if environment variable exists
   const char *termCS = getenv("SQLMX_TERMINAL_CHARSET");
   if (termCS) {
@@ -795,9 +777,7 @@ Int32 SqlciEnv::executeCommands(InputStmt *& input_stmt)
 	     if (!isInteractiveSession())
 	       get_logfile()->WriteAll(command);
 	     else if (get_logfile()->IsOpen())
-#pragma nowarn(1506)   // warning elimination 
 	       get_logfile()->Write(command, strlen(command));
-#pragma warn(1506)  // warning elimination 
 	     sqlci_parser(&command[2], &command[2], &sqlci_node,this);
 
 	     if (sqlci_node)
@@ -879,9 +859,7 @@ Int32 SqlciEnv::executeCommands(InputStmt *& input_stmt)
 
 	    sprintf(buf, "total opens = %d, total closes = %d", total_opens, total_closes);
 
-#pragma nowarn(1506)   // warning elimination 
 	    get_logfile()->WriteAll(buf, strlen(buf));
-#pragma warn(1506)  // warning elimination 
 	}
 
 	// Delete the stmt if not one of those we saved on the history list
@@ -1022,52 +1000,6 @@ void SqlciEnv::updateDefaultCatAndSch()
   resetSpecialError();
 }
 
-/////////////////////////////////////////
-// Processing of Report Writer class.
-// the constructor and destructor are 
-// defined here.  Set the Report Writer 
-// mode and Select In Progress mode to be
-// FALSE at this time.  Also instantiate
-// the Interface executor here.
-/////////////////////////////////////////
-
-SqlciRWEnv::SqlciRWEnv() 
-{ 
-  rwEnv_ = NULL;
-  rwSelect_ = FALSE;
-  rwExe_ = new SqlciRWInterfaceExecutor();
-  // Any memory required by RW should be derived from 
-  // system heap only. RW should not do any memory
-  // allocation or deallocation on its own.  All memory
-  // must be got by calling methods on this pointer 
-  // provided by MXCI.
-  heap_ = new NAHeap((char *) "reportwriter_heap",
-                     NAMemory::DERIVED_FROM_SYS_HEAP); 
-}
-
-SqlciRWEnv::~SqlciRWEnv() 
-{
-}
-
-/////////////////////////////////////////
-// Processing of MACL class.
-// the constructor and destructor are 
-// defined here.  Set the Report Writer 
-// mode and Select In Progress mode to be
-// FALSE at this time.  Also instantiate
-// the Interface executor here.
-/////////////////////////////////////////
-
-SqlciCSEnv::SqlciCSEnv() 
-{ 
-  csEnv_ = NULL;
-  csExe_ = new SqlciCSInterfaceExecutor();
-}
-
-SqlciCSEnv::~SqlciCSEnv() 
-{
-}
-
 // This is the command which will show the user
 // which mode they are in.
 
@@ -1079,14 +1011,6 @@ void SqlciEnv::showMode(ModeType mode_)
             cout << "The current mode is SQL mode." << endl;	    
             break;
 
-	case REPORT_:
-	    cout << "The current mode is REPORT WRITER mode." << endl;
-	    break;
-        
-       case MXCS_:
-           cout << "The current mode is MXCS mode." << endl;
-           break;
-
 	default:
 
 	    break;
@@ -1193,9 +1117,7 @@ short Env::process(SqlciEnv *sqlci_env)
   log->WriteAllWithoutEOL("MESSAGEFILE VRSN   ");
   char vmsgcode[10];
   sprintf(vmsgcode, "%d", SQLERRORS_MSGFILE_VERSION_INFO);
-#pragma nowarn(1506)   // warning elimination 
   Error vmsg(vmsgcode, strlen(vmsgcode), Error::ENVCMD_);
-#pragma warn(1506)  // warning elimination 
   vmsg.process(sqlci_env);
 
   ComAnsiNamePart defaultCat;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/b952c0d5/core/sql/sqlci/SqlciEnv.h
----------------------------------------------------------------------
diff --git a/core/sql/sqlci/SqlciEnv.h b/core/sql/sqlci/SqlciEnv.h
index 8f922e9..a9fceb6 100644
--- a/core/sql/sqlci/SqlciEnv.h
+++ b/core/sql/sqlci/SqlciEnv.h
@@ -57,18 +57,12 @@
 #include "Define.h"
 #include "Param.h"
 #include "Prepare.h"
-#include "CSInterface.h"
 
 // forward references
 class SqlciStats;
-class SqlciRWEnv;
-class SqlciRWInterfaceExecutor;
-class SqlciCSEnv;
-class SqlciCSInterfaceExecutor;
 class ComSchemaName;
 class ComAnsiNamePart;
 
-#pragma nowarn(1506)   // warning elimination 
 class Logfile {
 
 private:
@@ -114,44 +108,6 @@ public:
   NABoolean noDisplay() { return flags_ & NO_DISPLAY; };
   void setNoDisplay(NABoolean v);
 };
-#pragma warn(1506)  // warning elimination 
-
-
-// SqlciRWEnv class.  
-class SqlciRWEnv {
-
-private:			
-	NABoolean       rwSelect_;
-	void *		rwEnv_; // Pointer to ReportWriter's env.  This is a handle to their env.
-	SqlciRWInterfaceExecutor * rwExe_;
-	NAHeap		*heap_;
-
-public:
-	SqlciRWEnv();
-	~SqlciRWEnv();
-	NABoolean           isSelectInProgress()		{ return rwSelect_; }
-	void                setSelectInProgress(NABoolean val)  { rwSelect_ = val; }
-	void*               &rwEnv()				{ return rwEnv_; }
-	SqlciRWInterfaceExecutor *rwExe()			{ return rwExe_; }   
-	NAHeap                   *rwHeap()			{ return heap_;  }
-};
-
-
-// SqlciCSEnv class.
-class SqlciCSEnv {
-
-private:
-  void * csEnv_; // Pointer to their MACL environment.  This is a handle to their env.
-  SqlciCSInterfaceExecutor *csExe_;
-
-public:
-  SqlciCSEnv();
-  ~SqlciCSEnv();
-  void* &csEnv()                      { return csEnv_; }
-  SqlciCSInterfaceExecutor *csExe()   { return csExe_; }
-
-};
-
 
 class SqlciEnv
 {
@@ -169,12 +125,9 @@ private:
   SqlciList<PrepStmt> *prepared_stmts;
   SqlciList<Param>    *param_list;
   SqlciList<Param>    *pattern_list;
-  SqlciList<Define>   *define_list;
   SqlciList<Envvar>   *envvar_list;
   SqlciList<CursorStmt> *cursorList_;
   SqlciStats          *sqlci_stats;
-  SqlciRWEnv          *report_env; //Pointer to ReportWriter's Environement.
-  SqlciCSEnv          *cs_env;  // Pointer to MACL's Environment.
   ULng32	      list_count;
 
   CharInfo::CharSet terminal_charset_;
@@ -226,7 +179,7 @@ private:
 public:
   enum {MAX_LISTCOUNT = UINT_MAX };
   enum {MAX_FRAGMENT_LEN_OVERFLOW = 900};
-  enum ModeType { SQL_, REPORT_, MXCS_, DISPLAY_ }; // Modes in which MXCI can exist.
+  enum ModeType { SQL_, DISPLAY_ }; // Modes in which MXCI can exist.
 
   ModeType mode;
 
@@ -272,15 +225,10 @@ public:
   SqlciList<PrepStmt> *get_prep_stmts()   	{ return prepared_stmts; }
   SqlciList<Param>    *get_paramlist()    	{ return param_list; }
   SqlciList<Param>    *get_patternlist()        { return pattern_list; }
-  SqlciList<Define>   *get_definelist()   	{ return define_list; }
   SqlciList<Envvar>   *get_envvarlist()   	{ return envvar_list; }
   SqlciList<CursorStmt> *getCursorList()        { return cursorList_; }
   SqlciStats          *getStats()         	{ return sqlci_stats; }
-  SqlciRWEnv          *sqlciRWEnv()	        { return report_env; }
-  SqlciCSEnv          *sqlciCSEnv()             { return cs_env; }
-  NABoolean           isReportWriterMode()      { if (mode == REPORT_) return TRUE; else return FALSE;};
   void                setMode(ModeType mode_)   { mode = mode_; }
-  NABoolean           isMXCSMode() { if (mode == MXCS_) return TRUE; else return FALSE;};
   void                showMode(ModeType mode_) ;
   ModeType            getMode()                 { return mode;}
   void                setListCount(ULng32 num = MAX_LISTCOUNT) { list_count = num; }

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/b952c0d5/core/sql/sqlci/SqlciError.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlci/SqlciError.cpp b/core/sql/sqlci/SqlciError.cpp
index 3903582..fb734f1 100644
--- a/core/sql/sqlci/SqlciError.cpp
+++ b/core/sql/sqlci/SqlciError.cpp
@@ -103,13 +103,9 @@ void SqlciError ( short errorCode, ...)
    while ((Param=va_arg(ap, ErrorParam *)) != (ErrorParam *) 0)
      {
        if (Param->Param_type() == STRING_TYPE) 
-#pragma nowarn(1506)   // warning elimination 
 	 Condition->setOptionalString(cur_string_p++, Param->Str_Param());
-#pragma warn(1506)  // warning elimination 
        else
-#pragma nowarn(1506)   // warning elimination 
 	 Condition->setOptionalInteger(cur_int_p++, Param->Int_Param());
-#pragma warn(1506)  // warning elimination 
      }
 
    sqlci_DA.acceptNewCondition();
@@ -132,13 +128,9 @@ void SqlciError2 ( Int32 errorCode, ...)
    while ((Param=va_arg(ap, ErrorParam *)) != (ErrorParam *) 0)
      {
        if ((Param->Param_type() == STRING_TYPE) && Param->Str_Param() ) 
-#pragma nowarn(1506)   // warning elimination 
 	 Condition->setOptionalString(cur_string_p++, Param->Str_Param());
-#pragma warn(1506)  // warning elimination 
        if ((Param->Param_type() == INT_TYPE) && Param->Int_Param() != -1)
-#pragma nowarn(1506)   // warning elimination 
 	 Condition->setOptionalInteger(cur_int_p++, Param->Int_Param());
-#pragma warn(1506)  // warning elimination 
      }
 
    sqlci_DA.acceptNewCondition();
@@ -161,13 +153,9 @@ void SqlciWarning ( short errorCode, ...)
    while ((Param=va_arg(ap, ErrorParam *)) != (ErrorParam *) 0)
      {
        if (Param->Param_type() == STRING_TYPE) 
-#pragma nowarn(1506)   // warning elimination 
 	 Condition->setOptionalString(cur_string_p++, Param->Str_Param());
-#pragma warn(1506)  // warning elimination 
        else
-#pragma nowarn(1506)   // warning elimination 
 	 Condition->setOptionalInteger(cur_int_p++, Param->Int_Param());
-#pragma warn(1506)  // warning elimination 
      }
 
    sqlci_DA.acceptNewCondition();

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/b952c0d5/core/sql/sqlci/SqlciError.h
----------------------------------------------------------------------
diff --git a/core/sql/sqlci/SqlciError.h b/core/sql/sqlci/SqlciError.h
index cb299e8..6a2de15 100644
--- a/core/sql/sqlci/SqlciError.h
+++ b/core/sql/sqlci/SqlciError.h
@@ -155,11 +155,7 @@
 #define SQLCI_RW_DETAIL_ALIAS_NOT_ALLOWED 15547
 #define SQLCI_RW_RIGHT_MARGIN_EXCEEDS   15548
 #define SQLCI_RW_NONNUMERIC_CHARACTER   15549
-#pragma warning( disable : 4005 )  // warning elimination
-#pragma nowarn(140)   // warning elimination 
 #define SQLCI_RW_INVALID_FORMATTING     15550
-#pragma warn(140)  // warning elimination 
-#pragma warning( default : 4005 )  // warning elimination
 #define SQLCI_RW_DIVISION_BY_ZERO       15551
 #define SQLCI_RW_INVALID_DELIMITED_IDENTIFIER 15552
 #define SQLCI_RW_UNABLE_TO_RESET        15575

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/b952c0d5/core/sql/sqlci/SqlciHelp.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlci/SqlciHelp.cpp b/core/sql/sqlci/SqlciHelp.cpp
deleted file mode 100644
index 67dd105..0000000
--- a/core/sql/sqlci/SqlciHelp.cpp
+++ /dev/null
@@ -1,244 +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:         SqlciHelp.C
- * RCS:          $Id: SqlciHelp.cpp,v 1.2 1997/04/23 00:30:55  Exp $
- * Description:  
- *               
- *               
- * Created:      2/23/96
- * Modified:     $ $Date: 1997/04/23 00:30:55 $ (GMT)
- * Language:     C++
- * Status:       $State: Exp $
- *
- *
- *
- *
- *****************************************************************************
- */
-
-// -----------------------------------------------------------------------
-// Change history:
-// 
-// $Log: SqlciHelp.cpp,v $
-// Revision 1.2  1997/04/23 00:30:55
-// Merge of MDAM/Costing changes into SDK thread
-//
-// Revision 1.1.1.1.2.1  1997/04/11 23:24:47
-// 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:08
-// *** empty log message ***
-//
-// Revision 1.1.1.1  1997/03/28 01:39:44
-// 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:30
-// 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 <iostream>
-#include <string.h>
-#include <ctype.h>
-#include <stdlib.h>
-
-#include "SqlciCmd.h"
-#include "immudefs.h"
-#include "SqlciError.h"
-#include "Platform.h"
-
-Help::Help(char * argument_, Lng32 arglen_, help_type type_)
-                 : SqlciCmd(SqlciCmd::HELP_TYPE, argument_, arglen_)
-{
-  type = type_;
-};
-
-short Help::process(SqlciEnv * sqlci_env)
-{
-  // help is not yet supported from MXCI.
-  SqlciError (SQLCI_HELP_NOT_FOUND, (ErrorParam *) 0);
-  return 0;
-
-#pragma nowarn(269)   // warning elimination 
-  char * topic_name = get_argument();
-#pragma warn(269)  // warning elimination 
-  short  topic_len ;
-
-  short open_err ;
-  short read_err ;
-
-  short fnum ;
-
-  char  fname[36] ; // Maximum filename length, including terminating null
-  char  pnum[9] ;
-  char * alt_msgfile;
-
-  short symbol = 0 ;
-  short lang = 0 ;
-
-  enum  { msg_max_len = 200 } ;
-  char  help_msg[msg_max_len] ;
-  short help_msg_len ;
-  short more_lines ;
-  char  p1, p2, p3, p4, p5 ;
-  short done = 0 ;
-
-  struct IMMUkey_def key ;
-
-
-  strcpy (pnum, "T9197X00");
-  
-  alt_msgfile = getenv("SQLMSGFILE");
-
-  if (alt_msgfile)
-    strcpy (fname, alt_msgfile);
-  else
-    strcpy (fname, "$SYSTEM.SYSTEM.SQLMSG");
-
-#pragma nowarn(1506)   // warning elimination 
-  topic_len = strlen(topic_name) ;
-#pragma warn(1506)  // warning elimination 
-
-  if (topic_len >= len_HelpTopic)
-    {
-      SqlciError (SQLCI_LONG_HELP_TOPIC, (ErrorParam *) 0);
-      return 0 ;
-    }
-
-  open_err = IMMU_OPEN_(fname, (short)strlen(fname), &fnum, pnum,
-                        &symbol, &lang);
-
-  if (open_err)
-    {
-      SqlciError (SQLCI_HELP_FOPEN_ERROR,
-		  new ErrorParam (open_err),
-		  new ErrorParam (&fname[0]) ,
-		  (ErrorParam *) 0
-		  );
-      return 0;
-    }
-
-  // Build the key for message file 
-  strcpy (key.IMMUkey_product_number, "T9197X00");
-  strcpy (key.IMMUkey_record_type, "HL");
-  key.IMMUkey_key_field1 = 0 ;
-  key.IMMUkey_key_field2 = 1 ; // more 
-  
-  memset (key.IMMUkey_key_field3, ' ', sizeof(key.IMMUkey_key_field3));
-
-  for (Int32 i=0; i < topic_len; i++)
-#pragma nowarn(1506)   // warning elimination 
-    topic_name[i] = tolower(topic_name[i]);
-#pragma warn(1506)  // warning elimination 
-  memcpy (key.IMMUkey_key_field3, topic_name, topic_len) ;
-
-  key.IMMUkey_key_field3[topic_len] = '^' ;
-
-  switch (type)
-    {
-      case SYNTAX_  : memcpy (&key.IMMUkey_key_field3[topic_len+1], "syntax", 6); 
-                      break;
-      case EXAMPLE_ : memcpy (&key.IMMUkey_key_field3[topic_len+1], "example", 7);
-		      break;
-      case DETAIL_  : memcpy (&key.IMMUkey_key_field3[topic_len+1], "detail", 6);
-		      break;
-    }
-
-  // The key is complete. Read the records now 
-  
-  done = 0 ;
-  while (!done)
-    {
-      read_err = IMMU_READ_FORMAT_ (fnum, &key, &help_msg[0], msg_max_len,
-				    &help_msg_len, symbol, &more_lines,
-				    &p1, &p2, &p3, &p4, &p5) ;
-
-      if (read_err)
-	{
-	  if (read_err == 11) 
-	    SqlciError (SQLCI_HELP_NOT_FOUND, (ErrorParam *) 0);
-	  else
-	    SqlciError (SQLCI_HELP_READ_ERROR,
-			new ErrorParam (read_err),
-			new ErrorParam (&fname[0]),
-			(ErrorParam *) 0
-			);
-	  done = -1;
-	}
-      else
-	{
-	  if (help_msg_len == 0)
-	    {
-	      cout << "\n" ;
-	    } 
-	  else
-	    {
-	      help_msg[help_msg_len] = (char) 0 ;
-	      cout << help_msg << "\n" ;
-	    }
-
-	  if (!more_lines) done = -1;
-	}
-    }
-
-  IMMU_CLOSE_ (fnum);
-
-  cout << "Help Command : \n" ;
-  cout << "  Topic : " << topic_name << "\n" ; 
-  cout << "  Len   : " << strlen(topic_name) << "\n" ;
-  cout << "  Type  : " ;
-  switch (type)
-    {
-      case SYNTAX_  : cout << "Syntax\n" ; 
-                      break;
-      case EXAMPLE_ : cout << "Example\n" ;
-		      break;
-      case DETAIL_  : cout << "Detail\n" ;
-		      break;
-      default       : cout << "UNKNOWN type\n" ;
-		      break;
-    }
-
-  cout << "\n" ;
-  
-  return 0 ;
-
-};
-
-

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/b952c0d5/core/sql/sqlci/SqlciNode.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlci/SqlciNode.cpp b/core/sql/sqlci/SqlciNode.cpp
index 0577f49..082a8db 100644
--- a/core/sql/sqlci/SqlciNode.cpp
+++ b/core/sql/sqlci/SqlciNode.cpp
@@ -62,33 +62,3 @@ short SqlciNode::process(SqlciEnv * sqlci_env)
   cerr << "Error: virtual function process must be redefined. \n";
   return -1;
 };
-
-
-// The purpose of these functions is that every class which is
-// derived from SqlciNode has to implement these functions.  So
-// certain commands will be allowed  in SIP and certain commands
-// wonte be allowed in RW mode. For those classes these fucntions
-// will return TRUE and FALSE respectively. 
-
-NABoolean SqlciNode::isAllowedInSIP()
-{
-	cerr << "Error: virtual function isAllowedInSIP must be redefined. \n";
-	return FALSE;
-};
-
-// All commanda will be allowed in RWmode execpte those which are
-// exclusive to SIP  like CANCEL, LIST ALL, LIST FIRST, LIST NEXT.
-// So the default behaviour is TRUE and for those commands alone it will be 
-// FALSE.
-
-NABoolean SqlciNode::isAllowedInRWMode()
-{
-	cerr << "Error: virtual function isAllowedInRWMode must be redefined. \n";
-	return TRUE;
-};
-
-NABoolean SqlciNode::isAllowedInCSMode()
-{
-  	cerr << "Error: virtual function isAllowedInCSMode must be redefined. \n";
-	return TRUE;
-}

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/b952c0d5/core/sql/sqlci/SqlciNode.h
----------------------------------------------------------------------
diff --git a/core/sql/sqlci/SqlciNode.h b/core/sql/sqlci/SqlciNode.h
index 274b32d..7c30ab2 100644
--- a/core/sql/sqlci/SqlciNode.h
+++ b/core/sql/sqlci/SqlciNode.h
@@ -63,16 +63,6 @@ public:
   virtual ~SqlciNode();
   virtual short process(SqlciEnv * sqlci_env);
 
-  // These are new functions to allow certain
-  // commands to be accepted in the Report Writer 
-  // mode and in the SelectInProgress mode.  These 
-  // functions are virtual functions which has 
-  // to be implemented by all classes that derive
-  // from SqlciNode.
-  virtual NABoolean isAllowedInSIP();
-  virtual NABoolean isAllowedInRWMode();
-  virtual NABoolean isAllowedInCSMode();
-
   void set_next(SqlciNode * next_)	{next = next_;}
   SqlciNode * get_next() const		{return next;}
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/b952c0d5/core/sql/sqlci/SqlciParser.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlci/SqlciParser.cpp b/core/sql/sqlci/SqlciParser.cpp
index 8cf14c2..c8153f3 100644
--- a/core/sql/sqlci/SqlciParser.cpp
+++ b/core/sql/sqlci/SqlciParser.cpp
@@ -47,8 +47,6 @@
 #include "ComDiags.h"
 #include "str.h"
 #include "SqlciParseGlobals.h"
-#include "SqlciRWCmd.h"
-#include "SqlciCSCmd.h"
 #include "SqlciError.h"
 #include "sqlcmd.h"
 
@@ -73,9 +71,7 @@ static Int32 sqlci_parser_subproc(char *instr, char *origstr, SqlciNode ** node,
   if (origstr)
     {
       // remove trailing blanks
-#pragma nowarn(1506)   // warning elimination 
       Lng32 j = strlen(origstr) - 1;
-#pragma warn(1506)  // warning elimination 
       while ((j >= 0) && (origstr[j] == ' '))
 	j--;
       origstr[j+1] = 0;
@@ -182,44 +178,7 @@ Int32 sqlci_parser_syntax_error_cleanup(char *instr, SqlciEnv *sqlci_env)
 
 Int32 sqlci_parser_handle_report_writer(SqlciEnv *sqlci_env, Lng32 retval)
 {
-  // if success in parsing so far and we have a valid SqlciParseTree which
-  // is a SqlciNode then you check for RW mode or MACL/MXCS mode.
-  if (!retval) 
-    {
-      if ( (sqlci_env->sqlciRWEnv()->isSelectInProgress()) &&
-	   !(SqlciParseTree->isAllowedInSIP())
-	   )
-	{
-	  SqlciError (SQLCI_RW_SELECT_IN_PROGRESS,
-		      (ErrorParam *) 0 );
-	  delete SqlciParseTree;
-	  SqlciParseTree = NULL;
-	  return 0;
-	}
-      else if ( !(sqlci_env->sqlciRWEnv()->isSelectInProgress()) &&
-		!(SqlciParseTree->isAllowedInRWMode())
-		)
-	{
-	  SqlciError (SQLCI_RW_ALLOWED_ONLY_DURING_SIP,
-		      (ErrorParam *) 0 );
-	  delete SqlciParseTree;
-	  SqlciParseTree = NULL;
-	  return 0;
-	}
-      else if ((sqlci_env->isMXCSMode()) && !(SqlciParseTree->isAllowedInCSMode()))
-      {
-	  delete SqlciParseTree;
-        SqlciParseTree = (SqlciNode *)new SqlciCSQueryCmd(SqlciParse_OriginalStr,
-                               (Lng32)strlen(SqlciParse_OriginalStr));
-	assert(SqlciParseTree->isSqlciNode());
-        return 1;
-
-      }
-      else
-	return 1;
-    }
-  else
-    return 1;
+  return 0;
 }
 
 Int32 sqlci_parser_handle_error(SqlciNode **node, Lng32 retval)
@@ -228,26 +187,7 @@ Int32 sqlci_parser_handle_error(SqlciNode **node, Lng32 retval)
   
   if (retval && syntaxError_)
     {	
-      if (SqlciEnvGlobal->isReportWriterMode())
-	{
-	  SqlciParseTree = (SqlciNode *)new SqlciRWQueryCmd(SqlciParse_OriginalStr,
-			(Lng32)strlen(SqlciParse_OriginalStr));
-	  assert(SqlciParseTree->isSqlciNode());
-	  *node = SqlciParseTree;	
-	  sqlci_DA.clear(); // clear the diagonistics
-	  return 0;
-	}
-      else if (SqlciEnvGlobal->isMXCSMode())
-      {
-        SqlciParseTree = (SqlciNode *)new SqlciCSQueryCmd(SqlciParse_OriginalStr,
-                               (Lng32)strlen(SqlciParse_OriginalStr));
-	  assert(SqlciParseTree->isSqlciNode());
-	  *node = SqlciParseTree;	
-	  sqlci_DA.clear(); // clear the diagonistics
-	  return 0;
-      }
-      else
-	return retval;
+      return retval;
     }
   else
     return retval;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/b952c0d5/core/sql/sqlci/SqlciRWCmd.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlci/SqlciRWCmd.cpp b/core/sql/sqlci/SqlciRWCmd.cpp
deleted file mode 100644
index 2df93b7..0000000
--- a/core/sql/sqlci/SqlciRWCmd.cpp
+++ /dev/null
@@ -1,1172 +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:         SqlciRWCmd.cpp
- * Description:  Methods to process commands that interact with SQL/CLI and RW.
- *               
- *               
- * Created:      6/6/2003
- * Language:     C++
- * Status:       
- *
- *
- *
- *
- *****************************************************************************
- */
-
-#include "Platform.h"
-#include "SQLTypeDefs.h"
-#include "SqlciRWCmd.h"
-#include "SqlciError.h"
-#include "sqlcmd.h"
-#include "SqlciEnv.h"
-#include "Formatter.h"
-#include "exp_clause_derived.h"
-#include "exp_datetime.h"
-#include "unicode_char_set.h"
-#include "RWInterface.h"
-
-extern SqlciEnv * global_sqlci_env; // global sqlci_env for break key handling purposes.
-void ReportWriterError ( ErrorValue *e )
-{
-#pragma nowarn(1506)  // warning elimination
-  //Note: when C++ compiler bug is fixed, use constructor/destructor to
-  //manage memory allocation/deallocation automatically
-
-  ErrorParam *ep1 = new ErrorParam (e->charparam1_);
-  ErrorParam *ep2 = new ErrorParam (e->charparam2_); 
-  ErrorParam *ep3 = new ErrorParam (e->charparam3_); 
-  ErrorParam *ep4 = new ErrorParam (e->intparam1_); 
-  ErrorParam *ep5 = new ErrorParam (e->intparam2_); 
-  ErrorParam *ep6 = new ErrorParam (e->intparam3_);
-
-  SqlciError2 (e->errorCode_,
-       ep1,
-       ep2,
-       ep3,
-       ep4,
-       ep5,
-       ep6,
-        (ErrorParam *) 0);
-
-  delete ep1;
-  delete ep2;
-  delete ep3;
-  delete ep4;
-  delete ep5;
-  delete ep6;
-#pragma warn(1506)  // warning elimination
-}
-
-void SetError ( ErrorValue *e, Lng32 errorCode)
-{
-    e->errorCode_ = errorCode;
-    e->charparam1_= NULL;
-    e->charparam2_= NULL;
-    e->charparam3_= NULL;
-    e->intparam1_= -1;
-    e->intparam2_= -1;
-    e->intparam3_= -1;
-}
-///////////////////////////////////////////////////////////////////////
-//
-// This is the base class for RW commands.
-// This class is not constructed by the parser.
-//
-///////////////////////////////////////////////////////////////////////
-
-SqlciRWCmd::SqlciRWCmd(const report_cmd_type cmd_type_)
-                  : SqlciNode(SqlciNode::REPORT_CMD_TYPE),
-                    cmd_type(cmd_type_)
-{
-};
-
-SqlciRWCmd::~SqlciRWCmd()
-{
-};
-
-///////////////////////////////////////////////////////////////////
-// this class is created by sqlci parser when a LIST command
-// ("LIST FIRST <N>", ...etc) is seen.
-//
-// The class is constructed with the list type and the number of
-// rows specified in it.
-//
-// ListType values:
-// List First:  FIRST_
-// List Next:   NEXT_
-// List All:    ALL_
-// Cancel:      END_
-//
-// numRows: number of rows specified in the List command.
-//          -1, if 'list all' is specified.
-//
-//////////////////////////////////////////////////////////////////
-SqlciRWListCmd::SqlciRWListCmd(ListType type, Lng32 listCount, NABoolean listCountSet)
-     : SqlciRWCmd(LIST_TYPE),
-       type_(type), listCount_(listCount),
-       listCountSet_(listCountSet)
-{
-}
-
-SqlciRWListCmd::~SqlciRWListCmd()
-{
-}
-
-short SqlciRWListCmd::process(SqlciEnv * sqlci_env)
-{
-  short rc = 0;
-
-  SqlciRWInterfaceExecutor::ExecutionState state = SqlciRWInterfaceExecutor::INITIAL_;
-  switch (type_)
-    {
-    case FIRST_:
-      state = SqlciRWInterfaceExecutor::LIST_FIRST_;
-      if (sqlci_env->getListCount() != SqlciEnv::MAX_LISTCOUNT
-          && !listCountSet_)
-#pragma nowarn(1506)   // warning elimination 
-        listCount_ = sqlci_env->getListCount();
-#pragma warn(1506)  // warning elimination 
-      else if (listCountSet_ == FALSE)
-        listCount_ = 0;
-      break;
-
-    case NEXT_:
-      state = SqlciRWInterfaceExecutor::LIST_NEXT_;
-      if (sqlci_env->getListCount() != SqlciEnv::MAX_LISTCOUNT
-        && !listCountSet_)
-#pragma nowarn(1506)   // warning elimination 
-        listCount_ = sqlci_env->getListCount();
-#pragma warn(1506)  // warning elimination 
-      else if (listCountSet_ == FALSE)
-        listCount_ = 0;
-
-      if (sqlci_env->sqlciRWEnv()->rwExe()->resetListFlag())
-	{
-	  // display warning indicating that reset was done.
-	  ErrorValue err;
-	  err.errorCode_ = SQLCI_RW_RESET_LIST;
-          err.charparam1_= NULL;
-          err.charparam2_= NULL;
-          err.charparam3_= NULL;
-          err.intparam1_= -1;
-          err.intparam2_= -1;
-          err.intparam3_= -1;
-	  ReportWriterError(&err);
-
-	  // and reset the list to start at the beginning.
-	  state = SqlciRWInterfaceExecutor::LIST_FIRST_;
-	}
-      break;
-
-    case ALL_:
-      state = SqlciRWInterfaceExecutor::LIST_ALL_;
-      sqlci_env->sqlciRWEnv()->setSelectInProgress(FALSE); 
-      break;
-
-    }
-
-  sqlci_env->sqlciRWEnv()->rwExe()->setResetListFlag(FALSE);
-
-  sqlci_env->sqlciRWEnv()->rwExe()->setState(state);
-  
-  sqlci_env->sqlciRWEnv()->rwExe()->setListCount(listCount_);
-
-  rc = sqlci_env->sqlciRWEnv()->rwExe()->process(sqlci_env);
-
-  return rc;
-}
-
-//////////////////////////////////////////////////////////////////////////////
-//
-// This class is constructed by the parser when a CANCEL is seen.
-// This cancels any select in progress command, then gets out of RW
-// prompt and into mxci prompt.
-//
-//////////////////////////////////////////////////////////////////////////////
-SqlciRWCancelCmd::SqlciRWCancelCmd()
-     : SqlciRWCmd(CANCEL_TYPE)
-{
-}
-
-SqlciRWCancelCmd::~SqlciRWCancelCmd()
-{
-}
-
-short SqlciRWCancelCmd::process(SqlciEnv * sqlci_env)
-{
-  short rc = 0;
-
-  sqlci_env->sqlciRWEnv()->rwExe()->setState(SqlciRWInterfaceExecutor::CANCEL_);
-  
-  rc = sqlci_env->sqlciRWEnv()->rwExe()->process(sqlci_env);
-  sqlci_env->sqlciRWEnv()->setSelectInProgress(FALSE); 
-  return rc;
-}
-
-
-//////////////////////////////////////////////////////////////////////////////
-//
-// This class is constructed by the parser when a report writer query is seen.
-// These are the queries which are to be passed to RW without any
-// interpretation by sqlci.
-//
-//////////////////////////////////////////////////////////////////////////////
-SqlciRWQueryCmd::SqlciRWQueryCmd(char * rwCmd, Lng32 rwCmdLen)
-     : SqlciRWCmd(RW_QUERY_TYPE)
-{
-  rwCmdLen_ = rwCmdLen;
-  if (rwCmd)
-    {
-      rwCmd_ = new char[strlen(rwCmd)+1];
-      strcpy(rwCmd_, rwCmd);
-    }
-  else
-    rwCmd_ = 0;
-}
-
-SqlciRWQueryCmd::~SqlciRWQueryCmd()
-{
-  if (rwCmd_)
-    delete rwCmd_;
-}
-
-short SqlciRWQueryCmd::process(SqlciEnv * sqlci_env)
-{
-  short rc = 0;
-
-  sqlci_env->sqlciRWEnv()->rwExe()->setRWCmd(rwCmd_, rwCmdLen_);
-
-  sqlci_env->sqlciRWEnv()->rwExe()->setState(SqlciRWInterfaceExecutor::SEND_QUERY_TO_RW_);
-
-  rc = sqlci_env->sqlciRWEnv()->rwExe()->process(sqlci_env);
-
-  return rc;
-}
-
-////////////////////////////////////////////////////////////////////
-//
-// This class is constructed by parser when a RW Select command is
-// seen. This is the select query that follows a 'set list_count'
-// command.
-//
-////////////////////////////////////////////////////////////////////
-SqlciRWSelectCmd::SqlciRWSelectCmd(char * selectCmd)
-     : SqlciRWCmd(SELECT_TYPE)
-{
-  if (selectCmd)
-    {
-      selectCmd_ = new char[strlen(selectCmd)+1];
-      strcpy(selectCmd_, selectCmd);
-    }
-  else
-    selectCmd_ = 0;
-}
-
-SqlciRWSelectCmd::~SqlciRWSelectCmd()
-{
-  if (selectCmd_)
-    delete selectCmd_;
-}
-
-short SqlciRWSelectCmd::process(SqlciEnv * sqlci_env)
-{
-  short rc = 0;
-
-  sqlci_env->sqlciRWEnv()->rwExe()->setSelectCmd(selectCmd_);
-
-  sqlci_env->sqlciRWEnv()->rwExe()->setState(SqlciRWInterfaceExecutor::PREPARE_);
-
-  sqlci_env->sqlciRWEnv()->rwExe()->setResetListFlag(FALSE);
-
-  rc = sqlci_env->sqlciRWEnv()->rwExe()->process(sqlci_env);
-  return rc;
-}
-
-////////////////////////////////////////////////////////////////////
-//
-// This class is constructed by parser when a RW execute command is
-// seen. This is the execute of a prepared select query that follows 
-// a 'set list_count' command.
-//
-////////////////////////////////////////////////////////////////////
-SqlciRWExecuteCmd::SqlciRWExecuteCmd(char * stmtName, char * usingParamStr)
-     : SqlciRWCmd(EXECUTE_TYPE)
-{
-  if (stmtName)
-    {
-      stmtName_ = new char[strlen(stmtName)+1];
-      strcpy(stmtName_, stmtName);
-    }
-  else
-    stmtName_ = 0;
-
-  if (usingParamStr)
-    {
-      usingParamStr_ = new char[strlen(usingParamStr) + 1];
-      strcpy(usingParamStr_, usingParamStr);
-    }
-  else
-    {
-      usingParamStr_ = NULL;
-    }
-}
-
-SqlciRWExecuteCmd::~SqlciRWExecuteCmd()
-{
-  if (stmtName_)
-    delete stmtName_;
-
-  if (usingParamStr_)
-    delete usingParamStr_;
-}
-
-short SqlciRWInterfaceExecutor::setUsingParamInfo(char * usingParamStr)
-{
-  short rc = 0;
-
-  numUsingParams_ = 0;
-  if (usingParamStr)
-    {
-      if (! usingParams_)
-	usingParams_ = new char * [MAX_NUM_UNNAMED_PARAMS];
-
-      for (Int32 i = numUsingParams_; i > 0; )
-	delete usingParams_[--i];
-
-      rc = (short)Execute::storeParams(usingParamStr, numUsingParams_,
-				       usingParams_);
-    }
-
-  return rc;
-}
-
-short SqlciRWExecuteCmd::process(SqlciEnv * sqlci_env)
-{
-  short rc = 0;
-
-  PrepStmt * prepStmt = sqlci_env->get_prep_stmts()->get(stmtName_);
-  if (! prepStmt)
-    {
-      sqlci_env->diagsArea() << DgSqlCode(-SQLCI_STMT_NOT_FOUND)
-			     << DgString0(stmtName_);
-
-      return 0;
-    }
-
-  sqlci_env->sqlciRWEnv()->rwExe()->setExecutePrepStmt(prepStmt);
-  sqlci_env->sqlciRWEnv()->rwExe()->setExecuteCmd(stmtName_);
-
-  if (usingParamStr_)
-    {
-      rc = 
-	sqlci_env->sqlciRWEnv()->rwExe()->setUsingParamInfo(usingParamStr_);
-      if (rc)
-	return 0;
-    }
-
-  sqlci_env->sqlciRWEnv()->rwExe()->setState(SqlciRWInterfaceExecutor::SELECT_STARTED_);
-
-  sqlci_env->sqlciRWEnv()->rwExe()->setResetListFlag(FALSE);
-
-  rc = sqlci_env->sqlciRWEnv()->rwExe()->process(sqlci_env);
-  sqlci_env->sqlciRWEnv()->setSelectInProgress(TRUE);
-
-  return rc;
-}
-
-////////////////////////////////////////////////////////////////////////
-//
-// This class is the execution engine to process the RW select command.
-// It contains all the methods and other information that is needed to
-// interact with RW (mxci calling RW) when a select command is processed.
-//
-// It is constructed during SqlciRWSelectCmd::process and is 'alive'
-// as long as that 'select is in progress'. The globals RWEnv points to this
-// class.
-//
-////////////////////////////////////////////////////////////////////////
-
-SqlciRWInterfaceExecutor::SqlciRWInterfaceExecutor()
-     : selectCmd_(NULL),
-       executeStmtName_(NULL),
-       usingParams_(NULL), numUsingParams_(0),
-       rwCmd_(NULL), rwCmdLen_(0),
-       inputRow_(NULL), inputRowLen_(0),
-       outputRow_(NULL), outputRowLen_(0),
-       listCount_(0), currCount_(0),
-       cursorOpened_(FALSE),
-       prepStmt_(NULL),
-       flags_(0),
-       state_(INITIAL_)
-{
-}
-
-void SqlciRWInterfaceExecutor::setSelectCmd(char * selectCmd)
-{
-  if (selectCmd_)
-    delete selectCmd_;
-  selectCmd_ = NULL;
-
-  if (executeStmtName_)
-    delete executeStmtName_;
-  executeStmtName_ = NULL;
-
-  if (selectCmd)
-    {
-      selectCmd_ = new char[strlen(selectCmd)+1];
-      strcpy(selectCmd_, selectCmd);
-    }
-  else
-    selectCmd_ = 0;
-  
-  state_ = INITIAL_;
-}
-
-void SqlciRWInterfaceExecutor::setExecuteCmd(char * executeStmtName)
-{
-  if (selectCmd_)
-    delete selectCmd_;
-  selectCmd_ = NULL;
-
-  if (executeStmtName_)
-    delete executeStmtName_;
-
-  if (executeStmtName)
-    {
-      executeStmtName_ = new char[strlen(executeStmtName)+1];
-      strcpy(executeStmtName_, executeStmtName);
-    }
-  else
-    executeStmtName_ = 0;
-  
-  state_ = INITIAL_;
-}
-
-void SqlciRWInterfaceExecutor::setRWCmd(char * rwCmd, Lng32 rwCmdLen)
-{
-  if (rwCmd_)
-    delete rwCmd_;
-
-  rwCmdLen_ = rwCmdLen;
-  
-  if (rwCmd)
-    {
-      rwCmd_ = new char[strlen(rwCmd)+1];
-      strcpy(rwCmd_, rwCmd);
-    }
-  else
-    rwCmd_ = 0;
-}
-
-SqlciRWInterfaceExecutor::~SqlciRWInterfaceExecutor()
-{
-  if (selectCmd_)
-    delete selectCmd_;
-
-  if (executeStmtName_)
-    delete executeStmtName_;
-}
-
-//////////////////////////////////////////////////////////////////////////
-// Returns the next state of the state machine based on the retcode
-// and the nextState.
-// 'retcode' is of type RetStatus in RWInterface.h.
-//
-// If retcode is ERROR, then next state of error is returned.
-// If the nextState sent in is different than the current state, state_,
-// then it overrides the retcode state and is returned.
-// Otherwise, the state based on retcode is returned.
-//
-//////////////////////////////////////////////////////////////////////////
-SqlciRWInterfaceExecutor::ExecutionState SqlciRWInterfaceExecutor::getNextState(
-     Lng32 retcode,
-     SqlciRWInterfaceExecutor::ExecutionState nextState)
-{
-  ExecutionState state;
-
-  if (retcode == ERR)
-    state = RW_ERROR_;
-  else if (state_ != nextState)
-    state = nextState;
-  else
-    {
-      switch (retcode)
-	{
-	case SEND_QUERY:
-	  state = GET_INPUT_FROM_SQLCI_;
-	  break;
-	  
-	case SEND_INPUT_ROW:
-	  state = FETCH_;
-	  break;
-	  
-	case GET_OUTPUT_ROW:
-	  state = GET_OUTPUT_ROW_FROM_RW_;
-	  break;
-	  
-	case DONE:
-	  state = CLOSE_;
-	  break;
-
-	case RESET_LIST:
-	  state = RESET_LIST_;
-	  break;
-
-	default:
-	  state = state_;
-	  break;
-	  
-	}
-    }
-
-  return state;
-}
-
-Lng32 SqlciRWInterfaceExecutor::printOutputRow(SqlciEnv * sqlci_env,
-					      char * outputBuf,
-					      Lng32 outputBufLen)
-{
-  Logfile *log = sqlci_env->get_logfile();
-
-  log->WriteAll(outputBuf, outputBufLen, 0);
-
-  return 0;
-}
-
-static NABoolean isSqlError(Lng32 sqlRetcode)
-{
-  if (sqlRetcode < 0)
-    return TRUE;
-  else
-    return FALSE;
-}
-
-short SqlciRWInterfaceExecutor::open(SqlciEnv * sqlci_env)
-{
-  short rc;
-
-#ifdef _DEBUG
-      if (getenv("SHOW_RW_STATE"))
-	{
-	  char buf[40];
-	  strcpy(buf, "OPEN_");
-	  cout << "State " << buf << endl;
-	}
-#endif
-
-  // close cursor. TBD: add SqlCmd::close() call to do this.
-  // Ignore error, stmt may already be closed.
-  SQL_EXEC_CloseStmt(prepStmt_->getStmt());
-  SQL_EXEC_ClearDiagnostics(prepStmt_->getStmt());
-  
-  // open the stmt
-  rc = SqlCmd::doExec(sqlci_env,
-		      prepStmt_->getStmt(),
-		      prepStmt_,
-		      numUsingParams_,
-		      usingParams_);
-
-  currCount_ = 0;
-
-  cursorOpened_ = TRUE;
-
-  return rc;
-}
-
-void SqlciRWInterfaceExecutor::Close(SqlciEnv *sqlci_env)
-{
-  if (prepStmt_)
-    SQL_EXEC_CloseStmt(prepStmt_->getStmt());
-
-  SQL_EXEC_ClearDiagnostics(NULL);
-	
-  // Deallocate, if selectCmd. This call also
-  // deallocates the passed prepStmt_.
-  if ((selectCmd_) &&(prepStmt_))
-  {
-    SqlCmd::deallocate(sqlci_env, prepStmt_);
-    prepStmt_ = NULL;
-    // make sure that this is reset so we dont deallocate
-    // it again in interrupt handler if the break key is hit.
-    global_sqlci_env->resetDeallocateStmt(); 
-  }
-
-  cursorOpened_ = FALSE;
-
-}
-
-short SqlciRWInterfaceExecutor::process(SqlciEnv * sqlci_env)
-{
-  short retcode = 0;
-  Lng32 sqlRetcode = 0;
-  Lng32 rwRetcode = 0;
-
-  NABoolean done = FALSE;
-
-// 64-bit: no more report writer
-  assert(0);
-
-  return retcode;
-}
-
-/////////////////////////////////////////////////////////////////////
-// These methods are called by RW to extract information about
-// an input row.
-/////////////////////////////////////////////////////////////////////
-Lng32 MXCI_RW_getMaxColumns (void *sqlciEnv, Lng32 &max, ErrorValue* &e)
-{
-  SqlciEnv * sqlci_env = (SqlciEnv *)sqlciEnv;
-  
-  PrepStmt * prepStmt = sqlci_env->sqlciRWEnv()->rwExe()->prepStmt();
-  if (! prepStmt)
-  {
-    // populate 'e', stmt doesn't exist. TBD.
-    if (e == NULL)
-    {
-      e = new ErrorValue;
-    }
-    SetError(e, -SQLCI_STMT_NOT_FOUND);
-    ReportWriterError(e);
-    return ERR;
-  }
-
-  max = prepStmt->numOutputEntries();
-
-  return SUCCESS;
-}
-
-//////////////////////////////////////////////////////////////////////
-Lng32 MXCI_RW_getColInfo (void *sqlciEnv, Lng32 column, 
-			 AttributeDetails* &entry, ErrorValue* &e)
-{
-  SqlciEnv * sqlci_env = (SqlciEnv *)sqlciEnv;
-
-  PrepStmt * prepStmt = sqlci_env->sqlciRWEnv()->rwExe()->prepStmt();
-
-  if (! prepStmt)
-  {
-    if (e == NULL)
-    {
-      e = new ErrorValue;
-    }
-    SetError(e, -SQLCI_STMT_NOT_FOUND);
-    ReportWriterError(e);
-    return ERR;
-  }
-   
-
-  if ((column <= 0) ||
-      (column > prepStmt->numOutputEntries()))
-  {
-    if (e == NULL)
-    {
-      e = new ErrorValue;
-    }
-    SetError(e, -SQLCI_WRONG_COLUMN_VALUE);
-    ReportWriterError(e);
-    return ERR;
-    
-  }
-
-  if (entry == NULL)
-  {
-      // allocate entry here. 
-      // How will this get deallocated? TBD.
-      entry = new AttributeDetails;
-  }
-
-  PrepEntry * outputEntry = prepStmt->outputEntries()[column-1];
-
-  entry->dataType_ = outputEntry->datatype();
-  entry->length_ = outputEntry->length();
-  entry->precision_ = outputEntry->precision();
-  entry->scale_ = outputEntry->scale();
-  entry->nullable_ = outputEntry->nullFlag();
-  entry->headingLen_ = outputEntry->headingLen();
-  entry->heading_ = outputEntry->heading();
-  entry->output_ = outputEntry->outputName();
-  entry->outputLen_ = outputEntry->outputNameLen();
-  entry->tableName_ = outputEntry->tableName();
-  entry->tableLen_ = outputEntry->tableLen();
-
-  
-  entry->displayLen_ = Formatter::display_length(entry->dataType_,
-						 entry->length_,
-						 entry->precision_,
-						 entry->scale_,
-                                                 outputEntry->charsetEnum(),
-                                                 0,
-                                                 (SqlciEnv *) sqlciEnv,
-                                                 NULL);
-
-  if (entry->dataType_ == REC_DATETIME)
-    {
-      entry->dateTimeCode_ = outputEntry->precision();
-      entry->precision_ = 0; // not used for datetime
-    }
-  else if (entry->dataType_ >= REC_MIN_INTERVAL && 
-	   entry->dataType_ <= REC_MAX_INTERVAL) 
-    {
-      entry->leadPrecision_ = outputEntry->precision();
-    }
-  else if (DFS2REC::isAnyCharacter(entry->dataType_))
-    {
-      entry->charSet_ = outputEntry->charset();
-	  
-      entry->collation_ = 0; //TBD
-    }
-
-  return SUCCESS;
-}
-
-//////////////////////////////////////////////////////////////////////////
-#pragma nowarn(770)  // warning elimination
-Lng32 MXCI_RW_getColAddr (void *sqlciEnv, Lng32 column, char *input_row, 
-                          Lng32 len, char* &ptr, ErrorValue* &e)
-{
-  Lng32 retcode = 0;
-
-  SqlciEnv * sqlci_env = (SqlciEnv *)sqlciEnv;
-
-  PrepStmt * prepStmt = sqlci_env->sqlciRWEnv()->rwExe()->prepStmt();
-  if (! prepStmt)
-    // populate 'e', stmt doesn't exist. TBD.
-  {
-    if (e == NULL)
-    {
-      e = new ErrorValue;
-    }
-    SetError(e, -SQLCI_STMT_NOT_FOUND);
-    ReportWriterError(e);
-    return ERR;
-    
-  }
-
-  if ((column <= 0) ||
-      (column > prepStmt->numOutputEntries()))
-    // populate 'e', incorrect column value. TBD.
-  {
-    if (e == NULL)
-    {
-      e = new ErrorValue;
-    }
-    SetError(e, -SQLCI_WRONG_COLUMN_VALUE);
-    ReportWriterError(e);
-    return ERR;
-  }
-
-  PrepEntry * outputEntry = prepStmt->outputEntries()[column-1];
-  SQLDESC_ID * output_desc = prepStmt->getOutputDesc();
-
-  // the address of the data row.
-  // Should be the same as the 'input_row' address passed in.
-  char * outputData = prepStmt->outputData();
-  if (outputData != input_row)
-    return ERR;
-
-  Long data_addr = 0;
-  Long ind_data_addr = 0;
-  
-  retcode = SQL_EXEC_GetDescItem(output_desc, column,
-				 SQLDESC_VAR_PTR,
-				 &data_addr, 0, 0, 0, 0);
- 
-  retcode = SQL_EXEC_GetDescItem(output_desc, column,
-				 SQLDESC_IND_PTR,
-				 &ind_data_addr, 0, 0, 0, 0);
-  if (outputEntry->nullFlag())
-    data_addr = ind_data_addr;
-
-  ptr = (char*)data_addr;
-
-  return SUCCESS;
-}
-#pragma warn(770)  // warning elimination
-
-//////////////////////////////////////////////////////////////////////////
-// This method formats the input datetime value to the specified datetime
-// format.
-// The input value is in external (string) format.
-//////////////////////////////////////////////////////////////////////////
-#pragma nowarn(770)  // warning elimination
-Lng32 MXCI_RW_convertToDateFormat(void * sqlciEnv, 
-				 char* srcPtr, AttributeDetails* srcEntry,
-				 char *tgtPtr, AttributeDetails* tgtEntry, 
-				 DateTimeFormat format, ErrorValue* &e)
-{
-  Lng32 rc;
-
-  Int32 dtFormat;
-  switch (format)
-    {
-    case DEFAULT:
-      dtFormat = ExpDatetime::DATETIME_FORMAT_DEFAULT; break;
-    case USA:
-      dtFormat = ExpDatetime::DATETIME_FORMAT_USA; break;
-    case EUROPEAN:
-      dtFormat = ExpDatetime::DATETIME_FORMAT_EUROPEAN; break;
-    default:
-      assert(0);
-      return ERR;
-    }
-
-  rc =  ExpDatetime::convAsciiDatetimeToASCII(srcPtr,
-					      srcEntry->dateTimeCode_,
-					      srcEntry->scale_,
-					      srcEntry->length_,
-					      tgtPtr,
-					      tgtEntry->length_,
-					      format,
-					      NULL,
-					      NULL);
-  if (rc)
-    {
-      if (e == NULL)
-	{
-	  e = new ErrorValue;
-	}
-      SetError(e, SQLCI_CONV_RESULT_FAILED);
-      ReportWriterError(e);
-      return ERR;
-    }
-  else
-    return SUCCESS;
-}
-#pragma warn(770)  // warning elimination
-
-/////////////////////////////////////////////////////////////////////////////////////
-Lng32 MXCI_RW_allocateHeap (void* sqlciEnv, Lng32 len, char* &ptr)
-{
-
-  SqlciEnv * sqlci_env = (SqlciEnv *)sqlciEnv;
-  
-  NAHeap *h = sqlci_env->sqlciRWEnv()->rwHeap();
-  void *p = NULL;
-
-  if (h)
-    p = h->allocateMemory(len, TRUE);
- 
-  if (p)
-  {
-    ptr = (char *)p;
-    return SUCCESS;
-  }
-  else
-    return ERR;
-}
-
-///////////////////////////////////////////////////////////////////////////////////////
-
-Lng32 MXCI_RW_deallocateHeap (void* sqlciEnv, Lng32 len, char* ptr)
-{
-
-  SqlciEnv * sqlci_env = (SqlciEnv *)sqlciEnv;
-  
-  if (len != 0)
-  {
-    sqlci_env->sqlciRWEnv()->rwHeap()->deallocateMemory((void*)ptr);
-    return SUCCESS;
-  }
-  else
-    return ERR;
-}
-
-
-////////////////////////////////////////////////////////////////////////////////////////
-
-Lng32 MXCI_RW_unicodeConvertToUpper (void *sqlciEnv, char *input_char, Lng32 num_of_input_bytes,
-     char *output_char, Lng32& num_of_output_bytes, ErrorValue* &e)
-{
-  //SqlciEnv * sqlci_env = (SqlciEnv *)sqlciEnv;
-  
-  Lng32 length_bytes = num_of_input_bytes;
-  
-  NAWchar* target = (NAWchar*)output_char;
-  NAWchar* source = (NAWchar*)input_char;
-  Int32 wc_len = length_bytes/2;
-  Int32 actual_len = 0;
-  NAWchar* tmpWCP = NULL;
-  Int32 maxWideChars = num_of_output_bytes / 2;
-
-  if ((((Long)input_char % 2) != 0) || (((Long)output_char % 2) != 0))
-  {
-    if (e == NULL)
-    {
-      e = new ErrorValue;
-    }
-    SetError(e, -SQLCI_RW_BUFFER_UNEVEN_BOUNDARY);
-    ReportWriterError(e);
-    return ERR;
-  }
-
-  // the logic in this code is from w:/exp/exp_function_upper_unicode.cpp 
-  // in the eval funciton.  Whenever that code changes this has to 
-  // change and vice versa.
-
-  for (Int32 i = 0; i < wc_len ; i++)
-  {
-    tmpWCP = unicode_char_set::to_upper_full(source[i]);
-    if (tmpWCP)
-    {
-      if (actual_len + ((tmpWCP[2] ==0) ? 2 : 3) > maxWideChars)
-      {
-        if (e == NULL)
-        {
-          e = new ErrorValue;
-        }
-        SetError(e, -SQLCI_RW_STRING_OVERFLOW);
-        ReportWriterError(e);
-        return ERR;
-      }// end of if
-
-      target[actual_len++] = tmpWCP[0];
-      target[actual_len++] = tmpWCP[1];
-
-      if (tmpWCP[2] != (NAWchar)0)
-        target[actual_len++] = tmpWCP[2];
-    }
-    else
-    {
-      if (actual_len >= maxWideChars)
-      {
-        if (e == NULL)
-        {
-          e = new ErrorValue;
-        }
-        SetError(e, -SQLCI_RW_STRING_OVERFLOW);
-        ReportWriterError(e);
-        return ERR;
-      }
-      target[actual_len++] = unicode_char_set::to_upper(source[i]);
-    }// end of else
-  } // end of for
-
-  num_of_output_bytes = (actual_len * 2);
-  return SUCCESS;
-}
-
-////////////////////////////////////////////////////////////////////////////////////
-
-Lng32 MXCI_RW_unicodeConvertToLower(void *sqlciEnv, char *input_char, Lng32 num_of_input_bytes,
-char *output_char, Lng32& num_of_output_bytes, ErrorValue* &e)
-{
- // SqlciEnv * sqlci_env = (SqlciEnv *)sqlciEnv;
-
-  Lng32 len1 = num_of_input_bytes;
-  Lng32 buffer_size = num_of_output_bytes/2 ;
-  num_of_output_bytes = len1;
-
-  NAWchar* target = (NAWchar*)output_char;
-  NAWchar* source = (NAWchar*)input_char;
-  Int32 wc_len = len1/2;
-
-  // the logic in this code is from w:/exp/exp_function_lower_unicode.cpp 
-  // in the eval funciton.  Whenever that code changes this has to 
-  // change and vice versa.
-
-  for (Int32 i = 0; i < wc_len; i++)
-  {
-    if (i >= buffer_size)
-    {
-      if (e == NULL)
-      {
-        e = new ErrorValue;
-      }
-      SetError(e,-SQLCI_RW_STRING_OVERFLOW);
-      ReportWriterError(e);
-      return ERR;
-    }
-    target[i] = unicode_char_set::to_lower(source[i]);
-  }
-  return SUCCESS;
-}
-
-/////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////
-Lng32 MXCI_RW_convDoIt (void *sqlciEnv, char* srcPtr, AttributeDetails* srcEntry,
-  char *tgtPtr, AttributeDetails* tgtEntry, short formatting, ErrorValue* &e)
-{
-  Lng32 retcode = 0;
-  ULng32 convFlags = 0;
-
-  if (formatting)
-    {
-      // if formatting, blankpad target before doing the conversion.
-      str_pad (tgtPtr,tgtEntry->displayLen_,' ');
-
-      // the formatted target will be left blank padded (blanks to the left).
-      convFlags |= CONV_LEFT_PAD;
-    }
-  else
-    convFlags = 0;
-
-
-  // SqlciEnv * sqlci_env = (SqlciEnv *)sqlciEnv;
-
-  // Check for nullability.  The logic for this code
-  // is in w:/exp/exp_conv.cpp::processNulls function
-
-  //  Source is nullable 
-  if (srcEntry->nullable_)  
-    {
-      //if data is null - if source data is acutally null
-      if ((srcPtr[0] != '\0') || (srcPtr[1] != '\0')) 
-        {
-          if (formatting)
-            {
-	      //if Target is not nullable
-	      if (!(tgtEntry->nullable_)  )
-		{
-		  tgtPtr[0] = '?';
-		  return SUCCESS;  // Conversion has taken place.
-		}
-	      else 
-		{
-		  if (e == NULL)
-		    {
-		      e = new ErrorValue;
-		    }
-		  SetError(e, -SQLCI_RW_INVALID_FORMATTING);
-		  ReportWriterError(e);
-		  return ERR;
-		}
-            } // end of formatting
-          else // if not formatting
-            {
-	      // source is nullable , source is null and target is nullable
-	      if (tgtEntry->nullable_)
-		{
-		  str_pad (tgtPtr,2,'\377');
-		  return SUCCESS;  // Conversion has taken place.
-		}
-	      else
-                {
-                  if (e == NULL)
-		    {
-		      e = new ErrorValue;
-		    }
-                  SetError(e, -SQLCI_CONV_NULL_TO_NOT_NULL);
-                  ReportWriterError(e);
-                  return ERR;
-                }
-            }// end of else of if not formatting
-          
-        }// end of source data is null
-      
-      // source is nullable but the source data is not null
-      else 
-        {
-          srcPtr = (char*)srcPtr + 2; // skip the null indicator bytes
-	  
-        } // end of else if source is nullable but source data is not null
-      
-      //if source is not null and target is nullable
-      // set null indicator in target if needed.
-      
-      if (tgtEntry->nullable_  )
-	{
-	  str_pad (tgtPtr,2,'\0');    // indicate that tgt is not null. Move the ptr by 2 bytes.
-	  tgtPtr = (char*)tgtPtr + 2;
-	}
-      
-    } // end of source is nullable
-
-  char * VCLen = NULL;
-  short VCLenSize = 0;
-  if (DFS2REC::isAnyVarChar(tgtEntry->dataType_))
-    {
-      VCLen = tgtPtr;
-      VCLenSize = 2;
-      tgtPtr = (char*)tgtPtr + VCLenSize;
-    }
-  
-  
-  // If the datatype is of time INTERVAL or of type DATETIME, then
-  // Set the datatype to _SQLDT_ASCII_F (char)
-  // Set the length to the display length.
-  // Set the precision to 0.
-  // Set the scale to 0.
-  
-  Lng32 length_;
-  Lng32 dataType_;
-  Lng32 precision_;
-  Lng32 scale_;
-  
-  if ( srcEntry->dataType_ == _SQLDT_DATETIME  || 
-       ( srcEntry->dataType_ >= _SQLDT_INT_Y_Y && srcEntry->dataType_ <= _SQLDT_INT_D_F)
-       )
-    {
-      length_ = srcEntry->displayLen_ ;
-      dataType_ = 0;
-      precision_ = 0;
-      scale_ = 0;
-    }
-  else
-    {
-      length_ = srcEntry->length_;
-      dataType_ = srcEntry->dataType_;
-      precision_ = srcEntry->precision_;
-      scale_ = srcEntry->scale_;
-    }
-  
-
-#pragma warning (disable : 4244)   //warning elimination
-#pragma nowarn(1506)   // warning elimination 
-  retcode = convDoIt(srcPtr,
-		     length_,
-		     dataType_,
-		     precision_,
-		     scale_,
-		     tgtPtr,
-		     tgtEntry->length_,
-		     tgtEntry->dataType_, 
-		     tgtEntry->precision_,
-		     tgtEntry->scale_,
-		     VCLen,			//varCharLen
-		     VCLenSize,		//varCharLenSize = 2
-		     0,			//heap
-		     0,		//diagsarea
-		     CONV_UNKNOWN,
-		     0,
-		     convFlags);
-#pragma warn(1506)  // warning elimination 
-#pragma warning (default : 4244)   //warning elimination
-  
-  
-  if (retcode)
-    {
-      return ERR;
-    }
-  else
-    return SUCCESS;
-  
-}
-
-
-
-

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/b952c0d5/core/sql/sqlci/SqlciRWCmd.h
----------------------------------------------------------------------
diff --git a/core/sql/sqlci/SqlciRWCmd.h b/core/sql/sqlci/SqlciRWCmd.h
deleted file mode 100644
index b719205..0000000
--- a/core/sql/sqlci/SqlciRWCmd.h
+++ /dev/null
@@ -1,299 +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 @@@
-//
-**********************************************************************/
-#ifndef SQLCI_RW_CMD_H
-#define SQLCI_RW_CMD_H
-
-/* -*-C++-*-
- *****************************************************************************
- *
- * File:         SqlciRWCmd.h
- * Description:  Methods to process commands that interact with SQL/CLI and RW.
- *               
- *               
- * Created:      6/6/2003
- * Language:     C++
- * Status:       
- *
- *
- *
- *
- *****************************************************************************
- */
-
-#include "SqlciNode.h"
-#include "RWInterface.h"
-#include "SqlciEnv.h"
-#include "SqlciError.h"
-
-// forward declarations to reduce header file recompilations.
-class PrepStmt;
-
-//////////////////////////////////////////
-// THis method handles error for report writer
-// interface related mehods.
-///////////////////////////////////////////
-void ReportWriterError ( ErrorValue *e); 
-void SetError ( ErrorValue *e, Lng32 errorCode);
-
-///////////////////////////////////////////////////////////////////////
-//
-// This is the base class for RW commands.
-// This class is not constructed by the parser.
-//
-///////////////////////////////////////////////////////////////////////
-
-class SqlciRWCmd : public SqlciNode {
-public:
-  enum report_cmd_type {
-        LIST_TYPE,CANCEL_TYPE, SELECT_TYPE, EXECUTE_TYPE, RW_QUERY_TYPE
-  };
-  SqlciRWCmd (report_cmd_type cmd_type_);
-  ~SqlciRWCmd();
-  NABoolean isAllowedInSIP() { return TRUE;};
-  NABoolean isAllowedInRWMode() { return FALSE; };
-  NABoolean isAllowedInCSMode() { return FALSE; };
-
-
-private:
-  report_cmd_type cmd_type;
-
-};
-
-///////////////////////////////////////////////////////////////////
-// this class is created by sqlci parser when a LIST command
-// ("LIST FIRST <N>", ...etc) is seen.
-//
-// The class is constructed with the list type and the number of
-// rows specified in it.
-//
-// ListType values:
-// List First:  FIRST_
-// List Next:   NEXT_
-// List All:    ALL_
-//
-// numRows: number of rows specified in the List command.
-//          -1, if 'list all' is specified.
-//
-//////////////////////////////////////////////////////////////////
-class SqlciRWListCmd : public SqlciRWCmd
-{
-public:
-  enum ListType
-  {
-    FIRST_, NEXT_, ALL_
-  };
-
-  SqlciRWListCmd(ListType type, Lng32 listCount, NABoolean listCountSet);
-  ~SqlciRWListCmd();
-  short process(SqlciEnv * sqlci_env);
-
-private:
-  ListType type_;
-  Lng32 listCount_;
-  NABoolean listCountSet_;
-};
-
-//////////////////////////////////////////////////////////////////////////////
-//
-// This class is constructed by the parser when a CANCEL is seen.
-// This cancels any select in progress command, then gets out of RW
-// prompt and into mxci prompt.
-//
-//////////////////////////////////////////////////////////////////////////////
-class SqlciRWCancelCmd : public SqlciRWCmd
-{
-public:
-  SqlciRWCancelCmd();
-  ~SqlciRWCancelCmd();
-  short process(SqlciEnv * sqlci_env);
-
-};
-
-
-//////////////////////////////////////////////////////////////////////////////
-//
-// This class is constructed by the parser when a report writer query is seen.
-// These are the queries which are to be passed to RW without any
-// interpretation by sqlci.
-//
-//////////////////////////////////////////////////////////////////////////////
-class SqlciRWQueryCmd : public SqlciRWCmd
-{
-public:
-  SqlciRWQueryCmd(char * rwCmd, Lng32 rwCmdLen_);
-  ~SqlciRWQueryCmd();
-  short process(SqlciEnv * sqlci_env);
-  NABoolean isAllowedInRWMode() { return TRUE; };
-
-private:
-  char * rwCmd_;
-  Lng32   rwCmdLen_;
-};
-
-////////////////////////////////////////////////////////////////////
-//
-// This class is constructed by parser when a RW Select command is
-// seen. This is the select query that follows a 'set list_count'
-// command.
-//
-////////////////////////////////////////////////////////////////////
-class SqlciRWSelectCmd : public SqlciRWCmd
-{
-public:
-  SqlciRWSelectCmd(char * selectCmd);
-  ~SqlciRWSelectCmd();
-  short process(SqlciEnv * sqlci_env);
-  NABoolean isAllowedInRWMode() { return TRUE; };
-
-private:
-  char * selectCmd_;
-};
-
-////////////////////////////////////////////////////////////////////
-//
-// This class is constructed by parser when a RW execute command is
-// seen. This is the execute of a prepared select query that follows 
-// a 'set list_count' command.
-//
-////////////////////////////////////////////////////////////////////
-class SqlciRWExecuteCmd : public SqlciRWCmd
-{
-public:
-  SqlciRWExecuteCmd(char * stmtName, char * usingParamStr);
-  ~SqlciRWExecuteCmd();
-  short process(SqlciEnv * sqlci_env);
-  NABoolean isAllowedInRWMode() { return TRUE; };
-
-private:
-  char * stmtName_;
-
-  char * usingParamStr_;
-  char ** usingParams_; // [MAX_NUM_UNNAMED_PARAMS];
-  short numUsingParams_;
-};
-
-////////////////////////////////////////////////////////////////////////
-//
-// This class is the execution engine to process the RW select command.
-// It contains all the methods and other information that is needed to
-// interact with RW (mxci calling RW) when a select command is processed.
-//
-// It is constructed during SqlciRWSelectCmd::process and is 'alive'
-// as long as that 'select is in progress'. The globals RWEnv points to this
-// class.
-//
-////////////////////////////////////////////////////////////////////////
-
-class SqlciRWInterfaceExecutor
-{
-public:
-  enum ExecutionState
-  {
-    INITIAL_,
-    PREPARE_, OPEN_AND_FETCH_, OPEN_AND_EXIT_, FETCH_, CLOSE_,
-    SELECT_STARTED_,
-    LIST_FIRST_, LIST_NEXT_, LIST_ALL_, RESET_LIST_,
-    GET_INPUT_FROM_SQLCI_, SEND_QUERY_TO_RW_,
-    SEND_FETCHED_ROW_TO_RW_, GET_OUTPUT_ROW_FROM_RW_,
-    PRINT_OUTPUT_,
-    CANCEL_,
-    LIST_ENDED_, SELECT_ENDED_,
-    SQL_ERROR_, RW_ERROR_, 
-    EXIT_
-  };
-
-  SqlciRWInterfaceExecutor();
-
-  ~SqlciRWInterfaceExecutor();
-
-  short process(SqlciEnv * sqlci_env);
-
-  void setState(ExecutionState state) { state_ = state; };
-
-  void setListCount(Lng32 listCount) 
-  { 
-    listCount_ = listCount; 
-    currCount_ = -1;
-  };
-
-  void setSelectCmd(char * selectCmd);
-  void setExecuteCmd(char * executeStmtName);
-  void setExecutePrepStmt(PrepStmt * prepStmt)
-  {
-    prepStmt_ = prepStmt;
-  }
-
-  short setUsingParamInfo(char * usingParamStr);
-  void setRWCmd(char * rwCmd, Lng32 rwCmdLen);
-
-  ExecutionState getNextState(Lng32 retcode, ExecutionState nextState);
-
-  Lng32 printOutputRow(SqlciEnv * sqlci_env, char * outputBuf, Lng32 outputBufLen);
-
-  PrepStmt * prepStmt() { return prepStmt_; };
-  void Close(SqlciEnv * sqlci_env); // Closes the prepStmt and deallocates/
-  
-  NABoolean resetListFlag() { return (flags_ & RESET_LIST_FLAG) != 0; }
-  void setResetListFlag(NABoolean v)
-  { (v ? flags_ |= RESET_LIST_FLAG : flags_ &= ~RESET_LIST_FLAG); }
-
-private:
-  enum {
-    RESET_LIST_FLAG = 0x0001
-  };
-
-  char * selectCmd_;
-
-  char * executeStmtName_;
-  char ** usingParams_;
-  short numUsingParams_;
-
-  char * rwCmd_;
-  Lng32   rwCmdLen_;
-
-  char * inputRow_;
-  Lng32   inputRowLen_;
-
-  char * outputRow_;
-  Lng32   outputRowLen_;
-
-  Lng32 listCount_;
-  Lng32 currCount_;
-
-  NABoolean cursorOpened_;
-
-  PrepStmt * prepStmt_;
-
-  ULng32 flags_;
-
-  ExecutionState state_;
-
-  // private methods
-  short open(SqlciEnv* sqlci_env);
-
-};
-
-
-#endif
-

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/b952c0d5/core/sql/sqlci/SqlciRWSimulator.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlci/SqlciRWSimulator.cpp b/core/sql/sqlci/SqlciRWSimulator.cpp
deleted file mode 100644
index 37b8498..0000000
--- a/core/sql/sqlci/SqlciRWSimulator.cpp
+++ /dev/null
@@ -1,375 +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:         SqlciRWSimulator.cpp
- * Description:  Methods to implement RW_MXCI commands until the real code
- *               from RW is available.
- *               
- *               
- * Created:      6/6/2003
- * Language:     C++
- * Status:       
- *
- *
- *
- *
- *****************************************************************************
- */
-
-#include <stdlib.h>
-#include <string.h>
-#include <wchar.h>
-
-#include "sqlcmd.h"
-#include "SqlciRWCmd.h"
-#include "RWInterface.h"
-#include "Formatter.h"
-
-
-
-class ReportWriterEnv
-{
-public:
-  ReportWriterEnv();
-  ~ReportWriterEnv();
-
-  char* &headingRow() { return headingRow_; };
-  char* &footingRow() { return footingRow_; };
-  char* &underline() { return underline_; };
-  char* &inputRow() { return inputRow_; };
-
-  Lng32 &headingRowNum() { return headingRowNum_; }
-  Lng32 &footingRowNum() { return footingRowNum_; }
-private:
-  char * headingRow_;
-  char * underline_;
-  char * inputRow_;
-
-  Lng32 headingRowNum_;
-
-  char * footingRow_;
-  Lng32 footingRowNum_;
-};
-
-ReportWriterEnv::ReportWriterEnv()
-     : headingRow_(NULL), underline_(NULL),
-       headingRowNum_(-1),
-       footingRow_(NULL), footingRowNum_(-1)
-{
-}
-
-ReportWriterEnv::~ReportWriterEnv()
-{
-  if (headingRow_)
-    delete headingRow_;
-
-  if (footingRow_)
-    delete footingRow_;
-
-  if (underline_)
-    delete underline_;
-}
-
-Lng32 RW_MXCI_Constructor (void* &RWEnv, void *SqlciEnv)
-{
-  ReportWriterEnv * rwEnv = new ReportWriterEnv();
-
-  RWEnv = rwEnv;
-
-  return 0;
-}
-
-Lng32 RW_MXCI_Destructor (void* &RWEnv, void *sqlciEnv)
-{
-  SqlciEnv * sqlci_env = (SqlciEnv *)sqlciEnv;
-  delete (ReportWriterEnv *)RWEnv;
-
-  return SUCCESS;
-}
-
-Lng32 RW_MXCI_sendQuery (void* &RWEnv, void *sqlciEnv, char *query, Lng32 len)
-{
-  ReportWriterEnv * rwEnv = (ReportWriterEnv *)RWEnv;
-  SqlciEnv * sqlci_env = (SqlciEnv *)sqlciEnv;
-
-  if (strncmp(query, "rw reset_list", 13) == 0)
-    return RESET_LIST;
-  else
-    return SEND_QUERY;
-}
-
-Lng32 RW_MXCI_sendInputRow (void* &RWEnv, void* sqlciEnv, char *input_row, Lng32 len)
-{
-  ReportWriterEnv * rwEnv = (ReportWriterEnv *)RWEnv;
-  SqlciEnv * sqlci_env = (SqlciEnv *)sqlciEnv;
-
-  rwEnv->inputRow() = input_row;
-
-  return GET_OUTPUT_ROW;
-}
-
-static Lng32 RWformatRow(void* &RWEnv,
-			void *sqlciEnv, char* &output_row, Lng32 &len)
-{
-  ReportWriterEnv * rwEnv = (ReportWriterEnv *)RWEnv;
-
-  Lng32 max;
-  ErrorValue *e = NULL;
-
-  char * buf;
-  char * tgt;
-  Lng32 error = MXCI_RW_allocateHeap (sqlciEnv, 200, buf);
-  Lng32 error1 = MXCI_RW_allocateHeap (sqlciEnv, 600, tgt);
-
-  if (error)
-    return ERR;
- 
-  MXCI_RW_getMaxColumns (sqlciEnv, max, e);
-
-  Lng32 curpos = 0;
-  AttributeDetails * entry = NULL; 
-
-  for (short column=1; column <= max; column++)
-  {
-      MXCI_RW_getColInfo(sqlciEnv, column, 
-			 entry, e);
-      
-      char * ptr = NULL;
-      MXCI_RW_getColAddr (sqlciEnv, column, rwEnv->inputRow(),
-                          len, ptr, e);
-
-      char dateFmtBuf[30];
-      if (getenv("RW_DATEFORMAT") &&
-	  entry->dataType_ == 192)
-	{
-	  char * d = getenv("RW_DATEFORMAT");
-	  DateTimeFormat dt = EUROPEAN;
-	  if (strcmp(d, "DEFAULT") == 0)
-	    dt = DEFAULT;
-	  else if (strcmp(d, "USA") == 0)
-	    dt = USA;
-	  else if (strcmp(d, "EUROPEAN") == 0)
-	    dt = EUROPEAN;
-	    
-	  error = MXCI_RW_convertToDateFormat(sqlciEnv, ptr, entry,
-					      dateFmtBuf, entry,
-					      dt,
-					      e);
-	  ptr = dateFmtBuf;
-	}
-
-      Formatter::buffer_it((SqlciEnv *)sqlciEnv, ptr,
-			   entry->dataType_,
-			   entry->length_,
-			   entry->precision_,
-			   entry->scale_,
-			   NULL,
-			   entry->displayLen_,
-			   entry->displayLen_,
-			   entry->nullable_,
-			   &buf[curpos], &curpos,
-			   column < max,	//separatorNeeded
-			   TRUE);               //checkShowNonPrinting
-
-
-    }
-   
-  /*//Unicode test case # 1
-  NAWchar Buf1[50];
-  Buf1[0]=0x00F8; // from 11_lt2u.h
-  Buf1[1]=0x0042; // regular ascii character
-  long input_len1 = 4 ; // 2 * 2 = 4 ; 2 bytes per wide char
-  NAWchar out_buf1[6];
-  long out_len1 = 6;
-  long retcode = MXCI_RW_unicodeConvertToUpper(sqlciEnv,(char*)Buf1,input_len1, (char*)out_buf1, out_len1, e);
-
-  // Unicode test case # 2
-  NAWchar *Buf2 = L"ABCD EFG";
-  long input_len2 = wcslen(Buf2);
-  NAWchar out_buf2[100];
-  long out_len2 = 100;
-  long retcode2 = MXCI_RW_unicodeConvertToUpper(sqlciEnv,(char*)Buf2,input_len2, (char*)out_buf2, out_len2, e);
-
-  // Unicode test case # 3
-  NAWchar Buf3[50];
-  Buf3[0]=0x00D8; // from 11_ut2l.h
-  Buf3[1]=0x0042; // regular ascii character
-  long input_len3 = 4 ; // 2 * 2 = 4 ; 2 bytes per wide char
-  NAWchar out_buf3[6];
-  long out_len3 = 6;
-  long retcode3 = MXCI_RW_unicodeConvertToLower(sqlciEnv,(char*)Buf3,input_len3, (char*)out_buf3, out_len3, e);
-
-  // Unicode test case # 4
-  NAWchar *Buf4 = L"ABCD EFG";
-  long input_len4 = wcslen(Buf2);
-  NAWchar out_buf4[100];
-  long out_len4 = 100;
-  long retcode4 = MXCI_RW_unicodeConvertToLower(sqlciEnv,(char*)Buf4,input_len4, (char*)out_buf4, out_len4, e);
-  */
-
-  /* // ConvDoIt test case
-  AttributeDetails *srcEntry = new AttributeDetails;
-  AttributeDetails *tgtEntry = new AttributeDetails;
-  char srcPtr[20] = "FAN";
-  char tgtPtr[20] ;
-  ErrorValue *err = NULL;
-
-  srcEntry->nullable_= 1;
-  srcEntry->dataType_= 0;
-  srcEntry->precision_=0;
-  srcEntry->scale_=0;
-  tgtEntry->nullable_=1;
-  tgtEntry->dataType_=0;
-  tgtEntry->precision_=0;
-  tgtEntry->scale_=0;
-  short formatting = 0;
-
-  long retcode = MXCI_RW_convDoIt(sqlciEnv, srcPtr, srcEntry, tgtPtr, tgtEntry, formatting, err);
-
-  */
-
-
-
-  buf[curpos] = 0;
-
-  output_row = buf; // memory leak here but who cares, this is a simulator.
-  len = curpos;
-  if (e)
-    { 
-      delete e;
-      e = NULL;
-    }
-
-  return 0;
-}
-
-Lng32 RW_MXCI_getOutputRow (void* &RWEnv, void *sqlciEnv, char* &output_row, Lng32 &len)
-{
-  SqlciEnv * sqlci_env = (SqlciEnv *)sqlciEnv;
-  ReportWriterEnv * rwEnv = (ReportWriterEnv *)RWEnv;
-
-  if (rwEnv->headingRowNum() == 0)
-    {
-      output_row = rwEnv->headingRow();
-      len = strlen(rwEnv->headingRow());
-      rwEnv->headingRowNum()++;
-
-      return GET_OUTPUT_ROW;
-    }
-  else if (rwEnv->headingRowNum() == 1)
-    {
-      output_row = rwEnv->underline();
-      len = strlen(rwEnv->underline());
-		
-      rwEnv->headingRowNum() = -1;
-
-      return SEND_INPUT_ROW;
-    }
-  else if (rwEnv->footingRowNum() == 0)
-    {
-      output_row = rwEnv->footingRow();
-      len = strlen(rwEnv->footingRow());
-		
-      rwEnv->footingRowNum() = -1;
-
-      return DONE;
-    }
-
-  /*
-  PrepStmt * prepStmt = sqlci_env->sqlciRWEnv()->rwExe()->prepStmt();
-  SqlCmd::displayRow(sqlci_env, prepStmt);
-  output_row = prepStmt->outputBuf();
-  len = prepStmt->outputBuflen();
-  */
-  RWformatRow(RWEnv, sqlciEnv, output_row, len);
-  
-
-  return SEND_INPUT_ROW;
-}
-
-Lng32 RW_MXCI_sendSelectStatus (void* &RWEnv, void *sqlciEnv, Lng32 num_rows, SelectStatus status)
-{
-  Lng32 retcode = 0;
-
-  ReportWriterEnv * rwEnv = (ReportWriterEnv *)RWEnv;
-  SqlciEnv * sqlci_env = (SqlciEnv *)sqlciEnv;
-  ErrorValue * e = NULL;
-
-  if (getenv("RW_SEND_SELECT_STATUS_ERR"))
-    {
-      return ERR;
-    }
-
-  if ((status == LIST_FIRST_STARTED) ||
-      (status == LIST_ALL_STARTED))
-    {
-      // compute heading
-      PrepStmt * prepStmt = sqlci_env->sqlciRWEnv()->rwExe()->prepStmt();
-
-      Lng32 output_buflen = prepStmt->outputBuflen();
-      rwEnv->headingRow() = new char[output_buflen + 1];
-      rwEnv->underline() = new char[output_buflen + 1];
-      
-      retcode = 
-	SqlCmd::getHeadingInfo(sqlci_env, prepStmt, 
-			       rwEnv->headingRow(), rwEnv->underline()); 
-
-      rwEnv->headingRowNum() = 0;
-
-      return GET_OUTPUT_ROW;
-    }
-
-
-  if (status == LIST_ENDED)
-    return SEND_QUERY;
-  else if (status == SELECT_ENDED)
-    return DONE;
-  else if (status == SELECT_CANCELLED)
-    {
-      rwEnv->footingRow() = new char[78];
-      strcpy(rwEnv->footingRow(), "Report Cancelled!");
-      rwEnv->footingRowNum() = 0;
-      return GET_OUTPUT_ROW;
-    }
-  else
-    return SEND_INPUT_ROW;
-}
-
-Lng32 RW_MXCI_getErrorInfo (void* &RWEnv, void *sqlciEnv, ErrorValue *e)
-{
-  e->errorCode_ = 666;
-
-  return SUCCESS;
-}
-
-Lng32 RW_MXCI_sendOutputDevice (void* &RWEnv, void *sqlciEnv, OutputDevice device)
-{
-  if (device == LOG_FILE || device == SCREEN)
-    return SUCCESS;
-  else 
-    return ERR;
-}
-

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/b952c0d5/core/sql/sqlci/SqlciReset.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlci/SqlciReset.cpp b/core/sql/sqlci/SqlciReset.cpp
index c12858b..e7e127e 100644
--- a/core/sql/sqlci/SqlciReset.cpp
+++ b/core/sql/sqlci/SqlciReset.cpp
@@ -93,47 +93,6 @@ short Reset::reset_control(SqlciEnv * sqlci_env)
   return 0;
 }
 
-short Reset::reset_define(SqlciEnv * sqlci_env)
-{
-  if (!get_argument())
-    {
-      /* RESET all defines */
-      Define * define = sqlci_env->get_definelist()->getFirst();
-      while (define)
-	{
-	  define->reset(sqlci_env);
-	  sqlci_env->get_definelist()->remove(define->getName());
-	  define = sqlci_env->get_definelist()->getNext();
-	}
-    }
-  else
-    {
-      // DEFINEs are case insensitive (currently).
-      // Upcase the argument.
-      char * define_name = new char[strlen(get_argument())+1];
-      
-      // NT_PORT 7/10/96 (LS) changed k definition from int to size_t
-      //
-      for (size_t k=0; k < strlen(get_argument()); k++)
-	{
-#pragma nowarn(1506)   // warning elimination 
-	  define_name[k] = toupper((get_argument())[k]);
-#pragma warn(1506)  // warning elimination 
-	}
-      define_name[strlen(get_argument())] = 0;
- 
-      Define * define = sqlci_env->get_definelist()->get(define_name);
-      if (define)
-	{
-	  define->reset(sqlci_env);
-	  sqlci_env->get_definelist()->remove(define_name);
-	}
-      delete define_name;
-    }
-  
-  return 0;
-}
-
 short Reset::reset_param(SqlciEnv * sqlci_env)
 {
   if (!get_argument())
@@ -197,10 +156,6 @@ short Reset::process(SqlciEnv * sqlci_env)
       retcode = reset_control(sqlci_env);
       break;
 
-    case DEFINE_:
-      retcode = reset_define(sqlci_env);
-      break;
-
     case PARAM_:
       retcode = reset_param(sqlci_env);
       break;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/b952c0d5/core/sql/sqlci/SqlciShow.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlci/SqlciShow.cpp b/core/sql/sqlci/SqlciShow.cpp
index 6833b18..bbb7703 100644
--- a/core/sql/sqlci/SqlciShow.cpp
+++ b/core/sql/sqlci/SqlciShow.cpp
@@ -83,23 +83,6 @@ short Show::show_cursor(SqlciEnv * sqlci_env)
   return 0;
 }
 
-short Show::show_define(SqlciEnv * sqlci_env)
-{
-  char buff[4000];
-
-
-  Define * define = sqlci_env->get_definelist()->getFirst();
-  
-  while (define)
-    {
-      sprintf(buff, "%s\t%s", define->getName(), define->getValue());
-      sqlci_env->get_logfile()->WriteAll(buff);
-      define = sqlci_env->get_definelist()->getNext(); 
-    }
-
-  return 0;
-}
-
 short Show::show_param(SqlciEnv * sqlci_env)
 {
   char buff[250];
@@ -189,10 +172,6 @@ short Show::process(SqlciEnv * sqlci_env)
       retcode = show_cursor(sqlci_env);
       break;
 
-    case DEFINE_:
-      retcode = show_define(sqlci_env);
-      break;
-
     case PARAM_:
       retcode = show_param(sqlci_env);
       break;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/b952c0d5/core/sql/sqlci/SqlciStmts.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlci/SqlciStmts.cpp b/core/sql/sqlci/SqlciStmts.cpp
index bf314f8..67eaddf 100644
--- a/core/sql/sqlci/SqlciStmts.cpp
+++ b/core/sql/sqlci/SqlciStmts.cpp
@@ -325,9 +325,7 @@ short FCRepeat::process(SqlciEnv * sqlci_env)
   // ignore if "!" is in an obey file, or stdin redirected from a file
   // (should we display an informative error message?)
   if (!sqlci_env->isInteractiveNow())
-#pragma nowarn(1506)   // warning elimination 
     return retval;
-#pragma warn(1506)  // warning elimination 
 
   InputStmt * input_stmt = 0;
 
@@ -385,9 +383,7 @@ short FCRepeat::process(SqlciEnv * sqlci_env)
       SqlciError(SQLCI_NO_STMT_MATCH, (ErrorParam *) 0);
     }
   
-#pragma nowarn(1506)   // warning elimination 
   return retval;
-#pragma warn(1506)  // warning elimination 
 }
 
 
@@ -405,9 +401,7 @@ short FixCommand::process(SqlciEnv * sqlci_env)
   // ignore if FC is in an obey file, or stdin redirected from a file
   // (should we display an informative error message?)
   if (!sqlci_env->isInteractiveNow())
-#pragma nowarn(1506)   // warning elimination 
     return retval;
-#pragma warn(1506)  // warning elimination 
 
   InputStmt *input_stmt = 0, *stmt = 0;
 
@@ -556,8 +550,6 @@ short FixCommand::process(SqlciEnv * sqlci_env)
       SqlciError(SQLCI_NO_STMT_MATCH, (ErrorParam *) 0);
     }
 
-#pragma nowarn(1506)   // warning elimination 
   return retval;
-#pragma warn(1506)  // warning elimination 
 } // end FixCommand::process