You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafodion.apache.org by su...@apache.org on 2016/08/30 18:25:43 UTC

[1/6] incubator-trafodion git commit: JIRA TRAFODION-2180 enable/externalize non-ansi sql syntax/functionality

Repository: incubator-trafodion
Updated Branches:
  refs/heads/master 3baabb366 -> eb98b6d55


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/sqlcomp/nadefaults.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/nadefaults.cpp b/core/sql/sqlcomp/nadefaults.cpp
index 7cfaecf..77ca3c9 100644
--- a/core/sql/sqlcomp/nadefaults.cpp
+++ b/core/sql/sqlcomp/nadefaults.cpp
@@ -376,6 +376,12 @@ SDDkwd__(ALLOW_DP2_ROW_SAMPLING,               "SYSTEM"),
  // the two is supported. See binder for details.
   DDkwd__(ALLOW_INCOMPATIBLE_COMPARISON,	"OFF"),
 
+ // this default, if set to ON, will allow certain incompatible
+ // comparisons. This includes incompatible comparisons, assignments,
+ // conversions, UNION, arith, string and case stmts.
+ // See binder(BindItemExpr.cpp, SynthType.cpp) for details.
+  DDkwd__(ALLOW_INCOMPATIBLE_OPERATIONS,	"OFF"),
+
   // if set to 2, the replicateNonKeyVEGPred() mdamkey method
   // will try to use inputs to filter out VEG elements that are not
   // local  to the associated table to minimize predicate replication.
@@ -402,8 +408,10 @@ SDDkwd__(ALLOW_DP2_ROW_SAMPLING,               "SYSTEM"),
   // specified in a regular CREATE VIEW (not a create MV) statement.
   DDkwd__(ALLOW_ORDER_BY_IN_CREATE_VIEW,	"ON"),
 
+  DDkwd__(ALLOW_ORDER_BY_IN_SUBQUERIES,	        "OFF"),
+
   // rand() function in sql is disabled unless this CQD is turned on
-  DDkwd__(ALLOW_RAND_FUNCTION,			"OFF"),
+  DDkwd__(ALLOW_RAND_FUNCTION,			"ON"),
 
   DDkwd__(ALLOW_RANGE_PARTITIONING,	        "TRUE"),
 
@@ -1691,13 +1699,14 @@ SDDkwd__(EXE_DIAGNOSTIC_EVENTS,		"OFF"),
   DDui1__(GEN_XPLN_SIZE_DOWN,			"8"),
   DDui1__(GEN_XPLN_SIZE_UP,			"16"),
 
-
   // When less or equal to this CQD (5000 rows by default), a partial root 
   // will be running in the Master. Set to 0 to disable the feature.
   DDint__(GROUP_BY_PARTIAL_ROOT_THRESHOLD,	"5000"),
 
   DDkwd__(GROUP_BY_USING_ORDINAL,		"MINIMUM"),
 
+  DDkwd__(GROUP_OR_ORDER_BY_EXPR,		"OFF"),
+
   // HASH_JOINS ON means do HASH_JOINS
  XDDkwd__(HASH_JOINS,				"ON"),
   DDkwd__(HASH_JOINS_TYPE1_PLAN1,		"ON"),
@@ -2274,12 +2283,8 @@ SDDkwd__(ISO_MAPPING,           (char *)SQLCHARSETSTRING_ISO88591),
 
  SDDkwd__(MODE_SPECIAL_1,                       "OFF"),
 
- SDDkwd__(MODE_SPECIAL_2,                       "OFF"),
-
-  // enable special  features in R2.93
-  DDkwd__(MODE_SPECIAL_3,                       "OFF"),
   DDkwd__(MODE_SPECIAL_4,                       "OFF"),
-  DDkwd__(MODE_SPECIAL_5,                       "OFF"),
+
   DDflt0_(MSCF_CONCURRENCY_IO,			"0.10"),
   DDflt0_(MSCF_CONCURRENCY_MSG,			"0.10"),
 
@@ -5162,8 +5167,6 @@ NABoolean NADefaults::isReadonlyAttribute(const char* attrName) const
      return FALSE; // for internal development and testing purposes
 
    if (( stricmp(attrName, "ISO_MAPPING") == 0 )||
-       ( stricmp(attrName, "MODE_SPECIAL_1") == 0 ) ||
-       ( stricmp(attrName, "MODE_SPECIAL_2") == 0 ) ||
        ( stricmp(attrName, "NATIONAL_CHARSET") == 0 ) ||
        ( stricmp(attrName, "VALIDATE_VIEWS_AT_OPEN_TIME") == 0 ) ||
        ( stricmp(attrName, "USER_EXPERIENCE_LEVEL") == 0 ) ||
@@ -5176,7 +5179,7 @@ NABoolean NADefaults::isReadonlyAttribute(const char* attrName) const
        ( stricmp(attrName, "EXE_MEMORY_LIMIT_LOWER_BOUND_PA") == 0 ) ||
        ( stricmp(attrName, "EXE_MEMORY_LIMIT_LOWER_BOUND_SEQUENCE") == 0 ) ||
        ( stricmp(attrName, "EXE_MEMORY_LIMIT_LOWER_BOUND_EXCHANGE") == 0 ) ||
-	   ( stricmp(attrName, "SORT_ALGO") == 0 ) ||
+       ( stricmp(attrName, "SORT_ALGO") == 0 ) ||
        ( stricmp(attrName, "OVERFLOW_MODE") == 0 )
      )
      return TRUE;
@@ -5571,15 +5574,30 @@ enum DefaultConstants NADefaults::validateAndInsert(const char *attrName,
       //}
       //break;
 
+      case ALLOW_INCOMPATIBLE_ASSIGNMENT:
+      case ALLOW_INCOMPATIBLE_COMPARISON:
+	{
+	  NAString val;
+          
+          if (value == "ON")
+            val = "ON";
+          else
+            val = "OFF";
+                    
+          insert(ALLOW_INCOMPATIBLE_OPERATIONS, val, errOrWarn);
+        }
+        break;
+
       case MODE_SPECIAL_1:
 	{
-	  if (getToken(MODE_SPECIAL_2) == DF_ON)
-	    {
-	      // MS1 was already set by now. Reset it and return an error.
-	      insert(MODE_SPECIAL_1, "OFF", errOrWarn);
+	  NAString val;
+          
+          if (value == "ON")
+            val = "ON";
+          else
+            val = "OFF";
 
-	      attrEnum = __INVALID_DEFAULT_ATTRIBUTE;
-	    }
+          insert(ALLOW_INCOMPATIBLE_OPERATIONS, val, errOrWarn);
 
 	  // find_suitable_key to be turned off in this mode, unless
 	  // it has been explicitely set.
@@ -5590,36 +5608,6 @@ enum DefaultConstants NADefaults::validateAndInsert(const char *attrName,
 	}
       break;
 
-      case MODE_SPECIAL_2:
-	{
-	  NAString val;
-	  if (getToken(MODE_SPECIAL_1) == DF_ON)
-	    {
-	      // MS2 was already set by now. Reset it and return an error.
-	      insert(MODE_SPECIAL_2, "OFF", errOrWarn);
-
-	      attrEnum = __INVALID_DEFAULT_ATTRIBUTE;
-	      break;
-	    }
-
-	  if (value == "ON")
-	    val = "ON";
-	  else
-	    val = resetToDefaults_[LIMIT_MAX_NUMERIC_PRECISION];
-
-	  if (getToken(LIMIT_MAX_NUMERIC_PRECISION) == DF_SYSTEM)
-	    {
-	      insert(LIMIT_MAX_NUMERIC_PRECISION, val, errOrWarn);
-	    }
-
-	  if (value == "ON")
-	    val = "2";
-	  else
-	    val = resetToDefaults_[ROUNDING_MODE];
-	  insert(ROUNDING_MODE, val, errOrWarn);
-	}
-      break;
-
       case MODE_SPECIAL_4:
 	{
 	  NAString val;
@@ -5628,15 +5616,10 @@ enum DefaultConstants NADefaults::validateAndInsert(const char *attrName,
             val = "ON";
           else
             val = "OFF";
-          
-          insert(ALLOW_INCOMPATIBLE_COMPARISON, val, errOrWarn);
-          
-          insert(ALLOW_INCOMPATIBLE_ASSIGNMENT, val, errOrWarn);
-          
+                    
+          insert(ALLOW_INCOMPATIBLE_OPERATIONS, val, errOrWarn);
           insert(ALLOW_NULLABLE_UNIQUE_KEY_CONSTRAINT, val, errOrWarn);
-          
-          insert(MODE_SPECIAL_3, val, errOrWarn);
-          
+                    
           NAString csVal;
           if (value == "ON")
             csVal = SQLCHARSETSTRING_UTF8;
@@ -5674,25 +5657,6 @@ enum DefaultConstants NADefaults::validateAndInsert(const char *attrName,
 	}
       break;
 
-      case MODE_SPECIAL_5:
-	{
-	  NAString val;
-          
-          if (value == "ON")
-            val = "ON";
-          else
-            val = "OFF";
-          
-          insert(ALLOW_INCOMPATIBLE_COMPARISON, val, errOrWarn);
-          
-          insert(ALLOW_INCOMPATIBLE_ASSIGNMENT, val, errOrWarn);
-          
-          insert(ALLOW_NULLABLE_UNIQUE_KEY_CONSTRAINT, val, errOrWarn);
-
-          insert(TRAF_ALLOW_SELF_REF_CONSTR, val, errOrWarn);
-	}
-      break;
-
       case MODE_SEABASE:
 	{
 	  if (value == "ON")

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/sqlcomp/parser.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/parser.cpp b/core/sql/sqlcomp/parser.cpp
index 58b44b2..96c283f 100644
--- a/core/sql/sqlcomp/parser.cpp
+++ b/core/sql/sqlcomp/parser.cpp
@@ -143,7 +143,6 @@ Parser::Parser(const CmpContext* cmpContext)
   internalExpr_ = NORMAL_TOKEN;
 
   modeSpecial1_ = (CmpCommon::getDefault(MODE_SPECIAL_1) == DF_ON);
-  modeSpecial2_ = (CmpCommon::getDefault(MODE_SPECIAL_2) == DF_ON);
   modeSpecial4_ = (CmpCommon::getDefault(MODE_SPECIAL_4) == DF_ON);
 
   defaultColCharset_ = CharInfo::UnknownCharSet;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/sqlcomp/parser.h
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/parser.h b/core/sql/sqlcomp/parser.h
index cd57ed5..aa411b6 100644
--- a/core/sql/sqlcomp/parser.h
+++ b/core/sql/sqlcomp/parser.h
@@ -224,8 +224,6 @@ ItemExpr *get_w_ItemExprTree(const NAWchar * str,
 
   void setmodeSpecial1(NABoolean v) { modeSpecial1_ = v; }
   NABoolean modeSpecial1() { return modeSpecial1_; }
-  void setmodeSpecial2(NABoolean v) { modeSpecial2_ = v; }
-  NABoolean modeSpecial2() { return modeSpecial2_; }
   void setmodeSpecial4(NABoolean v) { modeSpecial4_ = v; }
   NABoolean modeSpecial4() { return modeSpecial4_; }
  
@@ -320,7 +318,6 @@ private:
   NAWcharBuf *wInputBuf_;
 
   NABoolean modeSpecial1_;
-  NABoolean modeSpecial2_;
   NABoolean modeSpecial4_;
 
   LIST(NABoolean )  hasOlapFunctions_;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/ustat/hs_globals.cpp
----------------------------------------------------------------------
diff --git a/core/sql/ustat/hs_globals.cpp b/core/sql/ustat/hs_globals.cpp
index 43f582e..3f48b42 100644
--- a/core/sql/ustat/hs_globals.cpp
+++ b/core/sql/ustat/hs_globals.cpp
@@ -243,7 +243,7 @@ Int32 ISFixedChar::compare(const ISFixedChar &rhs)
   if (CollationInfo::isSystemCollation(colCollation))
       return Collated_cmp(content, rhs.content, length, colCollation,
                           sortBuffer1, sortBuffer2);
-  // UCS2 cols not supported in MODE_SPECIAL_1 or 2 and do not support case insensitivity.
+  // UCS2 cols not supported in MODE_SPECIAL_1 and do not support case insensitivity.
   if (!caseInsensitive)
     {
       if (charset != CharInfo::UNICODE)
@@ -1297,7 +1297,7 @@ Int32 ISVarChar::compare(const ISVarChar &rhs)
                           MAXOF(*((short*)content), *((short*)rhs.content)),
                           colCollation, sortBuffer1, sortBuffer2);
 
-  // UCS2 cols not supported in MODE_SPECIAL_1 or 2 and do not support case insensitivity.
+  // UCS2 cols not supported in MODE_SPECIAL_1 and do not support case insensitivity.
   if (!caseInsensitive) {
     if (charset != CharInfo::UNICODE)
       return memcmp(content+VARCHAR_LEN_FIELD_IN_BYTES,
@@ -1324,7 +1324,7 @@ Int32 ISVarChar::operator==(const ISVarChar &rhs)
                         MAXOF(*((short*)content), *((short*)rhs.content)),
                         colCollation, sortBuffer1, sortBuffer2 ) == 0);
 
-  // UCS2 cols not supported in MODE_SPECIAL_1 or 2 and do not support case insensitivity.
+  // UCS2 cols not supported in MODE_SPECIAL_1 and do not support case insensitivity.
   if (!caseInsensitive)
     return !memcmp(content+VARCHAR_LEN_FIELD_IN_BYTES,
                   rhs.content+VARCHAR_LEN_FIELD_IN_BYTES,
@@ -10585,8 +10585,7 @@ bool isInternalSortType(HSColumnStruct &col)
         if (col.charset == CharInfo::UNICODE)
           {
             NAString MS1v = ActiveSchemaDB()->getDefaults().getValue(MODE_SPECIAL_1);
-            NAString MS2v = ActiveSchemaDB()->getDefaults().getValue(MODE_SPECIAL_2);
-            if ( MS1v == "ON"  || MS2v == "ON" )
+            if ( MS1v == "ON" )
               {
                  return false; //In these modes, Internal Sort won't work on UCS2 columns.
               }


[4/6] incubator-trafodion git commit: JIRA TRAFODION-2180 enable/externalize non-ansi sql syntax/functionality

Posted by su...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/regress/charsets/cidefs
----------------------------------------------------------------------
diff --git a/core/sql/regress/charsets/cidefs b/core/sql/regress/charsets/cidefs
deleted file mode 100755
index 9f447dd..0000000
--- a/core/sql/regress/charsets/cidefs
+++ /dev/null
@@ -1,125 +0,0 @@
---	This is the sqlci analogue of the shell-script "setupenv".
---
--- @@@ 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 @@@
-
-set SCHEMA $$TEST_SCHEMA$$;
--- control query default HIST_USE_SAMPLE_FOR_CARDINALITY_ESTIMATION  'ON';
--- control query default HIST_ON_DEMAND_STATS_SIZE '10000';
-
--- Define a standard physical environment for the compiler:
-control query default TARGET_CODE 'DEBUG';
-control query default TARGET_CPU_FREQUENCY '199.';
-control query default TARGET_IO_SEEK_TIME '0.020147';
-control query default TARGET_IO_SEQ_READ_RATE '2.5';
-control query default TARGET_MSG_LOCAL_RATE '10.';
-control query default TARGET_MSG_LOCAL_TIME '0.000125';
-control query default TARGET_MSG_REMOTE_RATE '100.';
-control query default TARGET_MSG_REMOTE_TIME  '0.00125';
-
-control query default ARKCMP_FAKE_HW 'ON';
-control query default SKIP_METADATA_VIEWS 'ON';
-
-#ifMX
-control query default REF_CONSTRAINT_NO_ACTION_LIKE_RESTRICT 'ON';
-#ifMX
-
-control query default DEF_NUM_SMP_CPUS
-#ifMX
-'2'
-#ifMX
-#ifMP
-'1'
-#ifMP
-;
-
-control query default MAX_ESPS_PER_CPU_PER_OP '1';
-
-control query default DEF_NUM_NODES_IN_ACTIVE_CLUSTERS
-#ifMX
-'1'
-#ifMX
-#ifMP
-'2'
-#ifMP
-;
-
--- Suppress the Row Format information from the SHOWDDL output so
--- we don't have to update hundreds of existing Expected Results
--- files in our regression test suites.  'OFF' is the default.
-control query default SQLMX_SHOWDDL_SUPPRESS_ROW_FORMAT 'ON';
-
--- this is the datavol location of the second partition
--- for partitioned tables.
-#ifNSK
-set pattern $$partition$$  $DATA04;
-set pattern $$partition1$$ $DATA01;
-set pattern $$partition2$$ $DATA03;
-set pattern $$partition3$$ $DATA05;
-set pattern $$TrigTempTablePartition$$ '''$DATA03:$DATA04,$DATA05:$DATA01''';
-
-#ifNSK
-
-#ifNT
-set pattern $$partition$$ $DATA;
-set pattern $$partition1$$ $DATA1;
-set pattern $$partition2$$ $DATA2;
-set pattern $$partition3$$ $SYSTEM;
-set pattern $$TrigTempTablePartition$$ '''$system:$data1,$data2:$data''';
-
-#ifNT
-
--- This pattern is needed for both NSK and NT to handle the quote in Metadata
--- queries
-set pattern $$quote$$ '''';
--- This CQD is added for creating a table  with no
--- partition or primary key when the POS is enabled.
-control query default POS_ALLOW_NON_PK_TABLES 'ON';
---control query default detailed_statistics 'ALL';
-
-
--- Only on a Linux cluster
-#ifdef CLUSTERNAME
-set pattern $$partition$$  $DB0000;
-set pattern $$partition0$$ $DB0000;
-set pattern $$partition1$$ $DB0001;
-set pattern $$partition2$$ $DB0002;
-set pattern $$partition3$$ $DB0003;
-set pattern $$partition4$$ $DB0004;
-set pattern $$partition5$$ $DB0005;
-set pattern $$partition6$$ $DB0006;
-set pattern $$partition7$$ $DB0007;
-set pattern $$partition8$$ $DB0008;
-set pattern $$audit_vol$$  $AUD000;
-set pattern $$PosTablePartition$$ '''$DB0000''';
-set pattern $$PosTablePartitions2$$ '''$DB0001, $DB0002''';
-set pattern $$PosTablePartitions3$$ '''$DB0003, $DB0004, $DB0005''';
-set pattern $$PosTablePartitions4$$ '''$DB0006, $DB0007, $DB0008, $DB0009''';
-set pattern $$TrigTempTablePartition$$ '''$DB0003:$DB0004,$DB0005:$DB0001''';
-set pattern $$TrigTempTablePartition1$$ '''$DB0001: $DB0004''';
-set pattern $$TrigTempTablePartition2$$ '''$DB0001''';
-set pattern $$TrigTempTablePartition3$$ '''$DB0004''';
-set pattern $$TrigTempTablePartition4$$ '''$DB0001, $DB0004,$NINEX: $DB0005''';
-set pattern $$TrigTempTablePartition5$$ '''$DB0005, $DB0005, $DB0005: $DB0005, $DB0005''';
-set pattern $$TrigTempTablePartition6$$ '''$DB0001,XXXX64 $DB0005''';
-#endif
-
--- eof

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/regress/compGeneral/EXPECTED006.SB
----------------------------------------------------------------------
diff --git a/core/sql/regress/compGeneral/EXPECTED006.SB b/core/sql/regress/compGeneral/EXPECTED006.SB
index 72ad937..80ba802 100644
--- a/core/sql/regress/compGeneral/EXPECTED006.SB
+++ b/core/sql/regress/compGeneral/EXPECTED006.SB
@@ -109,40 +109,6 @@
 *** ERROR[8822] The statement was not prepared.
 
 >>
->>-- Error 4026
->>#ifdef SEABASE_REGRESS
->>control query default DISABLE_READ_ONLY 'ON';
-
---- SQL operation complete.
->>#else
->>control query default COMP_BOOL_58 'ON';
->>#endif
->>control query default MODE_SPECIAL_1 'ON';
-
---- SQL operation complete.
->>control query default R2_HALLOWEEN_SUPPORT 'ON';
-
---- SQL operation complete.
->>prepare s1 from insert into t006t3 select * from t006t3 where a in (select a from t006t3);
-
-*** ERROR[4026] Reading from and inserting into, or updating in, or deleting from the same table, TRAFODION.SCH.T006T3, is not currently supported.
-
-*** ERROR[8822] The statement was not prepared.
-
->>control query default R2_HALLOWEEN_SUPPORT reset;
-
---- SQL operation complete.
->>control query default MODE_SPECIAL_1 reset;
-
---- SQL operation complete.
->>#ifdef SEABASE_REGRESS
->>control query default DISABLE_READ_ONLY reset;
-
---- SQL operation complete.
->>#else
->>control query default COMP_BOOL_58 reset;
->>#endif
->>
 >>-- Error 4034
 >>prepare xx from select * from t006t1 where a = 1234 collate default;
 
@@ -166,24 +132,15 @@
 >>-- Error 4039
 >>prepare xx from insert into t006t3 values ('a');
 
-*** ERROR[4039] Column A is of type INTEGER, incompatible with the value's type, CHAR(1).
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Error 4043
->>control query default MODE_SPECIAL_3 'ON';
-
---- SQL operation complete.
 >>prepare xx from select * from t006t1 where to_number(1112) = A;
 
 *** ERROR[4043] The operand of function TO_NUMBER must be character.
 
 *** ERROR[8822] The statement was not prepared.
 
->>control query default MODE_SPECIAL_3 reset;
-
---- SQL operation complete.
 >>prepare xx from select tokenstr('a', a) from t006t2;
 
 *** ERROR[4043] The operand of function TOKENSTR must be character.
@@ -262,19 +219,6 @@
 *** ERROR[8822] The statement was not prepared.
 
 >>
->>control query default MODE_SPECIAL_4 'ON';
-
---- SQL operation complete.
->>prepare xx from select * from t006t1 where to_date(A, '99:99:99:99') = A;
-
-*** ERROR[4045] The operand of function TO_DATE must be numeric.
-
-*** ERROR[8822] The statement was not prepared.
-
->>control query default MODE_SPECIAL_4 reset;
-
---- SQL operation complete.
->>
 >>-- Error 4046
 >>prepare xx from select ~(a) from t006t7;
 
@@ -429,33 +373,6 @@
 *** ERROR[8822] The statement was not prepared.
 
 >>
->>#ifdef SEABASE_REGRESS
->>control query default DISABLE_READ_ONLY 'ON';
-
---- SQL operation complete.
->>#else
->>control query default COMP_BOOL_58 'ON';
->>#endif
->>control query default MODE_SPECIAL_1 'ON';
-
---- SQL operation complete.
->>prepare xx from select rows since(a = 11, a) from t006t1 sequence by a;
-
-*** ERROR[4052] The second operand of function ROWS SINCE must be numeric.
-
-*** ERROR[8822] The statement was not prepared.
-
->>control query default MODE_SPECIAL_1 reset;
-
---- SQL operation complete.
->>#ifdef SEABASE_REGRESS
->>control query default DISABLE_READ_ONLY reset;
-
---- SQL operation complete.
->>#else
->>control query default COMP_BOOL_58 reset;
->>#endif
->>
 >>-- Error 4053
 >>prepare xx from select bitextract(a, a, b) from t006t5;
 
@@ -515,18 +432,12 @@
 
 *** ERROR[8822] The statement was not prepared.
 
->>control query default MODE_SPECIAL_3 'ON';
-
---- SQL operation complete.
 >>prepare xx from select trunc(a) from t006t1;
 
 *** ERROR[4059] The first operand of function TRUNC must be numeric.
 
 *** ERROR[8822] The statement was not prepared.
 
->>control query default MODE_SPECIAL_3 reset;
-
---- SQL operation complete.
 >>prepare xx from select a**a from t006t1;
 
 *** ERROR[4059] The first operand of function '**' must be numeric.
@@ -534,26 +445,6 @@
 *** ERROR[8822] The statement was not prepared.
 
 >>
->>-- Error 4065
->>control query default MODE_SPECIAL_4 'ON';
-
---- SQL operation complete.
->>prepare xx from select * from t006t1 where to_date(A, '201005') = A;
-
-*** ERROR[4065] The format, "201005", specified in the TO_DATE function is not supported.
-
-*** ERROR[8822] The statement was not prepared.
-
->>prepare xx from select * from t006t2 where to_date(A, 'YYYYMM') = A;
-
-*** ERROR[4041] Type DATE cannot be compared with type INTEGER.
-
-*** ERROR[8822] The statement was not prepared.
-
->>control query default MODE_SPECIAL_4 reset;
-
---- SQL operation complete.
->>
 >>-- Error 4067
 >>prepare xx from select * from table (explain(NULL, 5));
 
@@ -579,18 +470,12 @@
 
 >>
 >>-- Error 4071
->>control query default MODE_SPECIAL_3 'ON';
-
---- SQL operation complete.
 >>prepare xx from select * from t006t1 where last_day(A) = A;
 
 *** ERROR[4071] The first operand of function LAST_DAY must be a datetime.
 
 *** ERROR[8822] The statement was not prepared.
 
->>control query default MODE_SPECIAL_3 reset;
-
---- SQL operation complete.
 >>
 >>prepare xx from select juliantimestamp(a) from t006t1;
 
@@ -730,54 +615,6 @@
 
 --- SQL command prepared.
 >>
->>#ifdef SEABASE_REGRESS
->>control query default DISABLE_READ_ONLY 'ON';
-
---- SQL operation complete.
->>#else
->>control query default COMP_BOOL_58 'ON';
->>#endif
->>control query default MODE_SPECIAL_1 'ON';
-
---- SQL operation complete.
->>prepare xx from select substring(a for 3) from t006t1;
-
---- SQL command prepared.
->>prepare xx from select substring(a for 3) from t006t3;
-
---- SQL command prepared.
->>prepare xx from select substring(c for 3) from t006t5;
-
---- SQL command prepared.
->>prepare xx from select a from t006t1 group by 1 order by 1;
-
---- SQL command prepared.
->>prepare xx from select a from t006t1 group by A order by A;
-
---- SQL command prepared.
->>prepare xx from select * from t006t5 where c = 1231999;
-
---- SQL command prepared.
->>prepare xx from select * from t006t5 where a = date'12/31/1999';
-
---- SQL command prepared.
->>prepare xx from select * from t006t5 where cast(a as interval day) = 1;
-
---- SQL command prepared.
->>prepare xx from select * from t006t5 where 1 = interval '1' day;
-
---- SQL command prepared.
->>control query default MODE_SPECIAL_1 reset;
-
---- SQL operation complete.
->>#ifdef SEABASE_REGRESS
->>control query default DISABLE_READ_ONLY reset;
-
---- SQL operation complete.
->>#else
->>control query default COMP_BOOL_58 reset;
->>#endif
->>
 >>prepare xx from select date_trunc('YEAR',a) from t006t1;
 
 --- SQL command prepared.
@@ -1226,4 +1063,88 @@
 
 --- SQL operation complete.
 >>
+>>obey TEST006(mode_special_tests);
+>>-- Error 4026
+>>control query default MODE_SPECIAL_1 'ON';
+
+--- SQL operation complete.
+>>control query default R2_HALLOWEEN_SUPPORT 'ON';
+
+--- SQL operation complete.
+>>prepare s1 from insert into t006t3 select * from t006t3 where a in (select a from t006t3);
+
+*** ERROR[4026] Reading from and inserting into, or updating in, or deleting from the same table, TRAFODION.SCH.T006T3, is not currently supported.
+
+*** ERROR[8822] The statement was not prepared.
+
+>>control query default R2_HALLOWEEN_SUPPORT reset;
+
+--- SQL operation complete.
+>>
+>>prepare xx from select substring(a for 3) from t006t1;
+
+--- SQL command prepared.
+>>prepare xx from select substring(a for 3) from t006t3;
+
+--- SQL command prepared.
+>>prepare xx from select substring(c for 3) from t006t5;
+
+--- SQL command prepared.
+>>prepare xx from select a from t006t1 group by 1 order by 1;
+
+--- SQL command prepared.
+>>prepare xx from select a from t006t1 group by A order by A;
+
+--- SQL command prepared.
+>>prepare xx from select * from t006t5 where c = 1231999;
+
+--- SQL command prepared.
+>>prepare xx from select * from t006t5 where a = date'12/31/1999';
+
+--- SQL command prepared.
+>>prepare xx from select * from t006t5 where cast(a as interval day) = 1;
+
+--- SQL command prepared.
+>>prepare xx from select * from t006t5 where 1 = interval '1' day;
+
+--- SQL command prepared.
+>>
+>>prepare xx from select rows since(a = 11, a) from t006t1 sequence by a;
+
+*** ERROR[4052] The second operand of function ROWS SINCE must be numeric.
+
+*** ERROR[8822] The statement was not prepared.
+
+>>control query default MODE_SPECIAL_1 reset;
+
+--- SQL operation complete.
+>>
+>>control query default MODE_SPECIAL_4 'ON';
+
+--- SQL operation complete.
+>>prepare xx from select * from t006t1 where to_date(A, '99:99:99:99') = A;
+
+*** ERROR[4045] The operand of function TO_DATE must be numeric.
+
+*** ERROR[8822] The statement was not prepared.
+
+>>
+>>-- Error 4065
+>>prepare xx from select * from t006t1 where to_date(A, '201005') = A;
+
+*** ERROR[4065] The format, "201005", specified in the TO_DATE function is not supported.
+
+*** ERROR[8822] The statement was not prepared.
+
+>>prepare xx from select * from t006t2 where to_date(A, 'YYYYMM') = A;
+
+*** ERROR[4041] Type DATE cannot be compared with type INTEGER.
+
+*** ERROR[8822] The statement was not prepared.
+
+>>control query default MODE_SPECIAL_4 reset;
+
+--- SQL operation complete.
+>>
+>>
 >>log;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/regress/compGeneral/EXPECTED042
----------------------------------------------------------------------
diff --git a/core/sql/regress/compGeneral/EXPECTED042 b/core/sql/regress/compGeneral/EXPECTED042
index e0ab126..8359519 100644
--- a/core/sql/regress/compGeneral/EXPECTED042
+++ b/core/sql/regress/compGeneral/EXPECTED042
@@ -1,9 +1,9 @@
 >>showstats for table t042_orderline on ol_o_id detail;
 
 Detailed Histogram data for Table TRAFODION.ORDERENTRY.T042_ORDERLINE
-Table ID: 1956915417785292522
+Table ID: 5178120267908624440
 
-Hist ID:    1327343796
+Hist ID:    1736168167
 Column(s):  OL_O_ID
 Total Rows: 10
 Total UEC:  4
@@ -1789,7 +1789,7 @@ HQC key=SELECT T . VARCHAR0_UNIQ AS T_VARCHAR0_UNIQ , T . CHAR2_2 AS T_CHAR2_2 ,
 >>-- test compile time
 >>
 >>sh more /proc/loadavg  | cut -d' ' -f 1-3 | sed -e 's/^/System load: /' >> LOG042;
-System load: 0.75 0.87 0.98
+System load: 0.64 1.30 0.89
 >>sh grep "model name" /proc/cpuinfo | head -1 | cut -d '@' -f 2 | sed -e 's/^/CPU frequency: /' >> LOG042;
 CPU frequency: model name	: Intel Core Processor (Haswell)
 >>set statistics on;
@@ -1797,10 +1797,10 @@ CPU frequency: model name	: Intel Core Processor (Haswell)
 
 --- SQL command prepared.
 
-Start Time             2016/06/24 07:10:14.550650
-End Time               2016/06/24 07:10:14.552758
-Elapsed Time                      00:00:00.002108
-Compile Time                      00:00:00.002108
+Start Time             2016/08/23 16:14:20.560188
+End Time               2016/08/23 16:14:20.562743
+Elapsed Time                      00:00:00.002555
+Compile Time                      00:00:00.002555
 Execution Time                    00:00:00.000000
 
 
@@ -1831,10 +1831,10 @@ HQC key=SELECT * FROM T042_ORDERLINE WHERE OL_O_ID = #NP# ;
 
 --- SQL command prepared.
 
-Start Time             2016/06/24 07:10:14.695034
-End Time               2016/06/24 07:10:14.697872
-Elapsed Time                      00:00:00.002838
-Compile Time                      00:00:00.002838
+Start Time             2016/08/23 16:14:20.742414
+End Time               2016/08/23 16:14:20.745059
+Elapsed Time                      00:00:00.002645
+Compile Time                      00:00:00.002645
 Execution Time                    00:00:00.000000
 
 
@@ -1875,7 +1875,7 @@ NUM_ENTRIES  TEXT_ENTRIES  NUM_PLANS
 NUM_ENTRIES  TEXT_ENTRIES  NUM_PLANS 
 -----------  ------------  ----------
 
-         22             0          22
+         32             0          32
           2             0           2
 
 --- 2 row(s) selected.
@@ -1888,7 +1888,7 @@ NUM_ENTRIES  TEXT_ENTRIES  NUM_PLANS
 -----------  ------------  ----------
 
          65            10          65
-         22             0          22
+         32             0          32
           2             0           2
 
 --- 3 row(s) selected.
@@ -1984,6 +1984,11 @@ NUM_HITS    NUM_PARAMS
          0           1
          0           1
          0           1
+         0           1
+         0           1
+         0           1
+         0           1
+         0           1
          0           2
          0           2
          0           2
@@ -1994,6 +1999,11 @@ NUM_HITS    NUM_PARAMS
          0           5
          1           1
          1           1
+         1           1
+         1           1
+         1           1
+         1           1
+         1           1
          1           2
          1           2
          1           3
@@ -2003,9 +2013,9 @@ NUM_HITS    NUM_PARAMS
          2           1
          2           3
          3           3
-         9           4
+        13           4
 
---- 24 row(s) selected.
+--- 34 row(s) selected.
 >>select num_hits, num_params from table(querycacheentries('ustats', 'local')) order by 1,2;
 
 --- 0 row(s) selected.
@@ -2077,6 +2087,11 @@ NUM_HITS    NUM_PARAMS
          0           1
          0           1
          0           1
+         0           1
+         0           1
+         0           1
+         0           1
+         0           1
          0           2
          0           2
          0           2
@@ -2099,6 +2114,11 @@ NUM_HITS    NUM_PARAMS
          1           1
          1           1
          1           1
+         1           1
+         1           1
+         1           1
+         1           1
+         1           1
          1           2
          1           2
          1           2
@@ -2112,9 +2132,9 @@ NUM_HITS    NUM_PARAMS
          2           3
          3           3
          5           1
-         9           4
+        13           4
 
---- 99 row(s) selected.
+--- 109 row(s) selected.
 >>
 >>
 >>--Stats in Hybrid Query Cache
@@ -2131,7 +2151,7 @@ NUM_HKEYS   NUM_SKEYS   NUM_MAX_VALUES_PER_KEY  NUM_HASH_TABLE_BUCKETS
 NUM_HKEYS   NUM_SKEYS   NUM_MAX_VALUES_PER_KEY  NUM_HASH_TABLE_BUCKETS
 ----------  ----------  ----------------------  ----------------------
 
-        22          22                       5                     211
+        32          32                       5                     211
          2           2                       5                     211
 
 --- 2 row(s) selected.
@@ -2144,7 +2164,7 @@ NUM_HKEYS   NUM_SKEYS   NUM_MAX_VALUES_PER_KEY  NUM_HASH_TABLE_BUCKETS
 ----------  ----------  ----------------------  ----------------------
 
         37          60                       5                     211
-        22          22                       5                     211
+        32          32                       5                     211
          2           2                       5                     211
 
 --- 3 row(s) selected.
@@ -2235,9 +2255,19 @@ NUM_HKEYS   NUM_SKEYS   NUM_MAX_VALUES_PER_KEY  NUM_HASH_TABLE_BUCKETS
        208           0              5               0
        222           0              3               1
        222           1              3               1
+       227           0              1               0
+       227           1              1               0
+       233           0              1               0
+       233           1              1               0
+       270           0              1               0
+       270           1              1               0
+       282           0              1               0
+       282           1              1               0
        314           0              3               1
        314           0              3               1
        314           2              1               0
+       336           0              1              14
+       336           1              1              14
        422           2              1               1
        487           0              2               3
        487           1              2               3
@@ -2246,7 +2276,7 @@ NUM_HKEYS   NUM_SKEYS   NUM_MAX_VALUES_PER_KEY  NUM_HASH_TABLE_BUCKETS
        619           0              1              14
        619           0              1              14
 
---- 24 row(s) selected.
+--- 34 row(s) selected.
 >>select char_length(hkey), num_hits, num_PLiterals,  num_NPLiterals from table(hybridquerycacheentries('ustats', 'local')) order by 1, 2, 3, 4;
 
 --- 0 row(s) selected.
@@ -2329,9 +2359,19 @@ NUM_HKEYS   NUM_SKEYS   NUM_MAX_VALUES_PER_KEY  NUM_HASH_TABLE_BUCKETS
        208           0              5               0
        222           0              3               1
        222           1              3               1
+       227           0              1               0
+       227           1              1               0
+       233           0              1               0
+       233           1              1               0
+       270           0              1               0
+       270           1              1               0
+       282           0              1               0
+       282           1              1               0
        314           0              3               1
        314           0              3               1
        314           2              1               0
+       336           0              1              14
+       336           1              1              14
        422           2              1               1
        487           0              2               3
        487           1              2               3
@@ -2340,7 +2380,7 @@ NUM_HKEYS   NUM_SKEYS   NUM_MAX_VALUES_PER_KEY  NUM_HASH_TABLE_BUCKETS
        619           0              1              14
        619           0              1              14
 
---- 84 row(s) selected.
+--- 94 row(s) selected.
 >>
 >>
 >>-- virtual table ISP queries are not cacheable.

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/regress/compGeneral/TEST006
----------------------------------------------------------------------
diff --git a/core/sql/regress/compGeneral/TEST006 b/core/sql/regress/compGeneral/TEST006
index b624e72..dd87a1a 100644
--- a/core/sql/regress/compGeneral/TEST006
+++ b/core/sql/regress/compGeneral/TEST006
@@ -34,6 +34,7 @@ obey TEST006(positive_tests);
 obey TEST006(analyzer_tests);
 obey TEST006(defaults_tests);
 obey TEST006(misc_tests);
+obey TEST006(mode_special_tests);
 log;
 obey TEST006(clean_up);
 
@@ -109,23 +110,6 @@ prepare xx from select sum(max(a)) from t006t1;
 -- Error 4022
 prepare xx from insert into t006t2(a, a) select a, a from t006t3;
 
--- Error 4026
-#ifdef SEABASE_REGRESS
-control query default DISABLE_READ_ONLY 'ON';
-#else
-control query default COMP_BOOL_58 'ON';
-#endif
-control query default MODE_SPECIAL_1 'ON';
-control query default R2_HALLOWEEN_SUPPORT 'ON';
-prepare s1 from insert into t006t3 select * from t006t3 where a in (select a from t006t3);
-control query default R2_HALLOWEEN_SUPPORT reset;
-control query default MODE_SPECIAL_1 reset;
-#ifdef SEABASE_REGRESS
-control query default DISABLE_READ_ONLY reset;
-#else
-control query default COMP_BOOL_58 reset;
-#endif
-
 -- Error 4034
 prepare xx from select * from t006t1 where a = 1234 collate default;
 
@@ -136,9 +120,7 @@ prepare xx from select year(a) from t006t2;
 prepare xx from insert into t006t3 values ('a');
 
 -- Error 4043
-control query default MODE_SPECIAL_3 'ON';
 prepare xx from select * from t006t1 where to_number(1112) = A;
-control query default MODE_SPECIAL_3 reset;
 prepare xx from select tokenstr('a', a) from t006t2;
 prepare xx from select queryid_extract(a, b) from t006t5;
 prepare xx from select os_userid(a) from t006t2;
@@ -155,10 +137,6 @@ prepare xx from select user(a) from t006t1;
 prepare xx from select ~a from t006t1;
 prepare xx from select sin(a) from t006t1;
 
-control query default MODE_SPECIAL_4 'ON';
-prepare xx from select * from t006t1 where to_date(A, '99:99:99:99') = A;
-control query default MODE_SPECIAL_4 reset;
-
 -- Error 4046
 prepare xx from select ~(a) from t006t7;
 prepare xx from select bitextract(a, a, a) from t006t7;
@@ -194,20 +172,6 @@ prepare xx from select round(t006t2.a, t006t1.a) from t006t1, t006t2;
 prepare xx from select repeat(a, a) from t006t1;
 prepare xx from select offset(a,a,a) from t006t1;
 
-#ifdef SEABASE_REGRESS
-control query default DISABLE_READ_ONLY 'ON';
-#else
-control query default COMP_BOOL_58 'ON';
-#endif
-control query default MODE_SPECIAL_1 'ON';
-prepare xx from select rows since(a = 11, a) from t006t1 sequence by a;
-control query default MODE_SPECIAL_1 reset;
-#ifdef SEABASE_REGRESS
-control query default DISABLE_READ_ONLY reset;
-#else
-control query default COMP_BOOL_58 reset;
-#endif
-
 -- Error 4053
 prepare xx from select bitextract(a, a, b) from t006t5;
 prepare xx from select substring(a,1,a) from t006t1;
@@ -223,17 +187,9 @@ prepare xx from select movingcount(a, 1, a) from t006t1 sequence by a;
 
 -- Error 4059
 prepare xx from select round(a) from t006t1;
-control query default MODE_SPECIAL_3 'ON';
 prepare xx from select trunc(a) from t006t1;
-control query default MODE_SPECIAL_3 reset;
 prepare xx from select a**a from t006t1;
 
--- Error 4065
-control query default MODE_SPECIAL_4 'ON';
-prepare xx from select * from t006t1 where to_date(A, '201005') = A;
-prepare xx from select * from t006t2 where to_date(A, 'YYYYMM') = A;
-control query default MODE_SPECIAL_4 reset;
-
 -- Error 4067
 prepare xx from select * from table (explain(NULL, 5));
 
@@ -244,9 +200,7 @@ prepare xx from select convertfromhex(cast(a as char(1))) from t006t1;
 prepare xx from select converttimestamp(a) from t006t1;
 
 -- Error 4071
-control query default MODE_SPECIAL_3 'ON';
 prepare xx from select * from t006t1 where last_day(A) = A;
-control query default MODE_SPECIAL_3 reset;
 
 prepare xx from select juliantimestamp(a) from t006t1;
 
@@ -299,28 +253,6 @@ prepare xx from select current_running from t006t1;
 prepare xx from select position(a in a) from t006t4;
 prepare xx from select replace(a, a, a) from t006t4;
 
-#ifdef SEABASE_REGRESS
-control query default DISABLE_READ_ONLY 'ON';
-#else
-control query default COMP_BOOL_58 'ON';
-#endif
-control query default MODE_SPECIAL_1 'ON';
-prepare xx from select substring(a for 3) from t006t1;
-prepare xx from select substring(a for 3) from t006t3;
-prepare xx from select substring(c for 3) from t006t5;
-prepare xx from select a from t006t1 group by 1 order by 1;
-prepare xx from select a from t006t1 group by A order by A;
-prepare xx from select * from t006t5 where c = 1231999;
-prepare xx from select * from t006t5 where a = date'12/31/1999';
-prepare xx from select * from t006t5 where cast(a as interval day) = 1;
-prepare xx from select * from t006t5 where 1 = interval '1' day;
-control query default MODE_SPECIAL_1 reset;
-#ifdef SEABASE_REGRESS
-control query default DISABLE_READ_ONLY reset;
-#else
-control query default COMP_BOOL_58 reset;
-#endif
-
 prepare xx from select date_trunc('YEAR',a) from t006t1;
 prepare xx from select date_trunc('YEAR',a) from t006t1;
 prepare xx from select date_trunc('month',a) from t006t1;
@@ -520,3 +452,32 @@ control query default MEMORY_MONITOR_LOGFILE 'mml.log';
 prepare xx from select * from t006t2;
 control query default MEMORY_MONITOR 'OFF';
 
+?section mode_special_tests
+-- Error 4026
+control query default MODE_SPECIAL_1 'ON';
+control query default R2_HALLOWEEN_SUPPORT 'ON';
+prepare s1 from insert into t006t3 select * from t006t3 where a in (select a from t006t3);
+control query default R2_HALLOWEEN_SUPPORT reset;
+
+prepare xx from select substring(a for 3) from t006t1;
+prepare xx from select substring(a for 3) from t006t3;
+prepare xx from select substring(c for 3) from t006t5;
+prepare xx from select a from t006t1 group by 1 order by 1;
+prepare xx from select a from t006t1 group by A order by A;
+prepare xx from select * from t006t5 where c = 1231999;
+prepare xx from select * from t006t5 where a = date'12/31/1999';
+prepare xx from select * from t006t5 where cast(a as interval day) = 1;
+prepare xx from select * from t006t5 where 1 = interval '1' day;
+
+prepare xx from select rows since(a = 11, a) from t006t1 sequence by a;
+control query default MODE_SPECIAL_1 reset;
+
+control query default MODE_SPECIAL_4 'ON';
+prepare xx from select * from t006t1 where to_date(A, '99:99:99:99') = A;
+
+-- Error 4065
+prepare xx from select * from t006t1 where to_date(A, '201005') = A;
+prepare xx from select * from t006t2 where to_date(A, 'YYYYMM') = A;
+control query default MODE_SPECIAL_4 reset;
+
+

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/regress/compGeneral/cidefs
----------------------------------------------------------------------
diff --git a/core/sql/regress/compGeneral/cidefs b/core/sql/regress/compGeneral/cidefs
deleted file mode 100755
index 8479f06..0000000
--- a/core/sql/regress/compGeneral/cidefs
+++ /dev/null
@@ -1,128 +0,0 @@
---	This is the sqlci analogue of the shell-script "setupenv".
---
--- @@@ 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 @@@
-
-set SCHEMA $$TEST_SCHEMA$$;
-control query default HIST_USE_SAMPLE_FOR_CARDINALITY_ESTIMATION  'ON';
-control query default HIST_ON_DEMAND_STATS_SIZE '10000';
-
--- Define a standard physical environment for the compiler:
-control query default TARGET_CODE 'DEBUG';
-control query default TARGET_CPU_FREQUENCY '199.';
-control query default TARGET_IO_SEEK_TIME '0.020147';
-control query default TARGET_IO_SEQ_READ_RATE '2.5';
-control query default TARGET_MSG_LOCAL_RATE '10.';
-control query default TARGET_MSG_LOCAL_TIME '0.000125';
-control query default TARGET_MSG_REMOTE_RATE '100.';
-control query default TARGET_MSG_REMOTE_TIME  '0.00125';
-
-control query default ARKCMP_FAKE_HW 'ON';
-control query default SKIP_METADATA_VIEWS 'ON';
-
-#ifMX
-control query default REF_CONSTRAINT_NO_ACTION_LIKE_RESTRICT 'ON';
-#ifMX
-
-control query default DEF_NUM_SMP_CPUS
-#ifMX
-'2'
-#ifMX
-#ifMP
-'1'
-#ifMP
-;
-
-control query default MAX_ESPS_PER_CPU_PER_OP '1';
-
-control query default DEF_NUM_NODES_IN_ACTIVE_CLUSTERS
-#ifMX
-'1'
-#ifMX
-#ifMP
-'2'
-#ifMP
-;
-
--- Suppress the Row Format information from the SHOWDDL output so
--- we don't have to update hundreds of existing Expected Results
--- files in our regression test suites.  'OFF' is the default.
-control query default SQLMX_SHOWDDL_SUPPRESS_ROW_FORMAT 'ON';
-
--- this is the datavol location of the second partition
--- for partitioned tables.
-#ifNSK
-set pattern $$partition$$  $DATA04;
-set pattern $$partition1$$ $DATA01;
-set pattern $$partition2$$ $DATA03;
-set pattern $$partition3$$ $DATA05;
-set pattern $$TrigTempTablePartition$$ '''$DATA03:$DATA04,$DATA05:$DATA01''';
---set pattern $$system_name$$ SYSTEM_NAME;
-#ifNSK
-
-#ifNT
-set pattern $$partition$$ $DATA;
-set pattern $$partition1$$ $DATA1;
-set pattern $$partition2$$ $DATA2;
-set pattern $$partition3$$ $SYSTEM;
-set pattern $$TrigTempTablePartition$$ '''$system:$data1,$data2:$data''';
-set pattern $$SYSTEM_NAME$$ NSK;
-
-#ifNT
-
--- This pattern is needed for both NSK and NT to handle the quote in Metadata
--- queries
-set pattern $$quote$$ '''';
-
-set pattern $$REMOTE_SYSTEM_CATALOG$$ \NEVADA2.$DATA08.VICTEST;
--- This CQD is added for creating a table  with no
--- partition or primary key when the POS is enabled.
-control query default POS_ALLOW_NON_PK_TABLES 'ON';
---control query default detailed_statistics 'ALL';
-
-
--- Only on a Linux cluster
-#ifdef CLUSTERNAME
-set pattern $$partition$$  $DB0000;
-set pattern $$partition0$$ $DB0000;
-set pattern $$partition1$$ $DB0001;
-set pattern $$partition2$$ $DB0002;
-set pattern $$partition3$$ $DB0003;
-set pattern $$partition4$$ $DB0004;
-set pattern $$partition5$$ $DB0005;
-set pattern $$partition6$$ $DB0006;
-set pattern $$partition7$$ $DB0007;
-set pattern $$partition8$$ $DB0008;
-set pattern $$audit_vol$$  $AUD000;
-set pattern $$PosTablePartition$$ '''$DB0000''';
-set pattern $$PosTablePartitions2$$ '''$DB0001, $DB0002''';
-set pattern $$PosTablePartitions3$$ '''$DB0003, $DB0004, $DB0005''';
-set pattern $$PosTablePartitions4$$ '''$DB0006, $DB0007, $DB0008, $DB0009''';
-set pattern $$TrigTempTablePartition$$ '''$DB0003:$DB0004,$DB0005:$DB0001''';
-set pattern $$TrigTempTablePartition1$$ '''$DB0001: $DB0004''';
-set pattern $$TrigTempTablePartition2$$ '''$DB0001''';
-set pattern $$TrigTempTablePartition3$$ '''$DB0004''';
-set pattern $$TrigTempTablePartition4$$ '''$DB0001, $DB0004,$NINEX: $DB0005''';
-set pattern $$TrigTempTablePartition5$$ '''$DB0005, $DB0005, $DB0005: $DB0005, $DB0005''';
-set pattern $$TrigTempTablePartition6$$ '''$DB0001,XXXX64 $DB0005''';
-#endif
-
--- eof

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/regress/core/EXPECTED037.SB
----------------------------------------------------------------------
diff --git a/core/sql/regress/core/EXPECTED037.SB b/core/sql/regress/core/EXPECTED037.SB
index 62af477..c597cb3 100755
--- a/core/sql/regress/core/EXPECTED037.SB
+++ b/core/sql/regress/core/EXPECTED037.SB
@@ -75,7 +75,7 @@
 >>invoke table_name;
 
 -- Definition of Trafodion table TRAFODION.SCH.TABLE_NAME
--- Definition current  Thu Feb 25 06:24:08 2016
+-- Definition current  Tue Jul 19 01:27:42 2016
 
   (
     SYSKEY                           LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -224,7 +224,7 @@
 >>invoke system_name;
 
 -- Definition of Trafodion table TRAFODION.SCH.SYSTEM_NAME
--- Definition current  Thu Feb 25 06:24:10 2016
+-- Definition current  Tue Jul 19 01:27:44 2016
 
   (
     SYSKEY                           LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -358,14 +358,9 @@ create view sqlerror  as select usa from table_name;
 
 >>create view sqlstate  as select usa from table_name;
 
-*** ERROR[3128] SQLSTATE is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-create view sqlstate  as select usa from table_name;
-                   ^ (20 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
+*** ERROR[4001] Column USA is not found.  Tables in scope: TRAFODION.SCH.TABLE_NAME.  Default schema: TRAFODION.SCH.
 
+--- SQL operation failed with errors.
 >>create view stddev  as select usa from table_name;
 
 *** ERROR[4001] Column USA is not found.  Tables in scope: TRAFODION.SCH.TABLE_NAME.  Default schema: TRAFODION.SCH.
@@ -381,14 +376,9 @@ create view table  as select usa from table_name;
 
 >>create view upshift  as select usa from table_name;
 
-*** ERROR[3128] UPSHIFT is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-create view upshift  as select usa from table_name;
-                  ^ (19 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
+*** ERROR[4001] Column USA is not found.  Tables in scope: TRAFODION.SCH.TABLE_NAME.  Default schema: TRAFODION.SCH.
 
+--- SQL operation failed with errors.
 >>create view variance  as select usa from table_name;
 
 *** ERROR[4001] Column USA is not found.  Tables in scope: TRAFODION.SCH.TABLE_NAME.  Default schema: TRAFODION.SCH.
@@ -408,69 +398,34 @@ create view upshift  as select usa from table_name;
 >>-- Expect error [3128]
 >>prepare s1 from SELECT AFTER AFTER from (values(0)) AFTER(AFTER);
 
-*** ERROR[3128] AFTER is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT AFTER AFTER from (values(0)) AFTER(AFTER);
-                 ^ (18 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect error [3128]
 >>prepare s1 from SELECT ASYNC ASYNC from (values(0)) ASYNC(ASYNC);
 
-*** ERROR[3128] ASYNC is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT ASYNC ASYNC from (values(0)) ASYNC(ASYNC);
-                 ^ (18 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect error [3128]
 >>prepare s1 from SELECT AT AT from (values(0)) AT(AT);
 
-*** ERROR[3128] AT is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT AT AT from (values(0)) AT(AT);
-           ^ (12 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect error [3128]
 >>prepare s1 from SELECT BEFORE BEFORE from (values(0)) BEFORE(BEFORE);
 
-*** ERROR[3128] BEFORE is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT BEFORE BEFORE from (values(0)) BEFORE(BEFORE);
-                   ^ (20 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect error [3128]
 >>prepare s1 from SELECT BIT_LENGTH BIT_LENGTH from (values(0)) BIT_LENGTH(BIT_LENGTH);
 
-*** ERROR[3128] BIT_LENGTH is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT BIT_LENGTH BIT_LENGTH from (values(0)) BIT_LENGTH(BIT_LENGTH);
-                           ^ (28 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect error [15001]
 >>prepare s1 from SELECT BOOLEAN BOOLEAN from (values(0)) BOOLEAN(BOOLEAN);
 
 *** ERROR[15001] A syntax error occurred at or before: 
 SELECT BOOLEAN BOOLEAN from (values(0)) BOOLEAN(BOOLEAN);
-                     ^ (22 characters from start of SQL statement)
+             ^ (14 characters from start of SQL statement)
 
 *** ERROR[8822] The statement was not prepared.
 
@@ -478,170 +433,72 @@ SELECT BOOLEAN BOOLEAN from (values(0)) BOOLEAN(BOOLEAN);
 >>-- Expect error [3128]
 >>prepare s1 from SELECT BREADTH BREADTH from (values(0)) BREADTH(BREADTH);
 
-*** ERROR[3128] BREADTH is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT BREADTH BREADTH from (values(0)) BREADTH(BREADTH);
-                     ^ (22 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect error [3128]
 >>prepare s1 from SELECT COMPLETION COMPLETION from (values(0)) COMPLETION(COMPLETION);
 
-*** ERROR[3128] COMPLETION is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT COMPLETION COMPLETION from (values(0)) COMPLETION(COMPLETION);
-                           ^ (28 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect error [3128]
 >>prepare s1 from SELECT CONNECT CONNECT from (values(0)) CONNECT(CONNECT);
 
-*** ERROR[3128] CONNECT is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT CONNECT CONNECT from (values(0)) CONNECT(CONNECT);
-                     ^ (22 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect error [3128]
 >>prepare s1 from SELECT CYCLE CYCLE from (values(0)) CYCLE(CYCLE);
 
-*** ERROR[3128] CYCLE is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT CYCLE CYCLE from (values(0)) CYCLE(CYCLE);
-                 ^ (18 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect error [3128]
 >>prepare s1 from SELECT DEFERRABLE DEFERRABLE from (values(0)) DEFERRABLE(DEFERRABLE);
 
-*** ERROR[3128] DEFERRABLE is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT DEFERRABLE DEFERRABLE from (values(0)) DEFERRABLE(DEFERRABLE);
-                           ^ (28 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect error [3128]
 >>prepare s1 from SELECT DEFERRED DEFERRED from (values(0)) DEFERRED(DEFERRED);
 
-*** ERROR[3128] DEFERRED is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT DEFERRED DEFERRED from (values(0)) DEFERRED(DEFERRED);
-                       ^ (24 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect error [3128]
 >>prepare s1 from SELECT DEPTH DEPTH from (values(0)) DEPTH(DEPTH);
 
-*** ERROR[3128] DEPTH is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT DEPTH DEPTH from (values(0)) DEPTH(DEPTH);
-                 ^ (18 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect error [3128]
 >>prepare s1 from SELECT DICTIONARY DICTIONARY from (values(0)) DICTIONARY(DICTIONARY);
 
-*** ERROR[3128] DICTIONARY is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT DICTIONARY DICTIONARY from (values(0)) DICTIONARY(DICTIONARY);
-                           ^ (28 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect error [3128]
 >>prepare s1 from SELECT DISCONNECT DISCONNECT from (values(0)) DISCONNECT(DISCONNECT);
 
-*** ERROR[3128] DISCONNECT is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT DISCONNECT DISCONNECT from (values(0)) DISCONNECT(DISCONNECT);
-                           ^ (28 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect error [3128]
 >>prepare s1 from SELECT DOMAIN DOMAIN from (values(0)) DOMAIN(DOMAIN);
 
-*** ERROR[3128] DOMAIN is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT DOMAIN DOMAIN from (values(0)) DOMAIN(DOMAIN);
-                   ^ (20 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect error [3128]
 >>prepare s1 from SELECT EACH EACH from (values(0)) EACH(EACH);
 
-*** ERROR[3128] EACH is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT EACH EACH from (values(0)) EACH(EACH);
-               ^ (16 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect error [3128]
 >>prepare s1 from SELECT EQUALS EQUALS from (values(0)) EQUALS(EQUALS);
 
-*** ERROR[3128] EQUALS is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT EQUALS EQUALS from (values(0)) EQUALS(EQUALS);
-                   ^ (20 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect error [3128]
 >>prepare s1 from SELECT EXEC EXEC from (values(0)) EXEC(EXEC);
 
-*** ERROR[3128] EXEC is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT EXEC EXEC from (values(0)) EXEC(EXEC);
-               ^ (16 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect error [3128]
 >>prepare s1 from SELECT GENERAL GENERAL from (values(0)) GENERAL(GENERAL);
 
-*** ERROR[3128] GENERAL is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT GENERAL GENERAL from (values(0)) GENERAL(GENERAL);
-                     ^ (22 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect SYNTAX error now that we use IDENTITY as a token
 >>prepare s1 from SELECT IDENTITY IDENTITY from (values(0)) IDENTITY(IDENTITY);
@@ -656,50 +513,22 @@ SELECT IDENTITY IDENTITY from (values(0)) IDENTITY(IDENTITY);
 >>-- Expect error [3128]
 >>prepare s1 from SELECT INITIALLY INITIALLY from (values(0)) INITIALLY(INITIALLY);
 
-*** ERROR[3128] INITIALLY is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT INITIALLY INITIALLY from (values(0)) INITIALLY(INITIALLY);
-                         ^ (26 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect error [3128]
 >>prepare s1 from SELECT INSENSITIVE INSENSITIVE from (values(0)) INSENSITIVE(INSENSITIVE);
 
-*** ERROR[3128] INSENSITIVE is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT INSENSITIVE INSENSITIVE from (values(0)) INSENSITIVE(INSENSITIVE);
-                             ^ (30 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect error [3128]
 >>prepare s1 from SELECT LEAVE LEAVE from (values(0)) LEAVE(LEAVE);
 
-*** ERROR[3128] LEAVE is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT LEAVE LEAVE from (values(0)) LEAVE(LEAVE);
-                 ^ (18 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect error [3128]
 >>prepare s1 from SELECT LESS LESS from (values(0)) LESS(LESS);
 
-*** ERROR[3128] LESS is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT LESS LESS from (values(0)) LESS(LESS);
-               ^ (16 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect syntax error, LIMIT must be double quoted.
 >>prepare s1 from SELECT LIMIT LIMIT from (values(0)) LIMIT(LIMIT);
@@ -714,50 +543,22 @@ SELECT LIMIT LIMIT from (values(0)) LIMIT(LIMIT);
 >>-- Expect error [3128]
 >>prepare s1 from SELECT LOOP LOOP from (values(0)) LOOP(LOOP);
 
-*** ERROR[3128] LOOP is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT LOOP LOOP from (values(0)) LOOP(LOOP);
-               ^ (16 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect error [3128]
 >>prepare s1 from SELECT MODIFY MODIFY from (values(0)) MODIFY(MODIFY);
 
-*** ERROR[3128] MODIFY is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT MODIFY MODIFY from (values(0)) MODIFY(MODIFY);
-                   ^ (20 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect error [3128]
 >>prepare s1 from SELECT NEW NEW from (values(0)) NEW(NEW);
 
-*** ERROR[3128] NEW is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT NEW NEW from (values(0)) NEW(NEW);
-             ^ (14 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect error [3128]
 >>prepare s1 from SELECT NEXT NEXT from (values(0)) NEXT(NEXT);
 
-*** ERROR[3128] NEXT is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT NEXT NEXT from (values(0)) NEXT(NEXT);
-               ^ (16 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect error [15001]
 >>prepare s1 from SELECT NONE NONE from (values(0)) NONE(NONE);
@@ -772,14 +573,7 @@ SELECT NONE NONE from (values(0)) NONE(NONE);
 >>-- Expect error [3128]
 >>prepare s1 from SELECT OBJECT OBJECT from (values(0)) OBJECT(OBJECT);
 
-*** ERROR[3128] OBJECT is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT OBJECT OBJECT from (values(0)) OBJECT(OBJECT);
-                   ^ (20 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect error [3128]
 >>prepare s1 from SELECT OID OID from (values(0)) OID(OID);
@@ -789,122 +583,52 @@ SELECT OBJECT OBJECT from (values(0)) OBJECT(OBJECT);
 >>-- Expect error [3128]
 >>prepare s1 from SELECT OLD OLD from (values(0)) OLD(OLD);
 
-*** ERROR[3128] OLD is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT OLD OLD from (values(0)) OLD(OLD);
-             ^ (14 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect error [3128]
 >>prepare s1 from SELECT OPERATORS OPERATORS from (values(0)) OPERATORS(OPERATORS);
 
-*** ERROR[3128] OPERATORS is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT OPERATORS OPERATORS from (values(0)) OPERATORS(OPERATORS);
-                         ^ (26 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect error [3128]
 >>prepare s1 from SELECT OTHERS OTHERS from (values(0)) OTHERS(OTHERS);
 
-*** ERROR[3128] OTHERS is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT OTHERS OTHERS from (values(0)) OTHERS(OTHERS);
-                   ^ (20 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect error [3128]
 >>prepare s1 from SELECT PAD PAD from (values(0)) PAD(PAD);
 
-*** ERROR[3128] PAD is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT PAD PAD from (values(0)) PAD(PAD);
-             ^ (14 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect error [3128]
 >>prepare s1 from SELECT PARAMETERS PARAMETERS from (values(0)) PARAMETERS(PARAMETERS);
 
-*** ERROR[3128] PARAMETERS is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT PARAMETERS PARAMETERS from (values(0)) PARAMETERS(PARAMETERS);
-                           ^ (28 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect error [3128]
 >>prepare s1 from SELECT PENDANT PENDANT from (values(0)) PENDANT(PENDANT);
 
-*** ERROR[3128] PENDANT is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT PENDANT PENDANT from (values(0)) PENDANT(PENDANT);
-                     ^ (22 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect error [3128]
 >>prepare s1 from SELECT PREORDER PREORDER from (values(0)) PREORDER(PREORDER);
 
-*** ERROR[3128] PREORDER is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT PREORDER PREORDER from (values(0)) PREORDER(PREORDER);
-                       ^ (24 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect error [3128]
 >>prepare s1 from SELECT PRESERVE PRESERVE from (values(0)) PRESERVE(PRESERVE);
 
-*** ERROR[3128] PRESERVE is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT PRESERVE PRESERVE from (values(0)) PRESERVE(PRESERVE);
-                       ^ (24 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect error [3128]
 >>prepare s1 from SELECT PRIOR PRIOR from (values(0)) PRIOR(PRIOR);
 
-*** ERROR[3128] PRIOR is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT PRIOR PRIOR from (values(0)) PRIOR(PRIOR);
-                 ^ (18 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect error [3128]
 >>prepare s1 from SELECT PRIVATE PRIVATE from (values(0)) PRIVATE(PRIVATE);
 
-*** ERROR[3128] PRIVATE is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT PRIVATE PRIVATE from (values(0)) PRIVATE(PRIVATE);
-                     ^ (22 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect error [15001]
 >>prepare s1 from SELECT PROTECTED PROTECTED from (values(0)) PROTECTED(PROTECTED);
@@ -919,50 +643,22 @@ SELECT PROTECTED PROTECTED from (values(0)) PROTECTED(PROTECTED);
 >>-- Expect error [3128]
 >>prepare s1 from SELECT REF REF from (values(0)) REF(REF);
 
-*** ERROR[3128] REF is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT REF REF from (values(0)) REF(REF);
-             ^ (14 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect error [3128]
 >>prepare s1 from SELECT REFERENCING REFERENCING from (values(0)) REFERENCING(REFERENCING);
 
-*** ERROR[3128] REFERENCING is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT REFERENCING REFERENCING from (values(0)) REFERENCING(REFERENCING);
-                             ^ (30 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect error [3128]
 >>prepare s1 from SELECT RELATIVE RELATIVE from (values(0)) RELATIVE(RELATIVE);
 
-*** ERROR[3128] RELATIVE is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT RELATIVE RELATIVE from (values(0)) RELATIVE(RELATIVE);
-                       ^ (24 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect error [3128]
 >>prepare s1 from SELECT RESIGNAL RESIGNAL from (values(0)) RESIGNAL(RESIGNAL);
 
-*** ERROR[3128] RESIGNAL is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT RESIGNAL RESIGNAL from (values(0)) RESIGNAL(RESIGNAL);
-                       ^ (24 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect error [3128]
 >>prepare s1 from SELECT RETURNS RETURNS from (values(0)) RETURNS(RETURNS);
@@ -977,14 +673,7 @@ SELECT RETURNS RETURNS from (values(0)) RETURNS(RETURNS);
 >>-- Expect error [3128]
 >>prepare s1 from SELECT ROUTINE ROUTINE from (values(0)) ROUTINE(ROUTINE);
 
-*** ERROR[3128] ROUTINE is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT ROUTINE ROUTINE from (values(0)) ROUTINE(ROUTINE);
-                     ^ (22 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect error [3128]
 >>prepare s1 from SELECT ROW ROW from (values(0)) ROW(ROW);
@@ -999,134 +688,57 @@ SELECT ROW ROW from (values(0)) ROW(ROW);
 >>-- Expect error [3128]
 >>prepare s1 from SELECT SAVEPOINT SAVEPOINT from (values(0)) SAVEPOINT(SAVEPOINT);
 
-*** ERROR[3128] SAVEPOINT is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT SAVEPOINT SAVEPOINT from (values(0)) SAVEPOINT(SAVEPOINT);
-                         ^ (26 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect error [3128]
 >>prepare s1 from SELECT SCROLL SCROLL from (values(0)) SCROLL(SCROLL);
 
-*** ERROR[3128] SCROLL is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT SCROLL SCROLL from (values(0)) SCROLL(SCROLL);
-                   ^ (20 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect error [3128]
 >>prepare s1 from SELECT SEARCH SEARCH from (values(0)) SEARCH(SEARCH);
 
-*** ERROR[3128] SEARCH is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT SEARCH SEARCH from (values(0)) SEARCH(SEARCH);
-                   ^ (20 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect error [3128]
 >>prepare s1 from SELECT SENSITIVE SENSITIVE from (values(0)) SENSITIVE(SENSITIVE);
 
-*** ERROR[3128] SENSITIVE is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT SENSITIVE SENSITIVE from (values(0)) SENSITIVE(SENSITIVE);
-                         ^ (26 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect error [3128]
 >>prepare s1 from SELECT SIGNAL SIGNAL from (values(0)) SIGNAL(SIGNAL);
 
-*** ERROR[3128] SIGNAL is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT SIGNAL SIGNAL from (values(0)) SIGNAL(SIGNAL);
-                   ^ (20 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect error [3128]
 >>prepare s1 from SELECT SIMILAR SIMILAR from (values(0)) SIMILAR(SIMILAR);
 
-*** ERROR[3128] SIMILAR is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT SIMILAR SIMILAR from (values(0)) SIMILAR(SIMILAR);
-                     ^ (22 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect error [3128]
 >>prepare s1 from SELECT SQLEXCEPTION SQLEXCEPTION from (values(0)) SQLEXCEPTION(SQLEXCEPTION);
 
-*** ERROR[3128] SQLEXCEPTION is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT SQLEXCEPTION SQLEXCEPTION from (values(0)) SQLEXCEPTION(SQLEXCEPTION);
-                               ^ (32 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect error [3128]
 >>prepare s1 from SELECT SQLSTATE SQLSTATE from (values(0)) SQLSTATE(SQLSTATE);
 
-*** ERROR[3128] SQLSTATE is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT SQLSTATE SQLSTATE from (values(0)) SQLSTATE(SQLSTATE);
-                       ^ (24 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect error [3128]
 >>prepare s1 from SELECT SQLWARNING SQLWARNING from (values(0)) SQLWARNING(SQLWARNING);
 
-*** ERROR[3128] SQLWARNING is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT SQLWARNING SQLWARNING from (values(0)) SQLWARNING(SQLWARNING);
-                           ^ (28 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect error [3128]
 >>prepare s1 from SELECT STRUCTURE STRUCTURE from (values(0)) STRUCTURE(STRUCTURE);
 
-*** ERROR[3128] STRUCTURE is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT STRUCTURE STRUCTURE from (values(0)) STRUCTURE(STRUCTURE);
-                         ^ (26 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect error [3128]
 >>prepare s1 from SELECT SYSTEM_USER SYSTEM_USER from (values(0)) SYSTEM_USER(SYSTEM_USER);
 
-*** ERROR[3128] SYSTEM_USER is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT SYSTEM_USER SYSTEM_USER from (values(0)) SYSTEM_USER(SYSTEM_USER);
-                             ^ (30 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect error [3128]
 >>prepare s1 from SELECT TEMPORARY TEMPORARY from (values(0)) TEMPORARY(TEMPORARY);
@@ -1141,86 +753,37 @@ SELECT TEMPORARY TEMPORARY from (values(0)) TEMPORARY(TEMPORARY);
 >>-- Expect error [3128]
 >>prepare s1 from SELECT TEST TEST from (values(0)) TEST(TEST);
 
-*** ERROR[3128] TEST is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT TEST TEST from (values(0)) TEST(TEST);
-               ^ (16 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect error [3128]
 >>prepare s1 from SELECT THERE THERE from (values(0)) THERE(THERE);
 
-*** ERROR[3128] THERE is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT THERE THERE from (values(0)) THERE(THERE);
-                 ^ (18 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
->>
->>-- Expect error [3128]
->>prepare s1 from SELECT TIMEZONE_HOUR TIMEZONE_HOUR from (values(0)) TIMEZONE_HOUR(TIMEZONE_HOUR);
-
-*** ERROR[3128] TIMEZONE_HOUR is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT TIMEZONE_HOUR TIMEZONE_HOUR from (values(0)) TIMEZONE_HOUR(TIMEZONE_HOUR
-                                 ^ (34 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
+--- SQL command prepared.
+>>
+>>-- Expect error [3128]
+>>prepare s1 from SELECT TIMEZONE_HOUR TIMEZONE_HOUR from (values(0)) TIMEZONE_HOUR(TIMEZONE_HOUR);
 
+--- SQL command prepared.
 >>
 >>-- Expect error [3128]
 >>prepare s1 from SELECT TIMEZONE_MINUTE TIMEZONE_MINUTE from (values(0)) TIMEZONE_MINUTE(TIMEZONE_MINUTE);
 
-*** ERROR[3128] TIMEZONE_MINUTE is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT TIMEZONE_MINUTE TIMEZONE_MINUTE from (values(0)) TIMEZONE_MINUTE(TIMEZON
-                                     ^ (38 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect error [3128]
 >>prepare s1 from SELECT TRANSLATION TRANSLATION from (values(0)) TRANSLATION(TRANSLATION);
 
-*** ERROR[3128] TRANSLATION is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT TRANSLATION TRANSLATION from (values(0)) TRANSLATION(TRANSLATION);
-                             ^ (30 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect error [3128]
 >>prepare s1 from SELECT TRIGGER TRIGGER from (values(0)) TRIGGER(TRIGGER);
 
-*** ERROR[3128] TRIGGER is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT TRIGGER TRIGGER from (values(0)) TRIGGER(TRIGGER);
-                     ^ (22 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect error [3128]
 >>prepare s1 from SELECT UNDER UNDER from (values(0)) UNDER(UNDER);
 
-*** ERROR[3128] UNDER is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT UNDER UNDER from (values(0)) UNDER(UNDER);
-                 ^ (18 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect error [3128]
 >>prepare s1 from SELECT USAGE USAGE from (values(0)) USAGE(USAGE);
@@ -1235,362 +798,152 @@ SELECT USAGE USAGE from (values(0)) USAGE(USAGE);
 >>-- Expect error [3128]
 >>prepare s1 from SELECT VARIABLE VARIABLE from (values(0)) VARIABLE(VARIABLE);
 
-*** ERROR[3128] VARIABLE is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT VARIABLE VARIABLE from (values(0)) VARIABLE(VARIABLE);
-                       ^ (24 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect error [3128]
 >>prepare s1 from SELECT VIRTUAL VIRTUAL from (values(0)) VIRTUAL(VIRTUAL);
 
-*** ERROR[3128] VIRTUAL is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT VIRTUAL VIRTUAL from (values(0)) VIRTUAL(VIRTUAL);
-                     ^ (22 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect error [3128]
 >>prepare s1 from SELECT VISIBLE VISIBLE from (values(0)) VISIBLE(VISIBLE);
 
-*** ERROR[3128] VISIBLE is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT VISIBLE VISIBLE from (values(0)) VISIBLE(VISIBLE);
-                     ^ (22 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect error [3128]
 >>prepare s1 from SELECT WAIT WAIT from (values(0)) WAIT(WAIT);
 
-*** ERROR[3128] WAIT is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT WAIT WAIT from (values(0)) WAIT(WAIT);
-               ^ (16 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect error [3128]
 >>prepare s1 from SELECT WHILE WHILE from (values(0)) WHILE(WHILE);
 
-*** ERROR[3128] WHILE is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT WHILE WHILE from (values(0)) WHILE(WHILE);
-                 ^ (18 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect error [3128]
 >>prepare s1 from SELECT ZONE ZONE from (values(0)) ZONE(ZONE);
 
-*** ERROR[3128] ZONE is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT ZONE ZONE from (values(0)) ZONE(ZONE);
-               ^ (16 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect error [3128]
 >>prepare s1 from SELECT CAST CAST from (values(0)) CAST(CAST);
 
-*** ERROR[3128] CAST is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT CAST CAST from (values(0)) CAST(CAST);
-               ^ (16 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect error [3128]
 >>prepare s1 from SELECT CHARACTER_LENGTH CHARACTER_LENGTH from (values(0)) CHARACTER_LENGTH(CHARACTER_LENGTH);
 
-*** ERROR[3128] CHARACTER_LENGTH is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT CHARACTER_LENGTH CHARACTER_LENGTH from (values(0)) CHARACTER_LENGTH(CHAR
-                                       ^ (40 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect error [3128]
 >>prepare s1 from SELECT CHAR_LENGTH CHAR_LENGTH from (values(0)) CHAR_LENGTH(CHAR_LENGTH);
 
-*** ERROR[3128] CHAR_LENGTH is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT CHAR_LENGTH CHAR_LENGTH from (values(0)) CHAR_LENGTH(CHAR_LENGTH);
-                             ^ (30 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect error [3128]
 >>prepare s1 from SELECT DOUBLE DOUBLE from (values(0)) DOUBLE(DOUBLE);
 
-*** ERROR[3128] DOUBLE is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT DOUBLE DOUBLE from (values(0)) DOUBLE(DOUBLE);
-                   ^ (20 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect error [3128]
 >>prepare s1 from SELECT ELSE ELSE from (values(0)) ELSE(ELSE);
 
-*** ERROR[3128] ELSE is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT ELSE ELSE from (values(0)) ELSE(ELSE);
-               ^ (16 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect error [3128]
 >>prepare s1 from SELECT END END from (values(0)) END(END);
 
-*** ERROR[3128] END is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT END END from (values(0)) END(END);
-             ^ (14 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect error [3128]
 >>prepare s1 from SELECT FLOAT FLOAT from (values(0)) FLOAT(FLOAT);
 
-*** ERROR[3128] FLOAT is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT FLOAT FLOAT from (values(0)) FLOAT(FLOAT);
-                 ^ (18 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect error [3128]
 >>prepare s1 from SELECT LOWER LOWER from (values(0)) LOWER(LOWER);
 
-*** ERROR[3128] LOWER is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT LOWER LOWER from (values(0)) LOWER(LOWER);
-                 ^ (18 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect error [3128]
 >>prepare s1 from SELECT MIN MIN from (values(0)) MIN(MIN);
 
-*** ERROR[3128] MIN is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT MIN MIN from (values(0)) MIN(MIN);
-             ^ (14 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect error [3128]
 >>prepare s1 from SELECT NATIONAL NATIONAL from (values(0)) NATIONAL(NATIONAL);
 
-*** ERROR[3128] NATIONAL is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT NATIONAL NATIONAL from (values(0)) NATIONAL(NATIONAL);
-                       ^ (24 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect error [3128]
 >>prepare s1 from SELECT NCHAR NCHAR from (values(0)) NCHAR(NCHAR);
 
-*** ERROR[3128] NCHAR is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT NCHAR NCHAR from (values(0)) NCHAR(NCHAR);
-                 ^ (18 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect error [3128]
 >>prepare s1 from SELECT OCTET_LENGTH OCTET_LENGTH from (values(0)) OCTET_LENGTH(OCTET_LENGTH);
 
-*** ERROR[3128] OCTET_LENGTH is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT OCTET_LENGTH OCTET_LENGTH from (values(0)) OCTET_LENGTH(OCTET_LENGTH);
-                               ^ (32 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect error [3128]
 >>prepare s1 from SELECT POSITION POSITION from (values(0)) POSITION(POSITION);
 
-*** ERROR[3128] POSITION is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT POSITION POSITION from (values(0)) POSITION(POSITION);
-                       ^ (24 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect error [3128]
 >>prepare s1 from SELECT PRECISION PRECISION from (values(0)) PRECISION(PRECISION);
 
-*** ERROR[3128] PRECISION is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT PRECISION PRECISION from (values(0)) PRECISION(PRECISION);
-                         ^ (26 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect error [3128]
 >>prepare s1 from SELECT REAL REAL from (values(0)) REAL(REAL);
 
-*** ERROR[3128] REAL is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT REAL REAL from (values(0)) REAL(REAL);
-               ^ (16 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect error [3128]
 >>prepare s1 from SELECT SUBSTRING SUBSTRING from (values(0)) SUBSTRING(SUBSTRING);
 
-*** ERROR[3128] SUBSTRING is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT SUBSTRING SUBSTRING from (values(0)) SUBSTRING(SUBSTRING);
-                         ^ (26 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect error [3128]
 >>prepare s1 from SELECT SQL_FLOAT SQL_FLOAT from (values(0)) SQL_FLOAT(SQL_FLOAT);
 
-*** ERROR[3128] SQL_FLOAT is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT SQL_FLOAT SQL_FLOAT from (values(0)) SQL_FLOAT(SQL_FLOAT);
-                         ^ (26 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect error [3128]
 >>prepare s1 from SELECT SQL_REAL SQL_REAL from (values(0)) SQL_REAL(SQL_REAL);
 
-*** ERROR[3128] SQL_REAL is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT SQL_REAL SQL_REAL from (values(0)) SQL_REAL(SQL_REAL);
-                       ^ (24 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect error [3128]
 >>prepare s1 from SELECT SQL_VARCHAR SQL_VARCHAR from (values(0)) SQL_VARCHAR(SQL_VARCHAR);
 
-*** ERROR[3128] SQL_VARCHAR is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT SQL_VARCHAR SQL_VARCHAR from (values(0)) SQL_VARCHAR(SQL_VARCHAR);
-                             ^ (30 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect error [3128]
 >>prepare s1 from SELECT TRIM TRIM from (values(0)) TRIM(TRIM);
 
-*** ERROR[3128] TRIM is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT TRIM TRIM from (values(0)) TRIM(TRIM);
-               ^ (16 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect error [3128]
 >>prepare s1 from SELECT UPPER UPPER from (values(0)) UPPER(UPPER);
 
-*** ERROR[3128] UPPER is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT UPPER UPPER from (values(0)) UPPER(UPPER);
-                 ^ (18 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect error [3128]
 >>prepare s1 from SELECT UPSHIFT UPSHIFT from (values(0)) UPSHIFT(UPSHIFT);
 
-*** ERROR[3128] UPSHIFT is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT UPSHIFT UPSHIFT from (values(0)) UPSHIFT(UPSHIFT);
-                     ^ (22 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect error [3128]
 >>prepare s1 from SELECT VARCHAR VARCHAR from (values(0)) VARCHAR(VARCHAR);
 
-*** ERROR[3128] VARCHAR is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT VARCHAR VARCHAR from (values(0)) VARCHAR(VARCHAR);
-                     ^ (22 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect error [3128]
 >>prepare s1 from SELECT VARYING VARYING from (values(0)) VARYING(VARYING);
 
-*** ERROR[3128] VARYING is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT VARYING VARYING from (values(0)) VARYING(VARYING);
-                     ^ (22 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect SYNTAX error
 >>prepare s1 from SELECT COLLATE COLLATE from (values(0)) COLLATE(COLLATE);
@@ -2077,7 +1430,7 @@ SELECT EXTRACT EXTRACT from (values(0)) EXTRACT(EXTRACT);
 
 *** ERROR[15001] A syntax error occurred at or before: 
 SELECT FALSE FALSE from (values(0)) FALSE(FALSE);
-           ^ (12 characters from start of SQL statement)
+                 ^ (18 characters from start of SQL statement)
 
 *** ERROR[8822] The statement was not prepared.
 
@@ -2235,14 +1588,7 @@ SELECT ISOLATION ISOLATION from (values(0)) ISOLATION(ISOLATION);
 >>-- Expect SYNTAX error
 >>prepare s1 from SELECT LANGUAGE LANGUAGE from (values(0)) LANGUAGE(LANGUAGE);
 
-*** ERROR[3128] LANGUAGE is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT LANGUAGE LANGUAGE from (values(0)) LANGUAGE(LANGUAGE);
-                       ^ (24 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect SYNTAX error
 >>prepare s1 from SELECT LAST LAST from (values(0)) LAST(LAST);
@@ -2734,7 +2080,7 @@ SELECT TRANSPOSE TRANSPOSE from (values(0)) TRANSPOSE(TRANSPOSE);
 
 *** ERROR[15001] A syntax error occurred at or before: 
 SELECT TRUE TRUE from (values(0)) TRUE(TRUE);
-          ^ (11 characters from start of SQL statement)
+               ^ (16 characters from start of SQL statement)
 
 *** ERROR[8822] The statement was not prepared.
 
@@ -2772,14 +2118,7 @@ SELECT USING USING from (values(0)) USING(USING);
 >>-- Expect SYNTAX error
 >>prepare s1 from SELECT VALUE VALUE from (values(0)) VALUE(VALUE);
 
-*** ERROR[3128] VALUE is a reserved word.  It must be delimited by double-quotes to be used as an identifier.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-SELECT VALUE VALUE from (values(0)) VALUE(VALUE);
-                 ^ (18 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>-- Expect SYNTAX error
 >>prepare s1 from SELECT WHENEVER WHENEVER from (values(0)) WHENEVER(WHENEVER);

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/regress/core/EXPECTED038.LINUX
----------------------------------------------------------------------
diff --git a/core/sql/regress/core/EXPECTED038.LINUX b/core/sql/regress/core/EXPECTED038.LINUX
index 80b9c0e..2d33c7a 100644
--- a/core/sql/regress/core/EXPECTED038.LINUX
+++ b/core/sql/regress/core/EXPECTED038.LINUX
@@ -2748,7 +2748,7 @@ B1
 --- 0 row(s) selected.
 >>select * from T038b where b1 < cast('1997-28-02' as DATE) + interval '2' day;
 
-*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data 1997-28-02
+*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data: 1997-28-02
 
 --- 0 row(s) selected.
 >>


[3/6] incubator-trafodion git commit: JIRA TRAFODION-2180 enable/externalize non-ansi sql syntax/functionality

Posted by su...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/regress/core/EXPECTED056.SB
----------------------------------------------------------------------
diff --git a/core/sql/regress/core/EXPECTED056.SB b/core/sql/regress/core/EXPECTED056.SB
index 231172d..9ea76a1 100755
--- a/core/sql/regress/core/EXPECTED056.SB
+++ b/core/sql/regress/core/EXPECTED056.SB
@@ -2162,7 +2162,7 @@ A1
 +>                      i2 numeric(18,7) default 69, 
 +>                      i3 largeint default 39 
 +>                        primary key desc not null)
-+>                      location $$partition$$;
++>                      location $DATA;
 
 --- SQL operation complete.
 >>
@@ -2172,7 +2172,7 @@ A1
 +>                      s0Integer PIC S9(4) default 85 not null,
 +>                      i1 decimal(18) default 12734 not null)
 +>                      store by primary key
-+>                      location $$partition2$$;
++>                      location $DATA2;
 
 --- SQL operation complete.
 >>
@@ -2267,7 +2267,7 @@ I1                    I2                     I3                    S0INTEGER
 +>                      i2 numeric(18,7) default 69, 
 +>                      i3 largeint default 39 
 +>                        primary key desc not null)
-+>                      location $$partition$$;
++>                      location $DATA;
 
 --- SQL operation complete.
 >>
@@ -2277,7 +2277,7 @@ I1                    I2                     I3                    S0INTEGER
 +>                      s0Integer PIC S9(4) default 85 not null,
 +>                      i1 decimal(18) default 12734 not null)
 +>                      store by primary key
-+>                      location $$partition2$$;
++>                      location $DATA2;
 
 --- SQL operation complete.
 >>
@@ -2362,7 +2362,7 @@ I1                    I2                     I3                    S0INTEGER
 +>                      i2 numeric(18,7) default 69, 
 +>                      i3 largeint default 39 
 +>                        primary key desc not null)
-+>                      location $$partition$$;
++>                      location $DATA;
 
 --- SQL operation complete.
 >>
@@ -2372,7 +2372,7 @@ I1                    I2                     I3                    S0INTEGER
 +>                      s0Integer PIC S9(4) default 85 not null,
 +>                      i1 decimal(18) default 12734 not null)
 +>                      store by primary key
-+>                      location $$partition2$$;
++>                      location $DATA2;
 
 --- SQL operation complete.
 >>
@@ -2444,7 +2444,7 @@ I1                    I2                     I3                    S0INTEGER
 +>                      i2 numeric(18,7) default 69, 
 +>                      i3 largeint default 39 
 +>                        primary key desc not null)
-+>                      location $$partition$$;
++>                      location $DATA;
 
 --- SQL operation complete.
 >>
@@ -2454,7 +2454,7 @@ I1                    I2                     I3                    S0INTEGER
 +>                      s0Integer PIC S9(4) default 85 not null,
 +>                      i1 decimal(18) default 12734 not null)
 +>                      store by primary key
-+>                      location $$partition2$$;
++>                      location $DATA2;
 
 --- SQL operation complete.
 >>
@@ -2549,7 +2549,7 @@ I1                    I2                     I3                    S0INTEGER
 +>                      i2 numeric(18,7) default 69, 
 +>                      i3 largeint default 39 
 +>                        primary key desc not null)
-+>                      location $$partition$$;
++>                      location $DATA;
 
 --- SQL operation complete.
 >>
@@ -2559,7 +2559,7 @@ I1                    I2                     I3                    S0INTEGER
 +>                      s0Integer PIC S9(4) default 85 not null,
 +>                      i1 decimal(18) default 12734 not null)
 +>                      store by primary key
-+>                      location $$partition2$$;
++>                      location $DATA2;
 
 --- SQL operation complete.
 >>
@@ -2644,7 +2644,7 @@ I1                    I2                     I3                    S0INTEGER
 +>                      i2 numeric(18,7) default 69, 
 +>                      i3 largeint default 39 
 +>                        primary key desc not null)
-+>                      location $$partition$$;
++>                      location $DATA;
 
 --- SQL operation complete.
 >>
@@ -2654,7 +2654,7 @@ I1                    I2                     I3                    S0INTEGER
 +>                      s0Integer PIC S9(4) default 85 not null,
 +>                      i1 decimal(18) default 12734 not null)
 +>                      store by primary key
-+>                      location $$partition2$$;
++>                      location $DATA2;
 
 --- SQL operation complete.
 >>
@@ -2756,7 +2756,7 @@ I2
 +>    a1 decimal (18) not null not droppable,
 +>    a2 numeric (9, 2) default 49,
 +>    a4 decimal (9,0) ) 
-+>    location $$partition2$$
++>    location $DATA2
 +>    store by (a1 asc);
 
 --- SQL operation complete.
@@ -2817,7 +2817,7 @@ I2
 +>    a1 decimal (18) not null not droppable,
 +>    a2 numeric (9, 2) default 49,
 +>    a4 decimal (9,0) ) 
-+>    location $$partition2$$
++>    location $DATA2
 +>    store by (a1 asc);
 
 --- SQL operation complete.

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/regress/core/EXPECTED061.SB
----------------------------------------------------------------------
diff --git a/core/sql/regress/core/EXPECTED061.SB b/core/sql/regress/core/EXPECTED061.SB
index f25fb2a..f7312fd 100755
--- a/core/sql/regress/core/EXPECTED061.SB
+++ b/core/sql/regress/core/EXPECTED061.SB
@@ -98,8 +98,8 @@ ab   4    abcdefghijklmnopqrstu  1
 >>-- the NCHAR default value bug; reproduced here to avoid breaking it again.
 >>create table  t104t2 (c char(15) not null, d int not null,
 +>                      primary key (c, d))
-+>  range partition (add first key ('Mickey''s', 2) location $$partition$$,
-+>                   add first key ('sad"story', 10) location $$partition2$$);
++>  range partition (add first key ('Mickey''s', 2) location $DATA,
++>                   add first key ('sad"story', 10) location $DATA1);
 
 --- SQL operation complete.
 >>invoke t104t2;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/regress/core/TEST056
----------------------------------------------------------------------
diff --git a/core/sql/regress/core/TEST056 b/core/sql/regress/core/TEST056
index 8629a17..cb414f0 100755
--- a/core/sql/regress/core/TEST056
+++ b/core/sql/regress/core/TEST056
@@ -78,22 +78,22 @@ create table T056t10 (swallow int default 121 not null ,
                       barnowl int default 1000 not null);
 
 create unique index T056in5 on T056t10 (barnowl) 
-       location $$partition$$ 
+       location $DATA 
        range partition (
-        add first key 150 location $$partition$$,
-        add first key 180 location $$partition$$)
+        add first key 150 location $DATA,
+        add first key 180 location $DATA)
 ; 
 
 create table T056t11 (wren int not null , 
   junco int not null ,
   blackbird int,
   primary key(wren,junco) )
-      location $$partition2$$
+      location $DATA2
       range partition (
-        add first key (30)  location $$partition2$$,
-        add first key (170) location $$partition2$$,
-        add first key (190) location $$partition2$$,
-        add first key (300) location $$partition2$$)
+        add first key (30)  location $DATA2,
+        add first key (170) location $DATA2,
+        add first key (190) location $DATA2,
+        add first key (300) location $DATA2)
 ;
 
 insert into T056t11 values (1,11,111),(3,13,113),(5,15,115)
@@ -102,10 +102,10 @@ insert into T056t11 values (1,11,111),(3,13,113),(5,15,115)
 
 create unique index T056in6 on T056t11 (blackbird) 
 #ifMX
-       location $$partition2$$ 
+       location $DATA2 
        range partition (
-        add first key 150 location $$partition2$$,
-        add first key 180 location $$partition2$$)
+        add first key 150 location $DATA2,
+        add first key 180 location $DATA2)
 #ifMX
 ;
 
@@ -841,7 +841,7 @@ create table t056t62 (i1 numeric(18) default 71 not null,
                       i2 numeric(18,7) default 69, 
                       i3 largeint default 39 
                         primary key desc not null)
-                      location $$partition$$;
+                      location $DATA;
 					  
 create table t056t63 (i2 numeric (7,0)
                         primary key desc not null,
@@ -849,7 +849,7 @@ create table t056t63 (i2 numeric (7,0)
                       s0Integer PIC S9(4) default 85 not null,
                       i1 decimal(18) default 12734 not null)
                       store by primary key
-                      location $$partition2$$;
+                      location $DATA2;
 					  
 ?section test4data	
 insert into t056t62 values (204, 1.3815032111910257E9, 33);
@@ -931,7 +931,7 @@ create table t056t5 (
     a1 decimal (18) not null not droppable,
     a2 numeric (9, 2) default 49,
     a4 decimal (9,0) ) 
-    location $$partition2$$
+    location $DATA2
     store by (a1 asc);
 insert into t056t5 values ( 1, 66.22, null); 
 alter table t056t5 add column b1 decimal (18) default 1580 not null not droppable;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/regress/core/TEST061
----------------------------------------------------------------------
diff --git a/core/sql/regress/core/TEST061 b/core/sql/regress/core/TEST061
index 218e889..2949e19 100755
--- a/core/sql/regress/core/TEST061
+++ b/core/sql/regress/core/TEST061
@@ -76,8 +76,8 @@ select * from t101t2;
 -- the NCHAR default value bug; reproduced here to avoid breaking it again.
 create table  t104t2 (c char(15) not null, d int not null,
                       primary key (c, d))
-  range partition (add first key ('Mickey''s', 2) location $$partition$$,
-                   add first key ('sad"story', 10) location $$partition2$$);
+  range partition (add first key ('Mickey''s', 2) location $DATA,
+                   add first key ('sad"story', 10) location $DATA1);
 invoke t104t2;
 showddl t104t2;
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/regress/core/cidefs
----------------------------------------------------------------------
diff --git a/core/sql/regress/core/cidefs b/core/sql/regress/core/cidefs
deleted file mode 100755
index 32f080f..0000000
--- a/core/sql/regress/core/cidefs
+++ /dev/null
@@ -1,135 +0,0 @@
---	This is the sqlci analogue of the shell-script "setupenv".
---
--- @@@ 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 @@@
-
-set SCHEMA $$TEST_SCHEMA$$;
-control query default HIST_USE_SAMPLE_FOR_CARDINALITY_ESTIMATION  'ON';
-control query default HIST_ON_DEMAND_STATS_SIZE '10000';
-
--- Define a standard physical environment for the compiler:
-control query default TARGET_CODE 'DEBUG';
-control query default TARGET_CPU_FREQUENCY '199.';
-control query default TARGET_IO_SEEK_TIME '0.020147';
-control query default TARGET_IO_SEQ_READ_RATE '2.5';
-control query default TARGET_MSG_LOCAL_RATE '10.';
-control query default TARGET_MSG_LOCAL_TIME '0.000125';
-control query default TARGET_MSG_REMOTE_RATE '100.';
-control query default TARGET_MSG_REMOTE_TIME  '0.00125';
-control query default SKIP_METADATA_VIEWS 'ON';
-
-control query default ARKCMP_FAKE_HW 'ON';
-
-#ifMX
-control query default REF_CONSTRAINT_NO_ACTION_LIKE_RESTRICT 'ON';
-#ifMX
-
-control query default DEF_NUM_SMP_CPUS
-#ifMX
-'2'
-#ifMX
-#ifMP
-'1'
-#ifMP
-;
-
-control query default MAX_ESPS_PER_CPU_PER_OP '1';
-
-control query default DEF_NUM_NODES_IN_ACTIVE_CLUSTERS
-#ifMX
-'1'
-#ifMX
-#ifMP
-'2'
-#ifMP
-;
-
--- Suppress the Row Format information from the SHOWDDL output so
--- we don't have to update hundreds of existing Expected Results
--- files in our regression test suites.  'OFF' is the default.
-control query default SQLMX_SHOWDDL_SUPPRESS_ROW_FORMAT 'ON';
-
--- this is the datavol location of the second partition
--- for partitioned tables.
-#ifNSK
-set pattern $$partition$$  $DATA04;
-set pattern $$partition1$$ $DATA01;
-set pattern $$partition2$$ $DATA03;
-set pattern $$partition3$$ $DATA05;
-set pattern $$TrigTempTablePartition$$ '''$DATA03:$DATA04,$DATA05:$DATA01''';
-
-#ifNSK
-
-#ifNT
-set pattern $$partition$$ $DATA;
-set pattern $$partition1$$ $DATA1;
-set pattern $$partition2$$ $DATA2;
-set pattern $$partition3$$ $SYSTEM;
-set pattern $$partition4$$ $DATA3;
-set pattern $$TrigTempTablePartition$$ '''$system:$data1,$data2:$data''';
-
-#ifNT
-
--- This pattern is needed for both NSK and NT to handle the quote in Metadata
--- queries
-set pattern $$quote$$ '''';
-
--- Specify a unique 3-alphanumeric-character identifier
--- (e.g. your initial).  The first character must be a letter.
--- The id will be used by the test run to form the subvolume
--- name for the location of a schema, the name of a partition,
--- etc.  So more than one user can run the same test
--- simultaneously even when it accesses the same disk.
-set pattern $$runid$$ VPR;
-
--- This CQD is added for creating a table  with no
--- partition or primary key when the POS is enabled.
-control query default POS_ALLOW_NON_PK_TABLES 'ON';
-
---control query default detailed_statistics 'ALL';
-
--- eof
-
--- Only on a Linux cluster
-#ifdef CLUSTERNAME
-set pattern $$partition$$  $DB0000;
-set pattern $$partition0$$ $DB0000;
-set pattern $$partition1$$ $DB0001;
-set pattern $$partition2$$ $DB0002;
-set pattern $$partition3$$ $DB0003;
-set pattern $$partition4$$ $DB0004;
-set pattern $$partition5$$ $DB0005;
-set pattern $$partition6$$ $DB0006;
-set pattern $$partition7$$ $DB0007;
-set pattern $$partition8$$ $DB0008;
-set pattern $$audit_vol$$  $AUD000;
-set pattern $$PosTablePartition$$ '''$DB0000''';
-set pattern $$PosTablePartitions2$$ '''$DB0001, $DB0002''';
-set pattern $$PosTablePartitions3$$ '''$DB0003, $DB0004, $DB0005''';
-set pattern $$PosTablePartitions4$$ '''$DB0006, $DB0007, $DB0008, $DB0009''';
-set pattern $$TrigTempTablePartition$$ '''$DB0003:$DB0004,$DB0005:$DB0001''';
-set pattern $$TrigTempTablePartition1$$ '''$DB0001: $DB0004''';
-set pattern $$TrigTempTablePartition2$$ '''$DB0001''';
-set pattern $$TrigTempTablePartition3$$ '''$DB0004''';
-set pattern $$TrigTempTablePartition4$$ '''$DB0001, $DB0004,$NINEX: $DB0005''';
-set pattern $$TrigTempTablePartition5$$ '''$DB0005, $DB0005, $DB0005: $DB0005, $DB0005''';
-set pattern $$TrigTempTablePartition6$$ '''$DB0001,XXXX64 $DB0005''';
-#endif

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/regress/executor/EXPECTED001
----------------------------------------------------------------------
diff --git a/core/sql/regress/executor/EXPECTED001 b/core/sql/regress/executor/EXPECTED001
index 26e1f4e..38fd155 100755
--- a/core/sql/regress/executor/EXPECTED001
+++ b/core/sql/regress/executor/EXPECTED001
@@ -33,7 +33,7 @@
 >>invoke t001t1;
 
 -- Definition of Trafodion table TRAFODION.SCH.T001T1
--- Definition current  Thu Feb 25 07:44:34 2016
+-- Definition current  Tue Aug  9 03:54:49 2016
 
   (
     SYSKEY                           LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -54,7 +54,7 @@
 >>invoke t001t2;
 
 -- Definition of Trafodion table TRAFODION.SCH.T001T2
--- Definition current  Thu Feb 25 07:44:36 2016
+-- Definition current  Tue Aug  9 03:54:50 2016
 
   (
     A                                INT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -70,7 +70,7 @@
 >>invoke t001t3;
 
 -- Definition of Trafodion table TRAFODION.SCH.T001T3
--- Definition current  Thu Feb 25 07:44:38 2016
+-- Definition current  Tue Aug  9 03:54:50 2016
 
   (
     A                                INT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -88,7 +88,7 @@
 >>invoke $$TEST_SCHEMA$$.t001ut1;
 
 -- Definition of Trafodion table TRAFODION.SCH.T001UT1
--- Definition current  Thu Feb 25 07:44:38 2016
+-- Definition current  Tue Aug  9 03:54:50 2016
 
   (
     SYSKEY                           LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -104,7 +104,7 @@
 >>invoke $$TEST_SCHEMA_NAME$$.t001ut2;
 
 -- Definition of Trafodion table TRAFODION.SCH.T001UT2
--- Definition current  Thu Feb 25 07:44:39 2016
+-- Definition current  Tue Aug  9 03:54:50 2016
 
   (
     A                                INT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -120,7 +120,7 @@
 >>invoke         t001ut3;
 
 -- Definition of Trafodion table TRAFODION.SCH.T001UT3
--- Definition current  Thu Feb 25 07:44:40 2016
+-- Definition current  Tue Aug  9 03:54:51 2016
 
   (
     A                                INT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -226,10 +226,13 @@ A            B                   C            D
 >>-- Error case
 >>select 0, '0' + 1 from t001t1;
 
-*** ERROR[4034] The operation (CHAR(1) + NUMERIC(1))  is not allowed.
+(EXPR)  (EXPR)              
+------  --------------------
 
-*** ERROR[8822] The statement was not prepared.
+     0                     1
+     0                     1
 
+--- 2 row(s) selected.
 >>-- should get type incompatibility error
 >>
 >>select cast(b as ansivarchar(8)) from t001t1;
@@ -357,10 +360,13 @@ A            B          C            D
 >>#ifMX
 >>select 0, N'0' + 1 from t001ut1;
 
-*** ERROR[4034] The operation (CHAR(1) + NUMERIC(1))  is not allowed.
+(EXPR)  (EXPR)              
+------  --------------------
 
-*** ERROR[8822] The statement was not prepared.
+     0                     1
+     0                     1
 
+--- 2 row(s) selected.
 >>-- should get type incompatibility error
 >>
 >>select * from (select * from t001ut1) x;
@@ -471,10 +477,9 @@ select a from t001t1 where b like _SJIS'sj';
 
 >>select a from t001t1 where trim(b from 2) = '';
 
-*** ERROR[4133] Both trim character and source have to be CHARACTER typed.
-
-*** ERROR[8822] The statement was not prepared.
+*** ERROR[8404] The trim character argument of function TRIM must be one character in length.
 
+--- 0 row(s) selected.
 >>
 >>-- comment out because of the behavior change to NATIONAL_CHARSET in R2.
 >>-- It is a read-only CQD.

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/regress/executor/EXPECTED013.SB
----------------------------------------------------------------------
diff --git a/core/sql/regress/executor/EXPECTED013.SB b/core/sql/regress/executor/EXPECTED013.SB
index da6f64b..08e8b07 100644
--- a/core/sql/regress/executor/EXPECTED013.SB
+++ b/core/sql/regress/executor/EXPECTED013.SB
@@ -21,7 +21,7 @@
 >>invoke t013t1;
 
 -- Definition of Trafodion table TRAFODION.T013_SCH.T013T1
--- Definition current  Tue May 24 21:30:23 2016
+-- Definition current  Sun Aug 21 05:08:36 2016
 
   (
     SYSKEY                           LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -50,7 +50,7 @@ A
 >>invoke t013t1;
 
 -- Definition of Trafodion volatile table T013T1
--- Definition current  Tue May 24 21:30:37 2016
+-- Definition current  Sun Aug 21 05:08:59 2016
 
   (
     A                                INT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -115,7 +115,7 @@ A
 >>invoke t013t1;
 
 -- Definition of Trafodion table TRAFODION.T013_SCH.T013T1
--- Definition current  Tue May 24 21:31:43 2016
+-- Definition current  Sun Aug 21 05:10:25 2016
 
   (
     SYSKEY                           LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -141,7 +141,7 @@ A
 >>invoke t013t1;
 
 -- Definition of Trafodion volatile table T013T1
--- Definition current  Tue May 24 21:32:04 2016
+-- Definition current  Sun Aug 21 05:10:55 2016
 
   (
     A                                INT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -181,7 +181,7 @@ A            B            C
 >>invoke t013t1;
 
 -- Definition of Trafodion table TRAFODION.T013_SCH.T013T1
--- Definition current  Tue May 24 21:32:16 2016
+-- Definition current  Sun Aug 21 05:11:11 2016
 
   (
     SYSKEY                           LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -204,7 +204,7 @@ A
 >>invoke t013t1;
 
 -- Definition of Trafodion volatile table T013T1
--- Definition current  Tue May 24 21:32:22 2016
+-- Definition current  Sun Aug 21 05:11:30 2016
 
   (
     A                                INT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -430,28 +430,12 @@ CREATE VIEW TRAFODION.T013_SCH.TEMPV AS
 
 CONTROL QUERY DEFAULT
   SHOWCONTROL_SHOW_ALL          	OFF
-  TARGET_CODE                   	DEBUG
-  TARGET_CPU_FREQUENCY          	199.
-  TARGET_IO_SEEK_TIME           	0.020147
-  TARGET_IO_SEQ_READ_RATE       	2.5
-  TARGET_MSG_LOCAL_RATE         	10.
-  TARGET_MSG_LOCAL_TIME         	0.000125
-  TARGET_MSG_REMOTE_RATE        	100.
-  TARGET_MSG_REMOTE_TIME        	0.00125
-  ARKCMP_FAKE_HW                	ON
-  SKIP_METADATA_VIEWS           	ON
-  DEF_NUM_SMP_CPUS              	2
-  MAX_ESPS_PER_CPU_PER_OP       	1
-  DEF_NUM_NODES_IN_ACTIVE_CLUSTERS	1
-  POS_ALLOW_NON_PK_TABLES       	ON
   MODE_SEABASE                  	ON
   SEABASE_VOLATILE_TABLES       	ON
   HBASE_SERIALIZATION           	ON
   HBASE_SMALL_SCANNER           	SYSTEM
   HBASE_FILTER_PREDS            	2
   TRAF_INDEX_CREATE_OPT         	ON
-  TRAF_READ_OBJECT_DESC         	ON
-  TRAF_STORE_OBJECT_DESC        	ON
   HBASE_ASYNC_DROP_TABLE        	OFF
   POS                           	OFF
   SCHEMA                        	TRAFODION.T013_SCH
@@ -464,7 +448,7 @@ CONTROL QUERY DEFAULT
 >>invoke t013t1;
 
 -- Definition of Trafodion table TRAFODION.T013_SCH.T013T1
--- Definition current  Tue May 24 21:33:35 2016
+-- Definition current  Sun Aug 21 05:13:08 2016
 
   (
     SYSKEY                           LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -485,7 +469,7 @@ CONTROL QUERY DEFAULT
 >>invoke t013t1;
 
 -- Definition of Trafodion table TRAFODION.T013_SCH.T013T1
--- Definition current  Tue May 24 21:33:43 2016
+-- Definition current  Sun Aug 21 05:13:19 2016
 
   (
     SYSKEY                           LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -577,7 +561,7 @@ control query shape nested_join(anything,anything);
 >>invoke t013t3;
 
 -- Definition of Trafodion table TRAFODION.T013SCH1.T013T3
--- Definition current  Tue May 24 21:34:35 2016
+-- Definition current  Sun Aug 21 05:14:35 2016
 
   (
     SYSKEY                           LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -595,7 +579,7 @@ control query shape nested_join(anything,anything);
 >>invoke t013t3;
 
 -- Definition of Trafodion volatile table T013T3
--- Definition current  Tue May 24 21:34:42 2016
+-- Definition current  Sun Aug 21 05:14:51 2016
 
   (
     A                                INT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -611,7 +595,7 @@ control query shape nested_join(anything,anything);
 >>invoke t013t3;
 
 -- Definition of Trafodion table TRAFODION.T013SCH1.T013T3
--- Definition current  Tue May 24 21:34:55 2016
+-- Definition current  Sun Aug 21 05:15:07 2016
 
   (
     SYSKEY                           LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -677,7 +661,7 @@ CREATE VOLATILE TABLE T013T3
 >>invoke t013t3;
 
 -- Definition of Trafodion table TRAFODION.T013SCH1.T013T3
--- Definition current  Tue May 24 21:35:47 2016
+-- Definition current  Sun Aug 21 05:16:08 2016
 
   (
     SYSKEY                           LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -1299,7 +1283,7 @@ CREATE VOLATILE TABLE T013T1
 >>invoke t013t1;
 
 -- Definition of Trafodion table TRAFODION.T013_SCH.T013T1
--- Definition current  Tue May 24 21:42:50 2016
+-- Definition current  Sun Aug 21 05:25:42 2016
 
   (
     SYSKEY                           LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/regress/executor/EXPECTED014.SB
----------------------------------------------------------------------
diff --git a/core/sql/regress/executor/EXPECTED014.SB b/core/sql/regress/executor/EXPECTED014.SB
index 2615fc5..22727a6 100755
--- a/core/sql/regress/executor/EXPECTED014.SB
+++ b/core/sql/regress/executor/EXPECTED014.SB
@@ -406,7 +406,7 @@ A            B
 >>-- datatype of AS query columns and target tables must match
 >>create table t014t1t (a char(10), b date) as select * from t014t1s;
 
-*** ERROR[4039] Column A is of type CHAR(10), incompatible with the value's type, INTEGER.
+*** ERROR[4035] Type INTEGER cannot be cast to type DATE.
 
 *** ERROR[8822] The statement was not prepared.
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/regress/executor/EXPECTED020
----------------------------------------------------------------------
diff --git a/core/sql/regress/executor/EXPECTED020 b/core/sql/regress/executor/EXPECTED020
index c64a9d5..a41f8e8 100644
--- a/core/sql/regress/executor/EXPECTED020
+++ b/core/sql/regress/executor/EXPECTED020
@@ -3,6 +3,9 @@
 >>control query default auto_query_retry_warnings 'ON';
 
 --- SQL operation complete.
+>>set session default ESP_RELEASE_WORK_TIMEOUT '-2';
+
+--- SQL operation complete.
 >>
 >>-- TEST 1
 >>create table t020t1

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/regress/executor/EXPECTED022.SB
----------------------------------------------------------------------
diff --git a/core/sql/regress/executor/EXPECTED022.SB b/core/sql/regress/executor/EXPECTED022.SB
index 0dea94d..e588531 100644
--- a/core/sql/regress/executor/EXPECTED022.SB
+++ b/core/sql/regress/executor/EXPECTED022.SB
@@ -843,17 +843,17 @@ A           B         C
 >>-- negative cases
 >>select cast('2016-01-29Z' as date) from t022t1;
 
-*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data 2016-01-29Z
+*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data: 2016-01-29Z
 
 --- 0 row(s) selected.
 >>select cast('2016-01-29+05:00' as date) from t022t1;
 
-*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data 2016-01-29+05:00
+*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data: 2016-01-29+05:00
 
 --- 0 row(s) selected.
 >>select cast('10:11:12-05:000' as time) from t022t1;
 
-*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data 10:11:12-05:000
+*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data: 10:11:12-05:000
 
 --- 0 row(s) selected.
 >>select date '2016-01-29Z' from t022t1;
@@ -882,17 +882,17 @@ A           B         C
 
 >>select cast ('23:11:61' as time) from t022t1;
 
-*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data 23:11:61-05:000
+*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data: 23:11:61-05:000
 
 --- 0 row(s) selected.
 >>select cast ('23:11:06' as timestamp) from t022t1;
 
-*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data 23:11:06
+*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data: 23:11:06
 
 --- 0 row(s) selected.
 >>select cast('2010-01-01' as time) from t022t1;
 
-*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data 2010-01-015:000
+*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data: 2010-01-015:000
 
 --- 0 row(s) selected.
 >>select timestamp'2010-01-01 10' from t022t1;
@@ -2398,28 +2398,28 @@ Hello
 >>-- illegal european format
 >>select cast ('12.13.1987' as date) from t022t2;
 
-*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data 12.13.1987
+*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data: 12.13.1987
 
 --- 0 row(s) selected.
 >>
 >>-- illegal US format
 >>select cast ('13/12/1987' as date) from t022t2;
 
-*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data 13/12/1987
+*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data: 13/12/1987
 
 --- 0 row(s) selected.
 >>
 >>-- string overflow
 >>select cast (cast ('12.07.1961 03:04:55.123456' as timestamp) as char(18)) from t022t2;
 
-*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data 12.07.1961 03:04:55.123456
+*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data: 12.07.1961 03:04:55.123456
 
 --- 0 row(s) selected.
 >>
 >>-- Feb. 30th doesn't exist
 >>select cast('1997-30-02' as DATE) from t022t2;
 
-*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data 1997-30-02
+*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data: 1997-30-02
 
 --- 0 row(s) selected.
 >>
@@ -2760,7 +2760,7 @@ A      B
 >>set param ?p '11/20/1997 15:15:08.123456 am';
 >>insert into t022t8 (c1) values ( ?p );
 
-*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data 11/20/1997 15:15:08.123456 am
+*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data: 11/20/1997 15:15:08.123456 am
 
 *** ERROR[15015] PARAM ?p (value 11/20/1997 15:15:08.123456 am) cannot be converted to type TIMESTAMP(6).
 
@@ -2770,9 +2770,9 @@ A      B
 >>set param ?p '2100-01-01:ab:00:47.250000';
 >>insert into t022t8 (c1) values ( ?p );
 
-*** ERROR[8413] The string argument contains characters that cannot be converted. Source data 61623a30303a34372e323530303030
+*** ERROR[8413] The string argument contains characters that cannot be converted. Source data(in hex): 61623a30303a34372e323530303030
 
-*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data 2100-01-01:ab:00:47.250000
+*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data: 2100-01-01:ab:00:47.250000
 
 *** ERROR[15015] PARAM ?p (value 2100-01-01:ab:00:47.250000) cannot be converted to type TIMESTAMP(6).
 
@@ -2782,7 +2782,7 @@ A      B
 >>set param ?p '1998-03-12 03:15:08.123456 pm';
 >>insert into t022t8 (c1) values ( ?p );
 
-*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data 1998-03-12 03:15:08.123456 pm
+*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data: 1998-03-12 03:15:08.123456 pm
 
 *** ERROR[15015] PARAM ?p (value 1998-03-12 03:15:08.123456 pm) cannot be converted to type TIMESTAMP(6).
 
@@ -2792,7 +2792,7 @@ A      B
 >>set param ?p '1996-05-23 16:15:08.123 am';
 >>insert into t022t8 (c1) values ( ?p );
 
-*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data 1996-05-23 16:15:08.123 am
+*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data: 1996-05-23 16:15:08.123 am
 
 *** ERROR[15015] PARAM ?p (value 1996-05-23 16:15:08.123 am) cannot be converted to type TIMESTAMP(6).
 
@@ -2865,9 +2865,9 @@ C1
 >>set param ?p '00:a1:00';
 >>insert into t022t8 (c2) values ( ?p );
 
-*** ERROR[8413] The string argument contains characters that cannot be converted. Source data 61313a3030
+*** ERROR[8413] The string argument contains characters that cannot be converted. Source data(in hex): 61313a3030
 
-*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data 00:a1:00
+*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data: 00:a1:00
 
 *** ERROR[15015] PARAM ?p (value 00:a1:00) cannot be converted to type TIME(0).
 
@@ -2877,7 +2877,7 @@ C1
 >>set param ?p '14:59:59 am';
 >>insert into t022t8 (c2) values ( ?p );
 
-*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data 14:59:59 am
+*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data: 14:59:59 am
 
 *** ERROR[15015] PARAM ?p (value 14:59:59 am) cannot be converted to type TIME(0).
 
@@ -2887,7 +2887,7 @@ C1
 >>set param ?p '11:60:59 am';
 >>insert into t022t8 (c2) values ( ?p );
 
-*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data 11:60:59 am
+*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data: 11:60:59 am
 
 *** ERROR[15015] PARAM ?p (value 11:60:59 am) cannot be converted to type TIME(0).
 
@@ -3051,64 +3051,64 @@ C1                         C2
 >>-- negative cases (expect errors)
 >>select cast('.-2' as int) from t022t8;
 
-*** ERROR[8413] The string argument contains characters that cannot be converted. Source data 2e2d32
+*** ERROR[8413] The string argument contains characters that cannot be converted. Source data(in hex): 2e2d32
 
 --- 0 row(s) selected.
 >>select cast('.+3' as int) from t022t8;
 
-*** ERROR[8413] The string argument contains characters that cannot be converted. Source data 2e2b33
+*** ERROR[8413] The string argument contains characters that cannot be converted. Source data(in hex): 2e2b33
 
 --- 0 row(s) selected.
 >>select cast('.4-' as numeric(4)) from t022t8;
 
-*** ERROR[8413] The string argument contains characters that cannot be converted. Source data 2e342d
+*** ERROR[8413] The string argument contains characters that cannot be converted. Source data(in hex): 2e342d
 
 --- 0 row(s) selected.
 >>select cast('-. 3' as int) from t022t8;
 
-*** ERROR[8413] The string argument contains characters that cannot be converted. Source data 2e2033
+*** ERROR[8413] The string argument contains characters that cannot be converted. Source data(in hex): 2e2033
 
 --- 0 row(s) selected.
 >>select cast('-3 . ' as int) from t022t8;
 
-*** ERROR[8413] The string argument contains characters that cannot be converted. Source data 33202e20
+*** ERROR[8413] The string argument contains characters that cannot be converted. Source data(in hex): 33202e20
 
 --- 0 row(s) selected.
 >>
 >>select c1 from t022t8 where cast('.-2' as int) < 1000;
 
-*** ERROR[8413] The string argument contains characters that cannot be converted. Source data 2e2d32
+*** ERROR[8413] The string argument contains characters that cannot be converted. Source data(in hex): 2e2d32
 
 --- 0 row(s) selected.
 >>select c1 from t022t8 where cast('.+3' as int) < 1000;
 
-*** ERROR[8413] The string argument contains characters that cannot be converted. Source data 2e2b33
+*** ERROR[8413] The string argument contains characters that cannot be converted. Source data(in hex): 2e2b33
 
 --- 0 row(s) selected.
 >>select c1 from t022t8 where cast('.4-' as numeric(4)) < 1;
 
-*** ERROR[8413] The string argument contains characters that cannot be converted. Source data 2e342d
+*** ERROR[8413] The string argument contains characters that cannot be converted. Source data(in hex): 2e342d
 
 --- 0 row(s) selected.
 >>select c1 from t022t8 where cast('-. 3' as int) < 1;
 
-*** ERROR[8413] The string argument contains characters that cannot be converted. Source data 2e2033
+*** ERROR[8413] The string argument contains characters that cannot be converted. Source data(in hex): 2e2033
 
 --- 0 row(s) selected.
 >>select c1 from t022t8 where cast('-3 .' as int) < 1;
 
-*** ERROR[8413] The string argument contains characters that cannot be converted. Source data 33202e
+*** ERROR[8413] The string argument contains characters that cannot be converted. Source data(in hex): 33202e
 
 --- 0 row(s) selected.
 >>
 >>select cast ('123..' as real) from (values(1)) as T;
 
-*** ERROR[8413] The string argument contains characters that cannot be converted. Source data 3132332e2e
+*** ERROR[8413] The string argument contains characters that cannot be converted. Source data(in hex): 3132332e2e
 
 --- 0 row(s) selected.
 >>select cast ('123..12' as real)from (values(1)) as T;
 
-*** ERROR[8413] The string argument contains characters that cannot be converted. Source data 3132332e2e3132
+*** ERROR[8413] The string argument contains characters that cannot be converted. Source data(in hex): 3132332e2e3132
 
 --- 0 row(s) selected.
 >>
@@ -3741,14 +3741,14 @@ Hello
 >>-- illegal european format
 >>select cast (N'12.13.1987' as date) from t022u;
 
-*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data 12.13.1987
+*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data: 12.13.1987
 
 --- 0 row(s) selected.
 >>
 >>-- illegal US format
 >>select cast (N'13/12/1987' as date) from t022u;
 
-*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data 13/12/1987
+*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data: 13/12/1987
 
 --- 0 row(s) selected.
 >>
@@ -3763,7 +3763,7 @@ Hello
 >>-- Feb. 32th doesn't exist
 >>select cast(N'1997-02-32' as DATE) from t022u;
 
-*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data 1997-02-32
+*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data: 1997-02-32
 
 --- 0 row(s) selected.
 >>
@@ -3977,7 +3977,7 @@ Hello
 >>-- negative test on cast VAR/NCAR to DEC 
 >>select cast(N'1009a' as  DEC) from t022u;
 
-*** ERROR[8413] The string argument contains characters that cannot be converted. Source data 3130303961
+*** ERROR[8413] The string argument contains characters that cannot be converted. Source data(in hex): 3130303961
 
 --- 0 row(s) selected.
 >>
@@ -4015,17 +4015,17 @@ Hello
 >>-- negative test on cast VAR/NCAR to float/real/double 
 >>select cast(N'this is not a number.' as float) from t022u;
 
-*** ERROR[8413] The string argument contains characters that cannot be converted. Source data 74686973206973206e6f742061206e756d6265722e
+*** ERROR[8413] The string argument contains characters that cannot be converted. Source data(in hex): 74686973206973206e6f742061206e756d6265722e
 
 --- 0 row(s) selected.
 >>select cast(N'1023u' as real) from t022u;
 
-*** ERROR[8413] The string argument contains characters that cannot be converted. Source data 3130323375
+*** ERROR[8413] The string argument contains characters that cannot be converted. Source data(in hex): 3130323375
 
 --- 0 row(s) selected.
 >>select cast(N'''\2' as double precision) from t022u;
 
-*** ERROR[8413] The string argument contains characters that cannot be converted. Source data 275c32
+*** ERROR[8413] The string argument contains characters that cannot be converted. Source data(in hex): 275c32
 
 --- 0 row(s) selected.
 >>?ifNT
@@ -5613,17 +5613,17 @@ A           B         C
 >>-- negative cases
 >>select cast('2016-01-29Z' as date) from t022t1;
 
-*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data 2016-01-29Z
+*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data: 2016-01-29Z
 
 --- 0 row(s) selected.
 >>select cast('2016-01-29+05:00' as date) from t022t1;
 
-*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data 2016-01-29+05:00
+*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data: 2016-01-29+05:00
 
 --- 0 row(s) selected.
 >>select cast('10:11:12-05:000' as time) from t022t1;
 
-*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data 10:11:12-05:000
+*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data: 10:11:12-05:000
 
 --- 0 row(s) selected.
 >>select date '2016-01-29Z' from t022t1;
@@ -5652,17 +5652,17 @@ A           B         C
 
 >>select cast ('23:11:61' as time) from t022t1;
 
-*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data 23:11:61-05:000
+*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data: 23:11:61-05:000
 
 --- 0 row(s) selected.
 >>select cast ('23:11:06' as timestamp) from t022t1;
 
-*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data 23:11:06
+*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data: 23:11:06
 
 --- 0 row(s) selected.
 >>select cast('2010-01-01' as time) from t022t1;
 
-*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data 2010-01-015:000
+*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data: 2010-01-015:000
 
 --- 0 row(s) selected.
 >>select timestamp'2010-01-01 10' from t022t1;
@@ -7168,28 +7168,28 @@ Hello
 >>-- illegal european format
 >>select cast ('12.13.1987' as date) from t022t2;
 
-*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data 12.13.1987
+*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data: 12.13.1987
 
 --- 0 row(s) selected.
 >>
 >>-- illegal US format
 >>select cast ('13/12/1987' as date) from t022t2;
 
-*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data 13/12/1987
+*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data: 13/12/1987
 
 --- 0 row(s) selected.
 >>
 >>-- string overflow
 >>select cast (cast ('12.07.1961 03:04:55.123456' as timestamp) as char(18)) from t022t2;
 
-*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data 12.07.1961 03:04:55.123456
+*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data: 12.07.1961 03:04:55.123456
 
 --- 0 row(s) selected.
 >>
 >>-- Feb. 30th doesn't exist
 >>select cast('1997-30-02' as DATE) from t022t2;
 
-*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data 1997-30-02
+*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data: 1997-30-02
 
 --- 0 row(s) selected.
 >>
@@ -7530,7 +7530,7 @@ A      B
 >>set param ?p '11/20/1997 15:15:08.123456 am';
 >>insert into t022t8 (c1) values ( ?p );
 
-*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data 11/20/1997 15:15:08.123456 am
+*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data: 11/20/1997 15:15:08.123456 am
 
 *** ERROR[15015] PARAM ?p (value 11/20/1997 15:15:08.123456 am) cannot be converted to type TIMESTAMP(6).
 
@@ -7540,9 +7540,9 @@ A      B
 >>set param ?p '2100-01-01:ab:00:47.250000';
 >>insert into t022t8 (c1) values ( ?p );
 
-*** ERROR[8413] The string argument contains characters that cannot be converted. Source data 61623a30303a34372e323530303030
+*** ERROR[8413] The string argument contains characters that cannot be converted. Source data(in hex): 61623a30303a34372e323530303030
 
-*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data 2100-01-01:ab:00:47.250000
+*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data: 2100-01-01:ab:00:47.250000
 
 *** ERROR[15015] PARAM ?p (value 2100-01-01:ab:00:47.250000) cannot be converted to type TIMESTAMP(6).
 
@@ -7552,7 +7552,7 @@ A      B
 >>set param ?p '1998-03-12 03:15:08.123456 pm';
 >>insert into t022t8 (c1) values ( ?p );
 
-*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data 1998-03-12 03:15:08.123456 pm
+*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data: 1998-03-12 03:15:08.123456 pm
 
 *** ERROR[15015] PARAM ?p (value 1998-03-12 03:15:08.123456 pm) cannot be converted to type TIMESTAMP(6).
 
@@ -7562,7 +7562,7 @@ A      B
 >>set param ?p '1996-05-23 16:15:08.123 am';
 >>insert into t022t8 (c1) values ( ?p );
 
-*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data 1996-05-23 16:15:08.123 am
+*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data: 1996-05-23 16:15:08.123 am
 
 *** ERROR[15015] PARAM ?p (value 1996-05-23 16:15:08.123 am) cannot be converted to type TIMESTAMP(6).
 
@@ -7635,9 +7635,9 @@ C1
 >>set param ?p '00:a1:00';
 >>insert into t022t8 (c2) values ( ?p );
 
-*** ERROR[8413] The string argument contains characters that cannot be converted. Source data 61313a3030
+*** ERROR[8413] The string argument contains characters that cannot be converted. Source data(in hex): 61313a3030
 
-*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data 00:a1:00
+*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data: 00:a1:00
 
 *** ERROR[15015] PARAM ?p (value 00:a1:00) cannot be converted to type TIME(0).
 
@@ -7647,7 +7647,7 @@ C1
 >>set param ?p '14:59:59 am';
 >>insert into t022t8 (c2) values ( ?p );
 
-*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data 14:59:59 am
+*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data: 14:59:59 am
 
 *** ERROR[15015] PARAM ?p (value 14:59:59 am) cannot be converted to type TIME(0).
 
@@ -7657,7 +7657,7 @@ C1
 >>set param ?p '11:60:59 am';
 >>insert into t022t8 (c2) values ( ?p );
 
-*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data 11:60:59 am
+*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data: 11:60:59 am
 
 *** ERROR[15015] PARAM ?p (value 11:60:59 am) cannot be converted to type TIME(0).
 
@@ -7821,64 +7821,64 @@ C1                         C2
 >>-- negative cases (expect errors)
 >>select cast('.-2' as int) from t022t8;
 
-*** ERROR[8413] The string argument contains characters that cannot be converted. Source data 2e2d32
+*** ERROR[8413] The string argument contains characters that cannot be converted. Source data(in hex): 2e2d32
 
 --- 0 row(s) selected.
 >>select cast('.+3' as int) from t022t8;
 
-*** ERROR[8413] The string argument contains characters that cannot be converted. Source data 2e2b33
+*** ERROR[8413] The string argument contains characters that cannot be converted. Source data(in hex): 2e2b33
 
 --- 0 row(s) selected.
 >>select cast('.4-' as numeric(4)) from t022t8;
 
-*** ERROR[8413] The string argument contains characters that cannot be converted. Source data 2e342d
+*** ERROR[8413] The string argument contains characters that cannot be converted. Source data(in hex): 2e342d
 
 --- 0 row(s) selected.
 >>select cast('-. 3' as int) from t022t8;
 
-*** ERROR[8413] The string argument contains characters that cannot be converted. Source data 2e2033
+*** ERROR[8413] The string argument contains characters that cannot be converted. Source data(in hex): 2e2033
 
 --- 0 row(s) selected.
 >>select cast('-3 . ' as int) from t022t8;
 
-*** ERROR[8413] The string argument contains characters that cannot be converted. Source data 33202e20
+*** ERROR[8413] The string argument contains characters that cannot be converted. Source data(in hex): 33202e20
 
 --- 0 row(s) selected.
 >>
 >>select c1 from t022t8 where cast('.-2' as int) < 1000;
 
-*** ERROR[8413] The string argument contains characters that cannot be converted. Source data 2e2d32
+*** ERROR[8413] The string argument contains characters that cannot be converted. Source data(in hex): 2e2d32
 
 --- 0 row(s) selected.
 >>select c1 from t022t8 where cast('.+3' as int) < 1000;
 
-*** ERROR[8413] The string argument contains characters that cannot be converted. Source data 2e2b33
+*** ERROR[8413] The string argument contains characters that cannot be converted. Source data(in hex): 2e2b33
 
 --- 0 row(s) selected.
 >>select c1 from t022t8 where cast('.4-' as numeric(4)) < 1;
 
-*** ERROR[8413] The string argument contains characters that cannot be converted. Source data 2e342d
+*** ERROR[8413] The string argument contains characters that cannot be converted. Source data(in hex): 2e342d
 
 --- 0 row(s) selected.
 >>select c1 from t022t8 where cast('-. 3' as int) < 1;
 
-*** ERROR[8413] The string argument contains characters that cannot be converted. Source data 2e2033
+*** ERROR[8413] The string argument contains characters that cannot be converted. Source data(in hex): 2e2033
 
 --- 0 row(s) selected.
 >>select c1 from t022t8 where cast('-3 .' as int) < 1;
 
-*** ERROR[8413] The string argument contains characters that cannot be converted. Source data 33202e
+*** ERROR[8413] The string argument contains characters that cannot be converted. Source data(in hex): 33202e
 
 --- 0 row(s) selected.
 >>
 >>select cast ('123..' as real) from (values(1)) as T;
 
-*** ERROR[8413] The string argument contains characters that cannot be converted. Source data 3132332e2e
+*** ERROR[8413] The string argument contains characters that cannot be converted. Source data(in hex): 3132332e2e
 
 --- 0 row(s) selected.
 >>select cast ('123..12' as real)from (values(1)) as T;
 
-*** ERROR[8413] The string argument contains characters that cannot be converted. Source data 3132332e2e3132
+*** ERROR[8413] The string argument contains characters that cannot be converted. Source data(in hex): 3132332e2e3132
 
 --- 0 row(s) selected.
 >>
@@ -8511,14 +8511,14 @@ Hello
 >>-- illegal european format
 >>select cast (N'12.13.1987' as date) from t022u;
 
-*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data 12.13.1987
+*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data: 12.13.1987
 
 --- 0 row(s) selected.
 >>
 >>-- illegal US format
 >>select cast (N'13/12/1987' as date) from t022u;
 
-*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data 13/12/1987
+*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data: 13/12/1987
 
 --- 0 row(s) selected.
 >>
@@ -8533,7 +8533,7 @@ Hello
 >>-- Feb. 32th doesn't exist
 >>select cast(N'1997-02-32' as DATE) from t022u;
 
-*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data 1997-02-32
+*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data: 1997-02-32
 
 --- 0 row(s) selected.
 >>
@@ -8747,7 +8747,7 @@ Hello
 >>-- negative test on cast VAR/NCAR to DEC 
 >>select cast(N'1009a' as  DEC) from t022u;
 
-*** ERROR[8413] The string argument contains characters that cannot be converted. Source data 3130303961
+*** ERROR[8413] The string argument contains characters that cannot be converted. Source data(in hex): 3130303961
 
 --- 0 row(s) selected.
 >>
@@ -8785,17 +8785,17 @@ Hello
 >>-- negative test on cast VAR/NCAR to float/real/double 
 >>select cast(N'this is not a number.' as float) from t022u;
 
-*** ERROR[8413] The string argument contains characters that cannot be converted. Source data 74686973206973206e6f742061206e756d6265722e
+*** ERROR[8413] The string argument contains characters that cannot be converted. Source data(in hex): 74686973206973206e6f742061206e756d6265722e
 
 --- 0 row(s) selected.
 >>select cast(N'1023u' as real) from t022u;
 
-*** ERROR[8413] The string argument contains characters that cannot be converted. Source data 3130323375
+*** ERROR[8413] The string argument contains characters that cannot be converted. Source data(in hex): 3130323375
 
 --- 0 row(s) selected.
 >>select cast(N'''\2' as double precision) from t022u;
 
-*** ERROR[8413] The string argument contains characters that cannot be converted. Source data 275c32
+*** ERROR[8413] The string argument contains characters that cannot be converted. Source data(in hex): 275c32
 
 --- 0 row(s) selected.
 >>?ifNT

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/regress/executor/EXPECTED050
----------------------------------------------------------------------
diff --git a/core/sql/regress/executor/EXPECTED050 b/core/sql/regress/executor/EXPECTED050
index 43b9571..e963454 100755
--- a/core/sql/regress/executor/EXPECTED050
+++ b/core/sql/regress/executor/EXPECTED050
@@ -135,7 +135,7 @@
 >>set param ?ee e;
 >>select * from T050a where d=?ee;
 
-*** ERROR[8413] The string argument contains characters that cannot be converted. Source data 65
+*** ERROR[8413] The string argument contains characters that cannot be converted. Source data(in hex): 65
 
 *** ERROR[15015] PARAM ?ee (value e) cannot be converted to type NUMERIC(18, 6).
 
@@ -235,7 +235,7 @@ PARAM ?c aa
 PARAM ?d foo
 >>execute x using 77;
 
-*** ERROR[8413] The string argument contains characters that cannot be converted. Source data 666f6f
+*** ERROR[8413] The string argument contains characters that cannot be converted. Source data(in hex): 666f6f
 
 *** ERROR[15015] PARAM ?d (value foo) cannot be converted to type NUMERIC(18, 6).
 
@@ -441,10 +441,9 @@ aa     BB     CC               1            1            1
 >>	-- 4004, 4104
 >>select * from T050a,T050a x where x.e='f';
 
-*** ERROR[4041] Type INTEGER cannot be compared with type CHAR(1).
-
-*** ERROR[8822] The statement was not prepared.
+*** ERROR[8413] The string argument contains characters that cannot be converted. Source data(in hex): 66
 
+--- 0 row(s) selected.
 >>	-- 4034 or 4041 or like that
 >>
 >>-- Genesis 10-980402-1556 + OLT add'l fix

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/regress/executor/EXPECTED122
----------------------------------------------------------------------
diff --git a/core/sql/regress/executor/EXPECTED122 b/core/sql/regress/executor/EXPECTED122
index c372676..027ada3 100644
--- a/core/sql/regress/executor/EXPECTED122
+++ b/core/sql/regress/executor/EXPECTED122
@@ -65,7 +65,7 @@ A
 >>invoke t122t1;
 
 -- Definition of Trafodion table TRAFODION.SCH.T122T1
--- Definition current  Thu Feb 25 08:40:12 2016
+-- Definition current  Fri Aug  5 14:03:34 2016
 
   (
     SYSKEY                           LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -118,7 +118,7 @@ A
 >>execute s3;
 
 -- Definition of Trafodion table TRAFODION.SCH.T122T1
--- Definition current  Thu Feb 25 08:40:13 2016
+-- Definition current  Fri Aug  5 14:03:34 2016
 
   (
     SYSKEY                           LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -178,7 +178,7 @@ iv
 >>invoke t122t1;
 
 -- Definition of Trafodion table TRAFODION.SCH.T122T1
--- Definition current  Thu Feb 25 08:40:32 2016
+-- Definition current  Fri Aug  5 14:03:49 2016
 
   (
     SYSKEY                           LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -211,15 +211,11 @@ iv
 >>
 >>execute s2;
 
-*** ERROR[4039] Column A is of type CHAR(4), incompatible with the value's type, NUMERIC(1).
-
-*** ERROR[8822] The statement was not prepared.
-
 *** WARNING[8597] Statement was automatically retried 1 time(s). Delay before each retry was 0 seconds. See next entry for the error that caused this retry.
 
 *** WARNING[8738] Statement must be recompiled due to redefinition of the object(s) accessed.
 
---- 0 row(s) inserted.
+--- 1 row(s) inserted.
 >>
 >>execute s3;
 
@@ -229,7 +225,7 @@ iv
 
 
 -- Definition of Trafodion table TRAFODION.SCH.T122T1
--- Definition current  Thu Feb 25 08:40:34 2016
+-- Definition current  Fri Aug  5 14:03:49 2016
 
   (
     SYSKEY                           LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -248,15 +244,13 @@ iv
 (EXPR)              
 --------------------
 
-                   6
+                   7
 
 --- 1 row(s) selected.
 >>
 >>execute s5;
 
-*** ERROR[4041] Type CHAR(4) cannot be compared with type NUMERIC(1).
-
-*** ERROR[8822] The statement was not prepared.
+*** ERROR[8413] The string argument contains characters that cannot be converted. Source data(in hex): 6978
 
 *** WARNING[8597] Statement was automatically retried 1 time(s). Delay before each retry was 0 seconds. See next entry for the error that caused this retry.
 
@@ -266,9 +260,7 @@ iv
 >>
 >>execute s6;
 
-*** ERROR[4041] Type CHAR(4) cannot be compared with type NUMERIC(2).
-
-*** ERROR[8822] The statement was not prepared.
+*** ERROR[8413] The string argument contains characters that cannot be converted. Source data(in hex): 6978
 
 *** WARNING[8597] Statement was automatically retried 1 time(s). Delay before each retry was 0 seconds. See next entry for the error that caused this retry.
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/regress/executor/EXPECTED140
----------------------------------------------------------------------
diff --git a/core/sql/regress/executor/EXPECTED140 b/core/sql/regress/executor/EXPECTED140
index 2e96726..862de36 100644
--- a/core/sql/regress/executor/EXPECTED140
+++ b/core/sql/regress/executor/EXPECTED140
@@ -124,9 +124,9 @@ Task:  CLEANUP         Status: Started    Object: TRAFODION.SCH.T140C
 Task:  CLEANUP         Status: Ended      Object: TRAFODION.SCH.T140C
 Task:  PREPARATION     Status: Started    Object: TRAFODION.SCH.T140C
        Rows Processed: 2750311 
-Task:  PREPARATION     Status: Ended      ET: 00:00:35.794
+Task:  PREPARATION     Status: Ended      ET: 00:00:45.041
 Task:  COMPLETION      Status: Started    Object: TRAFODION.SCH.T140C
-Task:  COMPLETION      Status: Ended      ET: 00:00:01.515
+Task:  COMPLETION      Status: Ended      ET: 00:00:01.911
 
 --- 2750311 row(s) loaded.
 >>update statistics for table t140c on every column sample;
@@ -147,9 +147,9 @@ Task:  COMPLETION      Status: Ended      ET: 00:00:01.515
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... NOT NAMED
-PLAN_ID .................. 212333332780085319
+PLAN_ID .................. 212338343609062204
 ROWS_OUT ................ 33
-EST_TOTAL_COST ........... 0.05
+EST_TOTAL_COST ........... 0.01
 STATEMENT ................ select a from t140 where b>500;
 
 
@@ -158,7 +158,7 @@ ROOT ======================================  SEQ_NO 2        ONLY CHILD 1
 REQUESTS_IN .............. 1
 ROWS_OUT ................ 33
 EST_OPER_COST ............ 0
-EST_TOTAL_COST ........... 0.05
+EST_TOTAL_COST ........... 0.01
 DESCRIPTION
   max_card_est .......... 50
   fragment_id ............ 0
@@ -175,20 +175,6 @@ DESCRIPTION
   embedded_arkcmp ........ used
   IS_SQLCI ............... ON
   LDAP_USERNAME
-  TARGET_CODE ............ DEBUG
-  TARGET_CPU_FREQUENCY   199
-  TARGET_IO_SEEK_TIME .... 0.02
-  TARGET_IO_SEQ_READ_RATE  2.5
-  TARGET_MSG_LOCAL_RATE   10
-  TARGET_MSG_LOCAL_TIME    0.01
-  TARGET_MSG_REMOTE_RAT  100
-  TARGET_MSG_REMOTE_TIME   0.01
-  ARKCMP_FAKE_HW ......... ON
-  SKIP_METADATA_VIEWS .... ON
-  DEF_NUM_SMP_CPUS ....... 2
-  MAX_ESPS_PER_CPU_PER_OP  1
-  DEF_NUM_NODES_IN_ACTIVE  1
-  POS_ALLOW_NON_PK_TABLES  ON
   MODE_SEABASE ........... ON
   SEABASE_VOLATILE_TABLES  ON
   HBASE_ASYNC_DROP_TABLE   OFF
@@ -199,7 +185,7 @@ DESCRIPTION
   TRAF_INDEX_CREATE_OPT    ON
   SCHEMA ................. TRAFODION.SCH
   GENERATE_EXPLAIN ....... ON
-  ObjectUIDs ............. 1816740699929440032
+  ObjectUIDs ............. 3636762910170544433
   select_list ............ TRAFODION.SCH.T140.A
 
 
@@ -207,8 +193,8 @@ TRAFODION_SCAN ============================  SEQ_NO 1        NO CHILDREN
 TABLE_NAME ............... T140
 REQUESTS_IN .............. 1
 ROWS_OUT ................ 33
-EST_OPER_COST ............ 0.05
-EST_TOTAL_COST ........... 0.05
+EST_OPER_COST ............ 0.01
+EST_TOTAL_COST ........... 0.01
 DESCRIPTION
   max_card_est .......... 50
   fragment_id ............ 0
@@ -247,9 +233,9 @@ A
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... NOT NAMED
-PLAN_ID .................. 212333332780433763
+PLAN_ID .................. 212338343609413438
 ROWS_OUT ................ 33
-EST_TOTAL_COST ........... 0.05
+EST_TOTAL_COST ........... 0.01
 STATEMENT ................ select an from t140b where b<=200;
 
 
@@ -258,7 +244,7 @@ ROOT ======================================  SEQ_NO 2        ONLY CHILD 1
 REQUESTS_IN .............. 1
 ROWS_OUT ................ 33
 EST_OPER_COST ............ 0
-EST_TOTAL_COST ........... 0.05
+EST_TOTAL_COST ........... 0.01
 DESCRIPTION
   max_card_est .......... 75
   fragment_id ............ 0
@@ -275,20 +261,6 @@ DESCRIPTION
   embedded_arkcmp ........ used
   IS_SQLCI ............... ON
   LDAP_USERNAME
-  TARGET_CODE ............ DEBUG
-  TARGET_CPU_FREQUENCY   199
-  TARGET_IO_SEEK_TIME .... 0.02
-  TARGET_IO_SEQ_READ_RATE  2.5
-  TARGET_MSG_LOCAL_RATE   10
-  TARGET_MSG_LOCAL_TIME    0.01
-  TARGET_MSG_REMOTE_RAT  100
-  TARGET_MSG_REMOTE_TIME   0.01
-  ARKCMP_FAKE_HW ......... ON
-  SKIP_METADATA_VIEWS .... ON
-  DEF_NUM_SMP_CPUS ....... 2
-  MAX_ESPS_PER_CPU_PER_OP  1
-  DEF_NUM_NODES_IN_ACTIVE  1
-  POS_ALLOW_NON_PK_TABLES  ON
   MODE_SEABASE ........... ON
   SEABASE_VOLATILE_TABLES  ON
   HBASE_ASYNC_DROP_TABLE   OFF
@@ -299,7 +271,7 @@ DESCRIPTION
   TRAF_INDEX_CREATE_OPT    ON
   SCHEMA ................. TRAFODION.SCH
   GENERATE_EXPLAIN ....... ON
-  ObjectUIDs ............. 1816740699929440212
+  ObjectUIDs ............. 3636762910170544692
   select_list ............ TRAFODION.SCH.T140B.AN
 
 
@@ -307,8 +279,8 @@ TRAFODION_SCAN ============================  SEQ_NO 1        NO CHILDREN
 TABLE_NAME ............... T140B
 REQUESTS_IN .............. 1
 ROWS_OUT ................ 33
-EST_OPER_COST ............ 0.05
-EST_TOTAL_COST ........... 0.05
+EST_OPER_COST ............ 0.01
+EST_TOTAL_COST ........... 0.01
 DESCRIPTION
   max_card_est .......... 75
   fragment_id ............ 0
@@ -334,9 +306,9 @@ DESCRIPTION
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... NOT NAMED
-PLAN_ID .................. 212333332780550886
+PLAN_ID .................. 212338343609602246
 ROWS_OUT ................ 33
-EST_TOTAL_COST ........... 0.05
+EST_TOTAL_COST ........... 0.01
 STATEMENT ................ select an from t140 where b<=200;
 
 
@@ -345,7 +317,7 @@ ROOT ======================================  SEQ_NO 2        ONLY CHILD 1
 REQUESTS_IN .............. 1
 ROWS_OUT ................ 33
 EST_OPER_COST ............ 0
-EST_TOTAL_COST ........... 0.05
+EST_TOTAL_COST ........... 0.01
 DESCRIPTION
   max_card_est .......... 75
   fragment_id ............ 0
@@ -362,20 +334,6 @@ DESCRIPTION
   embedded_arkcmp ........ used
   IS_SQLCI ............... ON
   LDAP_USERNAME
-  TARGET_CODE ............ DEBUG
-  TARGET_CPU_FREQUENCY   199
-  TARGET_IO_SEEK_TIME .... 0.02
-  TARGET_IO_SEQ_READ_RATE  2.5
-  TARGET_MSG_LOCAL_RATE   10
-  TARGET_MSG_LOCAL_TIME    0.01
-  TARGET_MSG_REMOTE_RAT  100
-  TARGET_MSG_REMOTE_TIME   0.01
-  ARKCMP_FAKE_HW ......... ON
-  SKIP_METADATA_VIEWS .... ON
-  DEF_NUM_SMP_CPUS ....... 2
-  MAX_ESPS_PER_CPU_PER_OP  1
-  DEF_NUM_NODES_IN_ACTIVE  1
-  POS_ALLOW_NON_PK_TABLES  ON
   MODE_SEABASE ........... ON
   SEABASE_VOLATILE_TABLES  ON
   HBASE_ASYNC_DROP_TABLE   OFF
@@ -386,7 +344,7 @@ DESCRIPTION
   TRAF_INDEX_CREATE_OPT    ON
   SCHEMA ................. TRAFODION.SCH
   GENERATE_EXPLAIN ....... ON
-  ObjectUIDs ............. 1816740699929440032
+  ObjectUIDs ............. 3636762910170544433
   select_list ............ TRAFODION.SCH.T140.AN
 
 
@@ -394,8 +352,8 @@ TRAFODION_SCAN ============================  SEQ_NO 1        NO CHILDREN
 TABLE_NAME ............... T140
 REQUESTS_IN .............. 1
 ROWS_OUT ................ 33
-EST_OPER_COST ............ 0.05
-EST_TOTAL_COST ........... 0.05
+EST_OPER_COST ............ 0.01
+EST_TOTAL_COST ........... 0.01
 DESCRIPTION
   max_card_est .......... 75
   fragment_id ............ 0
@@ -432,9 +390,9 @@ AN
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... NOT NAMED
-PLAN_ID .................. 212333332780687252
+PLAN_ID .................. 212338343609793981
 ROWS_OUT ................ 10
-EST_TOTAL_COST ........... 0.05
+EST_TOTAL_COST ........... 0.01
 STATEMENT ................ select an from t140 where b=200 and an is not null;
 
 
@@ -443,7 +401,7 @@ ROOT ======================================  SEQ_NO 2        ONLY CHILD 1
 REQUESTS_IN .............. 1
 ROWS_OUT ................ 10
 EST_OPER_COST ............ 0
-EST_TOTAL_COST ........... 0.05
+EST_TOTAL_COST ........... 0.01
 DESCRIPTION
   max_card_est .......... 99
   fragment_id ............ 0
@@ -460,20 +418,6 @@ DESCRIPTION
   embedded_arkcmp ........ used
   IS_SQLCI ............... ON
   LDAP_USERNAME
-  TARGET_CODE ............ DEBUG
-  TARGET_CPU_FREQUENCY   199
-  TARGET_IO_SEEK_TIME .... 0.02
-  TARGET_IO_SEQ_READ_RATE  2.5
-  TARGET_MSG_LOCAL_RATE   10
-  TARGET_MSG_LOCAL_TIME    0.01
-  TARGET_MSG_REMOTE_RAT  100
-  TARGET_MSG_REMOTE_TIME   0.01
-  ARKCMP_FAKE_HW ......... ON
-  SKIP_METADATA_VIEWS .... ON
-  DEF_NUM_SMP_CPUS ....... 2
-  MAX_ESPS_PER_CPU_PER_OP  1
-  DEF_NUM_NODES_IN_ACTIVE  1
-  POS_ALLOW_NON_PK_TABLES  ON
   MODE_SEABASE ........... ON
   SEABASE_VOLATILE_TABLES  ON
   HBASE_ASYNC_DROP_TABLE   OFF
@@ -484,7 +428,7 @@ DESCRIPTION
   TRAF_INDEX_CREATE_OPT    ON
   SCHEMA ................. TRAFODION.SCH
   GENERATE_EXPLAIN ....... ON
-  ObjectUIDs ............. 1816740699929440032
+  ObjectUIDs ............. 3636762910170544433
   select_list ............ TRAFODION.SCH.T140.AN
   input_variables ........ %(200)
 
@@ -493,8 +437,8 @@ TRAFODION_SCAN ============================  SEQ_NO 1        NO CHILDREN
 TABLE_NAME ............... T140
 REQUESTS_IN .............. 1
 ROWS_OUT ................ 10
-EST_OPER_COST ............ 0.05
-EST_TOTAL_COST ........... 0.05
+EST_OPER_COST ............ 0.01
+EST_TOTAL_COST ........... 0.01
 DESCRIPTION
   max_card_est .......... 99
   fragment_id ............ 0
@@ -528,9 +472,9 @@ AN
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... NOT NAMED
-PLAN_ID .................. 212333332780824331
+PLAN_ID .................. 212338343609993741
 ROWS_OUT ................ 67
-EST_TOTAL_COST ........... 0.05
+EST_TOTAL_COST ........... 0.01
 STATEMENT ................ select an, a from t140 where b!=500;
 
 
@@ -539,7 +483,7 @@ ROOT ======================================  SEQ_NO 2        ONLY CHILD 1
 REQUESTS_IN .............. 1
 ROWS_OUT ................ 67
 EST_OPER_COST ............ 0
-EST_TOTAL_COST ........... 0.05
+EST_TOTAL_COST ........... 0.01
 DESCRIPTION
   max_card_est ......... 100
   fragment_id ............ 0
@@ -556,20 +500,6 @@ DESCRIPTION
   embedded_arkcmp ........ used
   IS_SQLCI ............... ON
   LDAP_USERNAME
-  TARGET_CODE ............ DEBUG
-  TARGET_CPU_FREQUENCY   199
-  TARGET_IO_SEEK_TIME .... 0.02
-  TARGET_IO_SEQ_READ_RATE  2.5
-  TARGET_MSG_LOCAL_RATE   10
-  TARGET_MSG_LOCAL_TIME    0.01
-  TARGET_MSG_REMOTE_RAT  100
-  TARGET_MSG_REMOTE_TIME   0.01
-  ARKCMP_FAKE_HW ......... ON
-  SKIP_METADATA_VIEWS .... ON
-  DEF_NUM_SMP_CPUS ....... 2
-  MAX_ESPS_PER_CPU_PER_OP  1
-  DEF_NUM_NODES_IN_ACTIVE  1
-  POS_ALLOW_NON_PK_TABLES  ON
   MODE_SEABASE ........... ON
   SEABASE_VOLATILE_TABLES  ON
   HBASE_ASYNC_DROP_TABLE   OFF
@@ -580,7 +510,7 @@ DESCRIPTION
   TRAF_INDEX_CREATE_OPT    ON
   SCHEMA ................. TRAFODION.SCH
   GENERATE_EXPLAIN ....... ON
-  ObjectUIDs ............. 1816740699929440032
+  ObjectUIDs ............. 3636762910170544433
   select_list ............ TRAFODION.SCH.T140.AN, TRAFODION.SCH.T140.A
 
 
@@ -588,8 +518,8 @@ TRAFODION_SCAN ============================  SEQ_NO 1        NO CHILDREN
 TABLE_NAME ............... T140
 REQUESTS_IN .............. 1
 ROWS_OUT ................ 67
-EST_OPER_COST ............ 0.05
-EST_TOTAL_COST ........... 0.05
+EST_OPER_COST ............ 0.01
+EST_TOTAL_COST ........... 0.01
 DESCRIPTION
   max_card_est ......... 100
   fragment_id ............ 0
@@ -660,9 +590,9 @@ AN
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... NOT NAMED
-PLAN_ID .................. 212333332781036815
+PLAN_ID .................. 212338343610235075
 ROWS_OUT ................ 10
-EST_TOTAL_COST ........... 0.05
+EST_TOTAL_COST ........... 0.01
 STATEMENT ................ select an from t140 where bn=201 and an is not null;
 
 
@@ -671,7 +601,7 @@ ROOT ======================================  SEQ_NO 2        ONLY CHILD 1
 REQUESTS_IN .............. 1
 ROWS_OUT ................ 10
 EST_OPER_COST ............ 0
-EST_TOTAL_COST ........... 0.05
+EST_TOTAL_COST ........... 0.01
 DESCRIPTION
   max_card_est .......... 99
   fragment_id ............ 0
@@ -688,20 +618,6 @@ DESCRIPTION
   embedded_arkcmp ........ used
   IS_SQLCI ............... ON
   LDAP_USERNAME
-  TARGET_CODE ............ DEBUG
-  TARGET_CPU_FREQUENCY   199
-  TARGET_IO_SEEK_TIME .... 0.02
-  TARGET_IO_SEQ_READ_RATE  2.5
-  TARGET_MSG_LOCAL_RATE   10
-  TARGET_MSG_LOCAL_TIME    0.01
-  TARGET_MSG_REMOTE_RAT  100
-  TARGET_MSG_REMOTE_TIME   0.01
-  ARKCMP_FAKE_HW ......... ON
-  SKIP_METADATA_VIEWS .... ON
-  DEF_NUM_SMP_CPUS ....... 2
-  MAX_ESPS_PER_CPU_PER_OP  1
-  DEF_NUM_NODES_IN_ACTIVE  1
-  POS_ALLOW_NON_PK_TABLES  ON
   MODE_SEABASE ........... ON
   SEABASE_VOLATILE_TABLES  ON
   HBASE_ASYNC_DROP_TABLE   OFF
@@ -712,7 +628,7 @@ DESCRIPTION
   TRAF_INDEX_CREATE_OPT    ON
   SCHEMA ................. TRAFODION.SCH
   GENERATE_EXPLAIN ....... ON
-  ObjectUIDs ............. 1816740699929440032
+  ObjectUIDs ............. 3636762910170544433
   select_list ............ TRAFODION.SCH.T140.AN
   input_variables ........ %(201)
 
@@ -721,8 +637,8 @@ TRAFODION_SCAN ============================  SEQ_NO 1        NO CHILDREN
 TABLE_NAME ............... T140
 REQUESTS_IN .............. 1
 ROWS_OUT ................ 10
-EST_OPER_COST ............ 0.05
-EST_TOTAL_COST ........... 0.05
+EST_OPER_COST ............ 0.01
+EST_TOTAL_COST ........... 0.01
 DESCRIPTION
   max_card_est .......... 99
   fragment_id ............ 0
@@ -755,9 +671,9 @@ AN
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... NOT NAMED
-PLAN_ID .................. 212333332781170537
+PLAN_ID .................. 212338343610423954
 ROWS_OUT ................ 67
-EST_TOTAL_COST ........... 0.05
+EST_TOTAL_COST ........... 0.01
 STATEMENT ................ select an, a from t140 where bn!=501;
 
 
@@ -766,7 +682,7 @@ ROOT ======================================  SEQ_NO 2        ONLY CHILD 1
 REQUESTS_IN .............. 1
 ROWS_OUT ................ 67
 EST_OPER_COST ............ 0
-EST_TOTAL_COST ........... 0.05
+EST_TOTAL_COST ........... 0.01
 DESCRIPTION
   max_card_est ......... 100
   fragment_id ............ 0
@@ -783,20 +699,6 @@ DESCRIPTION
   embedded_arkcmp ........ used
   IS_SQLCI ............... ON
   LDAP_USERNAME
-  TARGET_CODE ............ DEBUG
-  TARGET_CPU_FREQUENCY   199
-  TARGET_IO_SEEK_TIME .... 0.02
-  TARGET_IO_SEQ_READ_RATE  2.5
-  TARGET_MSG_LOCAL_RATE   10
-  TARGET_MSG_LOCAL_TIME    0.01
-  TARGET_MSG_REMOTE_RAT  100
-  TARGET_MSG_REMOTE_TIME   0.01
-  ARKCMP_FAKE_HW ......... ON
-  SKIP_METADATA_VIEWS .... ON
-  DEF_NUM_SMP_CPUS ....... 2
-  MAX_ESPS_PER_CPU_PER_OP  1
-  DEF_NUM_NODES_IN_ACTIVE  1
-  POS_ALLOW_NON_PK_TABLES  ON
   MODE_SEABASE ........... ON
   SEABASE_VOLATILE_TABLES  ON
   HBASE_ASYNC_DROP_TABLE   OFF
@@ -807,7 +709,7 @@ DESCRIPTION
   TRAF_INDEX_CREATE_OPT    ON
   SCHEMA ................. TRAFODION.SCH
   GENERATE_EXPLAIN ....... ON
-  ObjectUIDs ............. 1816740699929440032
+  ObjectUIDs ............. 3636762910170544433
   select_list ............ TRAFODION.SCH.T140.AN, TRAFODION.SCH.T140.A
 
 
@@ -815,8 +717,8 @@ TRAFODION_SCAN ============================  SEQ_NO 1        NO CHILDREN
 TABLE_NAME ............... T140
 REQUESTS_IN .............. 1
 ROWS_OUT ................ 67
-EST_OPER_COST ............ 0.05
-EST_TOTAL_COST ........... 0.05
+EST_OPER_COST ............ 0.01
+EST_TOTAL_COST ........... 0.01
 DESCRIPTION
   max_card_est ......... 100
   fragment_id ............ 0
@@ -902,9 +804,9 @@ A
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... NOT NAMED
-PLAN_ID .................. 212333332781389304
+PLAN_ID .................. 212338343610685313
 ROWS_OUT ................ 11
-EST_TOTAL_COST ........... 0.05
+EST_TOTAL_COST ........... 0.01
 STATEMENT ................ select an from t140 where an between 20 and 40;
 
 
@@ -913,7 +815,7 @@ ROOT ======================================  SEQ_NO 2        ONLY CHILD 1
 REQUESTS_IN .............. 1
 ROWS_OUT ................ 11
 EST_OPER_COST ............ 0
-EST_TOTAL_COST ........... 0.05
+EST_TOTAL_COST ........... 0.01
 DESCRIPTION
   max_card_est .......... 75
   fragment_id ............ 0
@@ -930,20 +832,6 @@ DESCRIPTION
   embedded_arkcmp ........ used
   IS_SQLCI ............... ON
   LDAP_USERNAME
-  TARGET_CODE ............ DEBUG
-  TARGET_CPU_FREQUENCY   199
-  TARGET_IO_SEEK_TIME .... 0.02
-  TARGET_IO_SEQ_READ_RATE  2.5
-  TARGET_MSG_LOCAL_RATE   10
-  TARGET_MSG_LOCAL_TIME    0.01
-  TARGET_MSG_REMOTE_RAT  100
-  TARGET_MSG_REMOTE_TIME   0.01
-  ARKCMP_FAKE_HW ......... ON
-  SKIP_METADATA_VIEWS .... ON
-  DEF_NUM_SMP_CPUS ....... 2
-  MAX_ESPS_PER_CPU_PER_OP  1
-  DEF_NUM_NODES_IN_ACTIVE  1
-  POS_ALLOW_NON_PK_TABLES  ON
   MODE_SEABASE ........... ON
   SEABASE_VOLATILE_TABLES  ON
   HBASE_ASYNC_DROP_TABLE   OFF
@@ -954,7 +842,7 @@ DESCRIPTION
   TRAF_INDEX_CREATE_OPT    ON
   SCHEMA ................. TRAFODION.SCH
   GENERATE_EXPLAIN ....... ON
-  ObjectUIDs ............. 1816740699929440032
+  ObjectUIDs ............. 3636762910170544433
   select_list ............ TRAFODION.SCH.T140.AN
 
 
@@ -962,8 +850,8 @@ TRAFODION_SCAN ============================  SEQ_NO 1        NO CHILDREN
 TABLE_NAME ............... T140
 REQUESTS_IN .............. 1
 ROWS_OUT ................ 11
-EST_OPER_COST ............ 0.05
-EST_TOTAL_COST ........... 0.05
+EST_OPER_COST ............ 0.01
+EST_TOTAL_COST ........... 0.01
 DESCRIPTION
   max_card_est .......... 75
   fragment_id ............ 0
@@ -1021,9 +909,9 @@ AN
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... NOT NAMED
-PLAN_ID .................. 212333332781583143
+PLAN_ID .................. 212338343610965450
 ROWS_OUT ................. 1
-EST_TOTAL_COST ........... 0.05
+EST_TOTAL_COST ........... 0.01
 STATEMENT ................ select avg(a) from t140b;
 
 
@@ -1032,7 +920,7 @@ ROOT ======================================  SEQ_NO 3        ONLY CHILD 2
 REQUESTS_IN .............. 1
 ROWS_OUT ................. 1
 EST_OPER_COST ............ 0
-EST_TOTAL_COST ........... 0.05
+EST_TOTAL_COST ........... 0.01
 DESCRIPTION
   max_card_est ........... 1
   fragment_id ............ 0
@@ -1049,20 +937,6 @@ DESCRIPTION
   embedded_arkcmp ........ used
   IS_SQLCI ............... ON
   LDAP_USERNAME
-  TARGET_CODE ............ DEBUG
-  TARGET_CPU_FREQUENCY   199
-  TARGET_IO_SEEK_TIME .... 0.02
-  TARGET_IO_SEQ_READ_RATE  2.5
-  TARGET_MSG_LOCAL_RATE   10
-  TARGET_MSG_LOCAL_TIME    0.01
-  TARGET_MSG_REMOTE_RAT  100
-  TARGET_MSG_REMOTE_TIME   0.01
-  ARKCMP_FAKE_HW ......... ON
-  SKIP_METADATA_VIEWS .... ON
-  DEF_NUM_SMP_CPUS ....... 2
-  MAX_ESPS_PER_CPU_PER_OP  1
-  DEF_NUM_NODES_IN_ACTIVE  1
-  POS_ALLOW_NON_PK_TABLES  ON
   MODE_SEABASE ........... ON
   SEABASE_VOLATILE_TABLES  ON
   HBASE_ASYNC_DROP_TABLE   OFF
@@ -1075,7 +949,7 @@ DESCRIPTION
   PARALLEL_NUM_ESPS ...... 1
   HBASE_DOP_PARALLEL_SCAN  2
   GENERATE_EXPLAIN ....... ON
-  ObjectUIDs ............. 1816740699929440212
+  ObjectUIDs ............. 3636762910170544692
   select_list ............ cast(cast((cast((cast((cast(sum(TRAFODION.SCH.T140B.
                              A)) * cast(10000 ...0))) / cast(count(1 )))) /
                              cast(10000 ...0))))
@@ -1085,7 +959,7 @@ SORT_SCALAR_AGGR ==========================  SEQ_NO 2        ONLY CHILD 1
 REQUESTS_IN .............. 1
 ROWS_OUT ................. 1
 EST_OPER_COST ............ 0.01
-EST_TOTAL_COST ........... 0.05
+EST_TOTAL_COST ........... 0.01
 DESCRIPTION
   max_card_est ........... 1
   fragment_id ............ 0
@@ -1098,8 +972,8 @@ TRAFODION_SCAN ============================  SEQ_NO 1        NO CHILDREN
 TABLE_NAME ............... T140B
 REQUESTS_IN .............. 1
 ROWS_OUT ............... 100
-EST_OPER_COST ............ 0.05
-EST_TOTAL_COST ........... 0.05
+EST_OPER_COST ............ 0.01
+EST_TOTAL_COST ........... 0.01
 DESCRIPTION
   max_card_est ......... 100
   fragment_id ............ 0
@@ -1135,9 +1009,9 @@ DESCRIPTION
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... NOT NAMED
-PLAN_ID .................. 212333332781877617
+PLAN_ID .................. 212338343611266473
 ROWS_OUT ................. 1
-EST_TOTAL_COST ........... 0.05
+EST_TOTAL_COST ........... 0.01
 STATEMENT ................ select avg(a) from t140b;
 
 
@@ -1146,7 +1020,7 @@ ROOT ======================================  SEQ_NO 3        ONLY CHILD 2
 REQUESTS_IN .............. 1
 ROWS_OUT ................. 1
 EST_OPER_COST ............ 0
-EST_TOTAL_COST ........... 0.05
+EST_TOTAL_COST ........... 0.01
 DESCRIPTION
   max_card_est ........... 1
   fragment_id ............ 0
@@ -1163,20 +1037,6 @@ DESCRIPTION
   embedded_arkcmp ........ used
   IS_SQLCI ............... ON
   LDAP_USERNAME
-  TARGET_CODE ............ DEBUG
-  TARGET_CPU_FREQUENCY   199
-  TARGET_IO_SEEK_TIME .... 0.02
-  TARGET_IO_SEQ_READ_RATE  2.5
-  TARGET_MSG_LOCAL_RATE   10
-  TARGET_MSG_LOCAL_TIME    0.01
-  TARGET_MSG_REMOTE_RAT  100
-  TARGET_MSG_REMOTE_TIME   0.01
-  ARKCMP_FAKE_HW ......... ON
-  SKIP_METADATA_VIEWS .... ON
-  DEF_NUM_SMP_CPUS ....... 2
-  MAX_ESPS_PER_CPU_PER_OP  1
-  DEF_NUM_NODES_IN_ACTIVE  1
-  POS_ALLOW_NON_PK_TABLES  ON
   MODE_SEABASE ........... ON
   SEABASE_VOLATILE_TABLES  ON
   HBASE_ASYNC_DROP_TABLE   OFF
@@ -1189,7 +1049,7 @@ DESCRIPTION
   PARALLEL_NUM_ESPS ...... 1
   HBASE_DOP_PARALLEL_SCAN  1
   GENERATE_EXPLAIN ....... ON
-  ObjectUIDs ............. 1816740699929440212
+  ObjectUIDs ............. 3636762910170544692
   select_list ............ cast(cast((cast((cast((cast(sum(TRAFODION.SCH.T140B.
                              A)) * cast(10000 ...0))) / cast(count(1 )))) /
                              cast(10000 ...0))))
@@ -1199,7 +1059,7 @@ SORT_SCALAR_AGGR ==========================  SEQ_NO 2        ONLY CHILD 1
 REQUESTS_IN .............. 1
 ROWS_OUT ................. 1
 EST_OPER_COST ............ 0.01
-EST_TOTAL_COST ........... 0.05
+EST_TOTAL_COST ........... 0.01
 DESCRIPTION
   max_card_est ........... 1
   fragment_id ............ 0
@@ -1212,8 +1072,8 @@ TRAFODION_SCAN ============================  SEQ_NO 1        NO CHILDREN
 TABLE_NAME ............... T140B
 REQUESTS_IN .............. 1
 ROWS_OUT ............... 100
-EST_OPER_COST ............ 0.05
-EST_TOTAL_COST ........... 0.05
+EST_OPER_COST ............ 0.01
+EST_TOTAL_COST ........... 0.01
 DESCRIPTION
   max_card_est ......... 100
   fragment_id ............ 0
@@ -1245,9 +1105,9 @@ DESCRIPTION
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... NOT NAMED
-PLAN_ID .................. 212333332781877617
+PLAN_ID .................. 212338343611266473
 ROWS_OUT ................. 1
-EST_TOTAL_COST ........... 0.05
+EST_TOTAL_COST ........... 0.01
 STATEMENT ................ select avg(a) from t140b;
 
 
@@ -1256,7 +1116,7 @@ ROOT ======================================  SEQ_NO 3        ONLY CHILD 2
 REQUESTS_IN .............. 1
 ROWS_OUT ................. 1
 EST_OPER_COST ............ 0
-EST_TOTAL_COST ........... 0.05
+EST_TOTAL_COST ........... 0.01
 DESCRIPTION
   max_card_est ........... 1
   fragment_id ............ 0
@@ -1273,20 +1133,6 @@ DESCRIPTION
   embedded_arkcmp ........ used
   IS_SQLCI ............... ON
   LDAP_USERNAME
-  TARGET_CODE ............ DEBUG
-  TARGET_CPU_FREQUENCY   199
-  TARGET_IO_SEEK_TIME .... 0.02
-  TARGET_IO_SEQ_READ_RATE  2.5
-  TARGET_MSG_LOCAL_RATE   10
-  TARGET_MSG_LOCAL_TIME    0.01
-  TARGET_MSG_REMOTE_RAT  100
-  TARGET_MSG_REMOTE_TIME   0.01
-  ARKCMP_FAKE_HW ......... ON
-  SKIP_METADATA_VIEWS .... ON
-  DEF_NUM_SMP_CPUS ....... 2
-  MAX_ESPS_PER_CPU_PER_OP  1
-  DEF_NUM_NODES_IN_ACTIVE  1
-  POS_ALLOW_NON_PK_TABLES  ON
   MODE_SEABASE ........... ON
   SEABASE_VOLATILE_TABLES  ON
   HBASE_ASYNC_DROP_TABLE   OFF
@@ -1299,7 +1145,7 @@ DESCRIPTION
   PARALLEL_NUM_ESPS ...... 1
   HBASE_DOP_PARALLEL_SCAN  1
   GENERATE_EXPLAIN ....... ON
-  ObjectUIDs ............. 1816740699929440212
+  ObjectUIDs ............. 3636762910170544692
   select_list ............ cast(cast((cast((cast((cast(sum(TRAFODION.SCH.T140B.
                              A)) * cast(10000 ...0))) / cast(count(1 )))) /
                              cast(10000 ...0))))
@@ -1309,7 +1155,7 @@ SORT_SCALAR_AGGR ==========================  SEQ_NO 2        ONLY CHILD 1
 REQUESTS_IN .............. 1
 ROWS_OUT ................. 1
 EST_OPER_COST ............ 0.01
-EST_TOTAL_COST ........... 0.05
+EST_TOTAL_COST ........... 0.01
 DESCRIPTION
   max_card_est ........... 1
   fragment_id ............ 0
@@ -1322,8 +1168,8 @@ TRAFODION_SCAN ============================  SEQ_NO 1        NO CHILDREN
 TABLE_NAME ............... T140B
 REQUESTS_IN .............. 1
 ROWS_OUT ............... 100
-EST_OPER_COST ............ 0.05
-EST_TOTAL_COST ........... 0.05
+EST_OPER_COST ............ 0.01
+EST_TOTAL_COST ........... 0.01
 DESCRIPTION
   max_card_est ......... 100
   fragment_id ............ 0

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/regress/executor/TEST013
----------------------------------------------------------------------
diff --git a/core/sql/regress/executor/TEST013 b/core/sql/regress/executor/TEST013
index e2df36a..34b9a88 100755
--- a/core/sql/regress/executor/TEST013
+++ b/core/sql/regress/executor/TEST013
@@ -54,6 +54,8 @@ create catalog t013_volatile_cat_$$SYSNAME$$;
 create catalog t013_volatile_cat_NSK;
 #ifNT
 
+cleanup obsolete volatile tables;
+
 log LOG013 clear;
 
 #ifndef SEABASE_REGRESS

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/regress/executor/TEST020
----------------------------------------------------------------------
diff --git a/core/sql/regress/executor/TEST020 b/core/sql/regress/executor/TEST020
index 84323e9..c7f76b7 100644
--- a/core/sql/regress/executor/TEST020
+++ b/core/sql/regress/executor/TEST020
@@ -42,6 +42,7 @@ drop table t020t3 cascade;
 ?section testcases
 
 control query default auto_query_retry_warnings 'ON';
+set session default ESP_RELEASE_WORK_TIMEOUT '-2';
 
 -- TEST 1
 create table t020t1

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/regress/executor/cidefs
----------------------------------------------------------------------
diff --git a/core/sql/regress/executor/cidefs b/core/sql/regress/executor/cidefs
deleted file mode 100755
index 479ca36..0000000
--- a/core/sql/regress/executor/cidefs
+++ /dev/null
@@ -1,119 +0,0 @@
---	This is the sqlci analogue of the shell-script "setupenv".
---
--- @@@ 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 @@@
-
-set SCHEMA $$TEST_SCHEMA$$;
--- control query default HIST_USE_SAMPLE_FOR_CARDINALITY_ESTIMATION  'ON';
--- control query default HIST_ON_DEMAND_STATS_SIZE '10000';
-
--- Define a standard physical environment for the compiler:
-control query default TARGET_CODE 'DEBUG';
-control query default TARGET_CPU_FREQUENCY '199.';
-control query default TARGET_IO_SEEK_TIME '0.020147';
-control query default TARGET_IO_SEQ_READ_RATE '2.5';
-control query default TARGET_MSG_LOCAL_RATE '10.';
-control query default TARGET_MSG_LOCAL_TIME '0.000125';
-control query default TARGET_MSG_REMOTE_RATE '100.';
-control query default TARGET_MSG_REMOTE_TIME  '0.00125';
-
-control query default ARKCMP_FAKE_HW 'ON';
-
-control query default SKIP_METADATA_VIEWS 'ON';
-
-control query default DEF_NUM_SMP_CPUS
-#ifMX
-'2'
-#ifMX
-#ifMP
-'1'
-#ifMP
-;
-
-control query default MAX_ESPS_PER_CPU_PER_OP '1';
-set session default ESP_RELEASE_WORK_TIMEOUT '-2';
-
-
-control query default DEF_NUM_NODES_IN_ACTIVE_CLUSTERS
-#ifMX
-'1'
-#ifMX
-#ifMP
-'2'
-#ifMP
-;
-
--- this is the datavol location of the second partition
--- for partitioned tables.
-#ifNSK
-set pattern $$partition$$  $DATA04;
-set pattern $$partition1$$ $DATA01;
-set pattern $$partition2$$ $DATA03;
-set pattern $$partition3$$ $DATA05;
-set pattern $$TrigTempTablePartition$$ '''$DATA03:$DATA04,$DATA05:$DATA01''';
-
-#ifNSK
-
-#ifNT
-set pattern $$partition$$ $DATA;
-set pattern $$partition1$$ $DATA1;
-set pattern $$partition2$$ $DATA2;
-set pattern $$partition3$$ $SYSTEM;
-set pattern $$partition4$$ $DATA4;
-set pattern $$TrigTempTablePartition$$ '''$system:$data1,$data2:$data''';
-
-#ifNT
-
--- This pattern is needed for both NSK and NT to handle the quote in Metadata
--- queries
-set pattern $$quote$$ '''';
--- This CQD is added for creating a table  with no
--- partition or primary key when the POS is enabled.
-control query default POS_ALLOW_NON_PK_TABLES 'ON';
---control query default detailed_statistics 'ALL';
-
--- eof
-
--- Only on a Linux cluster
-#ifdef CLUSTERNAME
-set pattern $$partition$$  $DB0000;
-set pattern $$partition0$$ $DB0000;
-set pattern $$partition1$$ $DB0001;
-set pattern $$partition2$$ $DB0002;
-set pattern $$partition3$$ $DB0003;
-set pattern $$partition4$$ $DB0004;
-set pattern $$partition5$$ $DB0005;
-set pattern $$partition6$$ $DB0006;
-set pattern $$partition7$$ $DB0007;
-set pattern $$partition8$$ $DB0008;
-set pattern $$audit_vol$$  $AUD000;
-set pattern $$PosTablePartition$$ '''$DB0000''';
-set pattern $$PosTablePartitions2$$ '''$DB0001, $DB0002''';
-set pattern $$PosTablePartitions3$$ '''$DB0003, $DB0004, $DB0005''';
-set pattern $$PosTablePartitions4$$ '''$DB0006, $DB0007, $DB0008, $DB0009''';
-set pattern $$TrigTempTablePartition$$ '''$DB0003:$DB0004,$DB0005:$DB0001''';
-set pattern $$TrigTempTablePartition1$$ '''$DB0001: $DB0004''';
-set pattern $$TrigTempTablePartition2$$ '''$DB0001''';
-set pattern $$TrigTempTablePartition3$$ '''$DB0004''';
-set pattern $$TrigTempTablePartition4$$ '''$DB0001, $DB0004,$NINEX: $DB0005''';
-set pattern $$TrigTempTablePartition5$$ '''$DB0005, $DB0005, $DB0005: $DB0005, $DB0005''';
-set pattern $$TrigTempTablePartition6$$ '''$DB0001,XXXX64 $DB0005''';
-#endif



[5/6] incubator-trafodion git commit: JIRA TRAFODION-2180 enable/externalize non-ansi sql syntax/functionality

Posted by su...@apache.org.
JIRA TRAFODION-2180 enable/externalize non-ansi sql syntax/functionality

Enabled and externalized support for following functionality:
-- RANDOM and RANDOM(seed) functions
-- CEIL (same as CEILING) math function
-- GREATEST(val1, val2), LEAST(val1, val2)
  -- return greater or lesser value between val1 and val2
-- MONTHS_BETWEEN(date1, date2)
  -- number of months between date1 and date2.
     +ve, if date1 > date2. -ve, otherwise
-- LAST_DAY(<date>)
  -- date of the last day of the month of <date>
-- NEXT_DAY(<date>, <string>)
  -- returns the date of the first weekday named by <string>
     that is later than the date <date>
-- TRUNC. Same as DATE_TRUNC
-- TO_NUMBER. Limited support.
-- TO_TIMESTAMP.  Limited support.
-- syntax BYTEINT (same as TINYINT)
-- select UNIQUE ... from <tab>.  Same as DISTINCT
-- NOT NULL ENABLE syntax in col defn (same as NOT NULL)
-- Removal of all reserved keywords
-- support for 'select * from DUAL'

Other changes:
-- error 8413 to indicate that source data being displayed is in hex

-- "-failed" option to runregr and runallsb.
   It will rerun only the tests that have failed

-- removed mode_special_2, mode_special_3, mode_special_5 cqds

-- fixed an issue with hive data modification check

-- alter rename stmt now writes generated object into metadata

-- Infrastructure support for couple of JIRAs.
   These have not been enabled as default for this ckin but
   developer regressions are run after enabling them.
  -- JIRA TRAFODION-2181 Incompatible operations
  -- JIRA TRAFODION-2184 Groupby/Orderby extensions


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/9a41e522
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/9a41e522
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/9a41e522

Branch: refs/heads/master
Commit: 9a41e522302b1aa6905f4072a55f5509dbb41198
Parents: 03acaa3
Author: Anoop Sharma <an...@esgyn.com>
Authored: Fri Aug 26 21:02:48 2016 +0000
Committer: Anoop Sharma <an...@esgyn.com>
Committed: Fri Aug 26 21:02:48 2016 +0000

----------------------------------------------------------------------
 core/sql/bin/SqlciErrors.txt                    |   4 +-
 core/sql/common/CharType.h                      |   3 +-
 core/sql/common/ComResWords.cpp                 |   4 -
 core/sql/common/DateTimeType.cpp                |  27 +-
 core/sql/common/NAString.cpp                    |  12 +-
 core/sql/common/NAType.h                        |  13 +-
 core/sql/common/NumericType.cpp                 |   4 +-
 core/sql/executor/ExExeUtilLoad.cpp             |   4 +-
 core/sql/executor/ExHdfsScan.cpp                |   8 +-
 core/sql/generator/GenExplain.cpp               |  11 +-
 core/sql/generator/GenFastTransport.cpp         |   2 +-
 core/sql/generator/GenPreCode.cpp               |  35 +-
 core/sql/optimizer/BindItemExpr.cpp             | 593 ++++++-------
 core/sql/optimizer/BindRelExpr.cpp              |  50 +-
 core/sql/optimizer/EncodedValue.cpp             |   5 +-
 core/sql/optimizer/OptimizerSimulator.cpp       |  13 -
 core/sql/optimizer/QRDescGenerator.cpp          |   3 +-
 core/sql/optimizer/SynthType.cpp                | 145 ++-
 core/sql/parser/SqlParserAux.cpp                |   3 +-
 core/sql/parser/sqlparser.y                     |  83 +-
 core/sql/parser/ulexer.cpp                      | 109 ++-
 core/sql/regress/charsets/EXPECTED002           |  11 +-
 core/sql/regress/charsets/TEST002               |   3 +-
 core/sql/regress/charsets/cidefs                | 125 ---
 core/sql/regress/compGeneral/EXPECTED006.SB     | 249 ++----
 core/sql/regress/compGeneral/EXPECTED042        |  82 +-
 core/sql/regress/compGeneral/TEST006            |  99 +--
 core/sql/regress/compGeneral/cidefs             | 128 ---
 core/sql/regress/core/EXPECTED037.SB            | 871 +++----------------
 core/sql/regress/core/EXPECTED038.LINUX         |   2 +-
 core/sql/regress/core/EXPECTED056.SB            |  28 +-
 core/sql/regress/core/EXPECTED061.SB            |   4 +-
 core/sql/regress/core/TEST056                   |  28 +-
 core/sql/regress/core/TEST061                   |   4 +-
 core/sql/regress/core/cidefs                    | 135 ---
 core/sql/regress/executor/EXPECTED001           |  31 +-
 core/sql/regress/executor/EXPECTED013.SB        |  42 +-
 core/sql/regress/executor/EXPECTED014.SB        |   2 +-
 core/sql/regress/executor/EXPECTED020           |   3 +
 core/sql/regress/executor/EXPECTED022.SB        | 152 ++--
 core/sql/regress/executor/EXPECTED050           |   9 +-
 core/sql/regress/executor/EXPECTED122           |  24 +-
 core/sql/regress/executor/EXPECTED140           | 296 ++-----
 core/sql/regress/executor/TEST013               |   2 +
 core/sql/regress/executor/TEST020               |   1 +
 core/sql/regress/executor/cidefs                | 119 ---
 core/sql/regress/fullstack2/EXPECTED062         |  51 --
 core/sql/regress/fullstack2/EXPECTED062.RELEASE |  51 --
 core/sql/regress/fullstack2/cidefs              | 121 ---
 core/sql/regress/hive/EXPECTED003               |   8 +-
 core/sql/regress/hive/EXPECTED005               |  40 +-
 core/sql/regress/hive/TEST003                   |   4 +-
 core/sql/regress/qat/cidefs                     |  32 -
 core/sql/regress/seabase/DIFF032.KNOWN          |   4 +
 core/sql/regress/seabase/EXPECTED003            |  82 +-
 core/sql/regress/seabase/EXPECTED030            |  12 +-
 core/sql/regress/seabase/EXPECTED032            | 297 +++++++
 core/sql/regress/seabase/FILTER032              |  27 +
 core/sql/regress/seabase/TEST010                |   1 +
 core/sql/regress/seabase/TEST032                |  91 ++
 core/sql/regress/tools/runallsb                 |  21 +-
 core/sql/regress/tools/runregr                  |  29 +-
 core/sql/regress/tools/runregr_charsets.ksh     |   4 +-
 core/sql/regress/tools/runregr_compGeneral.ksh  |  25 +-
 core/sql/regress/tools/runregr_core.ksh         |  25 +-
 core/sql/regress/tools/runregr_executor.ksh     |  21 +-
 core/sql/regress/tools/runregr_fullstack2.ksh   |  19 +-
 core/sql/regress/tools/runregr_hive.ksh         |  12 +-
 core/sql/regress/tools/runregr_qat.ksh          |   9 +-
 core/sql/regress/tools/runregr_seabase.ksh      |  12 +-
 core/sql/regress/tools/runregr_udr.ksh          |   4 +-
 core/sql/regress/tools/sbdefs                   |   9 +-
 core/sql/regress/udr/EXPECTED103                |  10 +-
 core/sql/regress/udr/EXPECTED108                |  18 +-
 core/sql/regress/udr/EXPECTED163.SB             |   4 +-
 core/sql/regress/udr/TEST108                    |  16 +-
 core/sql/regress/udr/cidefs                     |  69 --
 core/sql/sqlcat/TrafDDLdesc.h                   |   4 +
 core/sql/sqlcomp/CmpDescribe.cpp                |   6 +-
 core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp        |   1 -
 core/sql/sqlcomp/CmpSeabaseDDLindex.cpp         |   3 +-
 core/sql/sqlcomp/CmpSeabaseDDLtable.cpp         |  10 +
 core/sql/sqlcomp/DefaultConstants.h             |  19 +-
 core/sql/sqlcomp/nadefaults.cpp                 | 110 +--
 core/sql/sqlcomp/parser.cpp                     |   1 -
 core/sql/sqlcomp/parser.h                       |   3 -
 core/sql/ustat/hs_globals.cpp                   |   9 +-
 87 files changed, 1693 insertions(+), 3182 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/bin/SqlciErrors.txt
----------------------------------------------------------------------
diff --git a/core/sql/bin/SqlciErrors.txt b/core/sql/bin/SqlciErrors.txt
index eb24e62..78b026b 100644
--- a/core/sql/bin/SqlciErrors.txt
+++ b/core/sql/bin/SqlciErrors.txt
@@ -1535,9 +1535,9 @@ $1~String1 --------------------------------
 8410 22025 99999 BEGINNER MINOR LOGONLY An escape character in a LIKE pattern must be followed by another escape character, an underscore, or a percent character.
 8411 22003 99999 BEGINNER MINOR LOGONLY A numeric overflow occurred during an arithmetic computation or data conversion.$0~string0
 8412 22024 99999 BEGINNER MINOR LOGONLY An input character host variable is missing its null terminator.
-8413 22007 99999 BEGINNER MINOR LOGONLY The string argument contains characters that cannot be converted. Source data $0~string0
+8413 22007 99999 BEGINNER MINOR LOGONLY The string argument contains characters that cannot be converted. Source data(in hex): $0~string0
 8414 0A000 99999 BEGINNER MINOR LOGONLY The attempted conversion is not supported on this platform.$0~string0
-8415 22007 99999 BEGINNER MINOR LOGONLY The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data $0~string0
+8415 22007 99999 BEGINNER MINOR LOGONLY The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data: $0~string0
 8416 22008 99999 BEGINNER MINOR LOGONLY A datetime expression evaluated to an invalid datetime value.
 8417 ZZZZZ 99999 BEGINNER MAJOR DBADMIN An error occurred during the evaluation of USER function. The provided userid $0~string0 is invalid, incorrect, obsolete or inexistent and could not be converted to username.
 8418 0A000 99999 BEGINNER MINOR LOGONLY The USER function is not supported on this platform.

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/common/CharType.h
----------------------------------------------------------------------
diff --git a/core/sql/common/CharType.h b/core/sql/common/CharType.h
index 877b377..3a026bd 100644
--- a/core/sql/common/CharType.h
+++ b/core/sql/common/CharType.h
@@ -255,7 +255,8 @@ virtual NABoolean operator==(const NAType& other) const;
 #ifndef CLI_SRL
 virtual NABoolean isComparable(const NAType &other,
 			       ItemExpr *parentOp,
-			       Int32 emitErr = EmitErrAlways) const;
+			       Int32 emitErr = EmitErrAlways,
+                               UInt32 * flags = NULL) const;
 #endif
   
 NABoolean isCharSetAndCollationComboOK() const;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/common/ComResWords.cpp
----------------------------------------------------------------------
diff --git a/core/sql/common/ComResWords.cpp b/core/sql/common/ComResWords.cpp
index 31cf2bd..89dd01e 100644
--- a/core/sql/common/ComResWords.cpp
+++ b/core/sql/common/ComResWords.cpp
@@ -470,10 +470,6 @@ NABoolean
 ComResWords::isSqlReservedWord(const char *word,NABoolean mp_context,
 			       UInt32 ifSetFlags)
 {
-  // no reserved words in mode_special_4
-  if ((ifSetFlags & MODE_SPECIAL_4_) != 0)
-    return FALSE;
-
   char uword[MAX_RESWORD_LENGTH];
 
   NABoolean lookup = TRUE;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/common/DateTimeType.cpp
----------------------------------------------------------------------
diff --git a/core/sql/common/DateTimeType.cpp b/core/sql/common/DateTimeType.cpp
index 43e57b0..31150d8 100644
--- a/core/sql/common/DateTimeType.cpp
+++ b/core/sql/common/DateTimeType.cpp
@@ -130,37 +130,22 @@ NABoolean DatetimeType::isCompatible(const NAType& other, UInt32 * flags) const
   if (NOT NAType::isCompatible(other, flags))
     return FALSE;
 
+  // DATE/TIME, TIMESTAMP/TIME are not compatible. All others are.
   if (getStartField() != ((DatetimeType&) other).getStartField())
     return FALSE;
 
-  NABoolean modeSpecial4 = 
-    ((flags) && ((*flags & NAType::MODE_SPECIAL_4) != 0));
-  
+  NABoolean allowIncompOper = 
+    ((flags) && ((*flags & NAType::ALLOW_INCOMP_OPER) != 0));
   const DatetimeType* datetime2 = (DatetimeType*) &other;
-
-  if (NOT modeSpecial4)
+  if (NOT allowIncompOper)
     {
       if (getEndField() == datetime2->getEndField())
         return TRUE;
       else
         return FALSE;
     }
-  else
-    {
-      // modespecial 4 
-      // DATE/DATE, TIME/TIME, DATE/TIMESTAMP(0), TIMESTAMP(0)/DATE,
-      // TIMESTAMP(*)/TIMESTAMP(*) are compatible.( '*' is 0-6 )
-      // Others are not.
-      if (getEndField() == datetime2->getEndField())
-        return TRUE;
-      else if ((getFractionPrecision() == 0) && 
-               (datetime2->getFractionPrecision() == 0))
-        return TRUE;
-      else
-        return FALSE;
-    }
-  
-  return FALSE;
+
+  return TRUE;
 }
 
 #if defined( NA_LITTLE_ENDIAN )

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/common/NAString.cpp
----------------------------------------------------------------------
diff --git a/core/sql/common/NAString.cpp b/core/sql/common/NAString.cpp
index 712c984..2e660ec 100644
--- a/core/sql/common/NAString.cpp
+++ b/core/sql/common/NAString.cpp
@@ -382,17 +382,7 @@ NAString LookupDefineName(const NAString &ns, NABoolean iterate)
 // an ANSI, PotentialANSI, or Tandem reserved word.
 NABoolean IsSqlReservedWord(const char *sqlText)
 {
-
-  ComASSERT(sqlText != NULL);
-  UInt32 flags = 0;
-
-  if (Get_SqlParser_Flags(ALLOW_OLD_AND_NEW_KEYWORD))
-     flags |= ALLOWOLDNEW_;
-
-  if (Get_SqlParser_Flags(IN_MODE_SPECIAL_4))
-    flags |= MODE_SPECIAL_4_;
-
-  return ComResWords::isSqlReservedWord(sqlText,FALSE,flags);
+  return FALSE;
 }
 
 NABoolean IsCIdentifier(const char *id)

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/common/NAType.h
----------------------------------------------------------------------
diff --git a/core/sql/common/NAType.h b/core/sql/common/NAType.h
index d241d57..b664485 100644
--- a/core/sql/common/NAType.h
+++ b/core/sql/common/NAType.h
@@ -184,7 +184,8 @@ public:
   #ifndef CLI_SRL
   virtual NABoolean isComparable(const NAType &other,
                                  ItemExpr *parentOp,
-				 Int32 emitErr = EmitErrAlways) const;
+				 Int32 emitErr = EmitErrAlways,
+                                 UInt32 * flags = NULL) const;
   #endif
 
   // ---------------------------------------------------------------------
@@ -402,11 +403,6 @@ public:
     // See other parts of code for what all is done in this case.
     MODE_SPECIAL_1 = 0x0002,
 
-    // indicates that special2 mode is on. Special handling of
-    // syntax, expressions is done in some cases.
-    // See other parts of code for what all is done in this case.
-    MODE_SPECIAL_2 = 0x0004,
-
     // result with scale is requested to be rounded.
     ROUND_RESULT = 0x0008,
 
@@ -422,7 +418,10 @@ public:
     // indicates that special4 mode is on. Special handling of
     // syntax, expressions is done in some cases.
     // See other parts of code for what all is done in this case.
-    MODE_SPECIAL_4 = 0x0080
+    MODE_SPECIAL_4 = 0x0080,
+
+    // enable incompatibe operations.
+    ALLOW_INCOMP_OPER = 0x0100
   };
 
   // ---------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/common/NumericType.cpp
----------------------------------------------------------------------
diff --git a/core/sql/common/NumericType.cpp b/core/sql/common/NumericType.cpp
index 1db027e..62614c1 100644
--- a/core/sql/common/NumericType.cpp
+++ b/core/sql/common/NumericType.cpp
@@ -523,8 +523,6 @@ const NAType* NumericType::synthesizeType(enum NATypeSynthRuleEnum synthRule,
 
   NABoolean modeSpecial1 = 
     ((flags) && ((*flags & NAType::MODE_SPECIAL_1) != 0));
-  NABoolean modeSpecial2 = 
-    ((flags) && ((*flags & NAType::MODE_SPECIAL_2) != 0));
   NABoolean limitPrecision =
     ((flags) && ((*flags & NAType::LIMIT_MAX_NUMERIC_PRECISION) != 0));
   NABoolean makeUnionResultBinary =
@@ -638,7 +636,7 @@ const NAType* NumericType::synthesizeType(enum NATypeSynthRuleEnum synthRule,
                 scale;
     if (limitPrecision)
       {
-	if (((modeSpecial1) || (modeSpecial2)) &&
+	if ((modeSpecial1) &&
 	    (scale > MAX_NUMERIC_PRECISION))
 	  // scale overflow, return error.
 	  return NULL;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/executor/ExExeUtilLoad.cpp
----------------------------------------------------------------------
diff --git a/core/sql/executor/ExExeUtilLoad.cpp b/core/sql/executor/ExExeUtilLoad.cpp
index b0e8caf..08b13db 100644
--- a/core/sql/executor/ExExeUtilLoad.cpp
+++ b/core/sql/executor/ExExeUtilLoad.cpp
@@ -1713,7 +1713,7 @@ short ExExeUtilHBaseBulkLoadTcb::setCQDs()
   if (holdAndSetCQD("COMP_BOOL_226", "ON") < 0) { return -1;}
   // next cqd required to allow load into date/timestamp Traf columns from string Hive columns.
   // This is a common use case. Cqd can be removed when Traf hive access supports more Hive types.
-  if (holdAndSetCQD("ALLOW_INCOMPATIBLE_ASSIGNMENT", "ON") < 0) { return -1;}
+  if (holdAndSetCQD("ALLOW_INCOMPATIBLE_OPERATIONS", "ON") < 0) { return -1;}
   if (hblTdb().getForceCIF())
   {
     if (holdAndSetCQD("COMPRESSED_INTERNAL_FORMAT", "ON") < 0) {return -1; }
@@ -1749,7 +1749,7 @@ short ExExeUtilHBaseBulkLoadTcb::restoreCQDs()
 {
   if (restoreCQD("COMP_BOOL_226") < 0) { return -1;}
   if (restoreCQD("TRAF_LOAD_PREP_SKIP_DUPLICATES") < 0)  { return -1;}
-  if (restoreCQD("ALLOW_INCOMPATIBLE_ASSIGNMENT") < 0)  { return -1;}
+  if (restoreCQD("ALLOW_INCOMPATIBLE_OPERATIONS") < 0)  { return -1;}
   if (hblTdb().getForceCIF())
   {
     if (restoreCQD("COMPRESSED_INTERNAL_FORMAT") < 0) { return -1;}

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/executor/ExHdfsScan.cpp
----------------------------------------------------------------------
diff --git a/core/sql/executor/ExHdfsScan.cpp b/core/sql/executor/ExHdfsScan.cpp
index 978bd41..cbaeabc 100644
--- a/core/sql/executor/ExHdfsScan.cpp
+++ b/core/sql/executor/ExHdfsScan.cpp
@@ -402,6 +402,8 @@ ExWorkProcRetcode ExHdfsScanTcb::work()
 	    hdfsOffset_ = 0;
             checkRangeDelimiter_ = FALSE;
 
+            dataModCheckDone_ = FALSE;
+
 	    if (hdfsScanTdb().getHdfsFileInfoList()->isEmpty())
 	      {
                 step_ = CHECK_FOR_DATA_MOD_AND_DONE;
@@ -420,8 +422,6 @@ ExWorkProcRetcode ExHdfsScanTcb::work()
 
 	    hdfsScanBufMaxSize_ = hdfsScanTdb().hdfsBufSize_;
 
-            dataModCheckDone_ = FALSE;
-
 	    if (numRanges_ > 0)
               step_ = CHECK_FOR_DATA_MOD;
             else
@@ -439,6 +439,8 @@ ExWorkProcRetcode ExHdfsScanTcb::work()
 
             if (NOT dataModCheckDone_)
               {
+                dataModCheckDone_ = TRUE;
+
                 Lng32 numOfPartLevels = hdfsScanTdb().numOfPartCols_;
 
                 if (hdfsScanTdb().hdfsDirsToCheck())
@@ -482,8 +484,6 @@ ExWorkProcRetcode ExHdfsScanTcb::work()
                     step_ = HANDLE_ERROR_AND_DONE;
                     break;
                   }
-
-                dataModCheckDone_ = TRUE;
               }
 
             if (step_ == CHECK_FOR_DATA_MOD_AND_DONE)

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/generator/GenExplain.cpp
----------------------------------------------------------------------
diff --git a/core/sql/generator/GenExplain.cpp b/core/sql/generator/GenExplain.cpp
index eeed24b..8b1d7a7 100644
--- a/core/sql/generator/GenExplain.cpp
+++ b/core/sql/generator/GenExplain.cpp
@@ -1357,10 +1357,17 @@ static NABoolean isInternalCQD(DefaultConstants attr)
 // regressions run. That can cause explain plan diffs.
 // Specify those cqds in these methods so they are not displayed.
 // This method is only called during regressions run.
-static NABoolean displayDuringRegressRun(DefaultConstants attr)
+NABoolean displayDuringRegressRun(DefaultConstants attr)
 {
   if ((attr == TRAF_READ_OBJECT_DESC) ||
-      (attr == TRAF_STORE_OBJECT_DESC))
+      (attr == TRAF_STORE_OBJECT_DESC) ||
+      (attr == ALLOW_INCOMPATIBLE_ASSIGNMENT) ||
+      (attr == ALLOW_INCOMPATIBLE_COMPARISON) ||
+      (attr == ALLOW_INCOMPATIBLE_OPERATIONS) ||
+      (attr == ALLOW_FIRSTN_IN_SUBQUERIES) ||
+      (attr == ALLOW_ORDER_BY_IN_SUBQUERIES) ||
+      (attr == GROUP_BY_USING_ORDINAL) ||
+      (attr == GROUP_OR_ORDER_BY_EXPR))
     return FALSE;
   else
     return TRUE;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/generator/GenFastTransport.cpp
----------------------------------------------------------------------
diff --git a/core/sql/generator/GenFastTransport.cpp b/core/sql/generator/GenFastTransport.cpp
index 60929b8..6600934 100644
--- a/core/sql/generator/GenFastTransport.cpp
+++ b/core/sql/generator/GenFastTransport.cpp
@@ -355,7 +355,7 @@ static short ft_codegen(Generator *generator,
             newExpr = newExpr->bindNode(generator->getBindWA());
             if (!newExpr || generator->getBindWA()->errStatus())
               {
-                GenAssert(0, "newExpr->bindNode failed");
+                GenExit(); //GenAssert(0, "newExpr->bindNode failed");
               }
             
             if (hiveInsertErrMode == 3)

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/generator/GenPreCode.cpp
----------------------------------------------------------------------
diff --git a/core/sql/generator/GenPreCode.cpp b/core/sql/generator/GenPreCode.cpp
index 812cbc1..998d62c 100644
--- a/core/sql/generator/GenPreCode.cpp
+++ b/core/sql/generator/GenPreCode.cpp
@@ -8408,7 +8408,11 @@ ItemExpr * BiRelat::preCodeGen(Generator * generator)
   UInt32 flags =
             ((CmpCommon::getDefault(LIMIT_MAX_NUMERIC_PRECISION) == DF_ON)
             ? NAType::LIMIT_MAX_NUMERIC_PRECISION : 0);
-
+  if (CmpCommon::getDefault(ALLOW_INCOMPATIBLE_OPERATIONS) == DF_ON)
+    {
+      flags |= NAType::ALLOW_INCOMP_OPER;
+    }
+  
   const NAType *result_type = type_op1->synthesizeType(SYNTH_RULE_UNION,
                                                        *type_op1,
                                                        *type_op2,
@@ -8725,6 +8729,35 @@ ItemExpr * Cast::preCodeGen(Generator * generator)
 
     } // numeric to date conversion
 
+  if ((CmpCommon::getDefault(ALLOW_INCOMPATIBLE_OPERATIONS) == DF_ON) &&
+      (sourceTypeQual == NA_NUMERIC_TYPE) &&
+      (targetTypeQual == NA_INTERVAL_TYPE))
+    { 
+      NumericType &sourceType =
+	(NumericType &)(child(0)->getValueId().getType());
+
+      if (NOT sourceType.isExact())
+        {
+	  // doing a float numeric to interval conversion.
+	  // convert source to corresponding exact numeric (largeint).
+          // This is the largest interval type that is supported.
+	  ItemExpr * newChild =
+	    new (generator->wHeap())
+	    Cast(child(0),
+		 new (generator->wHeap())
+		 SQLLargeInt(TRUE,
+                             child(0)->castToItemExpr()->
+                             getValueId().getType().supportsSQLnull()));
+	  newChild = newChild->bindNode(generator->getBindWA());
+	  newChild = newChild->preCodeGen(generator);
+	  if (! newChild)
+	    return NULL;
+          
+	  setChild(0, newChild);
+	}
+      
+    } // numeric to date conversion
+
   if ((sourceTypeQual == NA_DATETIME_TYPE) &&
       (targetTypeQual == NA_DATETIME_TYPE)) {
     DatetimeType &sourceType =

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/optimizer/BindItemExpr.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/BindItemExpr.cpp b/core/sql/optimizer/BindItemExpr.cpp
index 789587d..9b49da2 100644
--- a/core/sql/optimizer/BindItemExpr.cpp
+++ b/core/sql/optimizer/BindItemExpr.cpp
@@ -698,7 +698,13 @@ void ItemExpr::bindSelf(BindWA *bindWA)
   for (Int32 i = 0; i < getArity(); i++, currChildNo()++) {
 
     ItemExpr *boundExpr = child(i)->bindNode(bindWA);
-    if (bindWA->errStatus()) return;
+    if (bindWA->errStatus()) 
+      return;
+    if (! boundExpr)
+      {
+        bindWA->setErrStatus();
+        return;
+      }
 
     if (boundExpr->getOperatorType() == ITM_CONSTANT &&
 	((ConstValue *)boundExpr)->isNullWasDefaultSpec())
@@ -2220,12 +2226,7 @@ static ItemExpr * ItemExpr_handleIncompatibleComparison(
   }
 
   // Check if we are to allow certain incompatible comparisons
-  // Don't allow incompatible comparisons when DDL is being executed
-  if (((CmpCommon::getDefault(ALLOW_INCOMPATIBLE_COMPARISON) == DF_ON) &&
-       (!CmpCommon::statement()->isDDL())) ||
-      (CmpCommon::getDefault(MODE_SPECIAL_1) == DF_ON) ||
-      (CmpCommon::getDefault(MODE_SPECIAL_3) == DF_ON) ||
-      (CmpCommon::getDefault(MODE_SPECIAL_4) == DF_ON))
+  if (CmpCommon::getDefault(ALLOW_INCOMPATIBLE_OPERATIONS) == DF_ON)
   {
     // if left and right operands are incompatible, convert
     // one of them to the other type.
@@ -2344,30 +2345,6 @@ static ItemExpr * ItemExpr_handleIncompatibleComparison(
 	    }
       }
 
-    if (CmpCommon::getDefault(MODE_SPECIAL_3) == DF_ON)
-      {
-	if (((type1.getPrecision() == SQLDTCODE_TIMESTAMP) &&
-	     (type2.getPrecision() == SQLDTCODE_DATE)) ||
-	    ((type2.getPrecision() == SQLDTCODE_TIMESTAMP) &&
-	     (type1.getPrecision() == SQLDTCODE_DATE)))
-	  {
-	    // date and timestamp comparison.
-	    // Convert date to timestamp.
-	    conversion = 8;
-
-	    if (type1.getPrecision() == SQLDTCODE_TIMESTAMP)
-	      {
-		srcOpIndex = 1;
-		tgtOpIndex = 0;
-	      }
-	    else
-	      {
-		srcOpIndex = 0;
-		tgtOpIndex = 1;
-	      }
-	  }
-      }
-    
     // check for date to numeric comparison.
     // if one child is a column and the other child is not, then
     // convert the non-column child to the type of the column child.
@@ -2443,22 +2420,6 @@ static ItemExpr * ItemExpr_handleIncompatibleComparison(
       conversion = 4;
     }
 
-
-    if ((CmpCommon::getDefault(MODE_SPECIAL_3) == DF_OFF) &&
-	((conversion == 6) ||
-	 (conversion == 7)))
-      {
-	return NULL; // conversion = 6 only supported with CB217
-      }
-    else if (NOT (((CmpCommon::getDefault(ALLOW_INCOMPATIBLE_COMPARISON) == DF_ON) &&
-		   (!CmpCommon::statement()->isDDL())) ||
-		  (CmpCommon::getDefault(MODE_SPECIAL_1) == DF_ON) ||
-		  (CmpCommon::getDefault(MODE_SPECIAL_3) == DF_ON) ||
-		  (CmpCommon::getDefault(MODE_SPECIAL_4) == DF_ON)))
-      {
-	return NULL;
-      }
-
     ItemExpr * newOp = NULL;
 
     switch (conversion)
@@ -3570,100 +3531,104 @@ ItemExpr *Concat::bindNode(BindWA *bindWA)
   if (bindWA->errStatus()) 
     return this;
 
-  if (CmpCommon::getDefault(MODE_SPECIAL_1) == DF_ON)
-    {
-      // allow DATE || CHAR, NUMERIC || CHAR
-      const NAType &type1 = 
-	child(0)->castToItemExpr()->getValueId().getType();
-      const NAType &type2 = 
-	child(1)->castToItemExpr()->getValueId().getType();
-
-      Int32 srcChildIndex = -1;
-      Int32 convType = -1;
-      if ((type1.getTypeQualifier() == NA_CHARACTER_TYPE) &&
-	  (type2.getTypeQualifier() == NA_DATETIME_TYPE))
-	{
-	  // convert child(1)(DATETIME) to char type
-	  srcChildIndex = 1;
-	  convType = 1;
-	}
-      else if ((type1.getTypeQualifier() == NA_DATETIME_TYPE) &&
-	       (type2.getTypeQualifier() == NA_CHARACTER_TYPE))
-	{
-	  // convert child(1)(DATETIME) to char type
-	  srcChildIndex = 0;
-	  convType = 1;
-	}
-      else if ((type1.getTypeQualifier() == NA_NUMERIC_TYPE) &&
-	       (type2.getTypeQualifier() == NA_CHARACTER_TYPE))
-	{
-	  // convert child(0)(NUMERIC) to char type
-	  srcChildIndex = 0;
-	  convType = 2;
-	}
-      else if ((type1.getTypeQualifier() == NA_CHARACTER_TYPE) &&
-	       (type2.getTypeQualifier() == NA_NUMERIC_TYPE))
-	{
-	  // convert child(1)(NUMERIC) to char type
-	  srcChildIndex = 1;
-	  convType = 2;
-	}
-      
-      if (srcChildIndex >= 0)
-	{
-	  Lng32 dLen = 0;
-	  if (convType == 1)
-	    {
-	      DatetimeType &dtType = (DatetimeType&)
-		child(srcChildIndex)->castToItemExpr()->getValueId().getType();
-	      dLen = dtType.getDisplayLength();
-	    }
-	  else if (convType == 2)
-	    {
-	      NumericType &nType = (NumericType&)
-		child(srcChildIndex)->castToItemExpr()->getValueId().getType();
-	      dLen =
-		nType.getDisplayLength(nType.getFSDatatype(),
-				       nType.getNominalSize(),
-				       nType.getPrecision(),
-				       nType.getScale(),
-				       0);
-	    }
-
-	  ItemExpr * newChild = NULL;
-	  if (convType == 1)
-	    {
-	      newChild =
-		new (bindWA->wHeap())
-		Cast(child(srcChildIndex),
-		     new (bindWA->wHeap())
-		     SQLChar(dLen,
-			     child(srcChildIndex)->castToItemExpr()->
-			     getValueId().getType().supportsSQLnull()));
-	      newChild = newChild->bindNode(bindWA);
-	      if (bindWA->errStatus())
-		return this;
-	    }
-	  else if (convType == 2)
-	    {
-	      Parser parser(bindWA->currentCmpContext());
-	      char buf[1000];
-
-	      // right justify the string representation of numeric operand 
-	      // and then do the concat
-	      sprintf(buf, "CAST(SPACE(%d - CHAR_LENGTH(CAST(@A1 AS VARCHAR(%d)))) || CAST(@A1 AS VARCHAR(%d)) AS VARCHAR(%d))",
-		      dLen, dLen, dLen, dLen);
-	      newChild = 
-		parser.getItemExprTree(buf, strlen(buf), BINDITEMEXPR_STMTCHARSET, 1, child(srcChildIndex));
-	      
-	      newChild = newChild->bindNode(bindWA);
-	      if (bindWA->errStatus()) 
-		return this;
-	    }
-
-	  setChild(srcChildIndex, newChild);
-	}
-    }
+  if (CmpCommon::getDefault(ALLOW_INCOMPATIBLE_OPERATIONS) == DF_ON)
+  {
+    const NAType &type1 = 
+      child(0)->castToItemExpr()->getValueId().getType();
+    const NAType &type2 = 
+      child(1)->castToItemExpr()->getValueId().getType();
+    
+    // allow DATE || CHAR (in mode_special_1)
+    // allow NUMERIC || CHAR for all
+    Int32 srcChildIndex = -1;
+    Int32 convType = -1;
+    if ((type1.getTypeQualifier() == NA_CHARACTER_TYPE) &&
+        (type2.getTypeQualifier() == NA_DATETIME_TYPE))
+      {
+        // convert child(1)(DATETIME) to char type
+        srcChildIndex = 1;
+        convType = 1;
+      }
+    else if ((type1.getTypeQualifier() == NA_DATETIME_TYPE) &&
+             (type2.getTypeQualifier() == NA_CHARACTER_TYPE))
+      {
+        // convert child(1)(DATETIME) to char type
+        srcChildIndex = 0;
+        convType = 1;
+      }
+    else if ((type1.getTypeQualifier() == NA_NUMERIC_TYPE) &&
+             (type2.getTypeQualifier() == NA_CHARACTER_TYPE))
+      {
+        // convert child(0)(NUMERIC) to char type
+        srcChildIndex = 0;
+        convType = 2;
+      }
+    else if ((type1.getTypeQualifier() == NA_CHARACTER_TYPE) &&
+             (type2.getTypeQualifier() == NA_NUMERIC_TYPE))
+      {
+        // convert child(1)(NUMERIC) to char type
+        srcChildIndex = 1;
+        convType = 2;
+      }
+    
+    if ((srcChildIndex >= 0) &&
+        ((convType == 2) ||
+         ((convType == 1) &&
+          (CmpCommon::getDefault(MODE_SPECIAL_1) == DF_ON))))         
+      {
+        Lng32 dLen = 0;
+        if (convType == 1)
+          {
+            DatetimeType &dtType = (DatetimeType&)
+              child(srcChildIndex)->castToItemExpr()->getValueId().getType();
+            dLen = dtType.getDisplayLength();
+          }
+        else if (convType == 2)
+          {
+            NumericType &nType = (NumericType&)
+              child(srcChildIndex)->castToItemExpr()->getValueId().getType();
+            dLen =
+              nType.getDisplayLength(nType.getFSDatatype(),
+                                     nType.getNominalSize(),
+                                     nType.getPrecision(),
+                                     nType.getScale(),
+                                     0);
+          }
+        
+        ItemExpr * newChild = NULL;
+        if (convType == 1)
+          {
+            newChild =
+              new (bindWA->wHeap())
+              Cast(child(srcChildIndex),
+                   new (bindWA->wHeap())
+                   SQLChar(dLen,
+                           child(srcChildIndex)->castToItemExpr()->
+                           getValueId().getType().supportsSQLnull()));
+            newChild = newChild->bindNode(bindWA);
+            if (bindWA->errStatus())
+              return this;
+          }
+        else if (convType == 2)
+          {
+            Parser parser(bindWA->currentCmpContext());
+            char buf[1000];
+            
+            // right justify the string representation of numeric operand 
+            // and then do the concat
+            sprintf(buf, "CAST(SPACE(%d - CHAR_LENGTH(CAST(@A1 AS VARCHAR(%d)))) || CAST(@A1 AS VARCHAR(%d)) AS VARCHAR(%d))",
+                    dLen, dLen, dLen, dLen);
+            newChild = 
+              parser.getItemExprTree(buf, strlen(buf), BINDITEMEXPR_STMTCHARSET, 1, child(srcChildIndex));
+            
+            newChild = newChild->bindNode(bindWA);
+            if (bindWA->errStatus()) 
+              return this;
+          }
+        
+        setChild(srcChildIndex, newChild);
+      }
+  }
 
   // Concat inherits from BuiltinFunction .. Function .. ItemExpr.
   BuiltinFunction::bindNode(bindWA);
@@ -4279,37 +4244,37 @@ ItemExpr *Trim::bindNode(BindWA *bindWA)
   if (bindWA->errStatus()) 
     return this;
 
-  if (CmpCommon::getDefault(MODE_SPECIAL_1) == DF_ON)
+  if (CmpCommon::getDefault(ALLOW_INCOMPATIBLE_OPERATIONS) == DF_ON)
     {
       // if argument is numeric, convert it to string.
       const NAType &type1 = 
-	child(1)->castToItemExpr()->getValueId().getType();
+        child(1)->castToItemExpr()->getValueId().getType();
       if (type1.getTypeQualifier() == NA_NUMERIC_TYPE)
-	{
-	  const NumericType &numeric  = (NumericType&)type1;
-	  if ((numeric.isExact()) &&
-	      (NOT numeric.isBigNum()) &&
-	      (numeric.getScale() == 0))
-	    {
-	      Lng32 dLen =
-		numeric.getDisplayLength(numeric.getFSDatatype(),
-					 numeric.getNominalSize(),
-					 numeric.getPrecision(),
-					 numeric.getScale(),
-					 0);
-	      
-	      ItemExpr * newChild =
-		new (bindWA->wHeap())
-		Cast(child(1),
-		     new (bindWA->wHeap())
-		     SQLChar(dLen, type1.supportsSQLnull()));
-	      
-	      newChild = newChild->bindNode(bindWA);
-	      if (bindWA->errStatus())
-		return this;
-	      setChild(1, newChild);
- 	    }
-	}
+        {
+          const NumericType &numeric  = (NumericType&)type1;
+          if ((numeric.isExact()) &&
+              (NOT numeric.isBigNum()) &&
+              (numeric.getScale() == 0))
+            {
+              Lng32 dLen =
+                numeric.getDisplayLength(numeric.getFSDatatype(),
+                                         numeric.getNominalSize(),
+                                         numeric.getPrecision(),
+                                         numeric.getScale(),
+                                         0);
+              
+              ItemExpr * newChild =
+                new (bindWA->wHeap())
+                Cast(child(1),
+                     new (bindWA->wHeap())
+                     SQLChar(dLen, type1.supportsSQLnull()));
+              
+              newChild = newChild->bindNode(bindWA);
+              if (bindWA->errStatus())
+                return this;
+              setChild(1, newChild);
+            }
+        }
     }
 
   // Trim inherits from BuiltinFunction .. Function .. ItemExpr.
@@ -4751,7 +4716,13 @@ Int32 ItemExpr::convertToValueIdSet(ValueIdSet &vs,
       else
       {
         boundExpr = (ItemExpr *) currIE->bindNodeRoot(bindWA) ;
-        if (bindWA->errStatus()) return TRUE;             // error
+        if (bindWA->errStatus()) 
+          return TRUE;
+        if (! boundExpr)
+          {
+            bindWA->setErrStatus();
+            return TRUE;             // error
+          }
 
         if ( bindWA->getCurrentScope()->context()->inOrderBy() ||
              bindWA->getCurrentScope()->context()->inGroupByClause() )
@@ -5610,10 +5581,6 @@ ItemExpr *BiArith::bindNode(BindWA *bindWA)
   //
   // <number> is the interval value equivalent of the least sig field 
   // of <datetime> for datetime computation.
-  NABoolean modeSpecial1 = (CmpCommon::getDefault(MODE_SPECIAL_1) == DF_ON);
-
-  NABoolean modeSpecial4 = (CmpCommon::getDefault(MODE_SPECIAL_4) == DF_ON);
-
   const NAType *naType0 = &child(0)->getValueId().getType();
   const NAType *naType1 = &child(1)->getValueId().getType();
   if (isDateMathFunction() &&
@@ -5632,28 +5599,20 @@ ItemExpr *BiArith::bindNode(BindWA *bindWA)
 	(naType1->getTypeQualifier() == NA_NUMERIC_TYPE)) ||
        ((naType0->getTypeQualifier() == NA_NUMERIC_TYPE) &&
 	(naType1->getTypeQualifier() == NA_INTERVAL_TYPE)) ) ||
-   	   
+      
       (isDateMathFunction() &&
        (naType0->getTypeQualifier() == NA_DATETIME_TYPE) &&
        (naType1->getTypeQualifier() == NA_INTERVAL_TYPE)) ||
-
-       ((modeSpecial1) &&
-       (((naType0->getTypeQualifier() == NA_INTERVAL_TYPE) &&
-	(naType1->getTypeQualifier() == NA_INTERVAL_TYPE)) ||
-       ((naType0->getTypeQualifier() == NA_CHARACTER_TYPE) &&
-	(naType1->getTypeQualifier() == NA_NUMERIC_TYPE)) ||
-       ((naType0->getTypeQualifier() == NA_NUMERIC_TYPE) &&
-	 (naType1->getTypeQualifier() == NA_CHARACTER_TYPE)))) ||
-
-       ((modeSpecial4) &&
+      
+      ((CmpCommon::getDefault(ALLOW_INCOMPATIBLE_OPERATIONS) == DF_ON) &&
        (((naType0->getTypeQualifier() == NA_INTERVAL_TYPE) &&
-	(naType1->getTypeQualifier() == NA_INTERVAL_TYPE)) ||
-       ((naType0->getTypeQualifier() == NA_CHARACTER_TYPE) &&
-	(naType1->getTypeQualifier() == NA_NUMERIC_TYPE)) ||
-       ((naType0->getTypeQualifier() == NA_NUMERIC_TYPE) &&
-	 (naType1->getTypeQualifier() == NA_CHARACTER_TYPE)) ||
-       ((naType0->getTypeQualifier() == NA_DATETIME_TYPE) &&
-        (naType1->getTypeQualifier() == NA_DATETIME_TYPE)))) )
+         (naType1->getTypeQualifier() == NA_INTERVAL_TYPE)) ||
+        ((naType0->getTypeQualifier() == NA_CHARACTER_TYPE) &&
+         (naType1->getTypeQualifier() == NA_NUMERIC_TYPE)) ||
+        ((naType0->getTypeQualifier() == NA_NUMERIC_TYPE) &&
+         (naType1->getTypeQualifier() == NA_CHARACTER_TYPE)) ||
+        ((naType0->getTypeQualifier() == NA_DATETIME_TYPE) &&
+         (naType1->getTypeQualifier() == NA_DATETIME_TYPE)))))
     {
       // if datetime +|- numeric, then cast numeric to interval type.
       // Validate that this is being done for
@@ -5690,7 +5649,7 @@ ItemExpr *BiArith::bindNode(BindWA *bindWA)
 	// if datetime +|- interval, then cast datetime to timestamp type.
 
      else if ((naType0->getTypeQualifier() == NA_DATETIME_TYPE) &&
-	  (naType1->getTypeQualifier() == NA_INTERVAL_TYPE))
+              (naType1->getTypeQualifier() == NA_INTERVAL_TYPE))
 	{
 	  const DatetimeType* datetime = (DatetimeType*)naType0;
 	  const IntervalType*  interval  = (IntervalType*)naType1;
@@ -5820,7 +5779,6 @@ ItemExpr *BiArith::bindNode(BindWA *bindWA)
 	       (naType1->getTypeQualifier() == NA_DATETIME_TYPE) &&
                (getOperatorType() == ITM_MINUS))
 	{
-          // in mode_special_4, datetime subtraction follows special orc semantics.
           // Column of DATE datatype is internally created as TIMESTAMP(0).
           // timestamp(0) - date               =  diff in days
           // timestamp(0) - timestamp(0)  = diff in days
@@ -5830,9 +5788,7 @@ ItemExpr *BiArith::bindNode(BindWA *bindWA)
           if (((datetime1->getSubtype() == DatetimeType::SUBTYPE_SQLTimestamp) ||
                (datetime1->getSubtype() == DatetimeType::SUBTYPE_SQLDate)) &&
               ((datetime2->getSubtype() == DatetimeType::SUBTYPE_SQLTimestamp) ||
-               (datetime2->getSubtype() == DatetimeType::SUBTYPE_SQLDate)) &&
-              (datetime1->getScale() == 0) &&
-              (datetime2->getScale() == 0))
+               (datetime2->getSubtype() == DatetimeType::SUBTYPE_SQLDate)))
             {
               ItemExpr * newChild = NULL;
               if (datetime1->getSubtype() == DatetimeType::SUBTYPE_SQLTimestamp)
@@ -6117,8 +6073,7 @@ ItemExpr *Assign::bindNode(BindWA *bindWA)
 
   if ((NOT child(0)->getValueId().getType().
        isCompatible(child(1)->getValueId().getType())) &&
-      ((CmpCommon::getDefault(MODE_SPECIAL_1) == DF_ON) ||
-       (CmpCommon::getDefault(ALLOW_INCOMPATIBLE_ASSIGNMENT) == DF_ON)) &&
+      (CmpCommon::getDefault(ALLOW_INCOMPATIBLE_OPERATIONS) == DF_ON) &&
       ((child(1)->getOperatorType() != ITM_CONSTANT) ||
        (NOT ((ConstValue *) child(1).getPtr() )->isNull())))
     {
@@ -6160,8 +6115,7 @@ ItemExpr *Assign::bindNode(BindWA *bindWA)
       if ((opType == REL_UPDATE) || (opType == REL_INSERT))
 	{
 	  NABoolean specialMode = 
-	    ((CmpCommon::getDefault(MODE_SPECIAL_1) == DF_ON) ||
-	     (CmpCommon::getDefault(MODE_SPECIAL_2) == DF_ON));
+	    (CmpCommon::getDefault(MODE_SPECIAL_1) == DF_ON);
 
           NABoolean checkForTrunc = TRUE;
           NABoolean noStringTruncWarn = FALSE;
@@ -6516,8 +6470,7 @@ ItemExpr *Like::applyBeginEndKeys(BindWA *bindWA, ItemExpr *boundExpr,
 
   const ConstValue *patternNode, *escapeNode = NULL;
 
-  NABoolean specialMode = ((CmpCommon::getDefault(MODE_SPECIAL_1) == DF_ON) || 
-			   (CmpCommon::getDefault(MODE_SPECIAL_2) == DF_ON));
+  NABoolean specialMode = (CmpCommon::getDefault(MODE_SPECIAL_1) == DF_ON);
 
   if (specialMode)
   {
@@ -7142,7 +7095,7 @@ ItemExpr *Case::bindNode(BindWA *bindWA)
     } while (ifThenElse AND ifThenElse->getOperatorType() == ITM_IF_THEN_ELSE);
   }
 
-  if (CmpCommon::getDefault(MODE_SPECIAL_1) == DF_ON)
+  if (CmpCommon::getDefault(ALLOW_INCOMPATIBLE_OPERATIONS) == DF_ON)
     {
       // if operands are incompatible, insert cast node to convert them
       // to a common datatype.
@@ -7155,121 +7108,120 @@ ItemExpr *Case::bindNode(BindWA *bindWA)
       Lng32 dLen = 0;
       Lng32 thenClauseNum = 1;
       while ((ifThenElse) && (NOT done))
-	{
-	  thenClause = thenClause->bindNode(bindWA);
-	  if (bindWA->errStatus())
-	    return this;
-
-	  ifThenElse->setChild(thenClauseNum, thenClause);
-	  
-	  if ((thenClause->getOperatorType() == ITM_CONSTANT) &&
-	      ((ConstValue *)thenClause)->isNull())
-	    {
-	      // do nothing
-	    }
-	  else if (thenClause->getValueId().getType().getTypeQualifier() 
-	      == NA_CHARACTER_TYPE)
-	    {
-	      if (thenClause->getValueId().getType().getNominalSize() > dLen)
-		dLen = thenClause->getValueId().getType().getNominalSize();
-	      charFound = TRUE;
-	    }
-	  else if (thenClause->getValueId().getType().getTypeQualifier() 
-		   == NA_NUMERIC_TYPE)
-	    {
-	      NumericType &numeric = (NumericType&)
-		thenClause->getValueId().getType();
-	      if ((numeric.isExact()) &&
-		  //		  (NOT numeric.isBigNum()) &&
-		  (numeric.getScale() == 0))
-		{
-		  Lng32 numericDLen =
-		    numeric.getDisplayLength(numeric.getFSDatatype(),
-					   numeric.getNominalSize(),
-					   numeric.getPrecision(),
-					   numeric.getScale(),
-					   0);
-		  
-		  if (numericDLen > dLen)
-		    dLen = numericDLen;
-		  numericFound = TRUE;
-		}
-	      else
-		{
-		  done = TRUE;
-		}
-	    }
-	  else
-	    {
-	      done = TRUE;
-	    }
-
-	  if (thenClauseNum == 2)
-	    ifThenElse = NULL;
-	  else
-	    {
-	      if (ifThenElse->child(2)->getOperatorType() == ITM_IF_THEN_ELSE)
-		{
-		  ifThenElse = ifThenElse->child(2);
-		  thenClause = ifThenElse->child(1);
-		  thenClauseNum = 1;
-		}
-	      else
-		{
-		  // this is the else clause
-		  thenClause = ifThenElse->child(2);
-		  thenClauseNum = 2;
-		}
-	    }
-	} // while
-
+        {
+          thenClause = thenClause->bindNode(bindWA);
+          if (bindWA->errStatus())
+            return this;
+      
+          ifThenElse->setChild(thenClauseNum, thenClause);
+      
+          if ((thenClause->getOperatorType() == ITM_CONSTANT) &&
+              ((ConstValue *)thenClause)->isNull())
+            {
+              // do nothing
+            }
+          else if (thenClause->getValueId().getType().getTypeQualifier() 
+                   == NA_CHARACTER_TYPE)
+            {
+              if (thenClause->getValueId().getType().getNominalSize() > dLen)
+                dLen = thenClause->getValueId().getType().getNominalSize();
+              charFound = TRUE;
+            }
+          else if (thenClause->getValueId().getType().getTypeQualifier() 
+                   == NA_NUMERIC_TYPE)
+            {
+              NumericType &numeric = (NumericType&)
+                thenClause->getValueId().getType();
+              if ((numeric.isExact()) &&
+                  //		  (NOT numeric.isBigNum()) &&
+                  (numeric.getScale() == 0))
+                {
+                  Lng32 numericDLen =
+                    numeric.getDisplayLength(numeric.getFSDatatype(),
+                                             numeric.getNominalSize(),
+                                             numeric.getPrecision(),
+                                             numeric.getScale(),
+                                             0);
+              
+                  if (numericDLen > dLen)
+                    dLen = numericDLen;
+                  numericFound = TRUE;
+                }
+              else
+                {
+                  done = TRUE;
+                }
+            }
+          else
+            {
+              done = TRUE;
+            }
+      
+          if (thenClauseNum == 2)
+            ifThenElse = NULL;
+          else
+            {
+              if (ifThenElse->child(2)->getOperatorType() == ITM_IF_THEN_ELSE)
+                {
+                  ifThenElse = ifThenElse->child(2);
+                  thenClause = ifThenElse->child(1);
+                  thenClauseNum = 1;
+                }
+              else
+                {
+                  // this is the else clause
+                  thenClause = ifThenElse->child(2);
+                  thenClauseNum = 2;
+                }
+            }
+        } // while
+  
       if ((NOT done) && (charFound) && (numericFound))
-	{
-	  ifThenElse = child(0);
-	  thenClause = ifThenElse->child(1)->castToItemExpr();
-	  thenClauseNum = 1;
-	  while (ifThenElse)
-	    {
-	      if (thenClause->getValueId().getType().getTypeQualifier() 
-		  == NA_NUMERIC_TYPE)
-		{
-		  // cast to character
-		  thenClause =
-		    new (bindWA->wHeap())
-		    Cast(thenClause,
-			 new (bindWA->wHeap())
-			 SQLChar(dLen,
-				 thenClause->
-				 getValueId().getType().supportsSQLnull()));
-
-		  thenClause = thenClause->bindNode(bindWA);
-		  if (bindWA->errStatus())
-		    return this;
-
-		  ifThenElse->setChild(thenClauseNum, thenClause);
-		}
-
-	      if (thenClauseNum == 2)
-		ifThenElse = NULL;
-	      else
-		{
-		  if (ifThenElse->child(2)->getOperatorType() == ITM_IF_THEN_ELSE)
-		    {
-		      ifThenElse = ifThenElse->child(2);
-		      thenClause = ifThenElse->child(1);
-		      thenClauseNum = 1;
-		    }
-		  else
-		    {
-		      // this is the else clause
-		      thenClause = ifThenElse->child(2);
-		      thenClauseNum = 2;
-		    }
-		}
-	    } // while
-
-	}
-    } // mode special1
+        {
+          ifThenElse = child(0);
+          thenClause = ifThenElse->child(1)->castToItemExpr();
+          thenClauseNum = 1;
+          while (ifThenElse)
+            {
+              if (thenClause->getValueId().getType().getTypeQualifier() 
+                  == NA_NUMERIC_TYPE)
+                {
+                  // cast to character
+                  thenClause =
+                    new (bindWA->wHeap())
+                    Cast(thenClause,
+                         new (bindWA->wHeap())
+                         SQLChar(dLen,
+                                 thenClause->
+                                 getValueId().getType().supportsSQLnull()));
+                  
+                  thenClause = thenClause->bindNode(bindWA);
+                  if (bindWA->errStatus())
+                    return this;
+                  
+                  ifThenElse->setChild(thenClauseNum, thenClause);
+                }
+              
+              if (thenClauseNum == 2)
+                ifThenElse = NULL;
+              else
+                {
+                  if (ifThenElse->child(2)->getOperatorType() == ITM_IF_THEN_ELSE)
+                    {
+                      ifThenElse = ifThenElse->child(2);
+                      thenClause = ifThenElse->child(1);
+                      thenClauseNum = 1;
+                    }
+                  else
+                    {
+                      // this is the else clause
+                      thenClause = ifThenElse->child(2);
+                      thenClauseNum = 2;
+                    }
+                }
+            } // while
+        }
+    } // allow incompatible operations
   
   // Case inherits from BuiltinFunction .. Function .. ItemExpr.
   ItemExpr *boundExpr = BuiltinFunction::bindNode(bindWA);
@@ -8998,7 +8950,7 @@ ItemExpr *QuantifiedComp::bindNode(BindWA *bindWA)
 
   // if left child is incompatible with right child, insert a node
   // to convert left to right.
-  if ((CmpCommon::getDefault(MODE_SPECIAL_1) == DF_ON) &&
+  if ((CmpCommon::getDefault(ALLOW_INCOMPATIBLE_OPERATIONS) == DF_ON) &&
       (createdFromINlist()))
     {
       const NAType &type1 = 
@@ -9998,8 +9950,7 @@ ItemExpr *ValueIdUnion::bindNode(BindWA *bindWA)
   if (nodeIsBound())
     return getValueId().getItemExpr();
 
-
-  if ((CmpCommon::getDefault(MODE_SPECIAL_1) == DF_ON) &&
+  if ((CmpCommon::getDefault(ALLOW_INCOMPATIBLE_OPERATIONS) == DF_ON) &&
       (isTrueUnion()) &&
       (entries() == 2))
     {
@@ -10702,7 +10653,7 @@ ItemExpr *ZZZBinderFunction::bindNode(BindWA *bindWA)
 	if (tempBoundTree->getValueId().getType().getTypeQualifier() !=
 	    NA_DATETIME_TYPE)
 	  {
-	    // 4071 The operand of a LAST_DAY function must be a datetime.
+	    // 4071 The operand of a NEXT_DAY function must be a datetime.
 	    *CmpCommon::diags() << DgSqlCode(-4071) << DgString0(getTextUpper());
 	    bindWA->setErrStatus();
 	    return this;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/optimizer/BindRelExpr.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/BindRelExpr.cpp b/core/sql/optimizer/BindRelExpr.cpp
index d232f2b..4e88616 100644
--- a/core/sql/optimizer/BindRelExpr.cpp
+++ b/core/sql/optimizer/BindRelExpr.cpp
@@ -3796,11 +3796,9 @@ static void fixUpSelectIndeciesInSet(ValueIdSet & expr,
 
 RelRoot * RelRoot::transformOrderByWithExpr(BindWA *bindWA)
 {
-  NABoolean specialMode = (CmpCommon::getDefault(MODE_SPECIAL_4) == DF_ON);
-  
+  NABoolean specialMode = (CmpCommon::getDefault(GROUP_OR_ORDER_BY_EXPR) == DF_ON);
   if (NOT specialMode)
     return this;
-  
   ItemExprList origSelectList(bindWA->wHeap());
   ItemExprList origOrderByList(bindWA->wHeap());
   
@@ -3924,17 +3922,10 @@ RelRoot * RelRoot::transformOrderByWithExpr(BindWA *bindWA)
 RelRoot * RelRoot::transformGroupByWithOrdinalPhase1(BindWA *bindWA)
 {
   NABoolean specialMode =
-    ((CmpCommon::getDefault(MODE_SPECIAL_1) == DF_ON) ||
-     (CmpCommon::getDefault(MODE_SPECIAL_2) == DF_ON) ||
-     (CmpCommon::getDefault(MODE_SPECIAL_4) == DF_ON));
-
-  if ((CmpCommon::getDefault(GROUP_BY_USING_ORDINAL) == DF_OFF) &&
-      (NOT specialMode))
-    return this;
+    (CmpCommon::getDefault(MODE_SPECIAL_1) == DF_ON);
 
   // make sure child of root is a groupby node.or a sequence node 
   // whose child is a group by node
-  // And has groupby clause, if in specialMode
   if (child(0)->getOperatorType() != REL_GROUPBY && 
       (child(0)->getOperatorType() != REL_SEQUENCE || 
        (child(0)->child(0) && child(0)->child(0)->getOperatorType()!=REL_GROUPBY)))
@@ -3985,7 +3976,7 @@ RelRoot * RelRoot::transformGroupByWithOrdinalPhase1(BindWA *bindWA)
   NABoolean foundSelIndex = FALSE;
 
   NABoolean lookForRenamedCols = TRUE;
-  if ((CmpCommon::getDefault(GROUP_BY_USING_ORDINAL) != DF_ALL) &&
+  if ((CmpCommon::getDefault(GROUP_OR_ORDER_BY_EXPR) == DF_OFF) &&
       (NOT specialMode))
     lookForRenamedCols = FALSE;
 
@@ -4247,16 +4238,13 @@ RelRoot * RelRoot::transformGroupByWithOrdinalPhase1(BindWA *bindWA)
       grby->addGroupExprTree(newGroupByList.convertToItemExpr());
     }
 
-  if ((CmpCommon::getDefault(GROUP_BY_USING_ORDINAL) != DF_OFF) ||
-      (specialMode)) {
-    grby->setParentRootSelectList(getCompExprTree());
-  }
+  grby->setParentRootSelectList(getCompExprTree());
 
   // if order by and group by are specified, check to see that
   // all columns specified in the order by clause are also present
   // in the group by clause.
   allOrderByRefsInGby_ = FALSE;
-  if ((specialMode) &&
+  if (
       (getOrderByTree()) &&
       (grby->getGroupExprTree() != NULL))
     {
@@ -4306,9 +4294,7 @@ RelRoot * RelRoot::transformGroupByWithOrdinalPhase1(BindWA *bindWA)
 RelRoot * RelRoot::transformGroupByWithOrdinalPhase2(BindWA *bindWA)
 {
   NABoolean specialMode =
-    ((CmpCommon::getDefault(MODE_SPECIAL_1) == DF_ON) ||
-     (CmpCommon::getDefault(MODE_SPECIAL_2) == DF_ON) ||
-     (CmpCommon::getDefault(MODE_SPECIAL_4) == DF_ON));
+    (CmpCommon::getDefault(MODE_SPECIAL_1) == DF_ON);
 
   // make sure child of root is a groupby node.or a sequence node 
   // whose child is a group by node
@@ -4481,9 +4467,7 @@ RelRoot * RelRoot::transformGroupByWithOrdinalPhase2(BindWA *bindWA)
   // recreate the groupExpr expression after updating the value ids
   grby->setGroupExpr (groupExprCpy);
 
-  if (((CmpCommon::getDefault(GROUP_BY_USING_ORDINAL) != DF_OFF) ||
-       (specialMode)) &&
-      (grby->selPredTree()) &&
+  if ((grby->selPredTree()) &&
       (grby->selIndexInHaving()))
     {
       setValueIdForRenamedColsInHaving(bindWA, grby->selPredTree(),
@@ -5386,7 +5370,8 @@ RelExpr *RelRoot::bindNode(BindWA *bindWA)
     bindWA->setHostArraysArea(tempWA);
   }
 
-  if (bindWA->errStatus()) return NULL;
+  if (bindWA->errStatus()) 
+    return NULL;
 
   // For SPJ, store the spOutParams_ from the bindWA in RelRoot,
   // We need it at codegen
@@ -5771,11 +5756,9 @@ RelExpr *RelRoot::bindNode(BindWA *bindWA)
       }
       //10-031125-1549 -end
 
-      NABoolean specialMode =
-        ((CmpCommon::getDefault(MODE_SPECIAL_1) == DF_ON) ||
-         (CmpCommon::getDefault(MODE_SPECIAL_2) == DF_ON) ||
-         (CmpCommon::getDefault(MODE_SPECIAL_4) == DF_ON));
+      NABoolean specialMode = TRUE;
       
+
       // In specialMode, we want to support order by on columns
       // which are not explicitely specified in the select list.
       // Ex: select a+1 from t group by a order by a;
@@ -6845,10 +6828,6 @@ void RelRoot::findKeyAndInsertInOutputList( ComSecurityKeySet KeysForTab
 
 RelExpr *GroupByAgg::bindNode(BindWA *bindWA)
 {
-  NABoolean specialMode =
-    ((CmpCommon::getDefault(MODE_SPECIAL_1) == DF_ON) ||
-     (CmpCommon::getDefault(MODE_SPECIAL_2) == DF_ON));
-
   if (nodeIsBound())
   {
     bindWA->getCurrentScope()->setRETDesc(getRETDesc());
@@ -6917,10 +6896,7 @@ RelExpr *GroupByAgg::bindNode(BindWA *bindWA)
       vid.getItemExpr()->setIsGroupByExpr(TRUE);
     }
 
-
-    if (((CmpCommon::getDefault(GROUP_BY_USING_ORDINAL) != DF_OFF) ||
-        (specialMode)) &&
-        (groupExprTree != NULL) &&
+    if ((groupExprTree != NULL) &&
         (getParentRootSelectList() != NULL))
       {
         RETDesc * childRETDesc = child(0)->getRETDesc();
@@ -9884,7 +9860,7 @@ RelExpr *Insert::bindNode(BindWA *bindWA)
             // If we allow incompatible type assignments, also include the
             // added cast into the updateToSelectMap
             assignSrcType.getTypeQualifier() !=  sourceType.getTypeQualifier() &&
-            CmpCommon::getDefault(ALLOW_INCOMPATIBLE_ASSIGNMENT) == DF_ON))
+            CmpCommon::getDefault(ALLOW_INCOMPATIBLE_OPERATIONS) == DF_ON))
         {
           updateToSelectMap().addMapEntry(target,assign->getSource());
         }

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/optimizer/EncodedValue.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/EncodedValue.cpp b/core/sql/optimizer/EncodedValue.cpp
index 8958299..ffcab14 100644
--- a/core/sql/optimizer/EncodedValue.cpp
+++ b/core/sql/optimizer/EncodedValue.cpp
@@ -220,9 +220,8 @@ NormValue::NormValue(const ConstValue * constant, NABoolean negate)
   void * theValue = constant->getConstValue();
 
   NABoolean reset = FALSE;
-  if (((CmpCommon::getDefault(::MODE_SPECIAL_1) == DF_ON) ||
-       (CmpCommon::getDefault(::MODE_SPECIAL_2) == DF_ON)) && 
-      (theType->getTypeQualifier() == NA_CHARACTER_TYPE)) 
+  if ((CmpCommon::getDefault(::MODE_SPECIAL_1) == DF_ON) &&
+      (theType->getTypeQualifier() == NA_CHARACTER_TYPE))
     {
       CharType *cType = (CharType *)theType;
       if((! cType->isCaseinsensitive()) &&

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/optimizer/OptimizerSimulator.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/OptimizerSimulator.cpp b/core/sql/optimizer/OptimizerSimulator.cpp
index 62ff8c2..f159249 100644
--- a/core/sql/optimizer/OptimizerSimulator.cpp
+++ b/core/sql/optimizer/OptimizerSimulator.cpp
@@ -2139,19 +2139,6 @@ void OptimizerSimulator::capture_TableOrView(NATable * naTab)
       
       ofstream * viewLogfile = writeSysCallStream_[VIEWDDLS];
 
-      // Need to set CQDs to enable special syntax if running in special modes
-      if (CmpCommon::getDefault(MODE_SPECIAL_1) == DF_ON)
-      {
-          (*viewLogfile) << "control query default DISABLE_READ_ONLY 'ON';" << endl;
-          (*viewLogfile) << "control query default MODE_SPECIAL_1 'ON';" << endl;
-      }
-
-      if (CmpCommon::getDefault(MODE_SPECIAL_2) == DF_ON)
-      {
-          (*viewLogfile) << "control query default DISABLE_READ_ONLY 'ON';" << endl;
-          (*viewLogfile) << "control query default MODE_SPECIAL_2 'ON';" << endl;
-      }
-
       (*viewLogfile) << viewText <<endl;
 
       // insert viewName into hash table

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/optimizer/QRDescGenerator.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/QRDescGenerator.cpp b/core/sql/optimizer/QRDescGenerator.cpp
index f8bb9f6..e699034 100644
--- a/core/sql/optimizer/QRDescGenerator.cpp
+++ b/core/sql/optimizer/QRDescGenerator.cpp
@@ -228,8 +228,7 @@ NABoolean QRDescGenerator::typeSupported(const NAType* type)
 
       case NA_CHARACTER_TYPE:
         {
-          if ((CmpCommon::getDefault(MODE_SPECIAL_1) == DF_ON)||
-              (CmpCommon::getDefault(MODE_SPECIAL_2) == DF_ON)) 
+          if (CmpCommon::getDefault(MODE_SPECIAL_1) == DF_ON)
             return FALSE;
           return ((CharType*)type)->getCollation() == CharInfo::DefaultCollation;
 	      }

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/optimizer/SynthType.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/SynthType.cpp b/core/sql/optimizer/SynthType.cpp
index ed64652..2d48c50 100644
--- a/core/sql/optimizer/SynthType.cpp
+++ b/core/sql/optimizer/SynthType.cpp
@@ -290,26 +290,27 @@ static Int32 getNumCHARACTERArgs(ItemExpr *parentOp)
 
 NABoolean NAType::isComparable(const NAType &other,
 			       ItemExpr *parentOp,
-			       Int32 emitErr) const
+			       Int32 emitErr,
+                               UInt32 * flags) const
 {
   #ifndef NDEBUG
     CMPASSERT(parentOp);	//## reserved for future errmsg 4034 w/ unparse,
   #endif			// for CoAndCo propagation and for errmsgs!
 
-	if (isCompatible(other))
-		return TRUE;
-	NAString defVal;
-	NABoolean charsetInference =
-		(CmpCommon::getDefault(INFER_CHARSET, defVal) == DF_ON);
-	if(charsetInference  &&
-		getTypeQualifier()       == NA_CHARACTER_TYPE &&
-		other.getTypeQualifier() == NA_CHARACTER_TYPE){  // do not reject matches of UNKNOWN_CHARSET with UNKNOWN_CHARSET
-			CharType *ct = (CharType *)this;
-			if (ct->isCompatibleAllowUnknownCharset(other))
-				return TRUE;
-		}
-
-  if (emitErr == EmitErrIfAnyChar)
+    if (isCompatible(other, flags))
+      return TRUE;
+    NAString defVal;
+    NABoolean charsetInference =
+      (CmpCommon::getDefault(INFER_CHARSET, defVal) == DF_ON);
+    if(charsetInference  &&
+       getTypeQualifier()       == NA_CHARACTER_TYPE &&
+       other.getTypeQualifier() == NA_CHARACTER_TYPE){  // do not reject matches of UNKNOWN_CHARSET with UNKNOWN_CHARSET
+      CharType *ct = (CharType *)this;
+      if (ct->isCompatibleAllowUnknownCharset(other))
+        return TRUE;
+    }
+    
+    if (emitErr == EmitErrIfAnyChar)
     if (getTypeQualifier()       != NA_CHARACTER_TYPE &&
         other.getTypeQualifier() != NA_CHARACTER_TYPE)
       emitErr = FALSE;
@@ -342,9 +343,10 @@ NABoolean NAType::isComparable(const NAType &other,
 
 NABoolean CharType::isComparable(const NAType &otherNA,
 				 ItemExpr *parentOp,
-				 Int32 emitErr) const
+				 Int32 emitErr,
+                                 UInt32 * flags) const
 {
-  if (NOT NAType::isComparable(otherNA, parentOp, emitErr))
+  if (NOT NAType::isComparable(otherNA, parentOp, emitErr, flags))
     return FALSE;
 
   const CharType &other = (const CharType &)otherNA;
@@ -567,9 +569,6 @@ static NABoolean synthItemExprLists(ItemExprList &exprList1,
 	// 3. DATE and numeric.  Date is an interval from year 1900.
 	// 4. interval and numeric.
 
-	// Or for MODE_SPECIAL_3:
-	// between date and timestamp.
-
 	// Check if this is char and numeric comparison
 	if (((operand1->getTypeQualifier() == NA_CHARACTER_TYPE) &&
 	     (operand2->getTypeQualifier() == NA_NUMERIC_TYPE) &&
@@ -655,19 +654,18 @@ static NABoolean synthItemExprLists(ItemExprList &exprList1,
 		  return TRUE;
 	      }
 	  }
-
-	if (CmpCommon::getDefault(MODE_SPECIAL_3) == DF_ON)
-	  {
-	    if (((vid1.getType().getPrecision() == SQLDTCODE_TIMESTAMP) &&
-		 (vid2.getType().getPrecision() == SQLDTCODE_DATE)) ||
-		((vid2.getType().getPrecision() == SQLDTCODE_TIMESTAMP) &&
-		 (vid1.getType().getPrecision() == SQLDTCODE_DATE)))
-	      return TRUE;
-	  }
       }
 
+    UInt32 flags = 0;
+    if (CmpCommon::getDefault(ALLOW_INCOMPATIBLE_OPERATIONS) == DF_ON)
+      {
+        flags |= NAType::ALLOW_INCOMP_OPER;
+      }
+    
     //## errmsg 4034 w/ unparse?
-    if ( DoCompatibilityTest && NOT operand1->isComparable(*operand2, parentOp) )
+    if ( DoCompatibilityTest && 
+         NOT operand1->isComparable(*operand2, parentOp,
+                                    NAType::EmitErrAlways, &flags) )
       return FALSE; 
   }
   return TRUE;			// success
@@ -1607,10 +1605,9 @@ const NAType *Assign::doSynthesizeType(ValueId & targetId, ValueId & sourceId)
   // Check that the operands are compatible.
   //
   if (NOT targetId.getType().isCompatible(sourceId.getType())) {
-    if (((CmpCommon::getDefault(MODE_SPECIAL_1) == DF_ON) ||
-	 (CmpCommon::getDefault(ALLOW_INCOMPATIBLE_ASSIGNMENT) == DF_ON)) &&
+    if ((CmpCommon::getDefault(ALLOW_INCOMPATIBLE_OPERATIONS) == DF_ON) &&
         (sourceId.getType().getTypeQualifier() != NA_RECORD_TYPE ) &&
-	((child(1)->getOperatorType() != ITM_CONSTANT) ||
+        ((child(1)->getOperatorType() != ITM_CONSTANT) ||
 	 (NOT ((ConstValue *) child(1).getPtr() )->isNull())))
       {
 	// target type is not the same as source type.
@@ -1705,17 +1702,14 @@ const NAType *Between::synthesizeType()
   NABoolean allowsUnknown = FALSE;
 
   NABoolean allowIncompatibleComparison =
-    (((CmpCommon::getDefault(ALLOW_INCOMPATIBLE_COMPARISON) == DF_ON) ||
-      (CmpCommon::getDefault(MODE_SPECIAL_1) == DF_ON) ||
-      (CmpCommon::getDefault(MODE_SPECIAL_3) == DF_ON)) &&
-     (!CmpCommon::statement()->isDDL())                             &&
+    ((CmpCommon::getDefault(ALLOW_INCOMPATIBLE_OPERATIONS) == DF_ON) &&
      (child(0)->castToItemExpr()->getOperatorType() != ITM_ONE_ROW) &&
      (child(1)->castToItemExpr()->getOperatorType() != ITM_ONE_ROW) &&
      (child(2)->castToItemExpr()->getOperatorType() != ITM_ONE_ROW) &&
      (child(0)->castToItemExpr()->getOperatorType() != ITM_ONEROW) &&
      (child(1)->castToItemExpr()->getOperatorType() != ITM_ONEROW) &&
      (child(2)->castToItemExpr()->getOperatorType() != ITM_ONEROW));
-
+  
   for (CollIndex i = 0; i < exprList1.entries(); i++) {
     //
     // Type cast any params.
@@ -1754,21 +1748,6 @@ const NAType *Between::synthesizeType()
 	   (op1.getTypeQualifier() == NA_CHARACTER_TYPE) &&
 	   (vid1.getItemExpr()->getOperatorType() == ITM_CONSTANT)))
         compareOp3 = FALSE;
-
-      if (CmpCommon::getDefault(MODE_SPECIAL_3) == DF_ON)
-	{
-	  if (((op1.getPrecision() == SQLDTCODE_TIMESTAMP) &&
-	       (op2.getPrecision() == SQLDTCODE_DATE)) ||
-	      ((op2.getPrecision() == SQLDTCODE_TIMESTAMP) &&
-	       (op1.getPrecision() == SQLDTCODE_DATE)))
-	    compareOp2 = FALSE;
-
-	  if (((op1.getPrecision() == SQLDTCODE_TIMESTAMP) &&
-	       (op3.getPrecision() == SQLDTCODE_DATE)) ||
-	      ((op3.getPrecision() == SQLDTCODE_TIMESTAMP) &&
-	       (op1.getPrecision() == SQLDTCODE_DATE)))
-	    compareOp3 = FALSE;
-	}
     }
 
     if (op1.getTypeQualifier() == NA_CHARACTER_TYPE &&
@@ -1842,11 +1821,6 @@ const NAType *BiArith::synthesizeType()
       flags |= NAType::MODE_SPECIAL_1;
     }
 
-  if (CmpCommon::getDefault(MODE_SPECIAL_2) == DF_ON)
-    {
-      flags |= NAType::MODE_SPECIAL_2;
-    }
-
   if (CmpCommon::getDefault(MODE_SPECIAL_4) == DF_ON)
     {
       flags |= NAType::MODE_SPECIAL_4;
@@ -2012,17 +1986,14 @@ const NAType *BiRelat::synthesizeType()
   // a CAST node on top of it.
   // This incompatible comparison is not allowed if the statement is a DDL
   NABoolean allowIncompatibleComparison = FALSE;
-  if ((((!CmpCommon::statement()->isDDL()) &&
-        ((CmpCommon::getDefault(ALLOW_INCOMPATIBLE_COMPARISON) == DF_ON) ||
-         (CmpCommon::getDefault(MODE_SPECIAL_1) == DF_ON) ||
-         (CmpCommon::getDefault(MODE_SPECIAL_3) == DF_ON))) ||
-       (CmpCommon::getDefault(MODE_SPECIAL_4) == DF_ON)) &&
+
+  if ((CmpCommon::getDefault(ALLOW_INCOMPATIBLE_OPERATIONS) == DF_ON) &&
       (child(0)->castToItemExpr()->getOperatorType() != ITM_ONE_ROW) &&
       (child(1)->castToItemExpr()->getOperatorType() != ITM_ONE_ROW) &&
       (exprList1.entries() == 1) &&
       (exprList2.entries() == 1))
     allowIncompatibleComparison = TRUE;
-
+  
   NABoolean allowsUnknown;
   if (!synthItemExprLists(exprList1, exprList2, allowIncompatibleComparison,
 			  allowsUnknown, this))
@@ -2120,10 +2091,6 @@ const NAType *IfThenElse::synthesizeType()
       flags |= NAType::MODE_SPECIAL_1;
     }
 
-  if (CmpCommon::getDefault(MODE_SPECIAL_2) == DF_ON)
-    {
-      flags |= NAType::MODE_SPECIAL_2;
-    }
   if (CmpCommon::getDefault(TYPE_UNIONED_CHAR_AS_VARCHAR) == DF_ON)
   {
     flags |= NAType::MAKE_RESULT_VARCHAR;
@@ -2161,17 +2128,21 @@ static NABoolean numericCastIsCompatible(const NAType &src, const NAType &tgt)
 {
   if (src.getTypeQualifier() == NA_NUMERIC_TYPE &&
       tgt.getTypeQualifier() == NA_INTERVAL_TYPE &&
-      tgt.isSupportedType()) {
-    NumericType&  numeric  = (NumericType&)src;
-    IntervalType& interval = (IntervalType&)tgt;
-    if (numeric.isExact())
-      {
-	if (CmpCommon::getDefault(MODE_SPECIAL_1) == DF_ON)
-	  return TRUE;
-	else if (interval.getStartField() == interval.getEndField())
-	  return TRUE;
-      }
-  }
+      tgt.isSupportedType()) 
+    {
+      if (CmpCommon::getDefault(ALLOW_INCOMPATIBLE_OPERATIONS) == DF_ON)
+        return TRUE;
+      
+      NumericType&  numeric  = (NumericType&)src;
+      IntervalType& interval = (IntervalType&)tgt;
+      if (numeric.isExact())
+        {
+          if (CmpCommon::getDefault(MODE_SPECIAL_1) == DF_ON)
+            return TRUE;
+          else if (interval.getStartField() == interval.getEndField())
+            return TRUE;
+        }
+    }
   //check for numeric to date conversion
   else if ((CmpCommon::getDefault(MODE_SPECIAL_1) == DF_ON) &&
 	   (tgt.getTypeQualifier() == NA_DATETIME_TYPE) &&
@@ -2400,7 +2371,7 @@ const NAType *Cast::synthesizeType()
     }
   }
   else if (srcQual == NA_NUMERIC_TYPE)
-    legal = numericCastIsCompatible(src, tgt) || tgtQual == NA_BOOLEAN_TYPE;
+    legal = numericCastIsCompatible(src, tgt);
   else if (srcQual == NA_INTERVAL_TYPE)
     legal = numericCastIsCompatible(tgt, src);
   else if (srcQual == NA_DATETIME_TYPE && tgtQual == NA_NUMERIC_TYPE)
@@ -2832,18 +2803,6 @@ const NAType *DateFormat::synthesizeType()
     return NULL;
   }
 
-  if (getDateFormat() == DATE_FORMAT_STR)
-    {
-      if ((CmpCommon::getDefault(MODE_SPECIAL_2) == DF_ON) &&
-	  ((vid.getType().getTypeQualifier() != NA_DATETIME_TYPE) &&
-	   (vid.getType().getTypeQualifier() != NA_CHARACTER_TYPE)))
-	{
-	  // 4071 The operand of a DATEFORMAT function must be a datetime.
-	  *CmpCommon::diags() << DgSqlCode(-4071) << DgString0(getTextUpper());
-	  return NULL;
-	}
-    }
-  
   if ((getDateFormat() == TIME_FORMAT_STR) &&
       ((vid.getType().getTypeQualifier() != NA_NUMERIC_TYPE) &&
        (vid.getType().getTypeQualifier() != NA_CHARACTER_TYPE) &&
@@ -5667,7 +5626,7 @@ const NAType *QuantifiedComp::synthesizeType()
   ItemExprList exprList2(getSubquery()->selectList(), HEAP);
   NABoolean allowsUnknown;
   NABoolean allowIncompatibleComparison = FALSE;
-  if (CmpCommon::getDefault(MODE_SPECIAL_1) == DF_ON)
+  if (CmpCommon::getDefault(ALLOW_INCOMPATIBLE_OPERATIONS) == DF_ON)
     allowIncompatibleComparison = TRUE; 
   if (!synthItemExprLists(exprList1, exprList2, allowIncompatibleComparison,
 			  allowsUnknown, this))

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/parser/SqlParserAux.cpp
----------------------------------------------------------------------
diff --git a/core/sql/parser/SqlParserAux.cpp b/core/sql/parser/SqlParserAux.cpp
index 1f4667b..0a86730 100644
--- a/core/sql/parser/SqlParserAux.cpp
+++ b/core/sql/parser/SqlParserAux.cpp
@@ -2277,8 +2277,7 @@ ItemExpr *processINlist(ItemExpr *lhs, ItemExpr *rhs)
 {
   ItemExpr * retItemExpr = NULL;
   Lng32 defaultsLimit = ActiveSchemaDB()->getDefaults().getAsLong(COMP_INT_22);
-  if ( /*** (CmpCommon::getDefault(MODE_SPECIAL_1) == DF_ON) && *** Allow for NEO users **/
-      (rhs->castToItemExpr()->getOperatorType() == ITM_ITEM_LIST))
+  if (rhs->castToItemExpr()->getOperatorType() == ITM_ITEM_LIST)
     {
       ItemList * il = (ItemList*)rhs;
       if ((defaultsLimit > 0) && // if defaultsLimit == 0 the the feature is turned OFF.

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/parser/sqlparser.y
----------------------------------------------------------------------
diff --git a/core/sql/parser/sqlparser.y b/core/sql/parser/sqlparser.y
index 11ec218..297a31f 100755
--- a/core/sql/parser/sqlparser.y
+++ b/core/sql/parser/sqlparser.y
@@ -82,8 +82,6 @@
 #include "SqlParserGlobals.h"			// must be the second #include
 
 #define CheckModeSpecial1() if (NOT SqlParser_CurrentParser->modeSpecial1()) { YYERROR; } 
-#define CheckModeSpecial2() if (NOT SqlParser_CurrentParser->modeSpecial2()) { YYERROR; } 
-
 
 // This define is to restrict some commands to the DB_Transporter.
 #define CHECK_DBTRANSPORTER \
@@ -94,13 +92,6 @@
      YYERROR; \
   }
                                
-#define CheckModeSpecial3 \
-  if (CmpCommon::getDefault(MODE_SPECIAL_3) != DF_ON) \
-  { \
-     yyerror(""); \
-     YYERROR; \
-  }
-  
 #define CheckModeSpecial4 \
   if (CmpCommon::getDefault(MODE_SPECIAL_4) != DF_ON) \
   { \
@@ -3230,14 +3221,14 @@ literal :       numeric_literal
 		  // in MS2, formatting is done as part of Format function.
 		  // Right now limit this to MS2. Once it is tested, we can do
 		  // it for all modes.
-		  if (CmpCommon::getDefault(MODE_SPECIAL_2) == DF_ON)
+                  /*		  if (CmpCommon::getDefault(MODE_SPECIAL_2) == DF_ON)
 		    {
                       $$ = new (PARSERHEAP()) ConstValue
                         (*$1, getStringCharSet(&$1));
                       SqlParser_CurrentParser->collectItem4HQC($$);	
                       $$ = new (PARSERHEAP()) DateFormat($$, *$6, DateFormat::FORMAT_TO_DATE);
 		    }
-		  else
+                    else*/
 		    {
 		      $$ = literalOfDate($1);
 		      if (! $$) YYERROR;
@@ -3314,8 +3305,7 @@ character_literal_notcasespecific_option : '(' TOK_NOT_CASESPECIFIC ')'
                                             {$$=FALSE;}
                                            | empty
                                             {
-					      if ((CmpCommon::getDefault(MODE_SPECIAL_2) == DF_ON) ||
-                                              (CmpCommon::getDefault(MODE_SPECIAL_1) == DF_ON))
+                                              if (CmpCommon::getDefault(MODE_SPECIAL_1) == DF_ON)
 						$$ = TRUE;
 					      else
 						$$=FALSE;
@@ -6657,7 +6647,7 @@ table_reference : table_name_and_hint
                 } 
              | TOK_DUAL
               {
-                CheckModeSpecial4;
+
 
                 ConstValue * cv = 
                   (ConstValue*)literalOfNumericNoScale(new (PARSERHEAP()) NAString("0", PARSERHEAP()));
@@ -8755,8 +8745,6 @@ datetime_misc_function : TOK_CONVERTTIMESTAMP '(' value_expression ')'
 			       }
     | TOK_TO_NUMBER '(' value_expression ')'
                                {
-				 CheckModeSpecial3;
-
 				 $$ = new (PARSERHEAP()) 
 				   ZZZBinderFunction(ITM_TO_NUMBER, $3);
 			       }
@@ -8767,8 +8755,6 @@ datetime_misc_function : TOK_CONVERTTIMESTAMP '(' value_expression ')'
 			       }
     | TOK_TO_TIMESTAMP '(' value_expression ')'
                                {
-				 CheckModeSpecial4;
-
 				 $$ = new (PARSERHEAP()) 
 				   ZZZBinderFunction(ITM_TO_TIMESTAMP, $3);
 			       }
@@ -8825,8 +8811,6 @@ string_function :
 	  }
      | TOK_CHR '(' value_expression CHAR_FUNC_optional_character_set ')' 
 	  {
-	    //	    CheckModeSpecial3;
-
 	    if (!(($4 == CharInfo::ISO88591) || ( CharInfo::maxBytesPerChar($4) == 2))){
 	      *SqlParser_Diags << DgSqlCode(-3217) << DgString0(CharInfo::getCharSetName($4)) << DgString1("CHAR");
 	      YYABORT;
@@ -8840,8 +8824,6 @@ string_function :
 
      | TOK_COALESCE '(' value_expression_list ')'
         {
-	  // CheckModeSpecial1(); -- Allow general NEO users to use
-
 	  $$ = new (PARSERHEAP()) ZZZBinderFunction(ITM_COALESCE,
 						    $3);
 
@@ -8948,7 +8930,7 @@ string_function :
 
      | TOK_INSTR '(' value_expression TOK_IN value_expression ')'
                   {
-		    CheckModeSpecial3;
+		    CheckModeSpecial4;
 
                      $$ = new (PARSERHEAP()) PositionFunc($5,$3,NULL);
                   }
@@ -9518,11 +9500,7 @@ math_func_1_operand :
               TOK_ACOS {$$ = ITM_ACOS;}
            |  TOK_ASIN {$$ = ITM_ASIN;}
            |  TOK_ATAN {$$ = ITM_ATAN;}
-           |  TOK_CEIL 
-                {
-		  CheckModeSpecial3; 
-		  $$ = ITM_CEIL;
-		}
+           |  TOK_CEIL {$$ = ITM_CEIL;}
            |  TOK_CEILING {$$ = ITM_CEIL;}
            |  TOK_COS {$$ = ITM_COS;}
            |  TOK_COSH {$$ = ITM_COSH;}
@@ -9579,16 +9557,12 @@ misc_function :
 
      | TOK_GREATEST '(' value_expression ',' value_expression ')'
                   {
-                    CheckModeSpecial4;
-
                     $$ = new (PARSERHEAP())
                       ZZZBinderFunction(ITM_GREATEST, $3, $5);
                   }
 
      | TOK_LEAST '(' value_expression ',' value_expression ')'
                   {
-                    CheckModeSpecial4;
-
                     $$ = new (PARSERHEAP())
                       ZZZBinderFunction(ITM_LEAST, $3, $5);
                   }
@@ -9774,8 +9748,6 @@ misc_function :
 
     | TOK_MONTHS_BETWEEN '(' value_expression ',' value_expression ')'
                       {
-			CheckModeSpecial3;
-
                         $$ = new (PARSERHEAP())
                              ZZZBinderFunction(ITM_MONTHS_BETWEEN, $3, $5);
 		      }
@@ -9881,20 +9853,17 @@ misc_function :
 
          | TOK_LAST_DAY '(' value_expression ')'
              {
-	       CheckModeSpecial3;
 	       $$ = new (PARSERHEAP()) ZZZBinderFunction(ITM_LAST_DAY, $3);
 	     }
 
          | TOK_NEXT_DAY '(' value_expression ',' value_expression ')'
              {
-	       CheckModeSpecial3;
 
 	       $$ = new (PARSERHEAP()) ZZZBinderFunction(ITM_NEXT_DAY, $3, $5);
 	     }
 
          | TOK_TRUNC '(' value_expression ',' unsigned_integer ')'
              {
-	       CheckModeSpecial3;
 
 	       ConstValue * cv = new (PARSERHEAP()) ConstValue($5);
 
@@ -9902,7 +9871,6 @@ misc_function :
 	     }
          | TOK_TRUNC '(' value_expression ')'
              {	       
-	       CheckModeSpecial3;
 
 	       ConstValue * cv = new (PARSERHEAP()) ConstValue(0);
 
@@ -10770,16 +10738,16 @@ int_type : TOK_INTEGER signed_option
            $$ = new (PARSERHEAP()) SQLSmall( $2, TRUE);
          else
            $$ = new (PARSERHEAP()) SQLTiny( $2, TRUE);
-         // ((SQLSmall *)$$)->setDisplayDataType("TINYINT");
        }
 	 | TOK_BYTEINT signed_option
        {
-         // For TD compatibility, we map BYTEINT to SMALLINT
+         // For TD compatibility, we map BYTEINT to TINYINT/SMALLINT
          // BYTEINT is supposed to be exact numeric value with precision 3 &
          // scale 0. signed: -128<=n<=127, unsigned: 0<=n<=255.
-         CheckModeSpecial1();
-         $$ = new (PARSERHEAP()) SQLSmall( $2, TRUE);
-         ((SQLSmall *)$$)->setDisplayDataType("BYTEINT");
+         if (CmpCommon::getDefault(TRAF_TINYINT_SUPPORT) == DF_OFF)
+           $$ = new (PARSERHEAP()) SQLSmall( $2, TRUE);
+         else
+           $$ = new (PARSERHEAP()) SQLTiny( $2, TRUE);
        }
 
 numeric_type_token :    TOK_NUMERIC
@@ -11082,8 +11050,7 @@ pic_type : TOK_PICTURE char_set collation_option pic_tail pic_notcasespecific_op
 
 		NABoolean caseInsensitive = $5;
 		if ((isStringType) &&
-		    ((SqlParser_CurrentParser->modeSpecial1()) ||
-		     (CmpCommon::getDefault(MODE_SPECIAL_2) == DF_ON)))
+		    (SqlParser_CurrentParser->modeSpecial1()))
 		  caseInsensitive = TRUE;
 
                 // picNAType assert fails if precision is 0
@@ -11702,8 +11669,7 @@ upshift_flag :	    { $$ = FALSE; }
 /* type boolean */
 notcasespecific_option : empty 
                            { 
-			     if ((SqlParser_CurrentParser->modeSpecial1()) ||
-				 (CmpCommon::getDefault(MODE_SPECIAL_2) == DF_ON))
+			     if (SqlParser_CurrentParser->modeSpecial1())
 			       $$ = TRUE;
 			     else
 			       $$ = FALSE; 
@@ -13600,8 +13566,6 @@ set_quantifier : { $$ = FALSE; /* by default, set quantifier is ALL */
              }
           | TOK_UNIQUE
              {
-               CheckModeSpecial4;
-
                 $$ = TRUE;
              }
 
@@ -18481,7 +18445,7 @@ rel_subquery : '(' query_expression order_by_clause ')'
                                   if ( temp->getOperatorType() != REL_ROOT )
                                     temp = new (PARSERHEAP()) RelRoot($2);
 
-                                  if (CmpCommon::getDefault(MODE_SPECIAL_4) == DF_OFF) 
+                                  if (CmpCommon::getDefault(ALLOW_ORDER_BY_IN_SUBQUERIES) == DF_OFF) 
                                     {
                                       if ($3)
                                         {
@@ -22910,8 +22874,10 @@ sort_or_group_key :   value_expression
                        }
                      else
                        {
-                         CheckModeSpecial4;
-
+                         if (CmpCommon::getDefault(GROUP_OR_ORDER_BY_EXPR) == DF_OFF)
+			   {
+			     YYERROR;
+			   }
                          ie = $1;
                        }
 
@@ -24987,8 +24953,7 @@ create_table_start_tokens :
 
                    | TOK_CREATE TOK_MULTISET TOK_TABLE optional_if_not_exists_clause 
                    {
-		     if ((NOT SqlParser_CurrentParser->modeSpecial1()) &&
-			 (NOT SqlParser_CurrentParser->modeSpecial2()))
+		     if (NOT SqlParser_CurrentParser->modeSpecial1())
 		       {
 			 YYERROR;
 		       }
@@ -25468,8 +25433,6 @@ column_constraint :  TOK_NOT TOK_NULL
                                 }
                             |  TOK_NOT TOK_NULL TOK_ENABLE
                                 {
-                                  CheckModeSpecial4;
-                                  
 			          NonISO88591LiteralEncountered = FALSE;
                                   $$ = new (PARSERHEAP()) ElemDDLConstraintNotNull(TRUE, PARSERHEAP());
                                 }
@@ -25762,14 +25725,6 @@ constraint_attributes : constraint_attribute
 format_attributes : empty { $$ = NULL; }
                     |  TOK_FORMAT QUOTED_STRING  
                          { 
-/* externalize (FORMAT '...') to regular users
-/*
-			   if ((NOT SqlParser_CurrentParser->modeSpecial1()) &&
-			       (NOT SqlParser_CurrentParser->modeSpecial2()))
-			     {
-			       YYERROR;
-			     }
-*/
 			   $$ = $2; 
 			 }
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/parser/ulexer.cpp
----------------------------------------------------------------------
diff --git a/core/sql/parser/ulexer.cpp b/core/sql/parser/ulexer.cpp
index b4a9cbf..e6a21c6 100644
--- a/core/sql/parser/ulexer.cpp
+++ b/core/sql/parser/ulexer.cpp
@@ -2453,70 +2453,69 @@ Int32 yyULexer::yylex(YYSTYPE *lvalp)
             }
           break;
 	case L'(':
-	  {
-	    if ((NOT SqlParser_CurrentParser->modeSpecial1()) &&
-		(NOT SqlParser_CurrentParser->modeSpecial2()))
+          {
+	    if (NOT SqlParser_CurrentParser->modeSpecial1())
 	      {
-          /* externalize FORMAT functionality to regular users */
-          do { advance(); } while (U_isspace(peekChar()));  // skip whitespace
-          beginRun2 = mark();
-          while (U_isalnumund(holdChar1=peekChar())) advance();  // end of word
-    	    setCurrChar(0);
-          keyWordEntry1 = ParKeyWords::lookupKeyWord(beginRun2);
+                /* externalize FORMAT functionality to regular users */
+                do { advance(); } while (U_isspace(peekChar()));  // skip whitespace
+                beginRun2 = mark();
+                while (U_isalnumund(holdChar1=peekChar())) advance();  // end of word
+                setCurrChar(0);
+                keyWordEntry1 = ParKeyWords::lookupKeyWord(beginRun2);
 	        setCurrChar(holdChar1);
-          if (keyWordEntry1->getTokenCode() == TOK_FORMAT)  // (FORMAT...
-            {
-              // FORMAT is not a reserved word. Make sure it is used in FORMAT 'string'
-              do { advance(); } while (U_isspace(holdChar2=peekChar())); // advance and skip whitespace
-              if (holdChar2 == '\'')
-                {
-                  // it is '(' in (FORMAT '...
-                  retractToMark(beginRun2);
-                  doBeforeAction();
-                  SqlParser_ParenDepth++;
-                  return aCompoundKeyword(TOK_LPAREN_BEFORE_FORMAT, lvalp);
-                }
-            }
+                if (keyWordEntry1->getTokenCode() == TOK_FORMAT)  // (FORMAT...
+                  {
+                    // FORMAT is not a reserved word. Make sure it is used in FORMAT 'string'
+                    do { advance(); } while (U_isspace(holdChar2=peekChar())); // advance and skip whitespace
+                    if (holdChar2 == '\'')
+                      {
+                        // it is '(' in (FORMAT '...
+                        retractToMark(beginRun2);
+                        doBeforeAction();
+                        SqlParser_ParenDepth++;
+                        return aCompoundKeyword(TOK_LPAREN_BEFORE_FORMAT, lvalp);
+                      }
+                  }
 	        else if (keyWordEntry1->getTokenCode() == TOK_DATE) // (DATE...
-            {
-              while (U_isspace(holdChar2=peekChar())) advance(); // skip whitespace
-              if (holdChar2 == '(') // '(' in (DATE (...
-                {
-                  retractToMark(beginRun2);
-                  doBeforeAction();
-                  SqlParser_ParenDepth++;
-                  return aCompoundKeyword(TOK_LPAREN_BEFORE_DATE_AND_LPAREN, lvalp);
-                }
-              else if (holdChar2 == ',')
-                {
-                  do {  advance(); } while (U_isspace(peekChar())); // advance and skip whitespace
-                  beginRun3 = mark();
-                  while (U_isalnumund(holdChar3=peekChar())) advance(); // end of word
-                  setCurrChar(0);
-                  keyWordEntry2 = ParKeyWords::lookupKeyWord(beginRun3);
-                  setCurrChar(holdChar3);
-                  if (keyWordEntry2->getTokenCode() == TOK_FORMAT) // '(' in (DATE, FORMAT...
-                    {
-                      retractToMark(beginRun2);
-                      doBeforeAction();
-                      SqlParser_ParenDepth++;
-                      return aCompoundKeyword(TOK_LPAREN_BEFORE_DATE_COMMA_AND_FORMAT, lvalp);
-                    }
-                }
-            }
+                  {
+                    while (U_isspace(holdChar2=peekChar())) advance(); // skip whitespace
+                    if (holdChar2 == '(') // '(' in (DATE (...
+                      {
+                        retractToMark(beginRun2);
+                        doBeforeAction();
+                        SqlParser_ParenDepth++;
+                        return aCompoundKeyword(TOK_LPAREN_BEFORE_DATE_AND_LPAREN, lvalp);
+                      }
+                    else if (holdChar2 == ',')
+                      {
+                        do {  advance(); } while (U_isspace(peekChar())); // advance and skip whitespace
+                        beginRun3 = mark();
+                        while (U_isalnumund(holdChar3=peekChar())) advance(); // end of word
+                        setCurrChar(0);
+                        keyWordEntry2 = ParKeyWords::lookupKeyWord(beginRun3);
+                        setCurrChar(holdChar3);
+                        if (keyWordEntry2->getTokenCode() == TOK_FORMAT) // '(' in (DATE, FORMAT...
+                          {
+                            retractToMark(beginRun2);
+                            doBeforeAction();
+                            SqlParser_ParenDepth++;
+                            return aCompoundKeyword(TOK_LPAREN_BEFORE_DATE_COMMA_AND_FORMAT, lvalp);
+                          }
+                      }
+                  }
       		// A separator specified by [(]
-          retractToMark(beginRun2);
-          doBeforeAction();
-          SqlParser_ParenDepth++;
-          return setTokval(yytext_[0], DBGMSG("Separator %s\n"), lvalp);
-/* end of enternalize FORMAT */
-/* old code
+                retractToMark(beginRun2);
+                doBeforeAction();
+                SqlParser_ParenDepth++;
+                return setTokval(yytext_[0], DBGMSG("Separator %s\n"), lvalp);
+                /* end of enternalize FORMAT */
+                /* old code
 		// A separator specified by [(]
 		advance();
 		doBeforeAction();
 		SqlParser_ParenDepth++;
 		return setTokval(yytext_[0], DBGMSG("Separator %s\n"), lvalp);
-*/
+                */
 	      }
 
             SqlParser_ParenDepth++;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/regress/charsets/EXPECTED002
----------------------------------------------------------------------
diff --git a/core/sql/regress/charsets/EXPECTED002 b/core/sql/regress/charsets/EXPECTED002
index 18f1eed..4e557b6 100755
--- a/core/sql/regress/charsets/EXPECTED002
+++ b/core/sql/regress/charsets/EXPECTED002
@@ -123,14 +123,12 @@
 >>
 >>--no UCS2 strings in a FIRST KEY clause
 >>create table nt009 (c char(10) character set UCS2)
-+>	location  $$partition$$
-+>	partition (add first key (_UCS2'aaa') location  $$partition1$$);
++>	partition (add first key (_UCS2'aaa') location  $DATA);
 
 *** ERROR[1240] The character set for a PARTITION KEY column must be ISO88591.
 
 *** ERROR[8822] The statement was not prepared.
 
->>
 >>--INFER_CHARSET works for default values in CREATE TABLE DDL
 >>control query default infer_charset 'on';
 
@@ -144,7 +142,7 @@
 >>invoke t013;
 
 -- Definition of Trafodion table TRAFODION.SCH.T013
--- Definition current  Sun Mar 20 15:28:28 2016
+-- Definition current  Fri Aug  5 18:17:57 2016
 
   (
     SYSKEY                           LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -182,10 +180,7 @@ B
 --- SQL command prepared.
 >>prepare xx from insert into t013 select 'a'||'b' from t013a;
 
-*** ERROR[4039] Column A is of type CHAR(10) CHARACTER SET UCS2, incompatible with the value's type, CHAR(2) CHARACTER SET ISO88591.
-
-*** ERROR[8822] The statement was not prepared.
-
+--- SQL command prepared.
 >>
 >>control query default infer_charset 'off';
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/regress/charsets/TEST002
----------------------------------------------------------------------
diff --git a/core/sql/regress/charsets/TEST002 b/core/sql/regress/charsets/TEST002
index 7be533c..0cd5e99 100755
--- a/core/sql/regress/charsets/TEST002
+++ b/core/sql/regress/charsets/TEST002
@@ -101,8 +101,7 @@ create trigger t013t2 after insert on nt008
 
 --no UCS2 strings in a FIRST KEY clause
 create table nt009 (c char(10) character set UCS2)
-	location  $$partition$$
-	partition (add first key (_UCS2'aaa') location  $$partition1$$);
+	partition (add first key (_UCS2'aaa') location  $DATA); 
 
 --INFER_CHARSET works for default values in CREATE TABLE DDL
 control query default infer_charset 'on';



[6/6] incubator-trafodion git commit: Merge [TRAFODION-2180] PR-674 enable/externalize non-ansi sql syntax/functionality

Posted by su...@apache.org.
Merge [TRAFODION-2180] PR-674 enable/externalize non-ansi sql syntax/functionality


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/eb98b6d5
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/eb98b6d5
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/eb98b6d5

Branch: refs/heads/master
Commit: eb98b6d559e35dfd873f3cc15c08ca8ed8fcf559
Parents: 3baabb3 9a41e52
Author: Suresh Subbiah <su...@apache.org>
Authored: Tue Aug 30 18:25:18 2016 +0000
Committer: Suresh Subbiah <su...@apache.org>
Committed: Tue Aug 30 18:25:18 2016 +0000

----------------------------------------------------------------------
 core/sql/bin/SqlciErrors.txt                    |   4 +-
 core/sql/common/CharType.h                      |   3 +-
 core/sql/common/ComResWords.cpp                 |   4 -
 core/sql/common/DateTimeType.cpp                |  27 +-
 core/sql/common/NAString.cpp                    |  12 +-
 core/sql/common/NAType.h                        |  13 +-
 core/sql/common/NumericType.cpp                 |   4 +-
 core/sql/executor/ExExeUtilLoad.cpp             |   4 +-
 core/sql/executor/ExHdfsScan.cpp                |   8 +-
 core/sql/generator/GenExplain.cpp               |  11 +-
 core/sql/generator/GenFastTransport.cpp         |   2 +-
 core/sql/generator/GenPreCode.cpp               |  35 +-
 core/sql/optimizer/BindItemExpr.cpp             | 593 ++++++-------
 core/sql/optimizer/BindRelExpr.cpp              |  50 +-
 core/sql/optimizer/EncodedValue.cpp             |   5 +-
 core/sql/optimizer/OptimizerSimulator.cpp       |  13 -
 core/sql/optimizer/QRDescGenerator.cpp          |   3 +-
 core/sql/optimizer/SynthType.cpp                | 145 ++-
 core/sql/parser/SqlParserAux.cpp                |   3 +-
 core/sql/parser/sqlparser.y                     |  83 +-
 core/sql/parser/ulexer.cpp                      | 109 ++-
 core/sql/regress/charsets/EXPECTED002           |  11 +-
 core/sql/regress/charsets/TEST002               |   3 +-
 core/sql/regress/charsets/cidefs                | 125 ---
 core/sql/regress/compGeneral/EXPECTED006.SB     | 249 ++----
 core/sql/regress/compGeneral/EXPECTED042        |  82 +-
 core/sql/regress/compGeneral/TEST006            |  99 +--
 core/sql/regress/compGeneral/cidefs             | 128 ---
 core/sql/regress/core/EXPECTED037.SB            | 871 +++----------------
 core/sql/regress/core/EXPECTED038.LINUX         |   2 +-
 core/sql/regress/core/EXPECTED056.SB            |  28 +-
 core/sql/regress/core/EXPECTED061.SB            |   4 +-
 core/sql/regress/core/TEST056                   |  28 +-
 core/sql/regress/core/TEST061                   |   4 +-
 core/sql/regress/core/cidefs                    | 135 ---
 core/sql/regress/executor/EXPECTED001           |  31 +-
 core/sql/regress/executor/EXPECTED013.SB        |  42 +-
 core/sql/regress/executor/EXPECTED014.SB        |   2 +-
 core/sql/regress/executor/EXPECTED020           |   3 +
 core/sql/regress/executor/EXPECTED022.SB        | 152 ++--
 core/sql/regress/executor/EXPECTED050           |   9 +-
 core/sql/regress/executor/EXPECTED122           |  24 +-
 core/sql/regress/executor/EXPECTED140           | 296 ++-----
 core/sql/regress/executor/TEST013               |   2 +
 core/sql/regress/executor/TEST020               |   1 +
 core/sql/regress/executor/cidefs                | 119 ---
 core/sql/regress/fullstack2/EXPECTED062         |  51 --
 core/sql/regress/fullstack2/EXPECTED062.RELEASE |  51 --
 core/sql/regress/fullstack2/cidefs              | 121 ---
 core/sql/regress/hive/EXPECTED003               |   8 +-
 core/sql/regress/hive/EXPECTED005               |  40 +-
 core/sql/regress/hive/TEST003                   |   4 +-
 core/sql/regress/qat/cidefs                     |  32 -
 core/sql/regress/seabase/DIFF032.KNOWN          |   4 +
 core/sql/regress/seabase/EXPECTED003            |  82 +-
 core/sql/regress/seabase/EXPECTED030            |  12 +-
 core/sql/regress/seabase/EXPECTED032            | 297 +++++++
 core/sql/regress/seabase/FILTER032              |  27 +
 core/sql/regress/seabase/TEST010                |   1 +
 core/sql/regress/seabase/TEST032                |  91 ++
 core/sql/regress/tools/runallsb                 |  21 +-
 core/sql/regress/tools/runregr                  |  29 +-
 core/sql/regress/tools/runregr_charsets.ksh     |   4 +-
 core/sql/regress/tools/runregr_compGeneral.ksh  |  25 +-
 core/sql/regress/tools/runregr_core.ksh         |  25 +-
 core/sql/regress/tools/runregr_executor.ksh     |  21 +-
 core/sql/regress/tools/runregr_fullstack2.ksh   |  19 +-
 core/sql/regress/tools/runregr_hive.ksh         |  12 +-
 core/sql/regress/tools/runregr_qat.ksh          |   9 +-
 core/sql/regress/tools/runregr_seabase.ksh      |  12 +-
 core/sql/regress/tools/runregr_udr.ksh          |   4 +-
 core/sql/regress/tools/sbdefs                   |   9 +-
 core/sql/regress/udr/EXPECTED103                |  10 +-
 core/sql/regress/udr/EXPECTED108                |  18 +-
 core/sql/regress/udr/EXPECTED163.SB             |   4 +-
 core/sql/regress/udr/TEST108                    |  16 +-
 core/sql/regress/udr/cidefs                     |  69 --
 core/sql/sqlcat/TrafDDLdesc.h                   |   4 +
 core/sql/sqlcomp/CmpDescribe.cpp                |   6 +-
 core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp        |   1 -
 core/sql/sqlcomp/CmpSeabaseDDLindex.cpp         |   3 +-
 core/sql/sqlcomp/CmpSeabaseDDLtable.cpp         |  10 +
 core/sql/sqlcomp/DefaultConstants.h             |  19 +-
 core/sql/sqlcomp/nadefaults.cpp                 | 110 +--
 core/sql/sqlcomp/parser.cpp                     |   1 -
 core/sql/sqlcomp/parser.h                       |   3 -
 core/sql/ustat/hs_globals.cpp                   |   9 +-
 87 files changed, 1693 insertions(+), 3182 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/eb98b6d5/core/sql/parser/sqlparser.y
----------------------------------------------------------------------


[2/6] incubator-trafodion git commit: JIRA TRAFODION-2180 enable/externalize non-ansi sql syntax/functionality

Posted by su...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/regress/fullstack2/EXPECTED062
----------------------------------------------------------------------
diff --git a/core/sql/regress/fullstack2/EXPECTED062 b/core/sql/regress/fullstack2/EXPECTED062
index 11fc562..632a84d 100644
--- a/core/sql/regress/fullstack2/EXPECTED062
+++ b/core/sql/regress/fullstack2/EXPECTED062
@@ -479,21 +479,6 @@ Current DEFAULTS
 >>showcontrol query default;
 
 CONTROL QUERY DEFAULT
-  TARGET_CODE                   	DEBUG
-  TARGET_CPU_FREQUENCY          	199.
-  TARGET_IO_SEEK_TIME           	0.020147
-  TARGET_IO_SEQ_READ_RATE       	2.5
-  TARGET_MSG_LOCAL_RATE         	10.
-  TARGET_MSG_LOCAL_TIME         	0.000125
-  TARGET_MSG_REMOTE_RATE        	100.
-  TARGET_MSG_REMOTE_TIME        	0.00125
-  ARKCMP_FAKE_HW                	ON
-  SKIP_METADATA_VIEWS           	ON
-  REF_CONSTRAINT_NO_ACTION_LIKE_RESTRICT	ON
-  DEF_NUM_SMP_CPUS              	2
-  MAX_ESPS_PER_CPU_PER_OP       	1
-  DEF_NUM_NODES_IN_ACTIVE_CLUSTERS	1
-  POS_ALLOW_NON_PK_TABLES       	ON
   MODE_SEABASE                  	ON
   SEABASE_VOLATILE_TABLES       	ON
   HBASE_ASYNC_DROP_TABLE        	OFF
@@ -501,8 +486,6 @@ CONTROL QUERY DEFAULT
   HBASE_SMALL_SCANNER           	SYSTEM
   HBASE_FILTER_PREDS            	2
   TRAF_INDEX_CREATE_OPT         	ON
-  TRAF_READ_OBJECT_DESC         	ON
-  TRAF_STORE_OBJECT_DESC        	ON
   SHOWCONTROL_SHOW_ALL          	ON
   SCHEMA                        	AAA.BBB
   CATALOG                       	CCC
@@ -525,21 +508,6 @@ CONTROL QUERY DEFAULT
 >>showcontrol default;
 
 CONTROL QUERY DEFAULT
-  TARGET_CODE                   	DEBUG
-  TARGET_CPU_FREQUENCY          	199.
-  TARGET_IO_SEEK_TIME           	0.020147
-  TARGET_IO_SEQ_READ_RATE       	2.5
-  TARGET_MSG_LOCAL_RATE         	10.
-  TARGET_MSG_LOCAL_TIME         	0.000125
-  TARGET_MSG_REMOTE_RATE        	100.
-  TARGET_MSG_REMOTE_TIME        	0.00125
-  ARKCMP_FAKE_HW                	ON
-  SKIP_METADATA_VIEWS           	ON
-  REF_CONSTRAINT_NO_ACTION_LIKE_RESTRICT	ON
-  DEF_NUM_SMP_CPUS              	2
-  MAX_ESPS_PER_CPU_PER_OP       	1
-  DEF_NUM_NODES_IN_ACTIVE_CLUSTERS	1
-  POS_ALLOW_NON_PK_TABLES       	ON
   MODE_SEABASE                  	ON
   SEABASE_VOLATILE_TABLES       	ON
   HBASE_ASYNC_DROP_TABLE        	OFF
@@ -547,8 +515,6 @@ CONTROL QUERY DEFAULT
   HBASE_SMALL_SCANNER           	SYSTEM
   HBASE_FILTER_PREDS            	2
   TRAF_INDEX_CREATE_OPT         	ON
-  TRAF_READ_OBJECT_DESC         	ON
-  TRAF_STORE_OBJECT_DESC        	ON
   SHOWCONTROL_SHOW_ALL          	ON
   DEF_CHUNK_SIZE                	1000
   CPUCOST_DM_GET                	.001
@@ -562,21 +528,6 @@ CONTROL QUERY DEFAULT
 >>showcontrol default;
 
 CONTROL QUERY DEFAULT
-  TARGET_CODE                   	DEBUG
-  TARGET_CPU_FREQUENCY          	199.
-  TARGET_IO_SEEK_TIME           	0.020147
-  TARGET_IO_SEQ_READ_RATE       	2.5
-  TARGET_MSG_LOCAL_RATE         	10.
-  TARGET_MSG_LOCAL_TIME         	0.000125
-  TARGET_MSG_REMOTE_RATE        	100.
-  TARGET_MSG_REMOTE_TIME        	0.00125
-  ARKCMP_FAKE_HW                	ON
-  SKIP_METADATA_VIEWS           	ON
-  REF_CONSTRAINT_NO_ACTION_LIKE_RESTRICT	ON
-  DEF_NUM_SMP_CPUS              	2
-  MAX_ESPS_PER_CPU_PER_OP       	1
-  DEF_NUM_NODES_IN_ACTIVE_CLUSTERS	1
-  POS_ALLOW_NON_PK_TABLES       	ON
   MODE_SEABASE                  	ON
   SEABASE_VOLATILE_TABLES       	ON
   HBASE_ASYNC_DROP_TABLE        	OFF
@@ -584,8 +535,6 @@ CONTROL QUERY DEFAULT
   HBASE_SMALL_SCANNER           	SYSTEM
   HBASE_FILTER_PREDS            	2
   TRAF_INDEX_CREATE_OPT         	ON
-  TRAF_READ_OBJECT_DESC         	ON
-  TRAF_STORE_OBJECT_DESC        	ON
   SHOWCONTROL_SHOW_ALL          	ON
   DEF_CHUNK_SIZE                	1000
   CPUCOST_DM_GET                	.001

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/regress/fullstack2/EXPECTED062.RELEASE
----------------------------------------------------------------------
diff --git a/core/sql/regress/fullstack2/EXPECTED062.RELEASE b/core/sql/regress/fullstack2/EXPECTED062.RELEASE
index 849ddf7..e5c83fe 100644
--- a/core/sql/regress/fullstack2/EXPECTED062.RELEASE
+++ b/core/sql/regress/fullstack2/EXPECTED062.RELEASE
@@ -479,21 +479,6 @@ Current DEFAULTS
 >>showcontrol query default;
 
 CONTROL QUERY DEFAULT
-  TARGET_CODE                   	DEBUG
-  TARGET_CPU_FREQUENCY          	199.
-  TARGET_IO_SEEK_TIME           	0.020147
-  TARGET_IO_SEQ_READ_RATE       	2.5
-  TARGET_MSG_LOCAL_RATE         	10.
-  TARGET_MSG_LOCAL_TIME         	0.000125
-  TARGET_MSG_REMOTE_RATE        	100.
-  TARGET_MSG_REMOTE_TIME        	0.00125
-  ARKCMP_FAKE_HW                	ON
-  SKIP_METADATA_VIEWS           	ON
-  REF_CONSTRAINT_NO_ACTION_LIKE_RESTRICT	ON
-  DEF_NUM_SMP_CPUS              	2
-  MAX_ESPS_PER_CPU_PER_OP       	1
-  DEF_NUM_NODES_IN_ACTIVE_CLUSTERS	1
-  POS_ALLOW_NON_PK_TABLES       	ON
   MODE_SEABASE                  	ON
   SEABASE_VOLATILE_TABLES       	ON
   HBASE_ASYNC_DROP_TABLE        	OFF
@@ -501,8 +486,6 @@ CONTROL QUERY DEFAULT
   HBASE_SMALL_SCANNER           	SYSTEM
   HBASE_FILTER_PREDS            	2
   TRAF_INDEX_CREATE_OPT         	ON
-  TRAF_READ_OBJECT_DESC         	ON
-  TRAF_STORE_OBJECT_DESC        	ON
   SHOWCONTROL_SHOW_ALL          	ON
   SCHEMA                        	AAA.BBB
   CATALOG                       	CCC
@@ -525,21 +508,6 @@ CONTROL QUERY DEFAULT
 >>showcontrol default;
 
 CONTROL QUERY DEFAULT
-  TARGET_CODE                   	DEBUG
-  TARGET_CPU_FREQUENCY          	199.
-  TARGET_IO_SEEK_TIME           	0.020147
-  TARGET_IO_SEQ_READ_RATE       	2.5
-  TARGET_MSG_LOCAL_RATE         	10.
-  TARGET_MSG_LOCAL_TIME         	0.000125
-  TARGET_MSG_REMOTE_RATE        	100.
-  TARGET_MSG_REMOTE_TIME        	0.00125
-  ARKCMP_FAKE_HW                	ON
-  SKIP_METADATA_VIEWS           	ON
-  REF_CONSTRAINT_NO_ACTION_LIKE_RESTRICT	ON
-  DEF_NUM_SMP_CPUS              	2
-  MAX_ESPS_PER_CPU_PER_OP       	1
-  DEF_NUM_NODES_IN_ACTIVE_CLUSTERS	1
-  POS_ALLOW_NON_PK_TABLES       	ON
   MODE_SEABASE                  	ON
   SEABASE_VOLATILE_TABLES       	ON
   HBASE_ASYNC_DROP_TABLE        	OFF
@@ -547,8 +515,6 @@ CONTROL QUERY DEFAULT
   HBASE_SMALL_SCANNER           	SYSTEM
   HBASE_FILTER_PREDS            	2
   TRAF_INDEX_CREATE_OPT         	ON
-  TRAF_READ_OBJECT_DESC         	ON
-  TRAF_STORE_OBJECT_DESC        	ON
   SHOWCONTROL_SHOW_ALL          	ON
   DEF_CHUNK_SIZE                	1000
   CPUCOST_DM_GET                	.001
@@ -562,21 +528,6 @@ CONTROL QUERY DEFAULT
 >>showcontrol default;
 
 CONTROL QUERY DEFAULT
-  TARGET_CODE                   	DEBUG
-  TARGET_CPU_FREQUENCY          	199.
-  TARGET_IO_SEEK_TIME           	0.020147
-  TARGET_IO_SEQ_READ_RATE       	2.5
-  TARGET_MSG_LOCAL_RATE         	10.
-  TARGET_MSG_LOCAL_TIME         	0.000125
-  TARGET_MSG_REMOTE_RATE        	100.
-  TARGET_MSG_REMOTE_TIME        	0.00125
-  ARKCMP_FAKE_HW                	ON
-  SKIP_METADATA_VIEWS           	ON
-  REF_CONSTRAINT_NO_ACTION_LIKE_RESTRICT	ON
-  DEF_NUM_SMP_CPUS              	2
-  MAX_ESPS_PER_CPU_PER_OP       	1
-  DEF_NUM_NODES_IN_ACTIVE_CLUSTERS	1
-  POS_ALLOW_NON_PK_TABLES       	ON
   MODE_SEABASE                  	ON
   SEABASE_VOLATILE_TABLES       	ON
   HBASE_ASYNC_DROP_TABLE        	OFF
@@ -584,8 +535,6 @@ CONTROL QUERY DEFAULT
   HBASE_SMALL_SCANNER           	SYSTEM
   HBASE_FILTER_PREDS            	2
   TRAF_INDEX_CREATE_OPT         	ON
-  TRAF_READ_OBJECT_DESC         	ON
-  TRAF_STORE_OBJECT_DESC        	ON
   SHOWCONTROL_SHOW_ALL          	ON
   DEF_CHUNK_SIZE                	1000
   CPUCOST_DM_GET                	.001

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/regress/fullstack2/cidefs
----------------------------------------------------------------------
diff --git a/core/sql/regress/fullstack2/cidefs b/core/sql/regress/fullstack2/cidefs
deleted file mode 100755
index 98d6ab5..0000000
--- a/core/sql/regress/fullstack2/cidefs
+++ /dev/null
@@ -1,121 +0,0 @@
---	This is the sqlci analogue of the shell-script "setupenv".
---
--- @@@ 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 @@@
-
-set SCHEMA $$TEST_SCHEMA$$;
--- control query default HIST_USE_SAMPLE_FOR_CARDINALITY_ESTIMATION  'ON';
--- control query default HIST_ON_DEMAND_STATS_SIZE '10000';
-
--- Define a standard physical environment for the compiler:
-control query default TARGET_CODE 'DEBUG';
-control query default TARGET_CPU_FREQUENCY '199.';
-control query default TARGET_IO_SEEK_TIME '0.020147';
-control query default TARGET_IO_SEQ_READ_RATE '2.5';
-control query default TARGET_MSG_LOCAL_RATE '10.';
-control query default TARGET_MSG_LOCAL_TIME '0.000125';
-control query default TARGET_MSG_REMOTE_RATE '100.';
-control query default TARGET_MSG_REMOTE_TIME  '0.00125';
-
-control query default ARKCMP_FAKE_HW 'ON';
-
-control query default SKIP_METADATA_VIEWS 'ON';
-
-#ifMX
-control query default REF_CONSTRAINT_NO_ACTION_LIKE_RESTRICT 'ON';
-#ifMX
-
-control query default DEF_NUM_SMP_CPUS
-#ifMX
-'2'
-#ifMX
-#ifMP
-'1'
-#ifMP
-;
-
-control query default MAX_ESPS_PER_CPU_PER_OP '1';
-
-control query default DEF_NUM_NODES_IN_ACTIVE_CLUSTERS
-#ifMX
-'1'
-#ifMX
-#ifMP
-'2'
-#ifMP
-;
-
--- this is the datavol location of the second partition
--- for partitioned tables.
-#ifNSK
-set pattern $$partition$$  $DATA04;
-set pattern $$partition1$$ $DATA01;
-set pattern $$partition2$$ $DATA03;
-set pattern $$partition3$$ $DATA05;
-set pattern $$TrigTempTablePartition$$ '''$DATA03:$DATA04,$DATA05:$DATA01''';
-
-#ifNSK
-
-#ifNT
-set pattern $$partition$$ $DATA;
-set pattern $$partition1$$ $DATA1;
-set pattern $$partition2$$ $DATA2;
-set pattern $$partition3$$ $SYSTEM;
-set pattern $$TrigTempTablePartition$$ '''$system:$data1,$data2:$data''';
-
-#ifNT
-
--- This pattern is needed for both NSK and NT to handle the quote in Metadata
--- queries
-set pattern $$quote$$ '''';
--- This CQD is added for creating a table  with no
--- partition or primary key when the POS is enabled.
-control query default POS_ALLOW_NON_PK_TABLES 'ON';
---control query default detailed_statistics 'ALL';
-
-
--- Only on a Linux cluster
-#ifdef CLUSTERNAME
-set pattern $$partition$$  $DB0000;
-set pattern $$partition0$$ $DB0000;
-set pattern $$partition1$$ $DB0001;
-set pattern $$partition2$$ $DB0002;
-set pattern $$partition3$$ $DB0003;
-set pattern $$partition4$$ $DB0004;
-set pattern $$partition5$$ $DB0005;
-set pattern $$partition6$$ $DB0006;
-set pattern $$partition7$$ $DB0007;
-set pattern $$partition8$$ $DB0008;
-set pattern $$audit_vol$$  $AUD000;
-set pattern $$PosTablePartition$$ '''$DB0000''';
-set pattern $$PosTablePartitions2$$ '''$DB0001, $DB0002''';
-set pattern $$PosTablePartitions3$$ '''$DB0003, $DB0004, $DB0005''';
-set pattern $$PosTablePartitions4$$ '''$DB0006, $DB0007, $DB0008, $DB0009''';
-set pattern $$TrigTempTablePartition$$ '''$DB0003:$DB0004,$DB0005:$DB0001''';
-set pattern $$TrigTempTablePartition1$$ '''$DB0001: $DB0004''';
-set pattern $$TrigTempTablePartition2$$ '''$DB0001''';
-set pattern $$TrigTempTablePartition3$$ '''$DB0004''';
-set pattern $$TrigTempTablePartition4$$ '''$DB0001, $DB0004,$NINEX: $DB0005''';
-set pattern $$TrigTempTablePartition5$$ '''$DB0005, $DB0005, $DB0005: $DB0005, $DB0005''';
-set pattern $$TrigTempTablePartition6$$ '''$DB0001,XXXX64 $DB0005''';
-#endif
-
--- eof

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/regress/hive/EXPECTED003
----------------------------------------------------------------------
diff --git a/core/sql/regress/hive/EXPECTED003 b/core/sql/regress/hive/EXPECTED003
index 21fef14..dc6ef06 100644
--- a/core/sql/regress/hive/EXPECTED003
+++ b/core/sql/regress/hive/EXPECTED003
@@ -139,15 +139,15 @@ P_PROMO_SK   P_PROMO_ID                 P_START_DATE_SK  P_END_DATE_SK  P_ITEM_S
 >>-- number of columns doesn't match
 >>
 >>prepare s from
-+>insert into hive.ins_time_dim values ('a', 2, 3, 4, 5, 6, 'c', 'd', 'e', 'f');
++>insert into hive.ins_time_dim values (current_time, 2, 3, 4, 5, 6, 'c', 'd', 'e', 'f');
 
-*** ERROR[4039] Column T_TIME_SK is of type INTEGER, incompatible with the value's type, CHAR(1).
+*** ERROR[4039] Column T_TIME_SK is of type INTEGER, incompatible with the value's type, TIME(0).
 
 *** ERROR[8822] The statement was not prepared.
 
 *** WARNING[8597] Statement was automatically retried 1 time(s). Delay before each retry was 0 seconds. See next entry for the error that caused this retry.
 
-*** WARNING[4039] Column T_TIME_SK is of type INTEGER, incompatible with the value's type, CHAR(1).
+*** WARNING[4039] Column T_TIME_SK is of type INTEGER, incompatible with the value's type, TIME(0).
 
 >>-- wrong data types
 >>
@@ -291,7 +291,7 @@ lp 1425661 - Hang with hive scan and [FIRST N]
 
 --- 1 row(s) selected.
 >>
->>prepare s from insert into ins_customer_demographics select * from customer_demographics;
+>>prepare s from insert OVERWRITE TABLE ins_customer_demographics select * from customer_demographics;
 
 --- SQL command prepared.
 >>execute s;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/regress/hive/EXPECTED005
----------------------------------------------------------------------
diff --git a/core/sql/regress/hive/EXPECTED005 b/core/sql/regress/hive/EXPECTED005
index ae8bd7b..8b290e4 100644
--- a/core/sql/regress/hive/EXPECTED005
+++ b/core/sql/regress/hive/EXPECTED005
@@ -106,7 +106,18 @@ Y                                          9525
 --- SQL command prepared.
 >>execute s1;
 
---- 0 row(s) selected.
+*** WARNING[8597] Statement was automatically retried 1 time(s). Delay before each retry was 0 seconds. See next entry for the error that caused this retry. 
+
+*** WARNING[8436] Mismatch detected between compiletime and runtime hive table definitions.
+
+C_PREFERRED_CUST_FLAG      (EXPR)              
+-------------------------  --------------------
+
+                                            685
+N                                          9789
+Y                                          9525
+
+--- 3 row(s) selected.
 >>-- because we don't invalidate in the executor,
 >>-- this should still return 0 rows
 >>
@@ -214,7 +225,18 @@ xyz
 --- SQL command prepared.
 >>execute s1;
 
---- 0 row(s) selected.
+*** WARNING[8597] Statement was automatically retried 1 time(s). Delay before each retry was 0 seconds. See next entry for the error that caused this retry. 
+
+*** WARNING[8436] Mismatch detected between compiletime and runtime hive table definitions.
+
+C_PREFERRED_CUST_FLAG      (EXPR)              
+-------------------------  --------------------
+
+                                           1384
+N                                         19631
+Y                                         18984
+
+--- 3 row(s) selected.
 >>-- s1 should still return 0 rows - for now
 >>execute s2;
 
@@ -510,7 +532,7 @@ C1           C2           C3           C4
 --- SQL operation complete.
 >>load with NO OUTPUT into trafodion.seabase.tbl_dos_num select * from tbl_dos_num;
 
-*** ERROR[8413] The string argument contains characters that cannot be converted. Source data 33393437380d
+*** ERROR[8413] The string argument contains characters that cannot be converted. Source data(in hex): 33393437380d
 
 --- 0 row(s) loaded.
 >>cqd HIVE_SCAN_SPECIAL_MODE '1';
@@ -541,7 +563,7 @@ C1           C2
 --- SQL operation complete.
 >>select * from tbl_bad;
 
-*** ERROR[8413] The string argument contains characters that cannot be converted. Source data 61
+*** ERROR[8413] The string argument contains characters that cannot be converted. Source data(in hex): 61
 
 --- 0 row(s) selected.
 >>cqd HIVE_SCAN_SPECIAL_MODE '2';
@@ -582,17 +604,17 @@ C1           C2                    C3                         C4               C
 --- SQL operation complete.
 >>load with no output into trafodion.seabase.traf_tbl_bad select * from tbl_bad;
 
-*** ERROR[8413] The string argument contains characters that cannot be converted. Source data 61
+*** ERROR[8413] The string argument contains characters that cannot be converted. Source data(in hex): 61
 
 --- 0 row(s) loaded.
 >>insert into trafodion.seabase.traf_tbl_bad select * from tbl_bad;
 
-*** ERROR[8413] The string argument contains characters that cannot be converted. Source data 61
+*** ERROR[8413] The string argument contains characters that cannot be converted. Source data(in hex): 61
 
 --- 0 row(s) inserted.
 >>upsert into trafodion.seabase.traf_tbl_bad select * from tbl_bad;
 
-*** ERROR[8413] The string argument contains characters that cannot be converted. Source data 61
+*** ERROR[8413] The string argument contains characters that cannot be converted. Source data(in hex): 61
 
 --- 0 row(s) inserted.
 >>cqd HIVE_SCAN_SPECIAL_MODE '2';
@@ -834,7 +856,7 @@ t005part.a	t005part.b	t005part.c
 >>invoke hive.hive.thive_insert_smallint;
 
 -- Definition of hive table THIVE_INSERT_SMALLINT
--- Definition current  Fri Jul  8 09:45:59 2016
+-- Definition current  Wed Aug 24 21:29:53 2016
 
   (
     A                                SMALLINT
@@ -939,7 +961,7 @@ A
 >>invoke hive.hive.thive_insert_varchar;
 
 -- Definition of hive table THIVE_INSERT_VARCHAR
--- Definition current  Fri Jul  8 09:46:08 2016
+-- Definition current  Wed Aug 24 21:29:58 2016
 
   (
     A                                VARCHAR(1 CHAR) CHARACTER SET UTF8 COLLATE

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/regress/hive/TEST003
----------------------------------------------------------------------
diff --git a/core/sql/regress/hive/TEST003 b/core/sql/regress/hive/TEST003
index 3761906..f5e4cde 100644
--- a/core/sql/regress/hive/TEST003
+++ b/core/sql/regress/hive/TEST003
@@ -95,7 +95,7 @@ insert into hive.ins_promotion select *, p_promo_sk from hive.promotion;
 -- number of columns doesn't match
 
 prepare s from
-insert into hive.ins_time_dim values ('a', 2, 3, 4, 5, 6, 'c', 'd', 'e', 'f');
+insert into hive.ins_time_dim values (current_time, 2, 3, 4, 5, 6, 'c', 'd', 'e', 'f');
 -- wrong data types
 
 
@@ -132,7 +132,7 @@ execute s1;
 prepare s1 from values('lp 1425661 - Hang with hive scan and [FIRST N]');
 execute s1;
 
-prepare s from insert into ins_customer_demographics select * from customer_demographics;
+prepare s from insert OVERWRITE TABLE ins_customer_demographics select * from customer_demographics;
 execute s;
 select count(*) from hive.customer_demographics;
 select count(*) from hive.ins_customer_demographics;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/regress/qat/cidefs
----------------------------------------------------------------------
diff --git a/core/sql/regress/qat/cidefs b/core/sql/regress/qat/cidefs
deleted file mode 100755
index d98bd47..0000000
--- a/core/sql/regress/qat/cidefs
+++ /dev/null
@@ -1,32 +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 @@@
-
--- control query default HIST_USE_SAMPLE_FOR_CARDINALITY_ESTIMATION  'ON';
--- control query default HIST_ON_DEMAND_STATS_SIZE '10000';
--- This CQD is added for creating a table with no
--- partition or primary key when the POS is enabled.
-control query default POS_ALLOW_NON_PK_TABLES 'ON';
-
-#ifNT
--- This CQD is added to prevent random crashes in ESPs on NT with
--- getRefCount() == 1 assert failure in Ipc.cpp
-control query default  RISK_PREMIUM_SERIAL '1.0';
-#ifNT

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/regress/seabase/DIFF032.KNOWN
----------------------------------------------------------------------
diff --git a/core/sql/regress/seabase/DIFF032.KNOWN b/core/sql/regress/seabase/DIFF032.KNOWN
new file mode 100644
index 0000000..98daf09
--- /dev/null
+++ b/core/sql/regress/seabase/DIFF032.KNOWN
@@ -0,0 +1,4 @@
+214d213
+<  3
+215a215
+>  3

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/regress/seabase/EXPECTED003
----------------------------------------------------------------------
diff --git a/core/sql/regress/seabase/EXPECTED003 b/core/sql/regress/seabase/EXPECTED003
index 55d41ae..9afa030 100644
--- a/core/sql/regress/seabase/EXPECTED003
+++ b/core/sql/regress/seabase/EXPECTED003
@@ -31,7 +31,7 @@
 >>invoke t003t1;
 
 -- Definition of Trafodion table TRAFODION.SCH.T003T1
--- Definition current  Thu Aug 11 20:57:52 2016
+-- Definition current  Mon Aug 15 08:53:30 2016
 
   (
     A                                TINYINT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -50,7 +50,7 @@
 >>invoke t003t1_like;
 
 -- Definition of Trafodion table TRAFODION.SCH.T003T1_LIKE
--- Definition current  Thu Aug 11 20:57:55 2016
+-- Definition current  Mon Aug 15 08:53:34 2016
 
   (
     A                                TINYINT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -69,7 +69,7 @@
 >>invoke t003t1_as;
 
 -- Definition of Trafodion table TRAFODION.SCH.T003T1_AS
--- Definition current  Thu Aug 11 20:58:01 2016
+-- Definition current  Mon Aug 15 08:53:40 2016
 
   (
     A                                TINYINT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -88,7 +88,7 @@
 >>invoke t003t1_view;
 
 -- Definition of Trafodion view TRAFODION.SCH.T003T1_VIEW
--- Definition current  Thu Aug 11 20:58:03 2016
+-- Definition current  Mon Aug 15 08:53:42 2016
 
   (
     A                                TINYINT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -353,7 +353,7 @@ A     B     C    D
 >>invoke hive.hive.ttiny;
 
 -- Definition of hive table TTINY
--- Definition current  Thu Aug 11 20:58:41 2016
+-- Definition current  Mon Aug 15 08:54:30 2016
 
   (
     A                                TINYINT
@@ -512,7 +512,7 @@ A     B
 >>invoke t003t1;
 
 -- Definition of Trafodion table TRAFODION.SCH.T003T1
--- Definition current  Thu Aug 11 20:59:07 2016
+-- Definition current  Mon Aug 15 08:54:56 2016
 
   (
     A                                TINYINT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -531,7 +531,7 @@ A     B
 >>invoke t003t1_like;
 
 -- Definition of Trafodion table TRAFODION.SCH.T003T1_LIKE
--- Definition current  Thu Aug 11 20:59:10 2016
+-- Definition current  Mon Aug 15 08:54:59 2016
 
   (
     A                                TINYINT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -550,7 +550,7 @@ A     B
 >>invoke t003t1_as;
 
 -- Definition of Trafodion table TRAFODION.SCH.T003T1_AS
--- Definition current  Thu Aug 11 20:59:13 2016
+-- Definition current  Mon Aug 15 08:55:03 2016
 
   (
     A                                TINYINT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -569,7 +569,7 @@ A     B
 >>invoke t003t1_view;
 
 -- Definition of Trafodion view TRAFODION.SCH.T003T1_VIEW
--- Definition current  Thu Aug 11 20:59:15 2016
+-- Definition current  Mon Aug 15 08:55:05 2016
 
   (
     A                                TINYINT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -834,7 +834,7 @@ A       B       C      D
 >>invoke hive.hive.ttiny;
 
 -- Definition of hive table TTINY
--- Definition current  Thu Aug 11 20:59:51 2016
+-- Definition current  Mon Aug 15 08:55:44 2016
 
   (
     A                                TINYINT
@@ -978,7 +978,7 @@ A       B
 >>invoke t003t2;
 
 -- Definition of Trafodion table TRAFODION.SCH.T003T2
--- Definition current  Thu Aug 11 21:00:00 2016
+-- Definition current  Mon Aug 15 08:55:51 2016
 
   (
     A                                LARGEINT UNSIGNED NO DEFAULT NOT NULL NOT
@@ -995,7 +995,7 @@ A       B
 >>invoke t003t2_like;
 
 -- Definition of Trafodion table TRAFODION.SCH.T003T2_LIKE
--- Definition current  Thu Aug 11 21:00:03 2016
+-- Definition current  Mon Aug 15 08:55:54 2016
 
   (
     A                                LARGEINT UNSIGNED NO DEFAULT NOT NULL NOT
@@ -1012,7 +1012,7 @@ A       B
 >>invoke t003t2_as;
 
 -- Definition of Trafodion table TRAFODION.SCH.T003T2_AS
--- Definition current  Thu Aug 11 21:00:06 2016
+-- Definition current  Mon Aug 15 08:55:58 2016
 
   (
     A                                LARGEINT UNSIGNED NO DEFAULT NOT NULL NOT
@@ -1029,7 +1029,7 @@ A       B
 >>invoke t003t2_view;
 
 -- Definition of Trafodion view TRAFODION.SCH.T003T2_VIEW
--- Definition current  Thu Aug 11 21:00:08 2016
+-- Definition current  Mon Aug 15 08:56:00 2016
 
   (
     A                                LARGEINT UNSIGNED NO DEFAULT NOT NULL NOT
@@ -1322,7 +1322,7 @@ A                     B
 >>invoke t003t2;
 
 -- Definition of Trafodion table TRAFODION.SCH.T003T2
--- Definition current  Thu Aug 11 21:00:38 2016
+-- Definition current  Mon Aug 15 08:56:27 2016
 
   (
     A                                LARGEINT UNSIGNED NO DEFAULT NOT NULL NOT
@@ -1339,7 +1339,7 @@ A                     B
 >>invoke t003t2_like;
 
 -- Definition of Trafodion table TRAFODION.SCH.T003T2_LIKE
--- Definition current  Thu Aug 11 21:00:41 2016
+-- Definition current  Mon Aug 15 08:56:30 2016
 
   (
     A                                LARGEINT UNSIGNED NO DEFAULT NOT NULL NOT
@@ -1356,7 +1356,7 @@ A                     B
 >>invoke t003t2_as;
 
 -- Definition of Trafodion table TRAFODION.SCH.T003T2_AS
--- Definition current  Thu Aug 11 21:00:45 2016
+-- Definition current  Mon Aug 15 08:56:34 2016
 
   (
     A                                LARGEINT UNSIGNED NO DEFAULT NOT NULL NOT
@@ -1373,7 +1373,7 @@ A                     B
 >>invoke t003t2_view;
 
 -- Definition of Trafodion view TRAFODION.SCH.T003T2_VIEW
--- Definition current  Thu Aug 11 21:00:46 2016
+-- Definition current  Mon Aug 15 08:56:36 2016
 
   (
     A                                LARGEINT UNSIGNED NO DEFAULT NOT NULL NOT
@@ -1669,7 +1669,7 @@ A                     B
 >>invoke t003t2;
 
 -- Definition of Trafodion table TRAFODION.SCH.T003T2
--- Definition current  Thu Aug 11 21:01:16 2016
+-- Definition current  Mon Aug 15 08:57:01 2016
 
   (
     A                                LARGEINT UNSIGNED NO DEFAULT NOT NULL NOT
@@ -1686,7 +1686,7 @@ A                     B
 >>invoke t003t2_like;
 
 -- Definition of Trafodion table TRAFODION.SCH.T003T2_LIKE
--- Definition current  Thu Aug 11 21:01:20 2016
+-- Definition current  Mon Aug 15 08:57:04 2016
 
   (
     A                                LARGEINT UNSIGNED NO DEFAULT NOT NULL NOT
@@ -1703,7 +1703,7 @@ A                     B
 >>invoke t003t2_as;
 
 -- Definition of Trafodion table TRAFODION.SCH.T003T2_AS
--- Definition current  Thu Aug 11 21:01:24 2016
+-- Definition current  Mon Aug 15 08:57:07 2016
 
   (
     A                                LARGEINT UNSIGNED NO DEFAULT NOT NULL NOT
@@ -1720,7 +1720,7 @@ A                     B
 >>invoke t003t2_view;
 
 -- Definition of Trafodion view TRAFODION.SCH.T003T2_VIEW
--- Definition current  Thu Aug 11 21:01:26 2016
+-- Definition current  Mon Aug 15 08:57:09 2016
 
   (
     A                                LARGEINT UNSIGNED NO DEFAULT NOT NULL NOT
@@ -2016,7 +2016,7 @@ A                      B
 >>invoke t003t3;
 
 -- Definition of Trafodion table TRAFODION.SCH.T003T3
--- Definition current  Thu Aug 11 21:01:34 2016
+-- Definition current  Mon Aug 15 08:57:17 2016
 
   (
     A                                BOOLEAN NO DEFAULT NOT NULL NOT DROPPABLE
@@ -2032,7 +2032,7 @@ A                      B
 >>invoke t003t3_like;
 
 -- Definition of Trafodion table TRAFODION.SCH.T003T3_LIKE
--- Definition current  Thu Aug 11 21:01:37 2016
+-- Definition current  Mon Aug 15 08:57:20 2016
 
   (
     A                                BOOLEAN NO DEFAULT NOT NULL NOT DROPPABLE
@@ -2048,7 +2048,7 @@ A                      B
 >>invoke t003t3_as;
 
 -- Definition of Trafodion table TRAFODION.SCH.T003T3_AS
--- Definition current  Thu Aug 11 21:01:40 2016
+-- Definition current  Mon Aug 15 08:57:24 2016
 
   (
     A                                BOOLEAN NO DEFAULT NOT NULL NOT DROPPABLE
@@ -2065,7 +2065,7 @@ A                      B
 >>invoke t003t3_salt;
 
 -- Definition of Trafodion table TRAFODION.SCH.T003T3_SALT
--- Definition current  Thu Aug 11 21:01:42 2016
+-- Definition current  Mon Aug 15 08:57:26 2016
 
   (
     A                                BOOLEAN NO DEFAULT NOT NULL NOT DROPPABLE
@@ -2082,7 +2082,7 @@ A                      B
 >>invoke t003t3_view;
 
 -- Definition of Trafodion view TRAFODION.SCH.T003T3_VIEW
--- Definition current  Thu Aug 11 21:01:44 2016
+-- Definition current  Mon Aug 15 08:57:28 2016
 
   (
     A                                BOOLEAN NO DEFAULT NOT NULL NOT DROPPABLE
@@ -2383,13 +2383,10 @@ TRUE   FALSE
 >>
 >>insert into t003t3 values ('true', false);
 
-*** ERROR[4039] Column A is of type BOOLEAN, incompatible with the value's type, CHAR(4).
-
-*** ERROR[8822] The statement was not prepared.
-
+--- 1 row(s) inserted.
 >>insert into t003t3 values (1, true);
 
-*** ERROR[4039] Column A is of type BOOLEAN, incompatible with the value's type, NUMERIC(1).
+*** ERROR[4035] Type NUMERIC(1) cannot be cast to type BOOLEAN.
 
 *** ERROR[8822] The statement was not prepared.
 
@@ -2424,7 +2421,7 @@ TRUE   FALSE
 >>invoke hive.hive.tbool;
 
 -- Definition of hive table TBOOL
--- Definition current  Thu Aug 11 21:02:21 2016
+-- Definition current  Mon Aug 15 08:58:07 2016
 
   (
     A                                BOOLEAN
@@ -2460,10 +2457,15 @@ TRUE
 --- 6 row(s) selected.
 >>insert overwrite table hive.hive.tbool select a from t003t3;
 
---- 0 row(s) inserted.
+--- 1 row(s) inserted.
 >>select * from hive.hive.tbool;
 
---- 0 row(s) selected.
+A    
+-----
+
+TRUE 
+
+--- 1 row(s) selected.
 >>
 >>
 >>cqd traf_boolean_io 'OFF';
@@ -2491,7 +2493,7 @@ TRUE
 >>invoke t003t3;
 
 -- Definition of Trafodion table TRAFODION.SCH.T003T3
--- Definition current  Thu Aug 11 21:02:45 2016
+-- Definition current  Mon Aug 15 08:58:30 2016
 
   (
     A                                BOOLEAN NO DEFAULT NOT NULL NOT DROPPABLE
@@ -2507,7 +2509,7 @@ TRUE
 >>invoke t003t3_like;
 
 -- Definition of Trafodion table TRAFODION.SCH.T003T3_LIKE
--- Definition current  Thu Aug 11 21:02:48 2016
+-- Definition current  Mon Aug 15 08:58:34 2016
 
   (
     A                                BOOLEAN NO DEFAULT NOT NULL NOT DROPPABLE
@@ -2523,7 +2525,7 @@ TRUE
 >>invoke t003t3_as;
 
 -- Definition of Trafodion table TRAFODION.SCH.T003T3_AS
--- Definition current  Thu Aug 11 21:02:52 2016
+-- Definition current  Mon Aug 15 08:58:38 2016
 
   (
     A                                BOOLEAN NO DEFAULT NOT NULL NOT DROPPABLE
@@ -2540,7 +2542,7 @@ TRUE
 >>invoke t003t3_salt;
 
 -- Definition of Trafodion table TRAFODION.SCH.T003T3_SALT
--- Definition current  Thu Aug 11 21:02:52 2016
+-- Definition current  Mon Aug 15 08:58:38 2016
 
   (
     A                                BOOLEAN NO DEFAULT NOT NULL NOT DROPPABLE
@@ -2557,7 +2559,7 @@ TRUE
 >>invoke t003t3_view;
 
 -- Definition of Trafodion view TRAFODION.SCH.T003T3_VIEW
--- Definition current  Thu Aug 11 21:02:54 2016
+-- Definition current  Mon Aug 15 08:58:40 2016
 
   (
     A                                BOOLEAN NO DEFAULT NOT NULL NOT DROPPABLE

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/regress/seabase/EXPECTED030
----------------------------------------------------------------------
diff --git a/core/sql/regress/seabase/EXPECTED030 b/core/sql/regress/seabase/EXPECTED030
index bb67b3e..431dfaa 100644
--- a/core/sql/regress/seabase/EXPECTED030
+++ b/core/sql/regress/seabase/EXPECTED030
@@ -557,7 +557,7 @@ A           B                               C
 
 >>select to_date('0103.2016', 'DD.MM.YYYY') from (values(1)) x(a);
 
-*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data 0103.2016
+*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data: 0103.2016
 
 --- 0 row(s) selected.
 >>select to_char('2016-03-01', 'YYYY-MM-DD') from (values(1)) x(a);
@@ -580,10 +580,12 @@ A           B                               C
 
 >>select * from t030t1 where to_date(c, 'YYYY-MM-DD') = '2016-03-01';
 
-*** ERROR[4041] Type DATE cannot be compared with type CHAR(10).
+A           B                               C
+----------  ------------------------------  ------------------------------
 
-*** ERROR[8822] The statement was not prepared.
+2016-03-01  2016-03-01                      2016-03-01                    
 
+--- 1 row(s) selected.
 >>select to_date('01.03.2016:10:11:12', 'DD.MM.YYYY:HH24:MI:SS') from (values(1)) x(a);
 
 *** ERROR[4065] The format, "DD.MM.YYYY:HH24:MI:SS", specified in the TO_DATE function is not supported.
@@ -629,14 +631,14 @@ A           B                               C
 >>-- ms4 error cases
 >>select to_date(123456789, '99:99:99:99') from (values(1)) x(a);
 
-*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data ?
+*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data: ?
 
 *** ERROR[8001] An internal executor error occurred.
 
 --- 0 row(s) selected.
 >>select to_date(-12345678, '99:99:99:99') from (values(1)) x(a);
 
-*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data ?
+*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot be converted. Source data: ?
 
 *** ERROR[8001] An internal executor error occurred.
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/regress/seabase/EXPECTED032
----------------------------------------------------------------------
diff --git a/core/sql/regress/seabase/EXPECTED032 b/core/sql/regress/seabase/EXPECTED032
new file mode 100644
index 0000000..b43dd14
--- /dev/null
+++ b/core/sql/regress/seabase/EXPECTED032
@@ -0,0 +1,297 @@
+>>
+>>-- add/enable support for syntax and functions
+>>drop table if exists t032t1 cascade;
+
+--- SQL operation complete.
+>>
+>>create table t032t1 (a int not null primary key, 
++>                     b byteint, 
++>                     c int not null enable,  
++>                     d date, e time, f timestamp,
++>                     g real);
+
+--- SQL operation complete.
+>>
+>>invoke t032t1;
+
+-- Definition of Trafodion table TRAFODION.SCH.T032T1
+-- Definition current  Wed Aug 24 20:59:45 2016
+
+  (
+    A                                INT NO DEFAULT NOT NULL NOT DROPPABLE
+  , B                                TINYINT DEFAULT NULL
+  , C                                INT NO DEFAULT NOT NULL NOT DROPPABLE
+  , D                                DATE DEFAULT NULL
+  , E                                TIME(0) DEFAULT NULL
+  , F                                TIMESTAMP(6) DEFAULT NULL
+  , G                                REAL DEFAULT NULL
+  )
+  PRIMARY KEY (A ASC)
+
+--- SQL operation complete.
+>>
+>>insert into t032t1 values (1, 2, 3, date '2016-08-15',  time '10:11:12',
++>                           timestamp '2016-08-15 10:11:12', 4e0);
+
+--- 1 row(s) inserted.
+>>insert into t032t1 values (2, 3, 3, date '2016-08-15',  time '10:11:12',
++>                           timestamp '2016-08-15 10:11:12', 4e0);
+
+--- 1 row(s) inserted.
+>>
+>>select unique b from t032t1;
+
+B   
+----
+
+   2
+   3
+
+--- 2 row(s) selected.
+>>
+>>select greatest(a, 10) from t032t1;
+
+(EXPR)     
+-----------
+
+         10
+         10
+
+--- 2 row(s) selected.
+>>select least(a, 10) from t032t1;
+
+(EXPR)     
+-----------
+
+          1
+          2
+
+--- 2 row(s) selected.
+>>
+>>select ceil(g), ceiling(g) from t032t1;
+
+(EXPR)                     (EXPR)                   
+-------------------------  -------------------------
+
+ 4.00000000000000000E+000   4.00000000000000000E+000
+ 4.00000000000000000E+000   4.00000000000000000E+000
+
+--- 2 row(s) selected.
+>>
+>>select months_between(d, date '2016-01-01') from t032t1;
+
+(EXPR)               
+---------------------
+
+             7.322580
+             7.322580
+
+--- 2 row(s) selected.
+>>select months_between(date '2016-01-01', d) from t032t1;
+
+(EXPR)               
+---------------------
+
+            -7.322580
+            -7.322580
+
+--- 2 row(s) selected.
+>>
+>>select months_between(d, date '2016-01-15') from t032t1;
+
+(EXPR)               
+---------------------
+
+             7.000000
+             7.000000
+
+--- 2 row(s) selected.
+>>select months_between(date '2016-01-15', d) from t032t1;
+
+(EXPR)               
+---------------------
+
+            -7.000000
+            -7.000000
+
+--- 2 row(s) selected.
+>>
+>>select last_day(d), last_day(f) from t032t1;
+
+(EXPR)      (EXPR)                    
+----------  --------------------------
+
+2016-08-31  2016-08-31 10:11:12.000000
+2016-08-31  2016-08-31 10:11:12.000000
+
+--- 2 row(s) selected.
+>>select next_day(d, 'sunday'), next_day(f, 'wednesday') from t032t1;
+
+(EXPR)      (EXPR)                    
+----------  --------------------------
+
+2016-08-21  2016-08-17 10:11:12.000000
+2016-08-21  2016-08-17 10:11:12.000000
+
+--- 2 row(s) selected.
+>>
+>>select 'RANDOMVAL=' ||  trim(cast(rand() as varchar(20) not null)) from (values(1)) x(a);
+
+(EXPR)                        
+------------------------------
+
+RANDOMVAL=1935127796          
+
+--- 1 row(s) selected.
+>>select random() from (values(1)) x(a);
+
+(EXPR)    
+----------
+
+         1
+
+--- 1 row(s) selected.
+>>
+>>select rand(100) from (values(1)) x(a);
+
+(EXPR)    
+----------
+
+   1680700
+
+--- 1 row(s) selected.
+>>
+>>select * from dual;
+
+(EXPR)
+------
+
+     0
+
+--- 1 row(s) selected.
+>>
+>>-- error 8413 enhancement
+>>select cast('a' as int) from dual;
+
+*** ERROR[8413] The string argument contains characters that cannot be converted. Source data(in hex): 61
+
+--- 0 row(s) selected.
+>>
+>>-- group by, order by enhancements
+>>select a aa from t032t1 group by aa;
+
+AA         
+-----------
+
+          1
+          2
+
+--- 2 row(s) selected.
+>>select a+1 from t032t1 group by a+1;
+
+(EXPR)              
+--------------------
+
+                   2
+                   3
+
+--- 2 row(s) selected.
+>>select a+1 from t032t1 order by a+1;
+
+(EXPR)              
+--------------------
+
+                   2
+                   3
+
+--- 2 row(s) selected.
+>>select * from (select b from t032t1 order by b desc) x(z);
+
+Z   
+----
+
+   2
+   3
+
+--- 2 row(s) selected.
+>>select * from (select [first 1] a from t032t1) x(z);
+
+Z          
+-----------
+
+          1
+
+--- 1 row(s) selected.
+>>
+>>-- incompatible operations
+>>select a from t032t1 where a = '2';
+
+A          
+-----------
+
+          2
+
+--- 1 row(s) selected.
+>>select b from t032t1 where b = '2';
+
+B   
+----
+
+   2
+
+--- 1 row(s) selected.
+>>select a + '1' from t032t1;
+
+(EXPR)              
+--------------------
+
+                   2
+                   3
+
+--- 2 row(s) selected.
+>>select a || '1' from t032t1;
+
+(EXPR)      
+------------
+
+          11
+          21
+
+--- 2 row(s) selected.
+>>insert into t032t1 values ('3', 3, 3, date '2016-08-15',  time '10:11:12',
++>                           timestamp '2016-08-15 10:11:12', 4e0);
+
+--- 1 row(s) inserted.
+>>select * from t032t1;
+
+A            B     C            D           E         F                           G
+-----------  ----  -----------  ----------  --------  --------------------------  ---------------
+
+          1     2            3  2016-08-15  10:11:12  2016-08-15 10:11:12.000000   4.0000000E+000
+          2     3            3  2016-08-15  10:11:12  2016-08-15 10:11:12.000000   4.0000000E+000
+          3     3            3  2016-08-15  10:11:12  2016-08-15 10:11:12.000000   4.0000000E+000
+
+--- 3 row(s) selected.
+>>
+>>select * from (values(1)) x(a) where current_date = current_timestamp;
+
+A   
+----
+
+   1
+
+--- 1 row(s) selected.
+>>select * from (values(1)) x(a) where current_timestamp(0) = current_timestamp(6);
+
+--- 0 row(s) selected.
+>>
+>>select cast(1e0 as interval year) from dual;
+
+(EXPR)
+------
+
+     1
+
+--- 1 row(s) selected.
+>>
+>>log;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/regress/seabase/FILTER032
----------------------------------------------------------------------
diff --git a/core/sql/regress/seabase/FILTER032 b/core/sql/regress/seabase/FILTER032
new file mode 100755
index 0000000..a3ac033
--- /dev/null
+++ b/core/sql/regress/seabase/FILTER032
@@ -0,0 +1,27 @@
+#! /bin/sh
+# @@@ 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 @@@
+
+fil=$1
+sed "
+s/RANDOMVAL=[0-9]*/RANDOMVAL=<removed>/
+
+" $fil

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/regress/seabase/TEST010
----------------------------------------------------------------------
diff --git a/core/sql/regress/seabase/TEST010 b/core/sql/regress/seabase/TEST010
index 7848bd6..ecc8fc9 100644
--- a/core/sql/regress/seabase/TEST010
+++ b/core/sql/regress/seabase/TEST010
@@ -23,6 +23,7 @@
 -- @@@ END COPYRIGHT @@@
 
 obey TEST010(clean_up);
+cleanup obsolete volatile tables;
 
 log LOG010 clear;
 obey TEST010(setup);

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/regress/seabase/TEST032
----------------------------------------------------------------------
diff --git a/core/sql/regress/seabase/TEST032 b/core/sql/regress/seabase/TEST032
new file mode 100644
index 0000000..0b618be
--- /dev/null
+++ b/core/sql/regress/seabase/TEST032
@@ -0,0 +1,91 @@
+-- @@@ 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 @@@
+--
+
+-- Misc tests.
+
+log LOG032 clear;
+
+-- add/enable support for syntax and functions
+drop table if exists t032t1 cascade;
+
+create table t032t1 (a int not null primary key, 
+                     b byteint, 
+                     c int not null enable,  
+                     d date, e time, f timestamp,
+                     g real);
+
+invoke t032t1;
+
+insert into t032t1 values (1, 2, 3, date '2016-08-15',  time '10:11:12',
+                           timestamp '2016-08-15 10:11:12', 4e0);
+insert into t032t1 values (2, 3, 3, date '2016-08-15',  time '10:11:12',
+                           timestamp '2016-08-15 10:11:12', 4e0);
+
+select unique b from t032t1;
+
+select greatest(a, 10) from t032t1;
+select least(a, 10) from t032t1;
+
+select ceil(g), ceiling(g) from t032t1;
+
+select months_between(d, date '2016-01-01') from t032t1;
+select months_between(date '2016-01-01', d) from t032t1;
+
+select months_between(d, date '2016-01-15') from t032t1;
+select months_between(date '2016-01-15', d) from t032t1;
+
+select last_day(d), last_day(f) from t032t1;
+select next_day(d, 'sunday'), next_day(f, 'wednesday') from t032t1;
+
+select 'RANDOMVAL=' ||  trim(cast(rand() as varchar(20) not null)) from (values(1)) x(a);
+select random() from (values(1)) x(a);
+
+select rand(100) from (values(1)) x(a);
+
+select * from dual;
+
+-- error 8413 enhancement
+select cast('a' as int) from dual;
+
+-- group by, order by enhancements
+select a aa from t032t1 group by aa;
+select a+1 from t032t1 group by a+1;
+select a+1 from t032t1 order by a+1;
+select * from (select b from t032t1 order by b desc) x(z);
+select * from (select [first 1] a from t032t1) x(z);
+
+-- incompatible operations
+select a from t032t1 where a = '2';
+select b from t032t1 where b = '2';
+select a + '1' from t032t1;
+select a || '1' from t032t1;
+insert into t032t1 values ('3', 3, 3, date '2016-08-15',  time '10:11:12',
+                           timestamp '2016-08-15 10:11:12', 4e0);
+select * from t032t1;
+
+select * from (values(1)) x(a) where current_date = current_timestamp;
+select * from (values(1)) x(a) where current_timestamp(0) = current_timestamp(6);
+
+select cast(1e0 as interval year) from dual;
+
+log;
+

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/regress/tools/runallsb
----------------------------------------------------------------------
diff --git a/core/sql/regress/tools/runallsb b/core/sql/regress/tools/runallsb
index 555ad93..1cc82bc 100755
--- a/core/sql/regress/tools/runallsb
+++ b/core/sql/regress/tools/runallsb
@@ -55,6 +55,7 @@ if [ $? -ne 0 ]; then
 fi
 
 diffOnly=0
+failedOnly=0
 
 OK=-1
 while [ $OK -ne 0 ]; do		# loop to allow options to appear in any order
@@ -70,6 +71,11 @@ while [ $OK -ne 0 ]; do		# loop to allow options to appear in any order
     export SEABASE_REGRESS_DIFFS=1
   fi
 
+  if [ "$1" = "-failed" ]; then
+    failedOnly=1
+    OK=1
+  fi
+
 done
 
 test ! -d $MY_SQROOT/sql/regress && ln -s $MY_SQROOT/../sql/regress $MY_SQROOT/sql/regress
@@ -85,7 +91,10 @@ if [ "$T" != "" ]; then
 fi
 
 diffStr=
-if [ $diffOnly -ne 0 ]; then
+if [ $failedOnly -ne 0 ]; then
+  echo "Running failed tests for $TEST_SUBDIRS"
+  diffStr="-failed "
+elif [ $diffOnly -ne 0 ]; then
   echo "Running diffs for $TEST_SUBDIRS"
   diffStr="-diff "
 else
@@ -128,6 +137,10 @@ for dir in $TEST_SUBDIRS; do
       echo "Found $rundir/$dir - continuing with tests"
    fi
 
+   if [ $failedOnly -ne 0 ]; then
+     rm -f $dir/runregr-sb.log 2>/dev/null
+   fi
+
    case $dir in
       core)
          pushd core
@@ -199,7 +212,11 @@ for dir in $TEST_SUBDIRS; do
  echo "------------------------------------------------------------------"
  echo "-- Showing result for $dir"
  echo "------------------------------------------------------------------"
- cat $dir/runregr-sb.log
+ if [ $failedOnly -ne 0 ]; then
+   cat $dir/runregr-failed.log
+ else
+   cat $dir/runregr-sb.log 
+ fi
 done
 
 echo ""

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/regress/tools/runregr
----------------------------------------------------------------------
diff --git a/core/sql/regress/tools/runregr b/core/sql/regress/tools/runregr
index fdd93a2..5786ac4 100755
--- a/core/sql/regress/tools/runregr
+++ b/core/sql/regress/tools/runregr
@@ -56,7 +56,7 @@ while [ "$#" -gt 0 ]; do
     -sb)
       sqlmxtbls=1
       table_format='sb'
-        export SEABASE_REGRESS=2
+      export SEABASE_REGRESS=2
       shift
       ;;
 
@@ -65,6 +65,11 @@ while [ "$#" -gt 0 ]; do
       shift
       ;;
 
+    -failed)
+      failed=1
+      shift
+      ;;
+
     -ssd)
       ssd=${2:?'The -ssd option requires an argument'}
       shift 2
@@ -240,7 +245,27 @@ if [ ! -d "$FilteredLogs/expfiles" ]; then
 fi
 echo "Using the following directory for filtered logs:   $FilteredLogs"
 
-if [ "$diffs" -eq 1 ]; then
+if [ "$failed" -eq 1 ]; then
+  rm -f $REGRRUNDIR/runregr-failed.log 2>$NULL
+  echo "Command executed: $tool -diff $* "
+  $tool -diff $* > $REGRRUNDIR/runregr-failed.log
+  ff=`cat $REGRRUNDIR/runregr-failed.log | grep ' ### FAIL ' | cut -c 22-28 ` 2>$NULL
+
+  if [ "$ff" == "" ]; then
+     echo "No failed tests, nothing to execute."
+     rm -f $REGRRUNDIR/runregr-failed.log 2>$NULL
+     echo "No failed tests." > $REGRRUNDIR/runregr-failed.log
+  else
+    failedTests=
+    for i in $ff; do
+      failedTests="$failedTests $i"
+    done
+    echo "Command executed: $tool $failedTests"
+    $tool $failedTests
+    rm -f $REGRRUNDIR/runregr-failed.log 2>$NULL
+    cp $rgrlog $REGRRUNDIR/runregr-failed.log 2>$NULL
+  fi
+elif [ "$diffs" -eq 1 ]; then
   echo "Command executed: $tool -diff $*"
   $tool -diff $*
 else

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/regress/tools/runregr_charsets.ksh
----------------------------------------------------------------------
diff --git a/core/sql/regress/tools/runregr_charsets.ksh b/core/sql/regress/tools/runregr_charsets.ksh
index c0d59fa..fddd2aa 100755
--- a/core/sql/regress/tools/runregr_charsets.ksh
+++ b/core/sql/regress/tools/runregr_charsets.ksh
@@ -493,9 +493,9 @@ for i in $prettyfiles; do
 
       if [ "$REGRCONCURRENT" -eq 1 ]; then
         echo "create schema ${TEST_SCHEMA}; set schema ${TEST_SCHEMA};" \
-          | cat $REGRTSTDIR/cidefs $sbdefsfile $defsfile - $testrun > $test.tmp
+          | cat $sbdefsfile $defsfile - $testrun > $test.tmp
       else
-        cat $REGRTSTDIR/cidefs $sbdefsfile $defsfile $testrun > $test.tmp
+        cat $sbdefsfile $defsfile $testrun > $test.tmp
       fi
 
       #Special case for test100 or test101

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/regress/tools/runregr_compGeneral.ksh
----------------------------------------------------------------------
diff --git a/core/sql/regress/tools/runregr_compGeneral.ksh b/core/sql/regress/tools/runregr_compGeneral.ksh
index e100654..39943d8 100755
--- a/core/sql/regress/tools/runregr_compGeneral.ksh
+++ b/core/sql/regress/tools/runregr_compGeneral.ksh
@@ -173,24 +173,24 @@ fi
 
 if [ `uname` = "Linux" ]; then
   # upcase all test*, expected*, filters and known diff files
-  lctestfiles=`ls -1 test???* | sed -e /~$/d -e /.bak$/d | sort -fu` 2>$NULL
+  lctestfiles=`ls -1 test???* 2>$NULL | sed -e /~$/d -e /.bak$/d | sort -fu` 2>$NULL
   for lcfile in $lctestfiles; do
     if [[ $lcfile != test*\.dat ]]; then
       ucfile=`echo $lcfile | tr a-z A-Z`
       cp -f $lcfile $ucfile 2>$NULL
     fi
   done
-  lcxptdfiles=`ls -1 expected???* | sed -e /~$/d -e /.bak$/d | sort -fu` 2>$NULL
+  lcxptdfiles=`ls -1 expected???* 2>$NULL | sed -e /~$/d -e /.bak$/d | sort -fu` 2>$NULL
   for lcfile in $lcxptdfiles; do
     ucfile=`echo $lcfile | tr a-z A-Z`
     cp -f $lcfile $ucfile 2>$NULL
   done
-  lcfiltfiles=`ls -1 filter???* | sed -e /~$/d -e /.bak$/d | sort -fu` 2>$NULL
+  lcfiltfiles=`ls -1 filter???* 2>$NULL | sed -e /~$/d -e /.bak$/d | sort -fu` 2>$NULL
   for lcfile in $lcfiltfiles; do
     ucfile=`echo $lcfile | tr a-z A-Z`
     cp -f $lcfile $ucfile 2>$NULL
   done
-  lcknownfiles=`ls -1 *.known* | sed -e /~$/d -e /.bak$/d | sort -fu` 2>$NULL
+  lcknownfiles=`ls -1 *.known* 2>$NULL | sed -e /~$/d -e /.bak$/d | sort -fu` 2>$NULL
   for lcfile in $lcknownfiles; do
     ucfile=`echo $lcfile | tr a-z A-Z`
     cp -f $lcfile $ucfile 2>$NULL
@@ -527,7 +527,6 @@ for i in $prettyfiles; do
       cp $REGRTSTDIR/QDROPj01 $REGRRUNDIR/QDROPJ01
       cp $REGRTSTDIR/QINSERTj01 $REGRRUNDIR/QINSERTJ01
       cp $REGRTSTDIR/QSELECTj01 $REGRRUNDIR/QSELECTJ01
-      cp $REGRTSTDIR/cidefs $REGRRUNDIR/cidefs
     fi
 
     if [ "$diffOnly" -eq 0 ]; then
@@ -542,7 +541,6 @@ for i in $prettyfiles; do
       rm -f $REGRRUNDIR/QDROPJ01
       rm -f $REGRRUNDIR/QINSERTJ01
       rm -f $REGRRUNDIR/QSELECTJ01
-      rm -f $REGRRUNDIR/cidefs
     fi
 
     continue
@@ -565,13 +563,6 @@ for i in $prettyfiles; do
     fi
   fi
 
-  #Special case for sqlmp alias tests, test075
-  if test "$tnum" = "075" ; then
-    if [ "$REGRTSTDIR" != "$REGRRUNDIR" ]; then
-      cp $REGRTSTDIR/cidefs $REGRRUNDIR/cidefs
-    fi
-  fi
-
   # run the test
 
   if [ $diffOnly -eq 0 ]; then
@@ -597,9 +588,9 @@ for i in $prettyfiles; do
 
       if [ "$REGRCONCURRENT" -eq 1 ]; then
         echo "create schema ${TEST_SCHEMA}; set schema ${TEST_SCHEMA};" \
-          | cat $REGRTSTDIR/cidefs $sbdefsfile $defsfile - $testrun > $test.tmp
+          | cat $sbdefsfile $defsfile - $testrun > $test.tmp
       else
-        cat $REGRTSTDIR/cidefs $sbdefsfile $defsfile $testrun > $test.tmp
+        cat $sbdefsfile $defsfile $testrun > $test.tmp
       fi
       # end of special case for TEST002
 
@@ -614,9 +605,9 @@ for i in $prettyfiles; do
 
       if [ "$REGRCONCURRENT" -eq 1 ]; then
         echo "create schema ${TEST_SCHEMA}; set schema ${TEST_SCHEMA};" \
-          | cat $REGRTSTDIR/cidefs $sbdefsfile $defsfile - $testrun > $test.tmp
+          | cat $sbdefsfile $defsfile - $testrun > $test.tmp
       else
-        cat $REGRTSTDIR/cidefs $sbdefsfile $defsfile $testrun > $test.tmp
+        cat $sbdefsfile $defsfile $testrun > $test.tmp
       fi
 
       if [ "$errlog" = "" ]; then

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/regress/tools/runregr_core.ksh
----------------------------------------------------------------------
diff --git a/core/sql/regress/tools/runregr_core.ksh b/core/sql/regress/tools/runregr_core.ksh
index 59004ad..3996126 100755
--- a/core/sql/regress/tools/runregr_core.ksh
+++ b/core/sql/regress/tools/runregr_core.ksh
@@ -166,23 +166,23 @@ exclusiveTests="$exclusiveTests TEST091 TEST099 TEST111"
 
 if [ `uname` = "Linux" ]; then
   # upcase all test*, expected*, filters and known diff files
-  lctestfiles=`ls -1 test???* | sed -e /~$/d -e /.bak$/d | sort -fu` 2>$NULL
+  lctestfiles=`ls -1 test???* 2>$NULL | sed -e /~$/d -e /.bak$/d | sort -fu` 2>$NULL
 
   for lcfile in $lctestfiles; do
     ucfile=`echo $lcfile | tr a-z A-Z`
     cp -f $lcfile $ucfile 2>$NULL
   done
-  lcxptdfiles=`ls -1 expected???* | sed -e /~$/d -e /.bak$/d | sort -fu` 2>$NULL
+  lcxptdfiles=`ls -1 expected???* 2>$NULL | sed -e /~$/d -e /.bak$/d | sort -fu` 2>$NULL
   for lcfile in $lcxptdfiles; do
     ucfile=`echo $lcfile | tr a-z A-Z`
     cp -f $lcfile $ucfile 2>$NULL
   done
-  lcfiltfiles=`ls -1 filter???* | sed -e /~$/d -e /.bak$/d | sort -fu` 2>$NULL
+  lcfiltfiles=`ls -1 filter???* 2>$NULL | sed -e /~$/d -e /.bak$/d | sort -fu` 2>$NULL
   for lcfile in $lcfiltfiles; do
     ucfile=`echo $lcfile | tr a-z A-Z`
     cp -f $lcfile $ucfile 2>$NULL
   done
-  lcknownfiles=`ls -1 *.known* | sed -e /~$/d -e /.bak$/d | sort -fu` 2>$NULL
+  lcknownfiles=`ls -1 *.known* 2>$NULL | sed -e /~$/d -e /.bak$/d | sort -fu` 2>$NULL
   for lcfile in $lcknownfiles; do
     ucfile=`echo $lcfile | tr a-z A-Z`
     cp -f $lcfile $ucfile 2>$NULL
@@ -535,7 +535,6 @@ for i in $prettyfiles; do
       cp $REGRTSTDIR/QINSERT[Jj]01 $REGRRUNDIR/QINSERTJ01
       cp $REGRTSTDIR/QSELECT[Jj]01 $REGRRUNDIR/QSELECTJ01
       cp $REGRTSTDIR/QUPDATE[Jj]01 $REGRRUNDIR/QUPDATEJ01
-      cp $REGRTSTDIR/cidefs $REGRRUNDIR/cidefs
     fi
 
     if [ "$diffOnly" -eq 0 ]; then
@@ -551,7 +550,6 @@ for i in $prettyfiles; do
       rm -f $REGRRUNDIR/QINSERTJ01
       rm -f $REGRRUNDIR/QSELECTJ01
       rm -f $REGRRUNDIR/QUPDATEJ01
-      rm -f $REGRRUNDIR/cidefs
     fi
 
     continue
@@ -576,13 +574,6 @@ for i in $prettyfiles; do
     fi
   fi
 
-  #Special case for sqlmp alias tests, test075
-  if test "$tnum" = "075" ; then
-    if [ "$REGRTSTDIR" != "$REGRRUNDIR" ]; then
-      cp $REGRTSTDIR/cidefs $REGRRUNDIR/cidefs
-    fi
-  fi
-
   #Special case for test100
   if test "$tnum" = "100" ; then
     if [ "$REGRTSTDIR" != "$REGRRUNDIR" ]; then
@@ -618,9 +609,9 @@ for i in $prettyfiles; do
 
       if [ "$REGRCONCURRENT" -eq 1 ]; then
         echo "create schema ${TEST_SCHEMA}; set schema ${TEST_SCHEMA};" \
-          | cat $REGRTSTDIR/cidefs $sbdefsfile $defsfile - $testrun > $test.tmp
+          | cat $sbdefsfile $defsfile - $testrun > $test.tmp
       else
-        cat $REGRTSTDIR/cidefs $sbdefsfile $defsfile $testrun > $test.tmp
+        cat $sbdefsfile $defsfile $testrun > $test.tmp
       fi
 
 
@@ -865,8 +856,8 @@ fi
 if [ $failuresOnly -eq 0 ]; then
   grep '#' $rgrlog
 else
-  egrep '(^$| FAIL )' $rgrlog			# or just the failures as logged
-  sed -n -e '/ FAIL /d' -e '/^$/,$p' $rgrlog
+  egrep '(^$| FAIL )' $rgrlog 			# or just the failures as logged
+  sed -n -e '/ FAIL /d' -e '/^$/,$p' $rgrlog 
 fi
 
 # ls -l CMPLOG* 2>$NULL

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/regress/tools/runregr_executor.ksh
----------------------------------------------------------------------
diff --git a/core/sql/regress/tools/runregr_executor.ksh b/core/sql/regress/tools/runregr_executor.ksh
index 3411009..6e763a0 100755
--- a/core/sql/regress/tools/runregr_executor.ksh
+++ b/core/sql/regress/tools/runregr_executor.ksh
@@ -181,23 +181,23 @@ cd $REGRTSTDIR 2>$NULL
 
 if [ `uname` = "Linux" ]; then
   # upcase all test*, expected*, filters and known diff files
-  lctestfiles=`ls -1 test???* | sed -e /~$/d -e /.bak$/d | sort -fu` 2>$NULL
+  lctestfiles=`ls -1 test???* 2>$NULL | sed -e /~$/d -e /.bak$/d | sort -fu` 2>$NULL
 
   for lcfile in $lctestfiles; do
     ucfile=`echo $lcfile | tr a-z A-Z`
     cp -f $lcfile $ucfile 2>$NULL
   done
-  lcxptdfiles=`ls -1 expected???* | sed -e /~$/d -e /.bak$/d | sort -fu` 2>$NULL
+  lcxptdfiles=`ls -1 expected???* 2>$NULL | sed -e /~$/d -e /.bak$/d | sort -fu` 2>$NULL
   for lcfile in $lcxptdfiles; do
     ucfile=`echo $lcfile | tr a-z A-Z`
     cp -f $lcfile $ucfile 2>$NULL
   done
-  lcfiltfiles=`ls -1 filter???* | sed -e /~$/d -e /.bak$/d | sort -fu` 2>$NULL
+  lcfiltfiles=`ls -1 filter???* 2>$NULL | sed -e /~$/d -e /.bak$/d | sort -fu` 2>$NULL
   for lcfile in $lcfiltfiles; do
     ucfile=`echo $lcfile | tr a-z A-Z`
     cp -f $lcfile $ucfile 2>$NULL
   done
-  lcknownfiles=`ls -1 *.known* | sed -e /~$/d -e /.bak$/d | sort -fu` 2>$NULL
+  lcknownfiles=`ls -1 *.known* 2>$NULL | sed -e /~$/d -e /.bak$/d | sort -fu` 2>$NULL
   for lcfile in $lcknownfiles; do
     ucfile=`echo $lcfile | tr a-z A-Z`
     cp -f $lcfile $ucfile 2>$NULL
@@ -574,7 +574,6 @@ for i in $prettyfiles; do
       cp $REGRTSTDIR/QDROPj01 $REGRRUNDIR/QDROPJ01
       cp $REGRTSTDIR/QINSERTj01 $REGRRUNDIR/QINSERTJ01
       cp $REGRTSTDIR/QSELECTj01 $REGRRUNDIR/QSELECTJ01
-      cp $REGRTSTDIR/cidefs $REGRRUNDIR/cidefs
     fi
 
     if [ "$diffOnly" -eq 0 ]; then
@@ -589,7 +588,6 @@ for i in $prettyfiles; do
       rm -f $REGRRUNDIR/QDROPJ01
       rm -f $REGRRUNDIR/QINSERTJ01
       rm -f $REGRRUNDIR/QSELECTJ01
-      rm -f $REGRRUNDIR/cidefs
     fi
 
     continue
@@ -602,13 +600,6 @@ for i in $prettyfiles; do
     fi
   fi
 
-  #Special case for sqlmp alias tests, test075
-  if test "$tnum" = "075" ; then
-    if [ "$REGRTSTDIR" != "$REGRRUNDIR" ]; then
-      cp $REGRTSTDIR/cidefs $REGRRUNDIR/cidefs
-    fi
-  fi
-
   #Special case for TMF read archive tests, test084
   if test "$tnum" = "084" ; then
     if [ "$REGRTSTDIR" != "$REGRRUNDIR" ]; then
@@ -640,9 +631,9 @@ for i in $prettyfiles; do
 
       if [ "$REGRCONCURRENT" -eq 1 ]; then
         echo "create schema ${TEST_SCHEMA}; set schema ${TEST_SCHEMA};" \
-          | cat $REGRTSTDIR/cidefs $sbdefsfile $defsfile - $testrun > $test.tmp
+          | cat $sbdefsfile $defsfile - $testrun > $test.tmp
       else
-        cat $REGRTSTDIR/cidefs $sbdefsfile $defsfile $testrun > $test.tmp
+        cat $sbdefsfile $defsfile $testrun > $test.tmp
       fi
 
       if [ $tnum = "103" ]; then

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/regress/tools/runregr_fullstack2.ksh
----------------------------------------------------------------------
diff --git a/core/sql/regress/tools/runregr_fullstack2.ksh b/core/sql/regress/tools/runregr_fullstack2.ksh
index 1cbbfca..d96aee7 100755
--- a/core/sql/regress/tools/runregr_fullstack2.ksh
+++ b/core/sql/regress/tools/runregr_fullstack2.ksh
@@ -151,22 +151,22 @@ cd $REGRTSTDIR 2>$NULL
 
 if [ `uname` = "Linux" ]; then
   # upcase all test*, expected*, filters and known diff files
-  lctestfiles=`ls -1 test???* | sed -e /~$/d -e /.bak$/d | sort -fu` 2>$NULL
+  lctestfiles=`ls -1 test???* 2>$NULL | sed -e /~$/d -e /.bak$/d | sort -fu` 2>$NULL
   for lcfile in $lctestfiles; do
     ucfile=`echo $lcfile | tr a-z A-Z`
     cp -f $lcfile $ucfile 2>$NULL
   done
-  lcxptdfiles=`ls -1 expected???* | sed -e /~$/d -e /.bak$/d | sort -fu` 2>$NULL
+  lcxptdfiles=`ls -1 expected???* 2>$NULL | sed -e /~$/d -e /.bak$/d | sort -fu` 2>$NULL
   for lcfile in $lcxptdfiles; do
     ucfile=`echo $lcfile | tr a-z A-Z`
     cp -f $lcfile $ucfile 2>$NULL
   done
-  lcfiltfiles=`ls -1 filter???* | sed -e /~$/d -e /.bak$/d | sort -fu` 2>$NULL
+  lcfiltfiles=`ls -1 filter???* 2>$NULL | sed -e /~$/d -e /.bak$/d | sort -fu` 2>$NULL
   for lcfile in $lcfiltfiles; do
     ucfile=`echo $lcfile | tr a-z A-Z`
     cp -f $lcfile $ucfile 2>$NULL
   done
-  lcknownfiles=`ls -1 *.known* | sed -e /~$/d -e /.bak$/d | sort -fu` 2>$NULL
+  lcknownfiles=`ls -1 *.known* 2>$NULL | sed -e /~$/d -e /.bak$/d | sort -fu` 2>$NULL
   for lcfile in $lcknownfiles; do
     ucfile=`echo $lcfile | tr a-z A-Z`
     cp -f $lcfile $ucfile 2>$NULL
@@ -483,13 +483,6 @@ for i in $prettyfiles; do
     fi
   fi
 
-  #Special case for sqlmp alias tests, test075
-  if test "$tnum" = "075" ; then
-    if [ "$REGRTSTDIR" != "$REGRRUNDIR" ]; then
-      cp $REGRTSTDIR/cidefs $REGRRUNDIR/cidefs
-    fi
-  fi
-
   # run the test
 
   if [ $diffOnly -eq 0 ]; then
@@ -506,9 +499,9 @@ for i in $prettyfiles; do
 
       if [ "$REGRCONCURRENT" -eq 1 ]; then
         echo "create schema ${TEST_SCHEMA}; set schema ${TEST_SCHEMA};" \
-          | cat $REGRTSTDIR/cidefs $sbdefsfile $defsfile - $testrun > $test.tmp
+          | cat $sbdefsfile $defsfile - $testrun > $test.tmp
       else
-        cat $REGRTSTDIR/cidefs $sbdefsfile $defsfile $testrun > $test.tmp
+        cat $sbdefsfile $defsfile $testrun > $test.tmp
       fi
 
       if [ "$errlog" = "" ]; then

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/regress/tools/runregr_hive.ksh
----------------------------------------------------------------------
diff --git a/core/sql/regress/tools/runregr_hive.ksh b/core/sql/regress/tools/runregr_hive.ksh
index b6cd72d..72e601c 100755
--- a/core/sql/regress/tools/runregr_hive.ksh
+++ b/core/sql/regress/tools/runregr_hive.ksh
@@ -161,23 +161,23 @@ exclusiveTests=''
 
 if [ $nsk -ne 0 -o `uname` = "Linux" ]; then
   # upcase all test*, expected*, filters and known diff files
-  lctestfiles=`ls -1 test???* | sed -e /~$/d -e /.bak$/d | sort -fu` 2>$NULL
+  lctestfiles=`ls -1 test???* 2>$NULL | sed -e /~$/d -e /.bak$/d | sort -fu` 2>$NULL
 
   for lcfile in $lctestfiles; do
     ucfile=`echo $lcfile | tr a-z A-Z`
     cp -f $lcfile $ucfile 2>$NULL
   done
-  lcxptdfiles=`ls -1 expected???* | sed -e /~$/d -e /.bak$/d | sort -fu` 2>$NULL
+  lcxptdfiles=`ls -1 expected???* 2>$NULL | sed -e /~$/d -e /.bak$/d | sort -fu` 2>$NULL
   for lcfile in $lcxptdfiles; do
     ucfile=`echo $lcfile | tr a-z A-Z`
     cp -f $lcfile $ucfile 2>$NULL
   done
-  lcfiltfiles=`ls -1 filter???* | sed -e /~$/d -e /.bak$/d | sort -fu` 2>$NULL
+  lcfiltfiles=`ls -1 filter???* 2>$NULL | sed -e /~$/d -e /.bak$/d | sort -fu` 2>$NULL
   for lcfile in $lcfiltfiles; do
     ucfile=`echo $lcfile | tr a-z A-Z`
     cp -f $lcfile $ucfile 2>$NULL
   done
-  lcknownfiles=`ls -1 *.known* | sed -e /~$/d -e /.bak$/d | sort -fu` 2>$NULL
+  lcknownfiles=`ls -1 *.known* 2>$NULL | sed -e /~$/d -e /.bak$/d | sort -fu` 2>$NULL
   for lcfile in $lcknownfiles; do
     ucfile=`echo $lcfile | tr a-z A-Z`
     cp -f $lcfile $ucfile 2>$NULL
@@ -434,9 +434,9 @@ for i in $prettyfiles; do
 
     if [ "$REGRCONCURRENT" -eq 1 ]; then
       echo "create schema ${TEST_SCHEMA}; set schema ${TEST_SCHEMA};" \
-        | cat $REGRTSTDIR/cidefs $defsfile - $testrun > $test.tmp
+        | cat $defsfile - $testrun > $test.tmp
     else
-      cat $REGRTSTDIR/cidefs $defsfile $testrun > $test.tmp
+      cat $defsfile $testrun > $test.tmp
     fi
 
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/regress/tools/runregr_qat.ksh
----------------------------------------------------------------------
diff --git a/core/sql/regress/tools/runregr_qat.ksh b/core/sql/regress/tools/runregr_qat.ksh
index 54729c3..c26c739 100755
--- a/core/sql/regress/tools/runregr_qat.ksh
+++ b/core/sql/regress/tools/runregr_qat.ksh
@@ -229,16 +229,11 @@ for i in $testfiles; do
         echo "$sqlci -i$tfileshp"
         $sqlci -i$tfileshp
       else
-        cidefsFile=
-        if [ -r "$REGRTSTDIR/cidefs" ]; then
-          cidefsFile="$REGRTSTDIR/cidefs"
-        fi
-
         if [ "$REGRCONCURRENT" -eq 1 ]; then
           echo "create schema ${TEST_SCHEMA}; set schema ${TEST_SCHEMA};" \
-            | cat $cidefsFile $sbdefsfile - $REGRTSTDIR/$tfile > $tfile.tmp
+            | cat $sbdefsfile - $REGRTSTDIR/$tfile > $tfile.tmp
         else
-          cat $cidefsFile $sbdefsfile $REGRTSTDIR/$tfile > $tfile.tmp
+          cat $sbdefsfile $REGRTSTDIR/$tfile > $tfile.tmp
         fi
         echo "$sqlci -i$tfile.tmp"
         $sqlci -i$tfile.tmp

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/regress/tools/runregr_seabase.ksh
----------------------------------------------------------------------
diff --git a/core/sql/regress/tools/runregr_seabase.ksh b/core/sql/regress/tools/runregr_seabase.ksh
index 23c403a..9b060c9 100755
--- a/core/sql/regress/tools/runregr_seabase.ksh
+++ b/core/sql/regress/tools/runregr_seabase.ksh
@@ -158,23 +158,23 @@ exclusiveTests=''
 
 if [ `uname` = "Linux" ]; then
   # upcase all test*, expected*, filters and known diff files
-  lctestfiles=`ls -1 test???* | sed -e /~$/d -e /.bak$/d | sort -fu` 2>$NULL
+  lctestfiles=`ls -1 test???* 2>$NULL | sed -e /~$/d -e /.bak$/d | sort -fu` 2>$NULL
 
   for lcfile in $lctestfiles; do
     ucfile=`echo $lcfile | tr a-z A-Z`
     cp -f $lcfile $ucfile 2>$NULL
   done
-  lcxptdfiles=`ls -1 expected???* | sed -e /~$/d -e /.bak$/d | sort -fu` 2>$NULL
+  lcxptdfiles=`ls -1 expected???* 2>$NULL | sed -e /~$/d -e /.bak$/d | sort -fu` 2>$NULL
   for lcfile in $lcxptdfiles; do
     ucfile=`echo $lcfile | tr a-z A-Z`
     cp -f $lcfile $ucfile 2>$NULL
   done
-  lcfiltfiles=`ls -1 filter???* | sed -e /~$/d -e /.bak$/d | sort -fu` 2>$NULL
+  lcfiltfiles=`ls -1 filter???* 2>$NULL | sed -e /~$/d -e /.bak$/d | sort -fu` 2>$NULL
   for lcfile in $lcfiltfiles; do
     ucfile=`echo $lcfile | tr a-z A-Z`
     cp -f $lcfile $ucfile 2>$NULL
   done
-  lcknownfiles=`ls -1 *.known* | sed -e /~$/d -e /.bak$/d | sort -fu` 2>$NULL
+  lcknownfiles=`ls -1 *.known* 2>$NULL | sed -e /~$/d -e /.bak$/d | sort -fu` 2>$NULL
   for lcfile in $lcknownfiles; do
     ucfile=`echo $lcfile | tr a-z A-Z`
     cp -f $lcfile $ucfile 2>$NULL
@@ -440,9 +440,9 @@ for i in $prettyfiles; do
 
     if [ "$REGRCONCURRENT" -eq 1 ]; then
       echo "create schema ${TEST_SCHEMA}; set schema ${TEST_SCHEMA};" \
-        | cat $REGRTSTDIR/cidefs $sbdefsfile $defsfile - $testrun > $test.tmp
+        | cat $sbdefsfile $defsfile - $testrun > $test.tmp
     else
-      cat $REGRTSTDIR/cidefs $sbdefsfile $defsfile $testrun > $test.tmp
+      cat $sbdefsfile $defsfile $testrun > $test.tmp
     fi
 
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/regress/tools/runregr_udr.ksh
----------------------------------------------------------------------
diff --git a/core/sql/regress/tools/runregr_udr.ksh b/core/sql/regress/tools/runregr_udr.ksh
index 1afaaca..1e68799 100755
--- a/core/sql/regress/tools/runregr_udr.ksh
+++ b/core/sql/regress/tools/runregr_udr.ksh
@@ -736,9 +736,9 @@ function DO_TEST
       fi
       if [ "$REGRCONCURRENT" -eq 1 ]; then
         echo "create schema ${TEST_SCHEMA}; set schema ${TEST_SCHEMA};" \
-          | cat $REGRTSTDIR/cidefs $defsfile - $REGRTSTDIR/$T > $T.tmp
+          | cat $defsfile - $REGRTSTDIR/$T > $T.tmp
       else
-        cat $REGRTSTDIR/cidefs $defsfile $sbdefsfile $REGRTSTDIR/$T > $T.tmp
+        cat $defsfile $sbdefsfile $REGRTSTDIR/$T > $T.tmp
       fi
       $mxci -i$T.tmp
     else

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/regress/tools/sbdefs
----------------------------------------------------------------------
diff --git a/core/sql/regress/tools/sbdefs b/core/sql/regress/tools/sbdefs
index 20e09f5..3d41065 100644
--- a/core/sql/regress/tools/sbdefs
+++ b/core/sql/regress/tools/sbdefs
@@ -26,16 +26,17 @@ cqd mode_seabase 'ON';
 cqd seabase_volatile_tables 'ON';
 cqd hbase_async_drop_table 'OFF';
 cqd hbase_serialization 'ON';
---cqd hbase_coprocessors 'OFF';
 cqd hbase_small_scanner 'SYSTEM';
 cqd hbase_filter_preds '2';
 cqd traf_aligned_row_format 'OFF';
---cqd traf_default_col_charset 'UTF8';
 cqd traf_index_create_opt 'ON';
---cqd ddl_transactions 'ON';
 cqd traf_read_object_desc 'ON';
 cqd traf_store_object_desc 'ON';
-cqd schema '$$TEST_SCHEMA$$';
+cqd allow_incompatible_operations 'ON';
+cqd allow_firstn_in_subqueries 'TRUE';
+cqd group_by_using_ordinal 'ALL';
+cqd allow_order_by_in_subqueries 'ON';
+cqd group_or_order_by_expr 'ON';
 set SCHEMA $$TEST_SCHEMA$$;
 #endif
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/regress/udr/EXPECTED103
----------------------------------------------------------------------
diff --git a/core/sql/regress/udr/EXPECTED103 b/core/sql/regress/udr/EXPECTED103
index a691f1d..197e0d1 100644
--- a/core/sql/regress/udr/EXPECTED103
+++ b/core/sql/regress/udr/EXPECTED103
@@ -166,7 +166,7 @@
 
 --- SQL operation complete.
 >>showddl library functionsForTest103;
-CREATE LIBRARY TRAFODION.UDR103SCH.FUNCTIONSFORTEST103 FILE '/mnt/rmarton/gitws/incubator-trafodion/core/sqf/../sql/regress/rundir/udr/TEST103_functions.dll'
+CREATE LIBRARY TRAFODION.UDR103SCH.FUNCTIONSFORTEST103 FILE '/mnt2/ansharma/ansharma_trafr21/incubator-trafodion/core/sqf/rundir/udr/TEST103_functions.dll'
 ;
 
 -- GRANT UPDATE, USAGE ON LIBRARY TRAFODION.UDR103SCH.FUNCTIONSFORTEST103 TO DB__ROOT WITH GRANT OPTION;
@@ -245,7 +245,7 @@ CREATE LIBRARY TRAFODION.UDR103SCH.FUNCTIONSFORTEST103 FILE '/mnt/rmarton/gitws/
 >>
 >>-- make sure query invalidation works when dropping routines and libraries
 >>showddl library functionsForTest103;
-CREATE LIBRARY TRAFODION.UDR103SCH.FUNCTIONSFORTEST103 FILE '/mnt/rmarton/gitws/incubator-trafodion/core/sqf/../sql/regress/rundir/udr/TEST103_functions.dll'
+CREATE LIBRARY TRAFODION.UDR103SCH.FUNCTIONSFORTEST103 FILE '/mnt2/ansharma/ansharma_trafr21/incubator-trafodion/core/sqf/rundir/udr/TEST103_functions.dll'
 ;
 
 -- GRANT UPDATE, USAGE ON LIBRARY TRAFODION.UDR103SCH.FUNCTIONSFORTEST103 TO DB__ROOT WITH GRANT OPTION;
@@ -282,7 +282,7 @@ CREATE FUNCTION TRAFODION.UDR103SCH.GENERATEPHONENUMBER
 CREATE PROCEDURE TRAFODION.UDR103SCH.UPDATESUBSCRIPTIONS
   (
     IN OPERATION CHAR(20) CHARACTER SET ISO88591
-  , IN "VALUE" CHAR(20) CHARACTER SET ISO88591
+  , IN VALUE CHAR(20) CHARACTER SET ISO88591
   , IN USERNAME CHAR(128) CHARACTER SET ISO88591
   , OUT RESULTS VARCHAR(1000) CHARACTER SET ISO88591
   )
@@ -356,7 +356,7 @@ CREATE PROCEDURE TRAFODION.UDR103SCH.UPDATESUBSCRIPTIONS
 
 --- SQL operation complete.
 >>showddl library functionsForTest103;
-CREATE LIBRARY TRAFODION.UDR103SCH.FUNCTIONSFORTEST103 FILE '/mnt/rmarton/gitws/incubator-trafodion/core/sqf/../sql/regress/rundir/udr/TEST103_functions.dll'
+CREATE LIBRARY TRAFODION.UDR103SCH.FUNCTIONSFORTEST103 FILE '/mnt2/ansharma/ansharma_trafr21/incubator-trafodion/core/sqf/rundir/udr/TEST103_functions.dll'
 ;
 
 -- GRANT UPDATE, USAGE ON LIBRARY TRAFODION.UDR103SCH.FUNCTIONSFORTEST103 TO DB__ROOT WITH GRANT OPTION;
@@ -468,7 +468,7 @@ CREATE FUNCTION TRAFODION.UDR103SCH.GENERATEPHONENUMBER
 CREATE PROCEDURE TRAFODION.UDR103SCH.UPDATESUBSCRIPTIONS
   (
     IN OPERATION CHAR(20) CHARACTER SET ISO88591
-  , IN "VALUE" CHAR(20) CHARACTER SET ISO88591
+  , IN VALUE CHAR(20) CHARACTER SET ISO88591
   , IN USERNAME CHAR(128) CHARACTER SET ISO88591
   , OUT RESULTS VARCHAR(1000) CHARACTER SET ISO88591
   )

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/regress/udr/EXPECTED108
----------------------------------------------------------------------
diff --git a/core/sql/regress/udr/EXPECTED108 b/core/sql/regress/udr/EXPECTED108
index 8085c78..5263730 100644
--- a/core/sql/regress/udr/EXPECTED108
+++ b/core/sql/regress/udr/EXPECTED108
@@ -6,12 +6,12 @@
 >>
 >>create table docs_part
 +>  ( seqno int not null not droppable primary key, text_data varchar(4000) )
-+> location $$partition$$
++> location $DATA
 +> hash2 partition
 +> (
-+>     add location $$partition1$$
-+>   , add location $$partition2$$
-+>   , add location $$partition3$$
++>     add location $DATA1
++>   , add location $DATA2
++>   , add location $DATA3
 +> );
 
 --- SQL operation complete.
@@ -19,12 +19,12 @@
 >>create table clicks
 +>  ( seqno int not null primary key, userid varchar(40), ts timestamp(6),
 +>    ipaddr char(20) )
-+> location $$partition$$
++> location $DATA
 +> hash2 partition
 +> (
-+>     add location $$partition1$$
-+>   , add location $$partition2$$
-+>   , add location $$partition3$$
++>     add location $DATA1
++>   , add location $DATA2
++>   , add location $DATA3
 +> );
 
 --- SQL operation complete.
@@ -49,7 +49,7 @@
 *** ERROR[11246] An error occurred locating function or class 'SESSIONIZE' in library 'TEST002.dll'.
 
 *** ERROR[11248] A call to dlsym returned errors 0 and 0. Details: 
-/opt/home/zellerh/trafodion/core/sqf/rundir/udr/TEST002.dll: undefined symbol: SESSIONIZE.
+/home/centos/ansharma_trafr21/incubator-trafodion/core/sqf/rundir/udr/TEST002.dll: undefined symbol: SESSIONIZE.
 
 --- SQL operation failed with errors.
 >>

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/regress/udr/EXPECTED163.SB
----------------------------------------------------------------------
diff --git a/core/sql/regress/udr/EXPECTED163.SB b/core/sql/regress/udr/EXPECTED163.SB
index a824f15..fe65a3d 100755
--- a/core/sql/regress/udr/EXPECTED163.SB
+++ b/core/sql/regress/udr/EXPECTED163.SB
@@ -213,9 +213,7 @@ A            (EXPR)
 >>-- only ordinals.
 >>select a from t1 order by add2(t1.a,t1.b);
 
-*** ERROR[15001] A syntax error occurred at or before: 
-select a from t1 order by add2(t1.a,t1.b);
-                                         ^ (42 characters from start of SQL statement)
+*** ERROR[4197] This expression cannot be used in the ORDER BY clause.
 
 *** ERROR[8822] The statement was not prepared.
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/regress/udr/TEST108
----------------------------------------------------------------------
diff --git a/core/sql/regress/udr/TEST108 b/core/sql/regress/udr/TEST108
index 191f961..23fb4c2 100644
--- a/core/sql/regress/udr/TEST108
+++ b/core/sql/regress/udr/TEST108
@@ -48,23 +48,23 @@ create table docs
 
 create table docs_part
   ( seqno int not null not droppable primary key, text_data varchar(4000) )
- location $$partition$$
+ location $DATA
  hash2 partition
  (
-     add location $$partition1$$
-   , add location $$partition2$$
-   , add location $$partition3$$
+     add location $DATA1
+   , add location $DATA2
+   , add location $DATA3
  );
 
 create table clicks
   ( seqno int not null primary key, userid varchar(40), ts timestamp(6),
     ipaddr char(20) )
- location $$partition$$
+ location $DATA
  hash2 partition
  (
-     add location $$partition1$$
-   , add location $$partition2$$
-   , add location $$partition3$$
+     add location $DATA1
+   , add location $DATA2
+   , add location $DATA3
  );
 
 create library TEST108 file $$QUOTE$$ $$REGRRUNDIR$$/$$DLL2$$ $$QUOTE$$;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/regress/udr/cidefs
----------------------------------------------------------------------
diff --git a/core/sql/regress/udr/cidefs b/core/sql/regress/udr/cidefs
deleted file mode 100755
index 4b614d8..0000000
--- a/core/sql/regress/udr/cidefs
+++ /dev/null
@@ -1,69 +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 @@@
---
--- control query default HIST_USE_SAMPLE_FOR_CARDINALITY_ESTIMATION  'ON';
--- control query default HIST_ON_DEMAND_STATS_SIZE '10000';
-control query default SKIP_METADATA_VIEWS 'ON';
-
--- This CQD is added for creating a table with no
--- partition or primary key when the POS is enabled.
-control query default POS_ALLOW_NON_PK_TABLES 'ON';
-#ifNT
--- Also for Linux
--- These substitutes partitions for DDL requests
-set pattern $$partition$$ $data;
-set pattern $$partition0$$ $data;
-set pattern $$partition1$$ $data1;
-set pattern $$partition2$$ $data2;
-set pattern $$partition3$$ $data3;
-set pattern $$partition4$$ $data4;
-set pattern $$runid$$ UTL;
-set pattern $$quote$$ '''';
-set pattern $$TrigTempTablePartition$$ '''$data:$data1''';
-set pattern $$TrigTempTablePartition1$$ '''$data:$data1''';
-#ifNT
-
-
--- Only on a Linux cluster
-#ifdef CLUSTERNAME
-set pattern $$partition$$  $DB0000;
-set pattern $$partition0$$ $DB0000;
-set pattern $$partition1$$ $DB0001;
-set pattern $$partition2$$ $DB0002;
-set pattern $$partition3$$ $DB0003;
-set pattern $$partition4$$ $DB0004;
-set pattern $$partition5$$ $DB0005;
-set pattern $$partition6$$ $DB0006;
-set pattern $$partition7$$ $DB0007;
-set pattern $$partition8$$ $DB0008;
-set pattern $$audit_vol$$  $AUD000;
-set pattern $$PosTablePartition$$ '''$DB0000''';
-set pattern $$PosTablePartitions2$$ '''$DB0001, $DB0002''';
-set pattern $$PosTablePartitions3$$ '''$DB0003, $DB0004, $DB0005''';
-set pattern $$PosTablePartitions4$$ '''$DB0006, $DB0007, $DB0008, $DB0009''';
-set pattern $$TrigTempTablePartition$$ '''$DB0003:$DB0004,$DB0005:$DB0001''';
-set pattern $$TrigTempTablePartition1$$ '''$DB0001: $DB0004''';
-set pattern $$TrigTempTablePartition2$$ '''$DB0001''';
-set pattern $$TrigTempTablePartition3$$ '''$DB0004''';
-set pattern $$TrigTempTablePartition4$$ '''$DB0001, $DB0004,$NINEX: $DB0005''';
-set pattern $$TrigTempTablePartition5$$ '''$DB0005, $DB0005, $DB0005: $DB0005, $DB0005''';
-set pattern $$TrigTempTablePartition6$$ '''$DB0001,XXXX64 $DB0005''';
-#endif

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/sqlcat/TrafDDLdesc.h
----------------------------------------------------------------------
diff --git a/core/sql/sqlcat/TrafDDLdesc.h b/core/sql/sqlcat/TrafDDLdesc.h
index d9bee94..34c1d2f 100644
--- a/core/sql/sqlcat/TrafDDLdesc.h
+++ b/core/sql/sqlcat/TrafDDLdesc.h
@@ -1007,6 +1007,10 @@ public:
   Int16 /*ComRowFormat*/  rowFormat_;
   Int16 /*ComObjectType*/ objectType_; 
 
+  // next 8 bytes are fillers for future usage
+  Int16 /*ComStorageType*/ storageType_;
+  char filler0[6];
+
   Int64 catUID;
   Int64 schemaUID;
   Int64 objectUID;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/sqlcomp/CmpDescribe.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpDescribe.cpp b/core/sql/sqlcomp/CmpDescribe.cpp
index 97cd5b5..c566fbd 100644
--- a/core/sql/sqlcomp/CmpDescribe.cpp
+++ b/core/sql/sqlcomp/CmpDescribe.cpp
@@ -1784,6 +1784,9 @@ inline static NABoolean identMatches2(const NAString &id, const char *c1, const
 
 #define IDENTMATCHES(c1,c2)     identMatches2(ident, c1, c2, exactMatch)
 
+// defined in generator/GenExplain.cpp
+NABoolean displayDuringRegressRun(DefaultConstants attr);
+
 // these CQDs are used for internal purpose and are set/sent by SQL.
 // Do not display them.
 static NABoolean isInternalCQD(DefaultConstants attr)
@@ -1798,7 +1801,8 @@ static NABoolean isInternalCQD(DefaultConstants attr)
     return TRUE;
   
   if ((getenv("SQLMX_REGRESS")) &&
-      (attr == TRAF_ALIGNED_ROW_FORMAT))
+      ((NOT displayDuringRegressRun(attr)) ||
+       (attr == TRAF_ALIGNED_ROW_FORMAT)))
     return TRUE;
   
   return FALSE;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp b/core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp
index 347d1be..46ec327 100644
--- a/core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp
+++ b/core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp
@@ -8931,7 +8931,6 @@ short CmpSeabaseDDL::executeSeabaseDDL(DDLExpr * ddlExpr, ExprNode * ddlNode,
 
                   if (schemaNamePart == SEABASE_REGRESS_DEFAULT_SCHEMA)
                     {
-                      // create this schema
                       CmpCommon::diags()->clear();
                       cliRC = cliInterface.executeImmediate("create shared schema trafodion.sch");
                       if (cliRC >= 0)

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/sqlcomp/CmpSeabaseDDLindex.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpSeabaseDDLindex.cpp b/core/sql/sqlcomp/CmpSeabaseDDLindex.cpp
index 9234c66..cef856b 100644
--- a/core/sql/sqlcomp/CmpSeabaseDDLindex.cpp
+++ b/core/sql/sqlcomp/CmpSeabaseDDLindex.cpp
@@ -1076,8 +1076,7 @@ short CmpSeabaseDDL::populateSeabaseIndexFromTable(
   NABoolean useHiveSrc = FALSE;
   NAString saltText;
   NAString hiveSrc = CmpCommon::getDefaultString(USE_HIVE_SOURCE);
-  if ((CmpCommon::getDefault(MODE_SPECIAL_4) == DF_ON) &&
-      (! hiveSrc.isNull()))
+  if (! hiveSrc.isNull())
     {
       for (CollIndex i = 0; i < selColList.entries(); i++)
       {

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/sqlcomp/CmpSeabaseDDLtable.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpSeabaseDDLtable.cpp b/core/sql/sqlcomp/CmpSeabaseDDLtable.cpp
index a4122ec..6175a5a 100644
--- a/core/sql/sqlcomp/CmpSeabaseDDLtable.cpp
+++ b/core/sql/sqlcomp/CmpSeabaseDDLtable.cpp
@@ -4173,6 +4173,16 @@ void CmpSeabaseDDL::renameSeabaseTable(
       return;
     }
 
+  cliRC = updateObjectRedefTime(&cliInterface,
+                                catalogNamePart, schemaNamePart, newObjectNamePart,
+                                COM_BASE_TABLE_OBJECT_LIT, -1, objUID);
+  if (cliRC < 0)
+    {
+      deallocEHI(ehi);
+      processReturn();
+      return;
+    }
+
   ActiveSchemaDB()->getNATableDB()->removeNATable
     (cn,
      ComQiScope::REMOVE_FROM_ALL_USERS, COM_BASE_TABLE_OBJECT,

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9a41e522/core/sql/sqlcomp/DefaultConstants.h
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/DefaultConstants.h b/core/sql/sqlcomp/DefaultConstants.h
index cee4f38..08076ff 100644
--- a/core/sql/sqlcomp/DefaultConstants.h
+++ b/core/sql/sqlcomp/DefaultConstants.h
@@ -1693,7 +1693,7 @@ enum DefaultConstants
   // -------------------------------------------------------------------------
   HIST_JOIN_CARD_LOWBOUND,
 
-  // allow any/first N in qubqueries.
+  // allow any/first N in subqueries.
   ALLOW_FIRSTN_IN_SUBQUERIES,
 
   // ------------------------------------------------------------------------
@@ -2542,10 +2542,6 @@ enum DefaultConstants
   // caller is nvci (scripts) process
   NVCI_PROCESS,
 
-  // if set to ON, turns on a subset of the 'special' features which are
-  // enabled using mode_special_1..
-  MODE_SPECIAL_2,
-
   // if this is set, then find a suitable key among all the columns of
   // a volatile table.
   // If this is not set, and there is no user specified primary key or
@@ -2971,8 +2967,6 @@ enum DefaultConstants
   // PUBLISH/UNPUBLISH command
   PUBLISHING_ROLES,
 
-  // enable special features
-  MODE_SPECIAL_3,
 
   // default used to test catman features
   CAT_TEST_BOOL,
@@ -3691,9 +3685,6 @@ enum DefaultConstants
   // hbase table index level, when zero, index level will be read from Hfile 
   HBASE_INDEX_LEVEL,
 
-  // enable special features for certain vendors.
-  MODE_SPECIAL_5,
-
   // enable self referencing foreign key constraints
   TRAF_ALLOW_SELF_REF_CONSTR,
   // enable ESP-RegionServer colocation logic
@@ -3855,6 +3846,14 @@ enum DefaultConstants
   // if ON, read object descriptor from metadata, if it was stored.
   TRAF_READ_OBJECT_DESC,
 
+  ALLOW_INCOMPATIBLE_OPERATIONS, 
+
+  // if ON: expr and renamed cols allowed in groupby/orderby expr.
+  GROUP_OR_ORDER_BY_EXPR,
+
+  // allow ORDER BY in subqueries.
+  ALLOW_ORDER_BY_IN_SUBQUERIES,
+
   // This enum constant must be the LAST one in the list; it's a count,
   // not an Attribute (it's not IN DefaultDefaults; it's the SIZE of it)!
   __NUM_DEFAULT_ATTRIBUTES