You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafodion.apache.org by db...@apache.org on 2015/08/18 17:18:40 UTC

[1/4] incubator-trafodion git commit: TRAFODION-1457 Issues related to decoding HBase region keys and TEXT table

Repository: incubator-trafodion
Updated Branches:
  refs/heads/master d081b7dda -> 5f9c7b31f


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1e60a9b8/core/sql/regress/charsets/EXPECTED012
----------------------------------------------------------------------
diff --git a/core/sql/regress/charsets/EXPECTED012 b/core/sql/regress/charsets/EXPECTED012
new file mode 100755
index 0000000..4574ba5
--- /dev/null
+++ b/core/sql/regress/charsets/EXPECTED012
@@ -0,0 +1,205 @@
+>>
+>>create table tlongvarchar0(a long varchar(10) character set ucs2);
+
+--- SQL operation complete.
+>>create table tlongwvarchar0(a longwvarchar(50));
+
+--- SQL operation complete.
+>>create table tlongwvarchar1(
++>                            a longwvarchar default _ucs2'good day', 
++>                            b longwvarchar default _ucs2'today', 
++>                            c int, d real)
++>#ifNSK
++>attribute blocksize 4096
++>#ifNSK
++>;
+
+--- SQL operation complete.
+>>
+>>
+>>showddl tlongvarchar0;
+
+CREATE TABLE CAT.SCH.TLONGVARCHAR0
+  (
+    A                                VARCHAR(10) CHARACTER SET UCS2 COLLATE
+      DEFAULT DEFAULT NULL
+  )
+;
+
+--- SQL operation complete.
+>>showddl tlongwvarchar0;
+
+CREATE TABLE CAT.SCH.TLONGWVARCHAR0
+  (
+    A                                VARCHAR(50) CHARACTER SET UCS2 COLLATE
+      DEFAULT DEFAULT NULL
+  )
+;
+
+--- SQL operation complete.
+>>invoke  tlongwvarchar1;
+
+-- Definition of table CAT.SCH.TLONGWVARCHAR1
+-- Definition current  Sat Jul 29 13:18:17 2006
+
+  (
+    A                                VARCHAR(2000) CHARACTER SET UCS2 COLLATE
+      DEFAULT DEFAULT _UCS2'good day'
+  , B                                VARCHAR(2000) CHARACTER SET UCS2 COLLATE
+      DEFAULT DEFAULT _UCS2'today'
+  , C                                INT DEFAULT NULL
+  , D                                REAL DEFAULT NULL
+  )
+
+--- SQL operation complete.
+>>
+>>insert into tlongvarchar0 values(N'4356'), (_ucs2'today');
+
+--- 2 row(s) inserted.
+>>insert into tlongwvarchar0 values(N'4356'), (_ucs2'tomorrow');
+
+--- 2 row(s) inserted.
+>>insert into tlongwvarchar1 values(N'abc', N'4356', 1, 2), (_ucs2'today', _ucs2'tomorrow', 2, 3);
+
+--- 2 row(s) inserted.
+>>insert into tlongwvarchar1(c, d) values(1, 2);
+
+--- 1 row(s) inserted.
+>>
+>>select cast(_ucs2'abcd' as longwvarchar(20)) from (values(1))x;
+
+(EXPR)                                  
+----------------------------------------
+
+abcd                                    
+
+--- 1 row(s) selected.
+>>select char_length(cast(_ucs2'abcd' as longwvarchar(20))) from (values(1))x;
+
+(EXPR)    
+----------
+
+         4
+
+--- 1 row(s) selected.
+>>select octet_length(cast(_ucs2'abcd' as longwvarchar(20))) from (values(1))x;
+
+(EXPR)    
+----------
+
+         8
+
+--- 1 row(s) selected.
+>>select char_length(cast(_ucs2'abcd' as longwvarchar)) from (values(1))x;
+
+(EXPR)    
+----------
+
+         4
+
+--- 1 row(s) selected.
+>>
+>>select a || _ucs2'_suffix' from tlongvarchar0;
+
+(EXPR)                            
+----------------------------------
+
+4356_suffix                       
+today_suffix                      
+
+--- 2 row(s) selected.
+>>select a || _ucs2'_suffix' from tlongwvarchar0;
+
+(EXPR)
+------------------------------------------------------------------------------------------------------------------
+
+4356_suffix                                                                                                       
+tomorrow_suffix                                                                                                   
+
+--- 2 row(s) selected.
+>>select a || _ucs2'_suffix' from tlongwvarchar1;
+
+(EXPR)
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 --------
+
+abc_suffix                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
         
+today_suffix                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
         
+good day_suffix                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
         
+
+--- 3 row(s) selected.
+>>
+>>update tlongwvarchar0 set a = _ucs2'the day after tomorrow';
+
+--- 2 row(s) updated.
+>>update tlongwvarchar1 set a = _ucs2'the day after tomorrow';
+
+--- 3 row(s) updated.
+>>delete from tlongwvarchar0;
+
+--- 2 row(s) deleted.
+>>
+>>-- test min/max values
+>>control query default Min_LONG_VARCHAR_DEFAULT_SIZE '2';
+
+--- SQL operation complete.
+>>control query default Min_LONG_VARCHAR_DEFAULT_SIZE '3';
+
+--- SQL operation complete.
+>>control query default Min_LONG_WVARCHAR_DEFAULT_SIZE '4';
+
+--- SQL operation complete.
+>>control query default Min_LONG_WVARCHAR_DEFAULT_SIZE '9';
+
+--- SQL operation complete.
+>>
+>>control query default MAX_LONG_VARCHAR_DEFAULT_SIZE '11';
+
+--- SQL operation complete.
+>>control query default MAX_LONG_VARCHAR_DEFAULT_SIZE '10';
+
+--- SQL operation complete.
+>>control query default MAX_LONG_WVARCHAR_DEFAULT_SIZE '111';
+
+--- SQL operation complete.
+>>control query default MAX_LONG_WVARCHAR_DEFAULT_SIZE '100';
+
+--- SQL operation complete.
+>>
+>>-- A valid range must be maintained (i.e., MIN <= MAX). The following 
+>>-- four CQD should fail
+>>control query default MIN_LONG_VARCHAR_DEFAULT_SIZE '12';
+
+*** ERROR[2029] The new min value is greater than the current max value 10.
+
+*** ERROR[8822] The statement was not prepared.
+
+>>control query default MIN_LONG_WVARCHAR_DEFAULT_SIZE '101';
+
+*** ERROR[2029] The new min value is greater than the current max value 100.
+
+*** ERROR[8822] The statement was not prepared.
+
+>>control query default MAX_LONG_VARCHAR_DEFAULT_SIZE '2';
+
+*** ERROR[2030] The new max value is less than the current min value 3.
+
+*** ERROR[8822] The statement was not prepared.
+
+>>control query default MAX_LONG_WVARCHAR_DEFAULT_SIZE '6';
+
+*** ERROR[2030] The new max value is less than the current min value 9.
+
+*** ERROR[8822] The statement was not prepared.
+
+>>
+>>drop table tlongvarchar0;
+
+--- SQL operation complete.
+>>drop table tlongwvarchar0;
+
+--- SQL operation complete.
+>>drop table tlongwvarchar1;
+
+--- SQL operation complete.
+>>
+>>log;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1e60a9b8/core/sql/regress/charsets/EXPECTED012.SB
----------------------------------------------------------------------
diff --git a/core/sql/regress/charsets/EXPECTED012.SB b/core/sql/regress/charsets/EXPECTED012.SB
deleted file mode 100755
index 4574ba5..0000000
--- a/core/sql/regress/charsets/EXPECTED012.SB
+++ /dev/null
@@ -1,205 +0,0 @@
->>
->>create table tlongvarchar0(a long varchar(10) character set ucs2);
-
---- SQL operation complete.
->>create table tlongwvarchar0(a longwvarchar(50));
-
---- SQL operation complete.
->>create table tlongwvarchar1(
-+>                            a longwvarchar default _ucs2'good day', 
-+>                            b longwvarchar default _ucs2'today', 
-+>                            c int, d real)
-+>#ifNSK
-+>attribute blocksize 4096
-+>#ifNSK
-+>;
-
---- SQL operation complete.
->>
->>
->>showddl tlongvarchar0;
-
-CREATE TABLE CAT.SCH.TLONGVARCHAR0
-  (
-    A                                VARCHAR(10) CHARACTER SET UCS2 COLLATE
-      DEFAULT DEFAULT NULL
-  )
-;
-
---- SQL operation complete.
->>showddl tlongwvarchar0;
-
-CREATE TABLE CAT.SCH.TLONGWVARCHAR0
-  (
-    A                                VARCHAR(50) CHARACTER SET UCS2 COLLATE
-      DEFAULT DEFAULT NULL
-  )
-;
-
---- SQL operation complete.
->>invoke  tlongwvarchar1;
-
--- Definition of table CAT.SCH.TLONGWVARCHAR1
--- Definition current  Sat Jul 29 13:18:17 2006
-
-  (
-    A                                VARCHAR(2000) CHARACTER SET UCS2 COLLATE
-      DEFAULT DEFAULT _UCS2'good day'
-  , B                                VARCHAR(2000) CHARACTER SET UCS2 COLLATE
-      DEFAULT DEFAULT _UCS2'today'
-  , C                                INT DEFAULT NULL
-  , D                                REAL DEFAULT NULL
-  )
-
---- SQL operation complete.
->>
->>insert into tlongvarchar0 values(N'4356'), (_ucs2'today');
-
---- 2 row(s) inserted.
->>insert into tlongwvarchar0 values(N'4356'), (_ucs2'tomorrow');
-
---- 2 row(s) inserted.
->>insert into tlongwvarchar1 values(N'abc', N'4356', 1, 2), (_ucs2'today', _ucs2'tomorrow', 2, 3);
-
---- 2 row(s) inserted.
->>insert into tlongwvarchar1(c, d) values(1, 2);
-
---- 1 row(s) inserted.
->>
->>select cast(_ucs2'abcd' as longwvarchar(20)) from (values(1))x;
-
-(EXPR)                                  
-----------------------------------------
-
-abcd                                    
-
---- 1 row(s) selected.
->>select char_length(cast(_ucs2'abcd' as longwvarchar(20))) from (values(1))x;
-
-(EXPR)    
-----------
-
-         4
-
---- 1 row(s) selected.
->>select octet_length(cast(_ucs2'abcd' as longwvarchar(20))) from (values(1))x;
-
-(EXPR)    
-----------
-
-         8
-
---- 1 row(s) selected.
->>select char_length(cast(_ucs2'abcd' as longwvarchar)) from (values(1))x;
-
-(EXPR)    
-----------
-
-         4
-
---- 1 row(s) selected.
->>
->>select a || _ucs2'_suffix' from tlongvarchar0;
-
-(EXPR)                            
-----------------------------------
-
-4356_suffix                       
-today_suffix                      
-
---- 2 row(s) selected.
->>select a || _ucs2'_suffix' from tlongwvarchar0;
-
-(EXPR)
-------------------------------------------------------------------------------------------------------------------
-
-4356_suffix                                                                                                       
-tomorrow_suffix                                                                                                   
-
---- 2 row(s) selected.
->>select a || _ucs2'_suffix' from tlongwvarchar1;
-
-(EXPR)
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 --------
-
-abc_suffix                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
         
-today_suffix                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
         
-good day_suffix                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
         
-
---- 3 row(s) selected.
->>
->>update tlongwvarchar0 set a = _ucs2'the day after tomorrow';
-
---- 2 row(s) updated.
->>update tlongwvarchar1 set a = _ucs2'the day after tomorrow';
-
---- 3 row(s) updated.
->>delete from tlongwvarchar0;
-
---- 2 row(s) deleted.
->>
->>-- test min/max values
->>control query default Min_LONG_VARCHAR_DEFAULT_SIZE '2';
-
---- SQL operation complete.
->>control query default Min_LONG_VARCHAR_DEFAULT_SIZE '3';
-
---- SQL operation complete.
->>control query default Min_LONG_WVARCHAR_DEFAULT_SIZE '4';
-
---- SQL operation complete.
->>control query default Min_LONG_WVARCHAR_DEFAULT_SIZE '9';
-
---- SQL operation complete.
->>
->>control query default MAX_LONG_VARCHAR_DEFAULT_SIZE '11';
-
---- SQL operation complete.
->>control query default MAX_LONG_VARCHAR_DEFAULT_SIZE '10';
-
---- SQL operation complete.
->>control query default MAX_LONG_WVARCHAR_DEFAULT_SIZE '111';
-
---- SQL operation complete.
->>control query default MAX_LONG_WVARCHAR_DEFAULT_SIZE '100';
-
---- SQL operation complete.
->>
->>-- A valid range must be maintained (i.e., MIN <= MAX). The following 
->>-- four CQD should fail
->>control query default MIN_LONG_VARCHAR_DEFAULT_SIZE '12';
-
-*** ERROR[2029] The new min value is greater than the current max value 10.
-
-*** ERROR[8822] The statement was not prepared.
-
->>control query default MIN_LONG_WVARCHAR_DEFAULT_SIZE '101';
-
-*** ERROR[2029] The new min value is greater than the current max value 100.
-
-*** ERROR[8822] The statement was not prepared.
-
->>control query default MAX_LONG_VARCHAR_DEFAULT_SIZE '2';
-
-*** ERROR[2030] The new max value is less than the current min value 3.
-
-*** ERROR[8822] The statement was not prepared.
-
->>control query default MAX_LONG_WVARCHAR_DEFAULT_SIZE '6';
-
-*** ERROR[2030] The new max value is less than the current min value 9.
-
-*** ERROR[8822] The statement was not prepared.
-
->>
->>drop table tlongvarchar0;
-
---- SQL operation complete.
->>drop table tlongwvarchar0;
-
---- SQL operation complete.
->>drop table tlongwvarchar1;
-
---- SQL operation complete.
->>
->>log;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1e60a9b8/core/sql/regress/compGeneral/DIFF042.KNOWN.SB
----------------------------------------------------------------------
diff --git a/core/sql/regress/compGeneral/DIFF042.KNOWN.SB b/core/sql/regress/compGeneral/DIFF042.KNOWN.SB
index 597d8f5..ecee0c6 100644
--- a/core/sql/regress/compGeneral/DIFF042.KNOWN.SB
+++ b/core/sql/regress/compGeneral/DIFF042.KNOWN.SB
@@ -1,24 +1,14 @@
-1974c1974
-<  0 4
----
->  0 5
-1982c1982
-<  1 4
----
->  1 5
-2031c2031
-<  0 4
----
->  0 5
-2081c2081
-<  1 4
----
->  1 5
-2220c2220
-<  179 0 4 0
----
->  200 0 5 0
-2303c2303
-<  179 0 4 0
----
->  200 0 5 0
+1976,1977d1975
+<  1 3
+<  1 3
+1983a1982,1983
+>  2 3
+>  3 3
+2068d2067
+<  1 0
+2077,2078d2075
+<  1 3
+<  1 3
+2086a2084,2085
+>  2 3
+>  3 3

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1e60a9b8/core/sql/regress/compGeneral/EXPECTED042
----------------------------------------------------------------------
diff --git a/core/sql/regress/compGeneral/EXPECTED042 b/core/sql/regress/compGeneral/EXPECTED042
index 558a4cd..3059c84 100644
--- a/core/sql/regress/compGeneral/EXPECTED042
+++ b/core/sql/regress/compGeneral/EXPECTED042
@@ -1889,7 +1889,7 @@ NUM_ENTRIES  TEXT_ENTRIES  NUM_PLANS
 
 --- 3 row(s) selected.
 >>
->>select num_hits, num_params from table(querycacheentries('user', 'local')) order by 1;
+>>select num_hits, num_params from table(querycacheentries('user', 'local')) order by 1,2;
 
 NUM_HITS    NUM_PARAMS
 ----------  ----------
@@ -1902,9 +1902,7 @@ NUM_HITS    NUM_PARAMS
          0           0
          0           0
          0           0
-         0           1
          0           0
-         0           1
          0           0
          0           0
          0           0
@@ -1927,8 +1925,6 @@ NUM_HITS    NUM_PARAMS
          0           0
          0           0
          0           0
-         0           1
-         0           3
          0           0
          0           0
          0           0
@@ -1945,61 +1941,65 @@ NUM_HITS    NUM_PARAMS
          0           0
          0           0
          0           0
-         0           1
          0           0
          0           0
          0           0
          0           0
          0           0
-         0           1
          0           0
          0           0
+         0           1
+         0           1
+         0           1
+         0           1
+         0           1
+         0           3
+         1           0
          1           1
          1           1
          1           1
-         1           4
          1           1
          1           1
-         1           2
-         1           9
-         1           0
          1           1
          1           1
          1           1
          1           1
          1           1
+         1           2
+         1           4
+         1           9
          5           1
 
 --- 75 row(s) selected.
->>select num_hits, num_params from table(querycacheentries('meta', 'local')) order by 1;
+>>select num_hits, num_params from table(querycacheentries('meta', 'local')) order by 1,2;
 
 NUM_HITS    NUM_PARAMS
 ----------  ----------
 
+         0           1
          0           2
-         0           5
          0           3
-         0           1
-         1           3
-         1           2
+         0           5
          1           1
-         1           2
          1           1
+         1           2
+         1           2
+         1           3
+         1           3
+         1           3
          1           5
-         2           3
          2           1
-         2           2
          2           1
          2           1
+         2           2
          2           3
-         3           3
         10           4
 
 --- 18 row(s) selected.
->>select num_hits, num_params from table(querycacheentries('ustats', 'local')) order by 1;
+>>select num_hits, num_params from table(querycacheentries('ustats', 'local')) order by 1,2;
 
 --- 0 row(s) selected.
->>select num_hits, num_params from table(querycacheentries('all', 'local')) order by 1;
+>>select num_hits, num_params from table(querycacheentries('all', 'local')) order by 1,2;
 
 NUM_HITS    NUM_PARAMS
 ----------  ----------
@@ -2011,11 +2011,8 @@ NUM_HITS    NUM_PARAMS
          0           0
          0           0
          0           0
-         0           5
          0           0
          0           0
-         0           1
-         0           1
          0           0
          0           0
          0           0
@@ -2024,9 +2021,6 @@ NUM_HITS    NUM_PARAMS
          0           0
          0           0
          0           0
-         0           3
-         0           2
-         0           1
          0           0
          0           0
          0           0
@@ -2056,45 +2050,52 @@ NUM_HITS    NUM_PARAMS
          0           0
          0           0
          0           0
-         0           3
-         0           1
          0           0
          0           0
-         0           1
          0           0
          0           0
          0           0
-         0           1
          0           0
          0           0
          0           0
-         1           2
+         0           1
+         0           1
+         0           1
+         0           1
+         0           1
+         0           1
+         0           2
+         0           3
+         0           3
+         0           5
+         1           0
          1           1
-         1           9
-         1           3
          1           1
-         1           2
          1           1
-         1           5
          1           1
          1           1
          1           1
          1           1
-         1           4
-         1           2
          1           1
          1           0
          1           1
          1           1
          1           1
          1           1
-         2           3
-         2           2
+         1           2
+         1           2
+         1           2
+         1           3
+         1           3
+         1           3
+         1           4
+         1           5
+         1           9
          2           1
-         2           3
          2           1
          2           1
-         3           3
+         2           2
+         2           3
          5           1
         10           4
 
@@ -2133,13 +2134,13 @@ NUM_HKEYS   NUM_SKEYS   NUM_MAX_VALUES_PER_KEY  NUM_HASH_TABLE_BUCKETS
 
 --- 3 row(s) selected.
 >>
->>select char_length(hkey), num_hits, num_PLiterals,  num_NPLiterals from table(hybridquerycacheentries('user', 'local')) order by 1, 2;
+>>select char_length(hkey), num_hits, num_PLiterals,  num_NPLiterals from table(hybridquerycacheentries('user', 'local')) order by 1, 2, 3, 4;
 
 (EXPR)      NUM_HITS    NUM_PLITERALS  NUM_NPLITERALS
 ----------  ----------  -------------  --------------
 
-        27           0              1               0
         27           0              0               1
+        27           0              1               0
         42           0              0               1
         42           0              0               1
         42           0              0               1
@@ -2167,10 +2168,10 @@ NUM_HKEYS   NUM_SKEYS   NUM_MAX_VALUES_PER_KEY  NUM_HASH_TABLE_BUCKETS
         55           1              1               0
         58           1              1               0
         59           1              1               0
-        60           0              1               1
         60           0              0               1
         60           0              0               1
         60           0              1               1
+        60           0              1               1
         61           1              1               0
         63           0              1               0
         63           0              1               0
@@ -2189,9 +2190,9 @@ NUM_HKEYS   NUM_SKEYS   NUM_MAX_VALUES_PER_KEY  NUM_HASH_TABLE_BUCKETS
         78           0              0               2
         78           0              0               2
         79           0              0               1
-        79           0              0               3
         79           0              0               1
         79           0              0               3
+        79           0              0               3
         80           0              0               1
         80           0              0               1
         82           0              0               4
@@ -2200,7 +2201,7 @@ NUM_HKEYS   NUM_SKEYS   NUM_MAX_VALUES_PER_KEY  NUM_HASH_TABLE_BUCKETS
         98           1              1               0
 
 --- 60 row(s) selected.
->>select char_length(hkey), num_hits, num_PLiterals,  num_NPLiterals from table(hybridquerycacheentries('meta', 'local')) order by 1, 2;
+>>select char_length(hkey), num_hits, num_PLiterals,  num_NPLiterals from table(hybridquerycacheentries('meta', 'local')) order by 1, 2, 3, 4;
 
 (EXPR)      NUM_HITS    NUM_PLITERALS  NUM_NPLITERALS
 ----------  ----------  -------------  --------------
@@ -2225,10 +2226,10 @@ NUM_HKEYS   NUM_SKEYS   NUM_MAX_VALUES_PER_KEY  NUM_HASH_TABLE_BUCKETS
        619           1              1              14
 
 --- 18 row(s) selected.
->>select char_length(hkey), num_hits, num_PLiterals,  num_NPLiterals from table(hybridquerycacheentries('ustats', 'local')) order by 1, 2;
+>>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.
->>select char_length(hkey), num_hits, num_PLiterals,  num_NPLiterals from table(hybridquerycacheentries('all', 'local')) order by 1, 2;
+>>select char_length(hkey), num_hits, num_PLiterals,  num_NPLiterals from table(hybridquerycacheentries('all', 'local')) order by 1, 2, 3, 4;
 
 (EXPR)      NUM_HITS    NUM_PLITERALS  NUM_NPLITERALS
 ----------  ----------  -------------  --------------
@@ -2262,10 +2263,10 @@ NUM_HKEYS   NUM_SKEYS   NUM_MAX_VALUES_PER_KEY  NUM_HASH_TABLE_BUCKETS
         55           1              1               0
         58           1              1               0
         59           1              1               0
-        60           0              1               1
         60           0              0               1
         60           0              0               1
         60           0              1               1
+        60           0              1               1
         61           1              1               0
         63           0              1               0
         63           0              1               0
@@ -2284,9 +2285,9 @@ NUM_HKEYS   NUM_SKEYS   NUM_MAX_VALUES_PER_KEY  NUM_HASH_TABLE_BUCKETS
         78           0              0               2
         78           0              0               2
         79           0              0               1
-        79           0              0               3
         79           0              0               1
         79           0              0               3
+        79           0              0               3
         80           0              0               1
         80           0              0               1
         82           0              0               4

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1e60a9b8/core/sql/regress/compGeneral/EXPECTEDTOK2
----------------------------------------------------------------------
diff --git a/core/sql/regress/compGeneral/EXPECTEDTOK2 b/core/sql/regress/compGeneral/EXPECTEDTOK2
new file mode 100644
index 0000000..73eec61
--- /dev/null
+++ b/core/sql/regress/compGeneral/EXPECTEDTOK2
@@ -0,0 +1,46 @@
+sqlparser.y: warning: 73 shift/reduce conflicts [-Wconflicts-sr]
+sqlparser.y: warning: 12 reduce/reduce conflicts [-Wconflicts-rr]
+ 
+nnnn conflicts: 1 shift/reduce nnnn olap_sequence_function: set_function_specification . TOK_OVER '(' opt_olap_part_clause opt_olap_order_clause ')'
+nnnn conflicts: 1 shift/reduce nnnn value_expression: value_expression_sans_collate . collation_option
+nnnn conflicts: 8 shift/reduce nnnn primary: row_subquery .
+nnnn conflicts: 1 shift/reduce nnnn sql_statement: TOK_BEGIN . TOK_DECLARE TOK_SECTION
+nnnn conflicts: 1 shift/reduce nnnn update_statement_searched: TOK_UPDATE . update_statement_searched_body
+nnnn conflicts: 9 shift/reduce nnnn row_subquery: '(' row_subquery . ')'
+nnnn conflicts: 1 reduce/reduce nnnn row_subquery: rel_subquery .
+nnnn conflicts: 1 reduce/reduce nnnn transaction_statement: TOK_BEGIN .
+nnnn conflicts: 1 shift/reduce nnnn show_statement: TOK_SHOWCONTROL showcontrol_type . optional_control_identifier optional_comma_match_clause
+nnnn conflicts: 1 shift/reduce nnnn extended_label_name: TOK_INDEX . label_name
+nnnn conflicts: 1 shift/reduce nnnn row_subquery: '(' row_subquery . ')'
+nnnn conflicts: 1 shift/reduce nnnn input_hostvar_expression: HOSTVAR .
+nnnn conflicts: 1 reduce/reduce nnnn primary: row_subquery .
+nnnn conflicts: 2 shift/reduce nnnn value_expression_list_comma: value_expression . ',' value_expression
+nnnn conflicts: 1 shift/reduce nnnn value_expression_list_comma: value_expression . ',' value_expression
+nnnn conflicts: 1 shift/reduce nnnn primary: row_subquery .
+nnnn conflicts: 1 shift/reduce nnnn control_statement: TOK_CONTROL TOK_QUERY TOK_SHAPE . query_shape_options query_shape_control
+nnnn conflicts: 1 reduce/reduce nnnn procedure_or_function: TOK_PROCEDURES .
+nnnn conflicts: 1 reduce/reduce nnnn procedure_or_function: TOK_FUNCTIONS .
+nnnn conflicts: 1 shift/reduce nnnn table_as_stream_any: table_as_stream .
+nnnn conflicts: 1 shift/reduce nnnn drop_catalog_statement: TOK_DROP TOK_CATALOG . catalog_name extension_drop_behavior
+nnnn conflicts: 1 reduce/reduce nnnn procedure_or_function: TOK_TABLE_MAPPING TOK_FUNCTIONS .
+nnnn conflicts: 13 shift/reduce nnnn query_spec_body: query_select_list table_expression . access_type optional_lock_mode
+nnnn conflicts: 1 reduce/reduce nnnn primary: row_subquery .
+nnnn conflicts: 1 reduce/reduce nnnn primary: row_subquery .
+nnnn conflicts: 1 reduce/reduce nnnn primary: row_subquery .
+nnnn conflicts: 1 reduce/reduce nnnn primary: row_subquery .
+nnnn conflicts: 1 shift/reduce nnnn query_shape_control: shape_identifier .
+nnnn conflicts: 2 shift/reduce, 1 reduce/reduce nnnn query_exp_for_cursor: query_expression . for_update_spec
+nnnn conflicts: 13 shift/reduce nnnn query_spec_body: query_select_list into_clause table_expression . access_type optional_lock_mode
+nnnn conflicts: 1 shift/reduce nnnn query_spec_body: query_select_list table_expression access_type . optional_lock_mode
+nnnn conflicts: 1 shift/reduce nnnn mv_definition: create_mv_keywords ddl_qualified_name optional_view_column_list refresh_type . create_mv_attribute_table_lists mv_initialization_clause optional_query_rewrite optional_create_mv_file_options optional_in_memory_clause as_token query_expression
+nnnn conflicts: 1 shift/reduce nnnn table_name_and_hint: table_name . optimizer_hint hbase_access_options
+nnnn conflicts: 1 shift/reduce nnnn table_reference: table_as_procedure .
+nnnn conflicts: 1 shift/reduce nnnn table_reference: table_as_stream_any . optimizer_hint
+nnnn conflicts: 1 shift/reduce nnnn table_reference: table_as_tmudf_function .
+nnnn conflicts: 1 shift/reduce nnnn table_reference: rel_subquery .
+nnnn conflicts: 1 shift/reduce nnnn query_spec_body: query_select_list into_clause table_expression access_type . optional_lock_mode
+nnnn conflicts: 1 shift/reduce nnnn file_attribute_clause: file_attribute_keyword file_attribute_list .
+nnnn conflicts: 1 shift/reduce nnnn id_group: '(' identifier . ')' TOK_TO identifier
+nnnn conflicts: 1 reduce/reduce nnnn table_reference: '(' Front_Of_Insert . Rest_Of_insert_statement ')' as_clause
+nnnn conflicts: 1 shift/reduce nnnn transpose_list: transpose_set .
+nnnn conflicts: 1 shift/reduce nnnn pipeline_clause: TOK_PIPELINE '(' pipeline_mv_name_list ')' . pipeline_def_list

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1e60a9b8/core/sql/regress/compGeneral/EXPECTEDTOK2.LINUX
----------------------------------------------------------------------
diff --git a/core/sql/regress/compGeneral/EXPECTEDTOK2.LINUX b/core/sql/regress/compGeneral/EXPECTEDTOK2.LINUX
deleted file mode 100644
index 73eec61..0000000
--- a/core/sql/regress/compGeneral/EXPECTEDTOK2.LINUX
+++ /dev/null
@@ -1,46 +0,0 @@
-sqlparser.y: warning: 73 shift/reduce conflicts [-Wconflicts-sr]
-sqlparser.y: warning: 12 reduce/reduce conflicts [-Wconflicts-rr]
- 
-nnnn conflicts: 1 shift/reduce nnnn olap_sequence_function: set_function_specification . TOK_OVER '(' opt_olap_part_clause opt_olap_order_clause ')'
-nnnn conflicts: 1 shift/reduce nnnn value_expression: value_expression_sans_collate . collation_option
-nnnn conflicts: 8 shift/reduce nnnn primary: row_subquery .
-nnnn conflicts: 1 shift/reduce nnnn sql_statement: TOK_BEGIN . TOK_DECLARE TOK_SECTION
-nnnn conflicts: 1 shift/reduce nnnn update_statement_searched: TOK_UPDATE . update_statement_searched_body
-nnnn conflicts: 9 shift/reduce nnnn row_subquery: '(' row_subquery . ')'
-nnnn conflicts: 1 reduce/reduce nnnn row_subquery: rel_subquery .
-nnnn conflicts: 1 reduce/reduce nnnn transaction_statement: TOK_BEGIN .
-nnnn conflicts: 1 shift/reduce nnnn show_statement: TOK_SHOWCONTROL showcontrol_type . optional_control_identifier optional_comma_match_clause
-nnnn conflicts: 1 shift/reduce nnnn extended_label_name: TOK_INDEX . label_name
-nnnn conflicts: 1 shift/reduce nnnn row_subquery: '(' row_subquery . ')'
-nnnn conflicts: 1 shift/reduce nnnn input_hostvar_expression: HOSTVAR .
-nnnn conflicts: 1 reduce/reduce nnnn primary: row_subquery .
-nnnn conflicts: 2 shift/reduce nnnn value_expression_list_comma: value_expression . ',' value_expression
-nnnn conflicts: 1 shift/reduce nnnn value_expression_list_comma: value_expression . ',' value_expression
-nnnn conflicts: 1 shift/reduce nnnn primary: row_subquery .
-nnnn conflicts: 1 shift/reduce nnnn control_statement: TOK_CONTROL TOK_QUERY TOK_SHAPE . query_shape_options query_shape_control
-nnnn conflicts: 1 reduce/reduce nnnn procedure_or_function: TOK_PROCEDURES .
-nnnn conflicts: 1 reduce/reduce nnnn procedure_or_function: TOK_FUNCTIONS .
-nnnn conflicts: 1 shift/reduce nnnn table_as_stream_any: table_as_stream .
-nnnn conflicts: 1 shift/reduce nnnn drop_catalog_statement: TOK_DROP TOK_CATALOG . catalog_name extension_drop_behavior
-nnnn conflicts: 1 reduce/reduce nnnn procedure_or_function: TOK_TABLE_MAPPING TOK_FUNCTIONS .
-nnnn conflicts: 13 shift/reduce nnnn query_spec_body: query_select_list table_expression . access_type optional_lock_mode
-nnnn conflicts: 1 reduce/reduce nnnn primary: row_subquery .
-nnnn conflicts: 1 reduce/reduce nnnn primary: row_subquery .
-nnnn conflicts: 1 reduce/reduce nnnn primary: row_subquery .
-nnnn conflicts: 1 reduce/reduce nnnn primary: row_subquery .
-nnnn conflicts: 1 shift/reduce nnnn query_shape_control: shape_identifier .
-nnnn conflicts: 2 shift/reduce, 1 reduce/reduce nnnn query_exp_for_cursor: query_expression . for_update_spec
-nnnn conflicts: 13 shift/reduce nnnn query_spec_body: query_select_list into_clause table_expression . access_type optional_lock_mode
-nnnn conflicts: 1 shift/reduce nnnn query_spec_body: query_select_list table_expression access_type . optional_lock_mode
-nnnn conflicts: 1 shift/reduce nnnn mv_definition: create_mv_keywords ddl_qualified_name optional_view_column_list refresh_type . create_mv_attribute_table_lists mv_initialization_clause optional_query_rewrite optional_create_mv_file_options optional_in_memory_clause as_token query_expression
-nnnn conflicts: 1 shift/reduce nnnn table_name_and_hint: table_name . optimizer_hint hbase_access_options
-nnnn conflicts: 1 shift/reduce nnnn table_reference: table_as_procedure .
-nnnn conflicts: 1 shift/reduce nnnn table_reference: table_as_stream_any . optimizer_hint
-nnnn conflicts: 1 shift/reduce nnnn table_reference: table_as_tmudf_function .
-nnnn conflicts: 1 shift/reduce nnnn table_reference: rel_subquery .
-nnnn conflicts: 1 shift/reduce nnnn query_spec_body: query_select_list into_clause table_expression access_type . optional_lock_mode
-nnnn conflicts: 1 shift/reduce nnnn file_attribute_clause: file_attribute_keyword file_attribute_list .
-nnnn conflicts: 1 shift/reduce nnnn id_group: '(' identifier . ')' TOK_TO identifier
-nnnn conflicts: 1 reduce/reduce nnnn table_reference: '(' Front_Of_Insert . Rest_Of_insert_statement ')' as_clause
-nnnn conflicts: 1 shift/reduce nnnn transpose_list: transpose_set .
-nnnn conflicts: 1 shift/reduce nnnn pipeline_clause: TOK_PIPELINE '(' pipeline_mv_name_list ')' . pipeline_def_list

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1e60a9b8/core/sql/regress/compGeneral/TEST015
----------------------------------------------------------------------
diff --git a/core/sql/regress/compGeneral/TEST015 b/core/sql/regress/compGeneral/TEST015
index 5931822..d2e020b 100755
--- a/core/sql/regress/compGeneral/TEST015
+++ b/core/sql/regress/compGeneral/TEST015
@@ -85,11 +85,11 @@ create table t9abc
  c int not null not droppable, d char(10)) no partition store by(a,b,c);
 create table t11
            (a int not null, b int not null, c int not null,
-            PRIMARY KEY (a,b) not droppable)
-            location $$partition$$ NAME p0
-              HASH2 PARTITION(add location $$partition1$$ name p1,
-                              add location $$partition2$$ name p2,
-                              add location $$partition3$$ name p3);
+            PRIMARY KEY (a,b) not droppable);
+--            location $$partition$$ NAME p0
+--              HASH2 PARTITION(add location $$partition1$$ name p1,
+--                              add location $$partition2$$ name p2,
+--                              add location $$partition3$$ name p3);
 
 
 create table cube2

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1e60a9b8/core/sql/regress/compGeneral/TEST042
----------------------------------------------------------------------
diff --git a/core/sql/regress/compGeneral/TEST042 b/core/sql/regress/compGeneral/TEST042
index b84ad92..31349a7 100644
--- a/core/sql/regress/compGeneral/TEST042
+++ b/core/sql/regress/compGeneral/TEST042
@@ -580,10 +580,10 @@ select num_entries, text_entries, num_plans from table(querycache('meta', 'local
 select num_entries, text_entries, num_plans from table(querycache('ustats', 'local'));
 select num_entries, text_entries, num_plans from table(querycache('all', 'local'));
 
-select num_hits, num_params from table(querycacheentries('user', 'local')) order by 1;
-select num_hits, num_params from table(querycacheentries('meta', 'local')) order by 1;
-select num_hits, num_params from table(querycacheentries('ustats', 'local')) order by 1;
-select num_hits, num_params from table(querycacheentries('all', 'local')) order by 1;
+select num_hits, num_params from table(querycacheentries('user', 'local')) order by 1,2;
+select num_hits, num_params from table(querycacheentries('meta', 'local')) order by 1,2;
+select num_hits, num_params from table(querycacheentries('ustats', 'local')) order by 1,2;
+select num_hits, num_params from table(querycacheentries('all', 'local')) order by 1,2;
 
 
 --Stats in Hybrid Query Cache
@@ -592,10 +592,10 @@ select * from table(hybridquerycache('meta', 'local'));
 select * from table(hybridquerycache('ustats', 'local'));
 select * from table(hybridquerycache('all', 'local'));
 
-select char_length(hkey), num_hits, num_PLiterals,  num_NPLiterals from table(hybridquerycacheentries('user', 'local')) order by 1, 2;
-select char_length(hkey), num_hits, num_PLiterals,  num_NPLiterals from table(hybridquerycacheentries('meta', 'local')) order by 1, 2;
-select char_length(hkey), num_hits, num_PLiterals,  num_NPLiterals from table(hybridquerycacheentries('ustats', 'local')) order by 1, 2;
-select char_length(hkey), num_hits, num_PLiterals,  num_NPLiterals from table(hybridquerycacheentries('all', 'local')) order by 1, 2;
+select char_length(hkey), num_hits, num_PLiterals,  num_NPLiterals from table(hybridquerycacheentries('user', 'local')) order by 1, 2, 3, 4;
+select char_length(hkey), num_hits, num_PLiterals,  num_NPLiterals from table(hybridquerycacheentries('meta', 'local')) order by 1, 2, 3, 4;
+select char_length(hkey), num_hits, num_PLiterals,  num_NPLiterals from table(hybridquerycacheentries('ustats', 'local')) order by 1, 2, 3, 4;
+select char_length(hkey), num_hits, num_PLiterals,  num_NPLiterals from table(hybridquerycacheentries('all', 'local')) order by 1, 2, 3, 4;
 
 
 -- virtual table ISP queries are not cacheable.

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1e60a9b8/core/sql/regress/core/TEST056
----------------------------------------------------------------------
diff --git a/core/sql/regress/core/TEST056 b/core/sql/regress/core/TEST056
index 5cfa816..823f66e 100755
--- a/core/sql/regress/core/TEST056
+++ b/core/sql/regress/core/TEST056
@@ -78,30 +78,22 @@ create table T056t10 (swallow int default 121 not null ,
                       barnowl int default 1000 not null);
 
 create unique index T056in5 on T056t10 (barnowl) 
-#ifMX
        location $$partition$$ 
        range partition (
         add first key 150 location $$partition$$,
         add first key 180 location $$partition$$)
-#ifMX
 ; 
 
 create table T056t11 (wren int not null , 
   junco int not null ,
-  blackbird int
-#ifMP
-not null
-#ifMP
-,
+  blackbird int,
   primary key(wren,junco) )
-#ifMX
       location $$partition2$$
       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$$)
-#ifMX
 ;
 
 insert into T056t11 values (1,11,111),(3,13,113),(5,15,115)

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1e60a9b8/core/sql/sqlcomp/CmpDescribe.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpDescribe.cpp b/core/sql/sqlcomp/CmpDescribe.cpp
index a886b7f..35ebbbc 100644
--- a/core/sql/sqlcomp/CmpDescribe.cpp
+++ b/core/sql/sqlcomp/CmpDescribe.cpp
@@ -2830,7 +2830,7 @@ short CmpDescribeSeabaseTable (
       if ((isSalted) && !withoutSalt)
         {
           Lng32 currPartitions = naf->getCountOfPartitions();
-          Lng32 numPartitions = naTable->numSaltPartns();
+          Lng32 numPartitions = naf->numSaltPartns();
 
           if (numPartitions != currPartitions)
             sprintf(buf,  "  SALT USING %d PARTITIONS /* ACTUAL PARTITIONS %d */", numPartitions, currPartitions);

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1e60a9b8/core/sql/sqlcomp/CmpSeabaseDDL.h
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpSeabaseDDL.h b/core/sql/sqlcomp/CmpSeabaseDDL.h
index 6ff59e2..e54337c 100644
--- a/core/sql/sqlcomp/CmpSeabaseDDL.h
+++ b/core/sql/sqlcomp/CmpSeabaseDDL.h
@@ -102,6 +102,7 @@ class StmtDDLAddConstraintCheck;
 class ElemDDLColDefArray;
 class ElemDDLColRefArray;
 class ElemDDLParamDefArray;
+class ElemDDLPartitionClause;
 
 class DDLExpr;
 class DDLNode;
@@ -177,6 +178,14 @@ class CmpSeabaseDDL
                                            const NAString &catName,
                                            const NAString &schName);
  
+  static short getTextFromMD(
+       const char *catalogName,
+       ExeCliInterface * cliInterface,
+       Int64 constrUID,
+       ComTextType textType,
+       Lng32 textSubID,
+       NAString &constrText);
+  
   NABoolean isAuthorizationEnabled();
 
   short existsInHbase(const NAString &objName,
@@ -692,17 +701,16 @@ class CmpSeabaseDDL
 			    NABoolean audited,
                             const NAString& objType);
 
-  // textType:   0, view text.  1, constraint text.  2, computed col text.
   // subID: 0, for text that belongs to table. colNumber, for column based text.
   short updateTextTable(ExeCliInterface *cliInterface,
                         Int64 objUID, 
-                        Lng32 textType, 
+                        ComTextType textType, 
                         Lng32 subID, 
                         NAString &text);
 
   short deleteFromTextTable(ExeCliInterface *cliInterface,
                             Int64 objUID, 
-                            Lng32 textType, 
+                            ComTextType textType, 
                             Lng32 subID);
 
   ItemExpr * bindDivisionExprAtDDLTime(ItemExpr *expr,
@@ -711,8 +719,12 @@ class CmpSeabaseDDL
   short validateDivisionByExprForDDL(ItemExpr *divExpr);
 
   short createEncodedKeysBuffer(char** &encodedKeysBuffer,
+                                int &numSplits,
 				desc_struct * colDescs, desc_struct * keyDescs,
-				Lng32 numSplits, Lng32 numKeys, 
+				int numSaltPartitions,
+                                Lng32 numSaltSplits,
+                                NAString *splitByClause,
+                                Lng32 numKeys,
                                 Lng32 keyLength, NABoolean isIndex);
 
   short validateRoutine( 
@@ -987,7 +999,7 @@ class CmpSeabaseDDL
   short getTextFromMD(
        ExeCliInterface * cliInterface,
        Int64 constrUID,
-       Lng32 textType,
+       ComTextType textType,
        Lng32 textSubID,
        NAString &constrText);
   

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1e60a9b8/core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp b/core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp
index bd86f9b..ac1d803 100644
--- a/core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp
+++ b/core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp
@@ -4033,7 +4033,7 @@ short CmpSeabaseDDL::updateHbaseOptionsInMetadata(
 
   // get the text from the metadata
 
-  Lng32 textType = 2;  // to get text containing HBASE_OPTIONS=>
+  ComTextType textType = COM_HBASE_OPTIONS_TEXT;  // to get text containing HBASE_OPTIONS=>
   Lng32 textSubID = 0; // meaning, the text pertains to the object as a whole
   NAString metadataText(STMTHEAP);
   result = getTextFromMD(cliInterface,
@@ -4117,21 +4117,13 @@ short CmpSeabaseDDL::updateHbaseOptionsInMetadata(
         }
       else
         {
-          // double any quotes in the text, since we are going to use it
-          // as a literal an an INSERT statement shortly 
-
-          NAString doubledQuoteMetadataText;
-          ToQuotedString(doubledQuoteMetadataText /* out */,
-                         metadataText,
-                         FALSE /* don't surround with quotes */);
-
-          // insert the edited text back into the metadata
+          // insert the text back into the metadata
 
           result = updateTextTable(cliInterface,
                                    objectUID,
                                    textType,
                                    textSubID,
-                                   doubledQuoteMetadataText);
+                                   metadataText);
         }
     }
 
@@ -4443,19 +4435,20 @@ short CmpSeabaseDDL::updateSeabaseMDTable(
                 }
             }
 
-           ToQuotedString(quotedDefVal, defVal, FALSE);
-
            if (colInfo->defaultClass == COM_ALWAYS_COMPUTE_COMPUTED_COLUMN_DEFAULT ||
                colInfo->defaultClass == COM_ALWAYS_DEFAULT_COMPUTED_COLUMN_DEFAULT)
              {
-               computedColumnDefinition = quotedDefVal;
-               quotedDefVal = "";
+               computedColumnDefinition = defVal;
+               // quotedDefVal = "";
                isComputedColumn = TRUE;
              }
            else if (useRWRS)
              {
                quotedDefVal = defVal; // outer quotes not needed when inserting using rowsets
              }
+           else
+             ToQuotedString(quotedDefVal, defVal, FALSE);
+
         } // colInfo->defVal
 
       const char *colClassLit = NULL;
@@ -5659,33 +5652,41 @@ short CmpSeabaseDDL::buildKeyInfoArray(
   return 0;
 }
 
-// textType:   0, view text.  1, constraint text.  2, computed col text.
 // subID: 0, for text that belongs to table. colNumber, for column based text.
 short CmpSeabaseDDL::updateTextTable(ExeCliInterface *cliInterface,
                                      Int64 objUID, 
-                                     Lng32 textType, 
+                                     ComTextType textType, 
                                      Lng32 subID, 
                                      NAString &text)
 {
   Lng32 cliRC = 0;
-
-  char * buf = new(STMTHEAP) char[400+TEXTLEN];
   Lng32 textLen = text.length();
+  Lng32 bufLen = (textLen>TEXTLEN ? TEXTLEN : textLen) + 1000;
+  char * buf = new(STMTHEAP) char[bufLen];
   Lng32 numRows = (textLen / TEXTLEN) + 1;
   Lng32 currPos = 0;
   for (Lng32 i = 0; i < numRows; i++)
     {
-      NAString temp = 
-        (i < numRows-1 ? text(currPos, TEXTLEN)
-         : text(currPos, (textLen - currPos)));
+      NAString temp;
 
-      str_sprintf(buf, "insert into %s.\"%s\".%s values (%Ld, %d, %d, %d, 0, '%s')",
-                  getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_TEXT,
-                  objUID,
-                  textType,
-                  subID,
-                  i,
-                  temp.data());
+      if (i < numRows-1)
+        ToQuotedString(temp, text(currPos, TEXTLEN));
+      else
+        ToQuotedString(temp, text(currPos, (textLen - currPos)));
+
+      if (snprintf(buf, bufLen, "insert into %s.\"%s\".%s values (%ld, %d, %d, %d, 0, %s)",
+                   getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_TEXT,
+                   objUID,
+                   textType,
+                   subID,
+                   i,
+                   temp.data()) >= bufLen)
+        {
+          // we left room in buf for a few hundred quotes, but using
+          // too many could get us here
+          *CmpCommon::diags() << DgSqlCode(-1207);
+          return -1;
+        }
       cliRC = cliInterface->executeImmediate(buf);
       
       if (cliRC < 0)
@@ -5702,7 +5703,7 @@ short CmpSeabaseDDL::updateTextTable(ExeCliInterface *cliInterface,
 
 short CmpSeabaseDDL::deleteFromTextTable(ExeCliInterface *cliInterface,
                                          Int64 objUID, 
-                                         Lng32 textType, 
+                                         ComTextType textType, 
                                          Lng32 subID)
 {
   Lng32 cliRC = 0;
@@ -5710,7 +5711,7 @@ short CmpSeabaseDDL::deleteFromTextTable(ExeCliInterface *cliInterface,
   char buf[1000];
   str_sprintf(buf, "delete from %s.\"%s\".%s where text_uid = %Ld and text_type = %d and sub_id = %d",
               getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_TEXT,
-              objUID, textType, subID);
+              objUID, static_cast<int>(textType), subID);
   cliRC = cliInterface->executeImmediate(buf);
   
   if (cliRC < 0)
@@ -6137,53 +6138,82 @@ short CmpSeabaseDDL::validateDivisionByExprForDDL(ItemExpr *divExpr)
 }
 
 short CmpSeabaseDDL::createEncodedKeysBuffer(char** &encodedKeysBuffer,
+                                             int &numSplits,
                                              desc_struct * colDescs, 
                                              desc_struct * keyDescs,
-                                             Lng32 numSplits, Lng32 numKeys, 
-                                             Lng32 keyLength, NABoolean isIndex)
+                                             int numSaltPartitions,
+                                             Lng32 numSaltSplits,
+                                             NAString *splitByClause,
+                                             Lng32 numKeys, 
+                                             Lng32 keyLength,
+                                             NABoolean isIndex)
 {
   encodedKeysBuffer = NULL;
-  
-  if (numSplits <= 0)
+  numSplits = 0;
+
+  if (numSaltSplits <= 0)
     return 0;
 
-    NAString ** inArray = createInArrayForLowOrHighKeys(colDescs, 
-                                                        keyDescs,
-                                                        numKeys,
-                                                        FALSE,
-                                                        isIndex,
-                                                        STMTHEAP ); 
-
-    char splitNumCharStr[5];
-    NAString splitNumString;
-
-    /* HBase creates 1 more split than
-       the number of rows in the split array. In the example below we have a 
-       salt column and an integer column as the key. KeyLength is 4 + 4 = 8.
-       encodedKeysBuffer will have 4 elements, each of length 8. When this
-       buffer is given to HBase through the Java API we get a table with 5 
-       splits and begin/end keys as shown below
-       
-       Start Key                                                     End Key
-       \x00\x00\x00\x01\x00\x00\x00\x00
-       \x00\x00\x00\x01\x00\x00\x00\x00      \x00\x00\x00\x02\x00\x00\x00\x00   
-       \x00\x00\x00\x02\x00\x00\x00\x00      \x00\x00\x00\x03\x00\x00\x00\x00
-       \x00\x00\x00\x03\x00\x00\x00\x00      \x00\x00\x00\x04\x00\x00\x00\x00   
-       \x00\x00\x00\x04\x00\x00\x00\x00 
-    */
-    encodedKeysBuffer = new (STMTHEAP) char*[numSplits];
-    for(int i =0; i < numSplits; i++)
-      encodedKeysBuffer[i] = new (STMTHEAP) char[keyLength];
-
-    inArray[0] = &splitNumString;
-    short retVal = 0;
-    
-    for(Int32 i =0; i < numSplits; i++) {
-      sprintf(splitNumCharStr, "%d", i+1);
-      splitNumString = splitNumCharStr;
+  // make a list of NAStrings with the default values for start keys
+  NAString ** defaultSplits = createInArrayForLowOrHighKeys(
+       colDescs,
+       keyDescs,
+       numKeys,
+       FALSE,
+       isIndex,
+       STMTHEAP );
+  NAString **splitValuesAsText = new(STMTHEAP) NAString *[numKeys];
+  ElemDDLPartitionList * pPartitionList = NULL;
+  ElemDDLPartitionRange *pPartitionRange = NULL;
+
+      numSplits = numSaltSplits;
+
+      // for salt splits, only the first key column value
+      // is variable, the rest use the default values
+      for (int k=1; k<numKeys; k++)
+        splitValuesAsText[k] = defaultSplits[k];
+
+  // allocate the result buffers, numSplits buffers of length keyLength
+  encodedKeysBuffer = new (STMTHEAP) char*[numSplits];
+  for(int i =0; i < numSplits; i++)
+    encodedKeysBuffer[i] = new (STMTHEAP) char[keyLength];
+
+  char splitNumCharStr[10];
+  NAString splitNumString;
+
+  // loop over the splits, HBase will create 1 more region than the
+  // number of rows in the split array
+  for(Int32 i =0; i < numSplits; i++)
+    {
+          /* We are splitting along salt partitions. In the example below we have a 
+             salt column and an integer column as the key. KeyLength is 4 + 4 = 8.
+             encodedKeysBuffer will have 4 elements, each of length 8. When this
+             buffer is given to HBase through the Java API we get a table with 5 
+             regions (4 splits) and begin/end keys as shown below
+
+             Start Key                             End Key
+                                                   \x00\x00\x00\x01\x00\x00\x00\x00
+             \x00\x00\x00\x01\x00\x00\x00\x00      \x00\x00\x00\x02\x00\x00\x00\x00   
+             \x00\x00\x00\x02\x00\x00\x00\x00      \x00\x00\x00\x03\x00\x00\x00\x00
+             \x00\x00\x00\x03\x00\x00\x00\x00      \x00\x00\x00\x04\x00\x00\x00\x00   
+             \x00\x00\x00\x04\x00\x00\x00\x00
+
+             When we have more salt partitions than regions, the salt values
+             will be distributed across the regions as evenly as possible
+          */
+
+          snprintf(splitNumCharStr, sizeof(splitNumCharStr), "%d",
+                  ((i+1)*numSaltPartitions)/(numSaltSplits+1));
+          splitNumString = splitNumCharStr;
+          splitValuesAsText[0] = &splitNumString;
+
+      short retVal = 0;
+
+      // convert the array of NAStrings with textual values into
+      // an encoded binary key buffer
       retVal = encodeKeyValues(colDescs,
                                keyDescs,
-                               inArray, // INPUT
+                               splitValuesAsText, // INPUT
                                isIndex,
                                encodedKeysBuffer[i],  // OUTPUT
                                STMTHEAP,
@@ -6191,7 +6221,19 @@ short CmpSeabaseDDL::createEncodedKeysBuffer(char** &encodedKeysBuffer,
 
       if (retVal)
         return -1;
-    }
+
+      // check whether the encoded keys are ascending
+      if (i > 0 &&
+          memcmp(encodedKeysBuffer[i-1],
+                 encodedKeysBuffer[i],
+                 keyLength) >= 0)
+        {
+          *CmpCommon::diags() << DgSqlCode(-1211)
+                              << DgInt0(i+1);
+          return -1;
+        }
+
+    } // loop over splits
 
   return 0;
 }
@@ -7841,8 +7883,9 @@ void CmpSeabaseDDL::purgedataHbaseTable(DDLExpr * ddlExpr,
   NAFileSet * naf = naTable->getClusteringIndex();
 
   NAList<HbaseCreateOption*> * hbaseCreateOptions = naTable->hbaseCreateOptions();
-  Lng32 numSaltedPartitions = naTable->numSaltPartns();
-  Lng32 numSplits = (numSaltedPartitions ? numSaltedPartitions - 1 : 0);
+  Lng32 numSaltPartns = naf->numSaltPartns();
+  Lng32 numSaltSplits = numSaltPartns - 1;
+  Lng32 numSplits = 0;
   Lng32 numKeys = naf->getIndexKeyColumns().entries();
   Lng32 keyLength = naf->getKeyLength();
   char ** encodedKeysBuffer = NULL;
@@ -7850,9 +7893,16 @@ void CmpSeabaseDDL::purgedataHbaseTable(DDLExpr * ddlExpr,
   const desc_struct * tableDesc = naTable->getTableDesc();
   desc_struct * colDescs = tableDesc->body.table_desc.columns_desc; 
   desc_struct * keyDescs = (desc_struct*)naf->getKeysDesc();
-  if (createEncodedKeysBuffer(encodedKeysBuffer,
-                              colDescs, keyDescs, numSplits, numKeys, 
-                              keyLength, FALSE))
+
+  if (createEncodedKeysBuffer(encodedKeysBuffer/*out*/,
+                              numSplits/*out*/,
+                              colDescs, keyDescs,
+                              numSaltPartns,
+                              numSaltSplits,
+                              NULL,
+                              numKeys, 
+                              keyLength,
+                              FALSE))
     {
       deallocEHI(ehi); 
 
@@ -9879,9 +9929,9 @@ CmpSeabaseDDL::setupHbaseOptions(ElemDDLHbaseOptions * hbaseOptionsClause,
         compressionOptionSpecified = TRUE;
       
       hbaseOptionsStr += hbaseOption->key();
-      hbaseOptionsStr += "=''";
+      hbaseOptionsStr += "='";
       hbaseOptionsStr += hbaseOption->val();
-      hbaseOptionsStr += "''";
+      hbaseOptionsStr += "'";
 
       hbaseOptionsStr += "|";
     }
@@ -9921,7 +9971,7 @@ CmpSeabaseDDL::setupHbaseOptions(ElemDDLHbaseOptions * hbaseOptionsClause,
                HBASE_SALTED_TABLE_MAX_FILE_SIZE) == TRUE)
       {
         numHbaseOptions += 1;
-        snprintf(fileSizeOption,100,"MAX_FILESIZE=''%ld''|", maxFileSizeInt);
+        snprintf(fileSizeOption,100,"MAX_FILESIZE='%ld'|", maxFileSizeInt);
         hbaseOptionsStr += fileSizeOption;
       }
     }
@@ -9938,9 +9988,9 @@ CmpSeabaseDDL::setupHbaseOptions(ElemDDLHbaseOptions * hbaseOptionsClause,
                HBASE_SALTED_TABLE_SET_SPLIT_POLICY) == TRUE)
       {
         numHbaseOptions += 1;
-        hbaseOptionsStr += "SPLIT_POLICY=''";
+        hbaseOptionsStr += "SPLIT_POLICY='";
         hbaseOptionsStr += saltedTableSplitPolicy;
-        hbaseOptionsStr += "''|";
+        hbaseOptionsStr += "'|";
       }
     }  
   }
@@ -9962,7 +10012,7 @@ CmpSeabaseDDL::setupHbaseOptions(ElemDDLHbaseOptions * hbaseOptionsClause,
           (HBASE_DATA_BLOCK_ENCODING_OPTION) == TRUE)
         {
           numHbaseOptions += 1;
-          sprintf(optionStr, "DATA_BLOCK_ENCODING=''%s''|", dataBlockEncoding.data());
+          sprintf(optionStr, "DATA_BLOCK_ENCODING='%s'|", dataBlockEncoding.data());
           hbaseOptionsStr += optionStr;
         }
     }
@@ -9977,7 +10027,7 @@ CmpSeabaseDDL::setupHbaseOptions(ElemDDLHbaseOptions * hbaseOptionsClause,
           (HBASE_COMPRESSION_OPTION) == TRUE)
         {
           numHbaseOptions += 1;
-          sprintf(optionStr, "COMPRESSION=''%s''|", compression.data());
+          sprintf(optionStr, "COMPRESSION='%s'|", compression.data());
           hbaseOptionsStr += optionStr;
         }
     }

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1e60a9b8/core/sql/sqlcomp/CmpSeabaseDDLindex.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpSeabaseDDLindex.cpp b/core/sql/sqlcomp/CmpSeabaseDDLindex.cpp
index c2e62b9..a6a241e 100644
--- a/core/sql/sqlcomp/CmpSeabaseDDLindex.cpp
+++ b/core/sql/sqlcomp/CmpSeabaseDDLindex.cpp
@@ -721,7 +721,7 @@ void CmpSeabaseDDL::createSeabaseIndex(
     // verify base table is salted
     if (naTable->hasSaltedColumn())
     {
-      createIndexNode->getSaltOptions()->setNumPartns(naTable->numSaltPartns());
+      createIndexNode->getSaltOptions()->setNumPartns(nafs->numSaltPartns());
       NAString saltColName;
       for (CollIndex c=0; c<baseTableKeyArr.entries(); c++)
         if (baseTableKeyArr[c]->isSaltColumn())
@@ -737,7 +737,7 @@ void CmpSeabaseDDL::createSeabaseIndex(
       //SALT column will be the first column in the index
       indexColRefArray.insertAt(numPrefixColumns, saltColRef);
       numPrefixColumns++;
-      numSplits = naTable->numSaltPartns() - 1;
+      numSplits = nafs->numSaltPartns() - 1;
     }
     else
     {
@@ -828,8 +828,10 @@ void CmpSeabaseDDL::createSeabaseIndex(
                                                 colInfoArray,
                                                 keyColCount) ;
 
-    if (createEncodedKeysBuffer(encodedKeysBuffer,
-                                colDescs, keyDescs, numSplits, 
+    if (createEncodedKeysBuffer(encodedKeysBuffer/*out*/,
+                                numSplits/*out*/,
+                                colDescs, keyDescs,
+                                nafs->numSaltPartns(), numSplits, NULL,
                                 keyColCount, keyLength, TRUE))
       {
         deallocEHI(ehi);

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1e60a9b8/core/sql/sqlcomp/CmpSeabaseDDLtable.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpSeabaseDDLtable.cpp b/core/sql/sqlcomp/CmpSeabaseDDLtable.cpp
index 3216dd7..0a417e0 100644
--- a/core/sql/sqlcomp/CmpSeabaseDDLtable.cpp
+++ b/core/sql/sqlcomp/CmpSeabaseDDLtable.cpp
@@ -116,14 +116,14 @@ void CmpSeabaseDDL::convertVirtTableColumnInfoToDescStruct(
   column_desc->body.columns_desc.colnumber = colInfo->colNumber;
   column_desc->body.columns_desc.datatype  = colInfo->datatype;
   column_desc->body.columns_desc.length    = colInfo->length;
-  if (!(DFS2REC::isInterval(colInfo->datatype) || DFS2REC::isDateTime(colInfo->datatype)))
+  if (!(DFS2REC::isInterval(colInfo->datatype)))
     column_desc->body.columns_desc.scale     = colInfo->scale;
   else
     column_desc->body.columns_desc.scale = 0;
   column_desc->body.columns_desc.precision = colInfo->precision;
   column_desc->body.columns_desc.datetimestart = (rec_datetime_field) colInfo->dtStart;
   column_desc->body.columns_desc.datetimeend = (rec_datetime_field) colInfo->dtEnd;
-  if (DFS2REC::isDateTime(colInfo->datatype))
+  if (DFS2REC::isDateTime(colInfo->datatype) || DFS2REC::isInterval(colInfo->datatype))
     column_desc->body.columns_desc.datetimefractprec = colInfo->scale;
   else
     column_desc->body.columns_desc.datetimefractprec = 0;
@@ -1255,7 +1255,8 @@ short CmpSeabaseDDL::createSeabaseTable2(
       return -1;
     }
 
-  int numSplits = 0;
+  int numSaltPartns = 0; // # of "_SALT_" values
+  int numSplits = 0;     // # of initial region splits
 
   Lng32 numSaltPartnsFromCQD = 
     CmpCommon::getDefaultNumeric(TRAF_NUM_OF_SALT_PARTNS);
@@ -1339,7 +1340,7 @@ short CmpSeabaseDDL::createSeabaseTable2(
             }
         }
 
-      Lng32 numSaltPartns =
+      numSaltPartns =
         (saltOptions ? saltOptions->getNumPartitions() : numSaltPartnsFromCQD);
       saltExprText += " FOR ";
       sprintf(numSaltPartnsStr,"%d", numSaltPartns);
@@ -1596,8 +1597,13 @@ short CmpSeabaseDDL::createSeabaseTable2(
                                                 colInfoArray,
                                                 numKeys) ;
 
-    if (createEncodedKeysBuffer(encodedKeysBuffer,
-                                colDescs, keyDescs, numSplits, numKeys, 
+    if (createEncodedKeysBuffer(encodedKeysBuffer/*out*/,
+                                numSplits /*out*/,
+                                colDescs, keyDescs,
+                                numSaltPartns,
+                                numSplits,
+                                NULL,
+                                numKeys, 
                                 keyLength, FALSE))
       {
         processReturn();
@@ -6342,10 +6348,32 @@ short CmpSeabaseDDL::getCheckConstraintText(StmtDDLAddConstraintCheck *addCheckN
   return 0;
 }
 
+// nonstatic method, calling two member functions
 short CmpSeabaseDDL::getTextFromMD(
                                    ExeCliInterface * cliInterface,
                                    Int64 textUID,
-                                   Lng32 textType,
+                                   ComTextType textType,
+                                   Lng32 textSubID,
+                                   NAString &outText)
+{
+  short retcode = getTextFromMD(getSystemCatalog(),
+                                cliInterface,
+                                textUID,
+                                textType,
+                                textSubID,
+                                outText);
+
+  if (retcode)
+    processReturn();
+
+  return retcode;
+}
+
+// static version of this method
+short CmpSeabaseDDL::getTextFromMD(const char * catalogName,
+                                   ExeCliInterface * cliInterface,
+                                   Int64 textUID,
+                                   ComTextType textType,
                                    Lng32 textSubID,
                                    NAString &outText)
 {
@@ -6354,8 +6382,8 @@ short CmpSeabaseDDL::getTextFromMD(
   char query[1000];
 
   str_sprintf(query, "select text from %s.\"%s\".%s where text_uid = %Ld and text_type = %d and sub_id = %d for read committed access order by seq_num",
-              getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_TEXT,
-              textUID, textType, textSubID);
+              catalogName, SEABASE_MD_SCHEMA, SEABASE_TEXT,
+              textUID, static_cast<int>(textType), textSubID);
   
   Queue * textQueue = NULL;
   cliRC = cliInterface->fetchAllRows(textQueue, query, 0, FALSE, FALSE, TRUE);
@@ -6363,8 +6391,6 @@ short CmpSeabaseDDL::getTextFromMD(
     {
       cliInterface->retrieveSQLDiagnostics(CmpCommon::diags());
 
-      processReturn();
-
       return -1;
     }
   
@@ -6511,15 +6537,12 @@ void CmpSeabaseDDL::alterSeabaseTableAddCheckConstraint(
     }
   
   // get check text
-  NAString origCheckConstrText;
-  if (getCheckConstraintText(alterAddCheckNode, origCheckConstrText))
+  NAString checkConstrText;
+  if (getCheckConstraintText(alterAddCheckNode, checkConstrText))
     {
       return;
     }
 
-  NAString checkConstrText;
-  ToQuotedString(checkConstrText, origCheckConstrText, FALSE);
-
   if (CmpCommon::getDefault(TRAF_NO_CONSTR_VALIDATION) == DF_OFF)
     {
       // validate data for check constraint.
@@ -6532,7 +6555,7 @@ void CmpSeabaseDDL::alterSeabaseTableAddCheckConstraint(
                   tableName.getCatalogNamePart().getInternalName().data(),
                   tableName.getSchemaNamePart().getInternalName().data(),
                   tableName.getObjectNamePart().getInternalName().data(),
-                  origCheckConstrText.data());
+                  checkConstrText.data());
       
       Lng32 len = 0;
       Int64 rowCount = 0;
@@ -7459,7 +7482,6 @@ void CmpSeabaseDDL::createNativeHbaseTable(
       colFamVec.push_back(nas->data());
     }
 
-  NAText hbaseOptionsStr;
   NAList<HbaseCreateOption*> hbaseCreateOptions;
   NAString hco;
   retcode = setupHbaseOptions(createTableNode->getHbaseOptionsClause(), 
@@ -7607,6 +7629,7 @@ short CmpSeabaseDDL::getSpecialTableInfo
       tableInfo->objOwnerID = objectOwner;
       tableInfo->schemaOwnerID = schemaOwner;
       tableInfo->hbaseCreateOptions = NULL;
+      tableInfo->rowFormat = COM_UNKNOWN_FORMAT_TYPE;
     }
 
   return 0;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1e60a9b8/core/sql/sqlcomp/CmpSeabaseDDLupgrade.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpSeabaseDDLupgrade.cpp b/core/sql/sqlcomp/CmpSeabaseDDLupgrade.cpp
index 940e607..dad219d 100644
--- a/core/sql/sqlcomp/CmpSeabaseDDLupgrade.cpp
+++ b/core/sql/sqlcomp/CmpSeabaseDDLupgrade.cpp
@@ -2097,7 +2097,6 @@ short CmpSeabaseMDupgrade::customizeNewMDv23tov30(CmpDDLwithStatusInfo *mdui,
             NAString hbaseCreateOptions((char*)oi->get(1));
                
             Lng32 numSaltPartns = 0;
-            NAString newHbaseCreateOptions;
                
             // get num salt partns from hbaseCreateOptions.
             // It is stored as:  NUM_SALT_PARTNS=>NNNN
@@ -2114,10 +2113,6 @@ short CmpSeabaseMDupgrade::customizeNewMDv23tov30(CmpDDLwithStatusInfo *mdui,
                    
                 hbaseCreateOptions.remove(idx2, strlen("NUM_SALT_PARTNS=>")+4);
                 hbaseCreateOptions = hbaseCreateOptions.strip();
-                   
-                if (NOT hbaseCreateOptions.isNull())
-                  ToQuotedString(newHbaseCreateOptions, hbaseCreateOptions.data(), 
-                                 FALSE);
               }
                
             str_sprintf(buf, "update %s.\"%s\".%s set num_salt_partns = %d where table_uid = %Ld",
@@ -2139,11 +2134,11 @@ short CmpSeabaseMDupgrade::customizeNewMDv23tov30(CmpDDLwithStatusInfo *mdui,
                 return -1;
               }
                
-            if (NOT newHbaseCreateOptions.isNull())
+            if (NOT hbaseCreateOptions.isNull())
               {
                 if (updateTextTable(&cliInterface, tableUID, 
                                     COM_HBASE_OPTIONS_TEXT, 0,
-                                    newHbaseCreateOptions))
+                                    hbaseCreateOptions))
                   {
                     *CmpCommon::diags() << DgSqlCode(-1423)
                                         << DgString0(SEABASE_TABLES);

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1e60a9b8/core/sql/sqlcomp/CmpSeabaseDDLview.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpSeabaseDDLview.cpp b/core/sql/sqlcomp/CmpSeabaseDDLview.cpp
index f8eb34c..e8f2819 100644
--- a/core/sql/sqlcomp/CmpSeabaseDDLview.cpp
+++ b/core/sql/sqlcomp/CmpSeabaseDDLview.cpp
@@ -726,15 +726,6 @@ void CmpSeabaseDDL::createSeabaseView(
   NAString viewText(STMTHEAP);
   buildViewText(createViewNode, viewText);
 
-  NAString newViewText(STMTHEAP);
-  for (Lng32 i = 0; i < viewText.length(); i++)
-    {
-      if (viewText.data()[i] == '\'')
-	newViewText += "''";
-      else
-	newViewText += viewText.data()[i];
-    }
-
   ElemDDLColDefArray colDefArray(STMTHEAP);
   if (buildViewColInfo(createViewNode, &colDefArray))
     {
@@ -840,7 +831,7 @@ void CmpSeabaseDDL::createSeabaseView(
     }
 
 
-  query = new(STMTHEAP) char[newViewText.length() + 1000];
+  query = new(STMTHEAP) char[1000];
   str_sprintf(query, "upsert into %s.\"%s\".%s values (%Ld, '%s', %d, %d, 0)",
 	      getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_VIEWS,
 	      objUID,
@@ -865,7 +856,7 @@ void CmpSeabaseDDL::createSeabaseView(
       return;
     }
 
-  if (updateTextTable(&cliInterface, objUID, COM_VIEW_TEXT, 0, newViewText))
+  if (updateTextTable(&cliInterface, objUID, COM_VIEW_TEXT, 0, viewText))
     {
       deallocEHI(ehi); 
       processReturn();

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1e60a9b8/core/sql/sqlcomp/DefaultConstants.h
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/DefaultConstants.h b/core/sql/sqlcomp/DefaultConstants.h
index 1ab4072..990fc5d 100644
--- a/core/sql/sqlcomp/DefaultConstants.h
+++ b/core/sql/sqlcomp/DefaultConstants.h
@@ -3754,6 +3754,8 @@ enum DefaultConstants
   UDR_JVM_DEBUG_PORT,
   UDR_JVM_DEBUG_TIMEOUT,
 
+  HBASE_RANGE_PARTITIONING_PARTIAL_COLS,
+
   // 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

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1e60a9b8/core/sql/sqlcomp/nadefaults.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/nadefaults.cpp b/core/sql/sqlcomp/nadefaults.cpp
index 5c786a0..ab55264 100644
--- a/core/sql/sqlcomp/nadefaults.cpp
+++ b/core/sql/sqlcomp/nadefaults.cpp
@@ -1766,6 +1766,7 @@ SDDkwd__(EXE_DIAGNOSTIC_EVENTS,		"OFF"),
 
   DDkwd__(HBASE_RANGE_PARTITIONING,	        "ON"),
   DDkwd__(HBASE_RANGE_PARTITIONING_MC_SPLIT,	"ON"),
+  DDkwd__(HBASE_RANGE_PARTITIONING_PARTIAL_COLS,"ON"),
  DDui___(HBASE_REGION_SERVER_MAX_HEAP_SIZE,     "1024"), // in units of MB
 
   DDkwd__(HBASE_ROWSET_VSBB_OPT,		"ON"),
@@ -6888,6 +6889,11 @@ DefaultToken NADefaults::token(Int32 attrEnum,
         isValid = TRUE;
     break;
 
+    case HBASE_RANGE_PARTITIONING_PARTIAL_COLS:
+      if (tok == DF_OFF || tok == DF_MINIMUM ||
+          tok == DF_MEDIUM || tok == DF_MAXIMUM || tok == DF_ON)
+        isValid = TRUE;
+
     // Nothing needs to be added here for ON/OFF/SYSTEM keywords --
     // instead, add to DEFAULT_ALLOWS_SEPARATE_SYSTEM code in the ctor.
 


[3/4] incubator-trafodion git commit: Fixing review comment issues for TRAFODION-1457.

Posted by db...@apache.org.
Fixing review comment issues for TRAFODION-1457.


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

Branch: refs/heads/master
Commit: 4e9bb0303ba403b95a3106eda1370c6e8f5a8b80
Parents: 1e60a9b
Author: Hans Zeller <ha...@esgyn.com>
Authored: Tue Aug 18 00:49:52 2015 +0000
Committer: Hans Zeller <ha...@esgyn.com>
Committed: Tue Aug 18 00:49:52 2015 +0000

----------------------------------------------------------------------
 core/sql/optimizer/BindItemExpr.cpp | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/4e9bb030/core/sql/optimizer/BindItemExpr.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/BindItemExpr.cpp b/core/sql/optimizer/BindItemExpr.cpp
index 6bdf67c..da39397 100644
--- a/core/sql/optimizer/BindItemExpr.cpp
+++ b/core/sql/optimizer/BindItemExpr.cpp
@@ -10304,17 +10304,17 @@ NABoolean ZZZBinderFunction::isPadWithSpace (ExprValueId& padExpr, CharInfo::Cha
      NABoolean foundSingleQuote = FALSE;
      for (const char *s = padString.data(); *s; s++)
      {
-       i++;  // 0x27 is the single quote character '
-       if ((!foundSingleQuote)&&(*s != 0x27)) // loop through 
+       i++;
+       if ((!foundSingleQuote)&&(*s != '\'')) // loop through 
          continue;  // the prefix _UCS2 or _ISO88591
        else if ((!foundSingleQuote))
        {
         foundSingleQuote = TRUE; // found the leading single quote.
         continue;
        }
-       if ((i == (padString.length())) && (*s == 0x27)) // trailing single quote
+       if ((i == (padString.length())) && (*s == '\'')) // trailing single quote
          continue;
-       if (*s != 0x20) // 0x20 is the single space character ' '
+       if (*s != ' ')
          return FALSE;
      }
      return foundSingleQuote;


[2/4] incubator-trafodion git commit: TRAFODION-1457 Issues related to decoding HBase region keys and TEXT table

Posted by db...@apache.org.
TRAFODION-1457 Issues related to decoding HBase region keys and TEXT table


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

Branch: refs/heads/master
Commit: 1e60a9b8cd487698c44659663ad09ddc455c3708
Parents: d35f77e
Author: Hans Zeller <ha...@esgyn.com>
Authored: Mon Aug 17 21:43:31 2015 +0000
Committer: Hans Zeller <ha...@esgyn.com>
Committed: Mon Aug 17 21:43:31 2015 +0000

----------------------------------------------------------------------
 core/sql/bin/SqlciErrors.txt                    |   9 +-
 core/sql/common/CharType.cpp                    | 266 ++++++-------------
 core/sql/common/CharType.h                      |   7 +
 core/sql/common/ComSmallDefs.h                  |   7 +-
 core/sql/common/IntervalType.cpp                |   2 +-
 core/sql/common/NAType.h                        |   7 +
 core/sql/common/csconvert.cpp                   |  21 ++
 core/sql/common/csconvert.h                     |  14 +-
 core/sql/optimizer/BindItemExpr.cpp             |  14 +-
 core/sql/optimizer/EncodedKeyValue.cpp          |   1 +
 core/sql/optimizer/ItemCache.cpp                |   1 -
 core/sql/optimizer/ItemColRef.h                 |  10 -
 core/sql/optimizer/ItemExpr.cpp                 | 108 +-------
 core/sql/optimizer/NATable.cpp                  | 227 +++++++++++-----
 core/sql/optimizer/NATable.h                    |   1 -
 core/sql/optimizer/QRDescGenerator.cpp          |   4 +-
 core/sql/parser/ElemDDLNode.cpp                 |   2 +-
 core/sql/parser/StmtDDLCreate.cpp               |  10 +-
 core/sql/regress/charsets/DIFF002.KNOWN.SB      |  14 -
 core/sql/regress/charsets/DIFF002.KNOWN.SB.OS   |  14 -
 core/sql/regress/charsets/EXPECTED002           | 260 ++++++++++++++++++
 core/sql/regress/charsets/EXPECTED002.SB        | 254 ------------------
 core/sql/regress/charsets/EXPECTED003           | 217 +++++++++++++++
 core/sql/regress/charsets/EXPECTED003.SB        | 217 ---------------
 core/sql/regress/charsets/EXPECTED012           | 205 ++++++++++++++
 core/sql/regress/charsets/EXPECTED012.SB        | 205 --------------
 core/sql/regress/compGeneral/DIFF042.KNOWN.SB   |  38 +--
 core/sql/regress/compGeneral/EXPECTED042        | 105 ++++----
 core/sql/regress/compGeneral/EXPECTEDTOK2       |  46 ++++
 core/sql/regress/compGeneral/EXPECTEDTOK2.LINUX |  46 ----
 core/sql/regress/compGeneral/TEST015            |  10 +-
 core/sql/regress/compGeneral/TEST042            |  16 +-
 core/sql/regress/core/TEST056                   |  10 +-
 core/sql/sqlcomp/CmpDescribe.cpp                |   2 +-
 core/sql/sqlcomp/CmpSeabaseDDL.h                |  22 +-
 core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp        | 216 +++++++++------
 core/sql/sqlcomp/CmpSeabaseDDLindex.cpp         |  10 +-
 core/sql/sqlcomp/CmpSeabaseDDLtable.cpp         |  59 ++--
 core/sql/sqlcomp/CmpSeabaseDDLupgrade.cpp       |   9 +-
 core/sql/sqlcomp/CmpSeabaseDDLview.cpp          |  13 +-
 core/sql/sqlcomp/DefaultConstants.h             |   2 +
 core/sql/sqlcomp/nadefaults.cpp                 |   6 +
 42 files changed, 1349 insertions(+), 1358 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1e60a9b8/core/sql/bin/SqlciErrors.txt
----------------------------------------------------------------------
diff --git a/core/sql/bin/SqlciErrors.txt b/core/sql/bin/SqlciErrors.txt
index f90cfa6..68ed8a0 100644
--- a/core/sql/bin/SqlciErrors.txt
+++ b/core/sql/bin/SqlciErrors.txt
@@ -205,6 +205,13 @@
 1203 ZZZZZ 99999 UUUUUUUU UUUUU UUUUUUU HBASE_OPTIONS clause in CREATE statement is longer than 6000 characters. Object $0~string0 was not created.
 1204 ZZZZZ 99999 UUUUUUUU UUUUU UUUUUUU Unsupported Hive datatype $0~string0.
 1205 ZZZZZ 99999 UUUUUUUU UUUUU UUUUUUU Hive feature $0~string0 is not supported.
+1206 ZZZZZ 99999 UUUUUUUU UUUUU UUUUUUU SALT AND SPLIT BY clauses are not allowed together.
+1207 ZZZZZ 99999 UUUUUUUU UUUUU UUUUUUU Text to be inserted into the TEXT metadata table contains too many quotes.
+1208 ZZZZZ 99999 UUUUUUUU UUUUU UUUUUUU The SPLIT BY clause is not supported for indexes.
+1209 ZZZZZ 99999 UUUUUUUU UUUUU UUUUUUU The SPLIT BY clause has more columns than the table has key columns ($0~Int0).
+1210 ZZZZZ 99999 UUUUUUUU UUUUU UUUUUUU Column $0~String0 is not allowed at position $1~Int0 in the SPLIT BY clause, because SPLIT BY must specify a prefix of the clustering key columns and the next clustering key column is $2~String1.
+1211 ZZZZZ 99999 UUUUUUUU UUUUU UUUUUUU The column values of the SPLIT BY first key in position $0~Int0 (one-based) are not greater (for ascending columns) or less (for descending columns) than its predecessor.
+1212 ZZZZZ 99999 UUUUUUUU UUUUU UUUUUUU An HBase region start key provided only part of the value for Trafodion key column $0~Int0. This could in some unusual situations cause errors.
 1220 ZZZZZ 99999 BEGINNER MAJOR DBADMIN Code must contain two non-blank characters.
 1221 ZZZZZ 99999 BEGINNER MAJOR DBADMIN Only system components may contain system operations.
 1222 ZZZZZ 99999 BEGINNER MAJOR DBADMIN Command not supported when authorization is not enabled.
@@ -843,7 +850,7 @@ $1~String1 --------------------------------
 3100 42000 99999 BEGINNER MAJOR DBADMIN Duplicate DSLACK clauses were specified.
 3101 42000 99999 BEGINNER MAJOR DBADMIN Duplicate ISLACK clauses were specified.
 3102 42000 99999 BEGINNER MAJOR DBADMIN Duplicate PARALLEL EXECUTION clauses were specified.
-3103 42000 99999 BEGINNER MAJOR DBADMIN Duplicate PARTITION clauses were specified.
+3103 42000 99999 BEGINNER MAJOR DBADMIN Duplicate $0~string0 clauses were specified.
 3104 42000 99999 BEGINNER MAJOR DBADMIN Only the ADD option is allowed in a PARTITION clause in a CREATE TABLE statement.
 3105 0A000 99999 BEGINNER MAJOR DBADMIN Only range, hash, hash2 and system partitioning are currently supported.
 3106 42000 99999 BEGINNER MAJOR DBADMIN Duplicate PRIMARY KEY clauses were specified.

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1e60a9b8/core/sql/common/CharType.cpp
----------------------------------------------------------------------
diff --git a/core/sql/common/CharType.cpp b/core/sql/common/CharType.cpp
index 4811884..40d258d 100644
--- a/core/sql/common/CharType.cpp
+++ b/core/sql/common/CharType.cpp
@@ -1140,46 +1140,74 @@ NAString* CharType::getKey(CollHeap* h) const
   return new (h) NAString(getTypeSQLname(), h);
 }
 
-
-// -- Min and max permissible values for a CHAR string
-// ## These too will need to be changed to handle different collating sequences
-// ## and character sets and multibyte chars and such ...
-
-void SQLChar::minRepresentableValue(void* bufPtr, Lng32* bufLen,
-				    NAString ** stringLiteral,
-				    CollHeap* h) const
+void CharType::minMaxRepresentableValue(void* bufPtr,
+                                        Lng32* bufLen,
+                                        NAString ** stringLiteral,
+                                        NABoolean isMax,
+                                        CollHeap* h) const
 {
-// 2/19/98: checked for unicode. No need to add Unicode case.
-  ComASSERT(*bufLen >= getNominalSize());
+  Int32 i;
+  Int32 vcLenHdrSize = getVarLenHdrSize();
+  char *valPtr       = reinterpret_cast<char *>(bufPtr) + vcLenHdrSize;
+  Int32 valBufLen    = getNominalSize();
+  Int32 valLen       = valBufLen; // output length of min/max value
+  char minmax_char;
+  wchar_t minmax_wchar;
 
-  Lng32 i = 0;
-  Lng32 bufCnt = *bufLen;
-  char min_char;
-  wchar_t min_wchar;
+  ComASSERT(*bufLen >= vcLenHdrSize + valBufLen);
 
-  if (getCharSet() == CharInfo::ISO88591 ||
-      getCharSet() == CharInfo::UTF8 ||
-      (getCharSet() == CharInfo::SJIS && getEncodingCharSet() == CharInfo::SJIS))
-  {
-      min_char = (char)getMinSingleCharacterValue();
-      for ( ;i < bufCnt; i++)
-         ((char *)bufPtr)[i] = min_char;
-  }
-  else if (getCharSet() == CharInfo::UCS2 ||
-           getBytesPerChar() == SQL_DBCHAR_SIZE /* same as SQL_SJIS_CHAR_MAXSIZE - so be careful */)
+  switch (getCharSet())
   {
-      min_wchar = (wchar_t)getMinSingleCharacterValue();
+  case CharInfo::ISO88591:
+  case CharInfo::SJIS:
+    if (isMax)
+      minmax_char = (char)getMaxSingleCharacterValue();
+    else
+      minmax_char = (char)getMinSingleCharacterValue();
+    memset(valPtr, minmax_char, valBufLen);
+    break;
+
+  case CharInfo::UTF8:
+    if (isMax)
+      valLen = fillWithMaxUTF8Chars(valPtr,
+                                    valBufLen,
+                                    getPrecisionOrMaxNumChars());
+    else
+      valLen = fillWithMinUTF8Chars(valPtr,
+                                    valBufLen,
+                                    getPrecisionOrMaxNumChars());
+    break;
+
+  case CharInfo::UCS2:
+    if (isMax)
+      minmax_wchar = (wchar_t)getMaxSingleCharacterValue();
+    else
+      minmax_wchar = (wchar_t)getMinSingleCharacterValue();
 #ifdef NA_LITTLE_ENDIAN
-      wc_swap_bytes(&min_wchar, 1);
+    wc_swap_bytes(&minmax_wchar, 1);
 #endif // NA_LITTLE_ENDIAN
-      bufCnt = bufCnt / SQL_DBCHAR_SIZE;
-      for ( ;i < bufCnt; i++)
-         ((wchar_t *)bufPtr)[i] = min_wchar;
+    valBufLen /= SQL_DBCHAR_SIZE;
+    for (i=0 ;i < valBufLen; i++)
+      ((wchar_t *)valPtr)[i] = minmax_wchar;
+    break;
 
-      i = i * SQL_DBCHAR_SIZE; // For proper NAString construction
+  default:
+    ComASSERT(FALSE); //LCOV_EXCL_LINE :rfi -- no other CharSets are supported yet.
   }
+
+  // copy the output value length into the varchar len header
+  if (vcLenHdrSize == sizeof(short))
+    {
+      short vc_len = (short) valLen;
+      str_cpy_all((char *)bufPtr, (char *)&vc_len, vcLenHdrSize);
+    }
+  else if (vcLenHdrSize == sizeof(Int32))
+    {
+      Int32 vc_len = (Int32) valLen;
+      str_cpy_all((char *)bufPtr, (char *)&vc_len, vcLenHdrSize);
+    }
   else
-      ComASSERT(FALSE); //LCOV_EXCL_LINE :rfi -- no other CharSets are supported yet.
+    ComASSERT(vcLenHdrSize == 0);
 
   if (stringLiteral)
     {
@@ -1189,51 +1217,22 @@ void SQLChar::minRepresentableValue(void* bufPtr, Lng32* bufLen,
     }
 }
 
-void SQLChar::maxRepresentableValue(void* bufPtr, Lng32* bufLen,
+// -- Min and max permissible values for a CHAR string
+// ## These too will need to be changed to handle different collating sequences
+// ## and character sets and multibyte chars and such ...
+
+void SQLChar::minRepresentableValue(void* bufPtr, Lng32* bufLen,
 				    NAString ** stringLiteral,
 				    CollHeap* h) const
 {
-// 2/19/98: checked for unicode
-  ComASSERT(*bufLen >= getNominalSize());
-
-  Lng32 i = 0;
-  Lng32 bufCnt = *bufLen;
-  char max_char;
-  wchar_t max_wchar;
-
-  if (getCharSet() == CharInfo::ISO88591 ||
-      (getCharSet() == CharInfo::SJIS && getEncodingCharSet() == CharInfo::SJIS))
-  {
-      max_char = (char)getMaxSingleCharacterValue();
-      for ( ;i < bufCnt; i++)
-         ((char *)bufPtr)[i] = max_char;
-  }
-  else if (getCharSet() == CharInfo::UTF8)
-  {
-    fillWithMaxUTF8Chars((char *)bufPtr,bufCnt,getPrecisionOrMaxNumChars());
-  }
-  else if (getCharSet() == CharInfo::UCS2 ||
-           getBytesPerChar() == SQL_DBCHAR_SIZE /* same as SQL_SJIS_CHAR_MAXSIZE - so be careful */)
-  {
-      max_wchar = (wchar_t)getMaxSingleCharacterValue();
-#ifdef NA_LITTLE_ENDIAN
-      wc_swap_bytes(&max_wchar, 1);
-#endif // NA_LITTLE_ENDIAN
-      bufCnt = bufCnt / SQL_DBCHAR_SIZE;
-      for ( ;i < bufCnt; i++)
-         ((wchar_t *)bufPtr)[i] = max_wchar;
-
-      i = i * SQL_DBCHAR_SIZE; // For proper NAString construction
-  }
-  else
-      ComASSERT(FALSE); //LCOV_EXCL_LINE :rfi -- no other CharSets are supported yet.
+  minMaxRepresentableValue(bufPtr, bufLen, stringLiteral, FALSE, h);
+}
 
-  if (stringLiteral)
-    {
-      NABoolean isNull = FALSE;
-      NABoolean res = createSQLLiteral((const char *) bufPtr, *stringLiteral, isNull, h);
-      assert(res);
-    }
+void SQLChar::maxRepresentableValue(void* bufPtr, Lng32* bufLen,
+				    NAString ** stringLiteral,
+				    CollHeap* h) const
+{
+  minMaxRepresentableValue(bufPtr, bufLen, stringLiteral, TRUE, h);
 }
 
 //  encoding of the max char value
@@ -1281,130 +1280,15 @@ void SQLVarChar::minRepresentableValue(void* bufPtr, Lng32* bufLen,
 				       NAString ** stringLiteral,
 				       CollHeap* h) const
 {
-  ComASSERT(*bufLen >= getNominalSize() + getVarLenHdrSize());
-
-  // copy the max length into the varchar len header
-  if (getVarLenHdrSize() == sizeof(short))
-    {
-      short vc_len = (short)getNominalSize();
-      str_cpy_all((char *)bufPtr, (char *)&vc_len, getVarLenHdrSize());
-    }
-  else  if (getVarLenHdrSize() == sizeof(Lng32))
-    {
-      Lng32 vc_len = (Lng32)getNominalSize();
-      str_cpy_all((char *)bufPtr, (char *)&vc_len, getVarLenHdrSize());
-    }
-  else
-    ComASSERT(0);
-
-  Lng32 i = getVarLenHdrSize();
-  Lng32 bufCnt = getVarLenHdrSize() + getNominalSize();
-  char min_char;
-  wchar_t min_wchar;
-
-  switch (getBytesPerChar())
-  {
-    case 4: // sames SQL_UTF8_CHAR_MAXSIZE
-      if (getCharSet() != CharInfo::UTF8)
-        ComASSERT(FALSE); //LCOV_EXCL_LINE :rfi -- no CharSet other than UTF8 has 4-byte chars
-      // fall through
-    case 1:
-      min_char = (char)getMinSingleCharacterValue();
-      for ( ;i < bufCnt; i++)
-         ((char *)bufPtr)[i] = min_char;
-      break;
-    case SQL_DBCHAR_SIZE: // same as BYTES_PER_NAWCHAR and SQL_SJIS_CHAR_MAXSIZE
-#if 0 /* SJIS NOT SUPPORTED YET */
-      if (getCharSet() == CharInfo::SJIS &&
-          getEncodingCharSet() == CharInfo::SJIS)
-      {
-        min_char = (char)getMinSingleCharacterValue();
-        for ( ;i < bufCnt; i++)
-           ((char *)bufPtr)[i] = min_char;
-        break;
-      }
-#endif
-      // else getCharSet() == CharInfo::UCS2
-      min_wchar = (wchar_t)getMinSingleCharacterValue();
-#ifdef NA_LITTLE_ENDIAN
-      wc_swap_bytes(&min_wchar, 1);
-#endif // NA_LITTLE_ENDIAN
-      bufCnt = bufCnt / SQL_DBCHAR_SIZE;
-      for (i = i / SQL_DBCHAR_SIZE; i < bufCnt; i++)
-         ((wchar_t *)bufPtr)[i] = min_wchar;
-
-      i = i * SQL_DBCHAR_SIZE; // For proper NAString construction
-      break;
-    default:
-      ComASSERT(FALSE); //LCOV_EXCL_LINE :rfi  -- no values other than 1,2, & 4 are possible
-  }
-  if (stringLiteral)
-    {
-      NABoolean isNull = FALSE;
-      NABoolean res = createSQLLiteral((const char *) bufPtr, *stringLiteral, isNull, h);
-      assert(res);
-    }
-} // minRepresentableValue()
+  minMaxRepresentableValue(bufPtr, bufLen, stringLiteral, FALSE, h);
+}
 
 void SQLVarChar::maxRepresentableValue(void* bufPtr, Lng32* bufLen,
 				       NAString ** stringLiteral,
 				       CollHeap* h) const
 {
-  ComASSERT(*bufLen >= getNominalSize() + getVarLenHdrSize());
-
-  // copy the max length into the varchar len header
-  if (getVarLenHdrSize() == sizeof(short))
-    {
-      short vc_len = (short)getNominalSize();
-      str_cpy_all((char *)bufPtr, (char *)&vc_len, getVarLenHdrSize());
-    }
-  else  if (getVarLenHdrSize() == sizeof(Lng32))
-    {
-      Lng32 vc_len = (Lng32)getNominalSize();
-      str_cpy_all((char *)bufPtr, (char *)&vc_len, getVarLenHdrSize());
-    }
-  else
-    ComASSERT(0);
-
-  Lng32 i = getVarLenHdrSize();
-  Lng32 bufCnt = getVarLenHdrSize() + getNominalSize();
-  char max_char;
-  wchar_t max_wchar;
-
-  switch (getBytesPerChar())
-  {
-    case 4: // sames SQL_UTF8_CHAR_MAXSIZE
-      ComASSERT(getCharSet() == CharInfo::UTF8);
-      fillWithMaxUTF8Chars(&((char *)bufPtr)[i],bufCnt-i,getPrecisionOrMaxNumChars());
-      break;
-    case 1:
-      max_char = (char)getMaxSingleCharacterValue();
-      for ( ;i < bufCnt; i++)
-         ((char *)bufPtr)[i] = max_char;
-      break;
-    case SQL_DBCHAR_SIZE: // same as BYTES_PER_NAWCHAR and SQL_SJIS_CHAR_MAXSIZE
-      {
-        max_wchar = (wchar_t)getMaxSingleCharacterValue();
-#ifdef NA_LITTLE_ENDIAN
-        wc_swap_bytes(&max_wchar, 1);
-#endif // NA_LITTLE_ENDIAN
-        wchar_t *wBufPtr = (wchar_t *) (((char *) bufPtr) + getVarLenHdrSize());
-        Int32 wBufCnt = getNominalSize() / SQL_DBCHAR_SIZE;
-        for (i=0; i < wBufCnt; i++)
-          wBufPtr[i] = max_wchar;
-
-        break;
-      }
-    default:
-      ComASSERT(FALSE); //LCOV_EXCL_LINE :rfi -- No values other than 1,2, & 4 are possible.
-  }
-  if (stringLiteral)
-    {
-      NABoolean isNull = FALSE;
-      NABoolean res = createSQLLiteral((const char *) bufPtr, *stringLiteral, isNull, h);
-      assert(res);
-    }
-} // maxRepresentableValue()
+  minMaxRepresentableValue(bufPtr, bufLen, stringLiteral, TRUE, h);
+}
 
 //LCOV_EXCL_START : cnu -- As of 8/30/2011, needed to link successfully, but not actually called.
 double SQLVarChar::encode (void *bufPtr) const

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1e60a9b8/core/sql/common/CharType.h
----------------------------------------------------------------------
diff --git a/core/sql/common/CharType.h b/core/sql/common/CharType.h
index 898eb90..e8c0e9e 100644
--- a/core/sql/common/CharType.h
+++ b/core/sql/common/CharType.h
@@ -339,6 +339,13 @@ virtual NABoolean createSQLLiteral(const char * buf,
                                    NABoolean &isNull,
                                    CollHeap *h) const;
 
+protected:
+void minMaxRepresentableValue(void* bufPtr,
+                              Lng32* bufLen,
+                              NAString ** stringLiteral,
+                              NABoolean isMax,
+                              CollHeap* h) const;
+
 private:
 
 void NONVIRT_METHOD_PLACEHOLDER_1();	// slot for reuse, or delete it!##

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1e60a9b8/core/sql/common/ComSmallDefs.h
----------------------------------------------------------------------
diff --git a/core/sql/common/ComSmallDefs.h b/core/sql/common/ComSmallDefs.h
index 203d31d..a4d8522 100644
--- a/core/sql/common/ComSmallDefs.h
+++ b/core/sql/common/ComSmallDefs.h
@@ -615,13 +615,16 @@ enum ComParamDefaultClass { COM_CURRENT_PARAM_DEFAULT        = COM_CURRENT_DEFAU
 #define COM_ALWAYS_COMPUTE_COMPUTED_PARAM_DEFAULT_LIT "AC"
 #define COM_ALWAYS_DEFAULT_COMPUTED_PARAM_DEFAULT_LIT "AD"
 
-// represent the kind of string value stored in TEXT table
+// Represents the kind of string value stored in TEXT table.  Note
+// that changing existing values will require an UPGRADE of the
+// metadata.
 enum ComTextType {COM_VIEW_TEXT = 0,
                   COM_CHECK_CONSTR_TEXT = 1,
                   COM_HBASE_OPTIONS_TEXT = 2,
                   COM_TABLE_COMMENT_TEXT = 3,
                   COM_COMPUTED_COL_TEXT = 4,
-                  COM_HBASE_COL_FAMILY_TEXT = 5
+                  COM_HBASE_COL_FAMILY_TEXT = 5,
+                  COM_HBASE_SPLIT_TEXT = 6
 };
 
 enum ComColumnDirection { COM_UNKNOWN_DIRECTION

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1e60a9b8/core/sql/common/IntervalType.cpp
----------------------------------------------------------------------
diff --git a/core/sql/common/IntervalType.cpp b/core/sql/common/IntervalType.cpp
index 8524182..e6b8250 100644
--- a/core/sql/common/IntervalType.cpp
+++ b/core/sql/common/IntervalType.cpp
@@ -619,7 +619,7 @@ NABoolean IntervalType::createSQLLiteral(const char * buf,
              getNominalSize(),
              getFSDatatype(),
              getPrecision(),
-             getScale(),
+             getFractionPrecision(),
              numVal,
              NUMVAL_LEN,
              REC_BYTE_V_ASCII,

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1e60a9b8/core/sql/common/NAType.h
----------------------------------------------------------------------
diff --git a/core/sql/common/NAType.h b/core/sql/common/NAType.h
index ddf6fca..ea4c64d 100644
--- a/core/sql/common/NAType.h
+++ b/core/sql/common/NAType.h
@@ -322,6 +322,13 @@ public:
   virtual void maxRepresentableValue(void*, Lng32*,
 				     NAString ** stringLiteral = NULL,
 				     CollHeap * h=0) const;
+  inline void minMaxRepresentableValue(void* buf,
+                                       Lng32* bufLen,
+                                       NABoolean isMax,
+                                       NAString ** stringLiteral = NULL,
+                                       CollHeap * h=0) const
+  { if (isMax) maxRepresentableValue(buf, bufLen, stringLiteral, h);
+    else       minRepresentableValue(buf, bufLen, stringLiteral, h); }
 
   virtual double getMinValue() const { return 0; };
   virtual double getMaxValue() const { return 0; };

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1e60a9b8/core/sql/common/csconvert.cpp
----------------------------------------------------------------------
diff --git a/core/sql/common/csconvert.cpp b/core/sql/common/csconvert.cpp
index e818e12..ffc5370 100644
--- a/core/sql/common/csconvert.cpp
+++ b/core/sql/common/csconvert.cpp
@@ -1181,6 +1181,27 @@ int lightValidateUTF8StrAndPad(char *bufr,
 }
 #endif /* Not currently called anywhere.*/
 
+int fillWithMinUTF8Chars(char *bufr,
+                         int in_len,
+                         int max_chars)
+{
+  int i;
+
+  if (max_chars <= 0)
+    max_chars = in_len;
+
+  // fill with minimum characters (NUL), up to the
+  // limit of characters
+  memset(bufr, 0, max_chars);
+
+  // fill up the remainder with blanks, which is the
+  // convention for UTF-8 strings with a character limit
+  if (in_len > max_chars)
+    memset(&bufr[max_chars], ' ', in_len-max_chars);
+
+  return max_chars;
+}
+
 int fillWithMaxUTF8Chars(char *bufr,
                          int in_len,
                          int max_chars)

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1e60a9b8/core/sql/common/csconvert.h
----------------------------------------------------------------------
diff --git a/core/sql/common/csconvert.h b/core/sql/common/csconvert.h
index ae42698..56c9603 100644
--- a/core/sql/common/csconvert.h
+++ b/core/sql/common/csconvert.h
@@ -258,15 +258,25 @@ int lightValidateUTF8StrAndPad(char *bufr,
                                int max_chars = 0,
                                int ignore_trailing_blanks = 1);
 
-/* A method to create the maximum valid UTF-8 character
-   string that fits into a given buffer. Used to form high keys.
+/* A method to create the minimum/maximum valid UTF-8 character
+   string that fits into a given buffer. Used to form low/high keys.
    If max_chars is > 0, generates at most max_chars and pads
    the remaining bytes with blanks. Returns the space occupied
    by actual characters, not padding (same as in_len if max_chars == 0).
 */
+int fillWithMinUTF8Chars(char *bufr,
+                         int in_len, // in bytes
+                         int max_chars);
 int fillWithMaxUTF8Chars(char *bufr,
                          int in_len, // in bytes
                          int max_chars);
+inline int fillWithMinMaxUTF8Chars(char *bufr,
+                                   int in_len, // in bytes
+                                   int max_chars,
+                                   int is_max)
+{ if (is_max) return fillWithMaxUTF8Chars(bufr, in_len, max_chars);
+  else        return fillWithMinUTF8Chars(bufr, in_len, max_chars); }
+                                   
 
 /* A method to find the beginning of a UTF8 char that is at the end off
    a buffer.

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1e60a9b8/core/sql/optimizer/BindItemExpr.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/BindItemExpr.cpp b/core/sql/optimizer/BindItemExpr.cpp
index 32a0edf..6bdf67c 100644
--- a/core/sql/optimizer/BindItemExpr.cpp
+++ b/core/sql/optimizer/BindItemExpr.cpp
@@ -10298,23 +10298,23 @@ NABoolean ZZZBinderFunction::isPadWithSpace (ExprValueId& padExpr, CharInfo::Cha
   if ((padExpr->castToItemExpr()->getOperatorType() == ITM_CONSTANT) &&
       (!((ConstValue *)padExpr->castToItemExpr())->getText().isNull()))
   {
-     NAWString padString(
-       ((ConstValue *)padExpr->castToItemExpr())->getConstWStr());
+     NAString padString(
+       ((ConstValue *)padExpr->castToItemExpr())->getConstStr(FALSE));
      Int32 i = 0;
      NABoolean foundSingleQuote = FALSE;
-     for (const NAWchar *s = padString.data(); *s; s++)
+     for (const char *s = padString.data(); *s; s++)
      {
-       i++;  // 0x0027 is the single quote character '
-       if ((!foundSingleQuote)&&(*s != 0x0027)) // loop through 
+       i++;  // 0x27 is the single quote character '
+       if ((!foundSingleQuote)&&(*s != 0x27)) // loop through 
          continue;  // the prefix _UCS2 or _ISO88591
        else if ((!foundSingleQuote))
        {
         foundSingleQuote = TRUE; // found the leading single quote.
         continue;
        }
-       if ((i == (padString.length())) && (*s == 0x0027)) // trailing single quote
+       if ((i == (padString.length())) && (*s == 0x27)) // trailing single quote
          continue;
-       if (*s != 0x0020) // 0x0020 is the single space character ' '
+       if (*s != 0x20) // 0x20 is the single space character ' '
          return FALSE;
      }
      return foundSingleQuote;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1e60a9b8/core/sql/optimizer/EncodedKeyValue.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/EncodedKeyValue.cpp b/core/sql/optimizer/EncodedKeyValue.cpp
index b98659e..5216e0f 100644
--- a/core/sql/optimizer/EncodedKeyValue.cpp
+++ b/core/sql/optimizer/EncodedKeyValue.cpp
@@ -390,6 +390,7 @@ short encodeKeyValues(desc_struct   * column_descs,
 
   atp_struct * workAtp = keyEncodeExpr->getWorkAtp();
   workAtp->getTupp(keyAtpIndex).setDataPointer(encodedKeyBuffer);
+  workAtp->setDiagsArea(diagsArea);
   
   if (keyEncodeExpr->getExpr()->eval(workAtp, 0, space) == ex_expr::EXPR_ERROR)
     error = -1;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1e60a9b8/core/sql/optimizer/ItemCache.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/ItemCache.cpp b/core/sql/optimizer/ItemCache.cpp
index 80426bc..9bdd830 100644
--- a/core/sql/optimizer/ItemCache.cpp
+++ b/core/sql/optimizer/ItemCache.cpp
@@ -645,7 +645,6 @@ Lng32 ConstValue::getSize() const
 {
   return (Lng32)(sizeof(*this) + getStorageSize() + 
     (text_ ? text_->length() : 0) +
-    (wtext_ ? wtext_->length() : 0) + 
     (locale_strval ? locale_strval->length() : 0) +
     (locale_wstrval ? locale_wstrval->length() : 0));
 }

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1e60a9b8/core/sql/optimizer/ItemColRef.h
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/ItemColRef.h b/core/sql/optimizer/ItemColRef.h
index e4d3ddd..0382f1a 100644
--- a/core/sql/optimizer/ItemColRef.h
+++ b/core/sql/optimizer/ItemColRef.h
@@ -448,9 +448,6 @@ public:
   // has been transformed (i.e., all \0 chars become "\0").
   NAString getConstStr(NABoolean transformNeeded = TRUE) const;
     
-  NAWString getConstWStr();
-  // returns the Unicode-encoded string form of column default values
-    
   short isNull() const			 { return isNull_ ? -1 : 0; }
   NABoolean isNullWasDefaultSpec() const { return isNull_==IS_NULL_WAS_DEFAULT;}
   void setWasDefaultSpec()		 { if (isNull_)
@@ -598,9 +595,6 @@ private:
             enum CharInfo::CharSet strLitPrefixCharSet = CharInfo::UnknownCharSet
          );
 
-   void init_wtext_field(enum CharInfo::CharSet strLitPrefixCharSet
-                         = CharInfo::UnknownCharSet);
-
 private:
 
   // this indicates whether the constant is a NULL constant
@@ -626,10 +620,6 @@ private:
   // code that doesn't always store valid literals.
   NABoolean textIsValidatedSQLLiteralInUTF8_;
 
-  // wtext_ is used to hold and return (via getConstWStr())
-  // a column default's string value.
-  NAWString *wtext_;  
-
   NABoolean rebindNeeded_; // TRUE if the string const value is originally
                            // set with an unknown charset value.
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1e60a9b8/core/sql/optimizer/ItemExpr.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/ItemExpr.cpp b/core/sql/optimizer/ItemExpr.cpp
index cf2c477..8cb182f 100644
--- a/core/sql/optimizer/ItemExpr.cpp
+++ b/core/sql/optimizer/ItemExpr.cpp
@@ -2289,6 +2289,10 @@ void ItemExpr::computeKwdAndFlags( NAString &kwd,
     else
       kwd = getText();
   }
+  else if (operatorType == ITM_NAMED_TYPE_TO_ITEM)
+  {
+    kwd = ToAnsiIdentifier(((NamedTypeToItem *)this)->getText());
+  }
   else if (( operatorType == ITM_CACHE_PARAM) &&
            (form == QUERY_FORMAT) )
     ((ConstantParameter *)this)->getConstVal()->unparse(kwd, phase, QUERY_FORMAT, tabId);
@@ -9737,7 +9741,7 @@ ConstValue::ConstValue()
      , storageSize_(0)
      , text_(new (CmpCommon::statementHeap()) NAString("NULL", CmpCommon::statementHeap()))
      , textIsValidatedSQLLiteralInUTF8_(FALSE)
-     , wtext_(0), isSystemSupplied_(FALSE)
+     , isSystemSupplied_(FALSE)
      , locale_strval(0)
      , locale_wstrval(0)
      , isStrLitWithCharSetPrefix_(FALSE)
@@ -9751,7 +9755,6 @@ ConstValue::ConstValue(Lng32 intval, NAMemory * outHeap)
            : ItemExpr(ITM_CONSTANT)
            , isNull_(IS_NOT_NULL)
            , textIsValidatedSQLLiteralInUTF8_(FALSE)
-           , wtext_(0)
            , type_(new (CmpCommon::statementHeap()) SQLInt(TRUE, FALSE))
 	   , isSystemSupplied_(FALSE)
            , locale_strval(0)
@@ -9778,7 +9781,7 @@ ConstValue::ConstValue(const NAString & strval,
              enum CharInfo::Collation collation,
              enum CharInfo::Coercibility coercibility,
              NAMemory * outHeap)
-: ItemExpr(ITM_CONSTANT), isNull_(IS_NOT_NULL), wtext_(0),
+: ItemExpr(ITM_CONSTANT), isNull_(IS_NOT_NULL),
   textIsValidatedSQLLiteralInUTF8_(FALSE), isStrLitWithCharSetPrefix_(FALSE),
   isSystemSupplied_(FALSE), locale_wstrval(0), rebindNeeded_(FALSE)
 {
@@ -9876,7 +9879,6 @@ ConstValue::ConstValue(const NAWString& wstrval,
    isSystemSupplied_(FALSE),
    value_(0),
    text_(0),
-   wtext_(0),
    locale_strval(0),
    locale_wstrval(0),
    isStrLitWithCharSetPrefix_(FALSE),
@@ -9951,8 +9953,6 @@ void ConstValue::initCharConstValue(const NAWString& strval,
 	    NAString((char*)strval.data(), storageSize_,
 	     outHeap);
   textIsValidatedSQLLiteralInUTF8_ = FALSE;
-
-  init_wtext_field(strLitPrefixCharSet);
 }
 
 
@@ -9964,7 +9964,6 @@ ConstValue::ConstValue(NAString strval, NAWString wstrval,
    value_(0),
    text_(0),
    textIsValidatedSQLLiteralInUTF8_(FALSE),
-   wtext_(0),
    isSystemSupplied_(FALSE),
    isStrLitWithCharSetPrefix_(FALSE),
    rebindNeeded_(FALSE)
@@ -10066,7 +10065,6 @@ ConstValue::ConstValue(const NAType * type, void * value, Lng32 value_len,
   : ItemExpr(ITM_CONSTANT)
   , isNull_(IS_NOT_NULL)
   , type_(type)
-  , wtext_(0)
   , isSystemSupplied_(FALSE)
   , locale_strval(0)
   , locale_wstrval(0)
@@ -10128,7 +10126,6 @@ ConstValue::ConstValue(const NAType * type, void * value, Lng32 value_len,
   : ItemExpr(ITM_CONSTANT)
   , isNull_(isNull)
   , type_(type)
-  , wtext_(0)
   , isSystemSupplied_(FALSE)
   , locale_strval(0)
   , locale_wstrval(0)
@@ -10176,7 +10173,6 @@ ConstValue::ConstValue(const NAType * type,
 		       const NABoolean includeNull,
                        NAMemory * outHeap)
 : ItemExpr(ITM_CONSTANT)
-, wtext_(0)
 , isNull_(IsNullEnum(type->supportsSQLnull() && includeNull && !wantMinValue))
 , type_(type)
 , isSystemSupplied_(FALSE)
@@ -10267,7 +10263,7 @@ ConstValue::ConstValue(OperatorTypeEnum otype,
 
 ConstValue::ConstValue(const ConstValue& s, NAHeap *h)
   : ItemExpr(ITM_CONSTANT), isNull_(s.isNull_), type_(s.type_)
-  , storageSize_(s.storageSize_), wtext_(s.wtext_)
+  , storageSize_(s.storageSize_)
   , textIsValidatedSQLLiteralInUTF8_(s.textIsValidatedSQLLiteralInUTF8_)
   , isSystemSupplied_(s.isSystemSupplied_)
   , isStrLitWithCharSetPrefix_(s.isStrLitWithCharSetPrefix_)
@@ -10284,7 +10280,7 @@ ConstValue::ConstValue(const ConstValue& s, NAHeap *h)
 
 ConstValue::ConstValue(const ConstValue& s)
   : ItemExpr(ITM_CONSTANT), isNull_(s.isNull_), type_(s.type_)
-  , storageSize_(s.storageSize_), wtext_(s.wtext_), value_(s.value_)
+  , storageSize_(s.storageSize_), value_(s.value_)
   , textIsValidatedSQLLiteralInUTF8_(s.textIsValidatedSQLLiteralInUTF8_)
   , text_(s.text_), isSystemSupplied_(s.isSystemSupplied_)
   , isStrLitWithCharSetPrefix_(s.isStrLitWithCharSetPrefix_)
@@ -10302,9 +10298,6 @@ ConstValue::~ConstValue()
 
   if (text_)
     NADELETEBASIC((NAString*)text_,CmpCommon::statementHeap());
-
-  if (wtext_)
-    NADELETEBASIC((NAWString*)wtext_,CmpCommon::statementHeap());
 }
 
 NABoolean ConstValue::isAUserSuppliedInput() const    { return TRUE; }
@@ -10494,16 +10487,12 @@ NAString ConstValue::getConstStr(NABoolean transformeNeeded) const
   {
     CharType* chType = (CharType*)getType();
 
-     // 4/8/96: added the Boolean switch so that displayable
-     // and non-displayable version can be differed.
-    if ( transformeNeeded ) {
+    // 4/8/96: added the Boolean switch so that displayable
+    // and non-displayable version can be differed.
+    if ( transformeNeeded )
       return chType->getCharSetAsPrefix() + getText();
-    }
-    else {
-      NAString str(CmpCommon::statementHeap());
-      ToQuotedString(str, *text_);
-      return chType->getCharSetAsPrefix() + str;
-    }
+    else
+      return chType->getCharSetAsPrefix() + getTextForQuery(QUERY_FORMAT);
   }
   else
   {
@@ -10511,76 +10500,6 @@ NAString ConstValue::getConstStr(NABoolean transformeNeeded) const
   }
 }
 
-NAWString ConstValue::getConstWStr()
-{
-  if (wtext_ == NULL)
-    init_wtext_field();
-
-  return *wtext_;
-}
-
-void ConstValue::init_wtext_field(enum CharInfo::CharSet strLitPrefixCharSet)
-{
-  NAMemory *heap = CmpCommon::statementHeap();
-
-  if (getType()->getTypeQualifier() == NA_CHARACTER_TYPE)
-    {
-      CharType* chType = (CharType*)getType();
-      enum CharInfo::CharSet charset = chType->getCharSet();
-      switch (charset)
-        {
-        case CharInfo::ISO88591:
-        case CharInfo::UTF8:
-        // case CharInfo::SJIS: // Uncomment if we ever support SJIS
-          {
-            NAWcharBuf *wBuf = NULL;
-            NAString str(getConstStr(FALSE), heap);
-
-#pragma nowarn(1506)   // warning elimination
-            charBuf cBuf((unsigned char*)str.data(), str.length(), heap);
-#pragma warn(1506)  // warning elimination
-            Int32 ErrCod = 0;
-            wBuf = csetToUnicode(cBuf, heap, wBuf, charset, ErrCod);
-            if (wBuf)
-              {
-                wtext_ = new (heap)
-                  NAWString(wBuf->data(), wBuf->getStrLen(), heap);
-                NADELETE(wBuf, NAWcharBuf, heap);
-              }
-            break;
-          }
-        case CharInfo::UNICODE:
-          {
-            NAWString wt((NAWchar*)text_->data(), (text_->length() / BYTES_PER_NAWCHAR));
-            NAWString wstr = wt.ToQuotedWString();
-            if ( ( strLitPrefixCharSet == CharInfo::ISO88591 ) ||
-                 ( strLitPrefixCharSet == CharInfo::UTF8 )   )
-            {
-              wtext_ = new (heap)
-                NAWString(NAWString(CharInfo::ISO88591,
-                          (strLitPrefixCharSet == CharInfo::ISO88591)
-                           ? "_ISO88591" : "_UTF8" ) + wstr,
-                          heap);
-            }
-            else
-            {
-            wtext_ = new (heap)
-	      NAWString(
-	        NAWString(CharInfo::ISO88591, chType->getCharSetAsPrefix()) + wstr,
-                        heap);
-            }
-            break;
-          }
-        }
-    }
-  else
-    {
-      wtext_ = new (heap) NAWString(CharInfo::ISO88591, getConstStr().data(), heap);
-    }
-
-  if (!wtext_) wtext_ = new (heap) NAWString(WIDE_(""), heap);
-}
-
 // Genesis 10-980402-1556 (see Binder)
 ConstValue * ConstValue::toUpper(CollHeap *h)
 {
@@ -10813,7 +10732,6 @@ NABoolean ConstValue::isEmptyString() const
 {
   if (getType()->getTypeQualifier() == NA_CHARACTER_TYPE) {
     if (text_ && text_->length() == 0) { return TRUE; }
-    if (wtext_ && wtext_->length() == 0) { return TRUE; }
   }
   return FALSE;
 }

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1e60a9b8/core/sql/optimizer/NATable.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/NATable.cpp b/core/sql/optimizer/NATable.cpp
index 81ebed1..f1b5de6 100644
--- a/core/sql/optimizer/NATable.cpp
+++ b/core/sql/optimizer/NATable.cpp
@@ -1452,6 +1452,9 @@ static ItemExpr * getRangePartitionBoundaryValuesFromEncodedKeys(
       // need to extend the partial buffer, allocate a copy
       actEncodedKey = new(heap) char[totalKeyLength];
       memcpy(actEncodedKey, encodedKey, encodedKeyLen);
+
+      // extend the remainder with zeroes, assuming that this is what
+      // HBase does when deciding which region a row belongs to
       memset(&actEncodedKey[encodedKeyLen], 0, totalKeyLength-encodedKeyLen);
       Lng32 currOffset = lenOfFullyProvidedCols;
 
@@ -1459,11 +1462,14 @@ static ItemExpr * getRangePartitionBoundaryValuesFromEncodedKeys(
       // so that we can treat the buffer as fully encoded in the final loop below
       for (CollIndex j = numProvidedCols; j < partColArray.entries(); j++)
         {
-          const NAType *pkType = partColArray[j]->getType();
-          Lng32 nullHdrSize = pkType->getSQLnullHdrSize();
-          Lng32 colEncodedLength = nullHdrSize + pkType->getNominalSize();
-          NABoolean isDescending = (partColArray[j]->getClusteringKeyOrdering() == DESCENDING);
-
+          const NAType *pkType        = partColArray[j]->getType();
+          Lng32 nullHdrSize           = pkType->getSQLnullHdrSize();
+          int valOffset               = currOffset + nullHdrSize;
+          int valEncodedLength        = pkType->getNominalSize();
+          Lng32 colEncodedLength      = nullHdrSize + valEncodedLength;
+          NABoolean isDescending      = (partColArray[j]->getClusteringKeyOrdering() == DESCENDING);
+
+          NABoolean nullHdrAlreadySet = FALSE;
           NABoolean columnIsPartiallyProvided = (currOffset < encodedKeyLen);
 
           if (columnIsPartiallyProvided)
@@ -1472,58 +1478,161 @@ static ItemExpr * getRangePartitionBoundaryValuesFromEncodedKeys(
               // value. Note that the buffer has a prefix of some bytes with actual key
               // values, followed by bytes that are zeroed out. 
 
+              // the number of bytes actually provided in the key (not filled in)
+              int numBytesInProvidedVal = encodedKeyLen-valOffset;
+
+              if (nullHdrSize && numBytesInProvidedVal <= 0)
+                {
+                  // only the null-header or a part thereof was provided
+                  CMPASSERT(nullHdrSize == sizeof(short));
+
+                  // get the partial indicator values into a short
+                  short indicatorVal = *reinterpret_cast<short *>(&actEncodedKey[currOffset]);
+
+                  // make it either 0 or -1
+                  if (indicatorVal)
+                    indicatorVal = -1;
 
-              // First, for descending columns, use 0xFF instead of 0 for fillers
-              if (isDescending)
-                memset(&actEncodedKey[encodedKeyLen],
-                       0xFF,
-                       currOffset + colEncodedLength - encodedKeyLen);
+                  // put it back and let the code below know that we set it already
+                  // (this is handled otherwise as a non-provided column)
+                  memcpy(&actEncodedKey[currOffset], &indicatorVal, sizeof(indicatorVal));
+                  nullHdrAlreadySet = TRUE;
+                  columnIsPartiallyProvided = FALSE;
+                }
 
               // Next, decide by data type whether it's ok for the type to have
-              // a suffix of the buffer zeroed out (even descending columns will
-              // in the end see zeroes). If the type can't take it, we'll just
-              // discard all the partial information.
+              // a suffix of the buffer zeroed out (descending columns will
+              // see 0xFF values, once the encoded value gets inverted). If the
+              // type can't take it or we are not quite sure, we'll just discard
+              // all the partial information. Note that this could potentially
+              // lead to two partition boundaries with the same key, and also
+              // to partition boundaries that don't reflect the actual region
+              // boundaries.
 
-              switch (pkType->getTypeQualifier())
-                {
-                case NA_NUMERIC_TYPE:
+              if (columnIsPartiallyProvided)
+                switch (pkType->getTypeQualifier())
                   {
-                    NumericType *nt = (NumericType *) pkType;
+                  case NA_NUMERIC_TYPE:
+                    {
+                      NumericType *nt = (NumericType *) pkType;
+
+                      if (!nt->isExact() || nt->isDecimal() || nt->isBigNum() ||
+                          (isDescending && nt->decimalPrecision()))
+                        // we may be able to improve this in the future
+                        columnIsPartiallyProvided = FALSE;
+                    }
+                    break;
 
-                    if (!nt->isExact() || nt->isDecimal() || nt->isBigNum())
+                  case NA_DATETIME_TYPE:
+                  case NA_INTERVAL_TYPE:
+                    // those types should tolerate zeroing out trailing bytes, but
+                    // not filling with 0xFF 
+                    if (isDescending)
                       columnIsPartiallyProvided = FALSE;
-                  }
-                  break;
+                    break;
 
-                case NA_DATETIME_TYPE:
-                case NA_INTERVAL_TYPE:
-                  // those types should tolerate zeroing out trailing bytes
-                  break;
+                  case NA_CHARACTER_TYPE:
+                    // generally, character types should also tolerate zeroing out
+                    // trailing bytes, but we might need to clean up characters
+                    // that got split in the middle
+                    {
+                      CharInfo::CharSet cs = pkType->getCharSet();
+
+                      switch (cs)
+                        {
+                        case CharInfo::UCS2:
+                          // For now just accept partial characters, it's probably ok
+                          // since they are just used as a key. May look funny in EXPLAIN.
+                          break;
+                        case CharInfo::UTF8:
+                          {
+                            // temporarily invert the provided key so it is actual UTF8
+                            if (isDescending)
+                              for (int i=0; i<numBytesInProvidedVal; i++)
+                                actEncodedKey[valOffset+i] = ~actEncodedKey[valOffset+i];
+
+                            CMPASSERT(numBytesInProvidedVal > 0);
+
+                            // remove a trailing partial character, if needed
+                            int validLen = lightValidateUTF8Str(&actEncodedKey[valOffset],
+                                                                numBytesInProvidedVal);
+
+                            // replace the remainder of the buffer with UTF8 min/max chars
+                            fillWithMinMaxUTF8Chars(&actEncodedKey[valOffset+validLen],
+                                                    valEncodedLength - validLen,
+                                                    0,
+                                                    isDescending);
+
+                            // limit to the max # of UTF-8characters, if needed
+                            if (pkType->getPrecisionOrMaxNumChars() > 0)
+                              {
+                                // this time validate the # of chars (likely to be more,
+                                // since we filled to the end with non-blanks)
+                                validLen = lightValidateUTF8Str(&actEncodedKey[valOffset],
+                                                                valEncodedLength,
+                                                                pkType->getPrecisionOrMaxNumChars());
+
+                                if (validLen > 0)
+                                  // space after valid #chars is filled with blanks
+                                  memset(&actEncodedKey[valOffset+validLen], ' ', valEncodedLength-validLen);
+                                else
+                                  columnIsPartiallyProvided = FALSE;
+                              }
+
+                            // undo the inversion, if needed, now for the whole key
+                            if (isDescending)
+                              for (int k=0; k<valEncodedLength; k++)
+                                actEncodedKey[valOffset+k] = ~actEncodedKey[valOffset+k];
+                          }
+                          break;
+                        case CharInfo::ISO88591:
+                          // filling with 0x00 or oxFF should both be ok
+                          break;
+
+                        default:
+                          // don't accept partial keys for other charsets
+                          columnIsPartiallyProvided = FALSE;
+                          break;
+                        }
+                    }
+                    break;
 
-                case NA_CHARACTER_TYPE:
-                  // generally, character types should also tolerate zeroing out
-                  // trailing bytes, but we might need to clean up characters
-                  // that got split in the middle
-                  {
-                    CharInfo::CharSet cs = pkType->getCharSet();
-
-                    switch (cs)
-                      {
-                      case CharInfo::UCS2:
-                      case CharInfo::UTF8:
-                        // For now just accept partial characters, it's probably ok
-                        // since they are just used as a key. May look funny in EXPLAIN.
-                        break;
-
-                      default:
-                        break;
-                      }
+                  default:
+                    // don't accept partial keys for any other data types
+                    columnIsPartiallyProvided = FALSE;
+                    break;
                   }
-                  break;
 
-                default:
-                  columnIsPartiallyProvided = FALSE;
-                  break;
+              if (columnIsPartiallyProvided)
+                {
+                  // a CQD can suppress, give errors, warnings or enable partially provided cols
+                  DefaultToken tok = CmpCommon::getDefault(HBASE_RANGE_PARTITIONING_PARTIAL_COLS);
+
+                  switch (tok)
+                    {
+                    case DF_OFF:
+                      // disable use of partial columns
+                      // (use this as a workaround if they cause problems)
+                      columnIsPartiallyProvided = FALSE;
+                      break;
+
+                    case DF_MINIMUM:
+                      // give an error (again, this is probably mostly used as a
+                      // workaround or to detect past problems)
+                      *CmpCommon::diags() << DgSqlCode(-1212) << DgInt0(j);
+                      break;
+
+                    case DF_MEDIUM:
+                      // give a warning, could be used for searching or testing
+                      *CmpCommon::diags() << DgSqlCode(+1212) << DgInt0(j);
+                      break;
+
+                    case DF_ON:
+                    case DF_MAXIMUM:
+                    default:
+                      // allow it, no warning or error
+                      break;
+                    }
                 }
 
               if (columnIsPartiallyProvided)
@@ -1539,9 +1648,9 @@ static ItemExpr * getRangePartitionBoundaryValuesFromEncodedKeys(
               // NOTE: This is generating un-encoded values, unlike
               //       the values we get from HBase. The next loop below
               //       will skip decoding for any values generated here.
-              Lng32 remainingBufLen = colEncodedLength - nullHdrSize;
+              Lng32 remainingBufLen = valEncodedLength;
 
-              if (nullHdrSize)
+              if (nullHdrSize && !nullHdrAlreadySet)
                 {
                   // generate a NULL indicator
                   // NULL (-1) for descending columns, this is the max value
@@ -1552,20 +1661,11 @@ static ItemExpr * getRangePartitionBoundaryValuesFromEncodedKeys(
                   memcpy(&actEncodedKey[currOffset], &indicatorVal, sizeof(indicatorVal));
                 }
 
-              if (isDescending)
-                {
-                  pkType->maxRepresentableValue(&actEncodedKey[currOffset + nullHdrSize],
-                                                &remainingBufLen,
-                                                NULL,
-                                                heap);
-                }
-              else
-                {
-                  pkType->minRepresentableValue(&actEncodedKey[currOffset + nullHdrSize],
-                                                &remainingBufLen,
-                                                NULL,
-                                                heap);
-                }
+              pkType->minMaxRepresentableValue(&actEncodedKey[valOffset],
+                                               &remainingBufLen,
+                                               isDescending,
+                                               NULL,
+                                               heap);
             }
 
           currOffset += colEncodedLength;
@@ -1628,11 +1728,12 @@ static ItemExpr * getRangePartitionBoundaryValuesFromEncodedKeys(
           }
 
           // un-encode the key value by using an expression
+          NAString encConstLiteral("encoded_val");
           ConstValue *keyColEncVal =
             new (heap) ConstValue(pkType,
                                   (void *) encodedKeyP,
                                   decodedValueLen,
-                                  NULL,
+                                  &encConstLiteral,
                                   heap);
           CMPASSERT(keyColEncVal);
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1e60a9b8/core/sql/optimizer/NATable.h
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/NATable.h b/core/sql/optimizer/NATable.h
index 76fd913..4eb3c23 100644
--- a/core/sql/optimizer/NATable.h
+++ b/core/sql/optimizer/NATable.h
@@ -777,7 +777,6 @@ public:
   NABoolean insertMissingStatsWarning(CollIndexSet colsSet) const;
 
   const desc_struct * getTableDesc() const { return tableDesc_; }
-  Lng32 numSaltPartns() { return clusteringIndex_->numSaltPartns(); }
   NAList<HbaseCreateOption*> * hbaseCreateOptions()
     { return clusteringIndex_->hbaseCreateOptions();}
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1e60a9b8/core/sql/optimizer/QRDescGenerator.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/QRDescGenerator.cpp b/core/sql/optimizer/QRDescGenerator.cpp
index c53b18f..2a412a3 100644
--- a/core/sql/optimizer/QRDescGenerator.cpp
+++ b/core/sql/optimizer/QRDescGenerator.cpp
@@ -764,9 +764,7 @@ QRExplicitExprPtr QRDescGenerator::getExprTree(ItemExpr* itemExpr)
                                        QRDescriptorException,
                                        "Unhandled bytes-per-char: %d",
                                        ((CharType*)type)->getBytesPerChar());
-                    QRWStringValPtr wideScalar = new (mvqrHeap_) QRWStringVal(ADD_MEMCHECK_ARGS(mvqrHeap_));
-                    wideScalar->setWideValue(constVal->getConstWStr());
-                    scalar = wideScalar;
+                    scalar->setValue(constVal->getConstStr(FALSE));
                     valueWasSet = TRUE;
                   }
                 break;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1e60a9b8/core/sql/parser/ElemDDLNode.cpp
----------------------------------------------------------------------
diff --git a/core/sql/parser/ElemDDLNode.cpp b/core/sql/parser/ElemDDLNode.cpp
index 2bdea29..c728b5a 100644
--- a/core/sql/parser/ElemDDLNode.cpp
+++ b/core/sql/parser/ElemDDLNode.cpp
@@ -2214,7 +2214,7 @@ ElemDDLKeyValue::getText() const
 // virtual
 NAString ElemDDLKeyValue::getSyntax() const
 {
-  return keyValue_->getConstStr();
+  return keyValue_->getConstStr(FALSE);
 
 
 } // getSyntax()

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1e60a9b8/core/sql/parser/StmtDDLCreate.cpp
----------------------------------------------------------------------
diff --git a/core/sql/parser/StmtDDLCreate.cpp b/core/sql/parser/StmtDDLCreate.cpp
index 5c31d46..ee39303 100644
--- a/core/sql/parser/StmtDDLCreate.cpp
+++ b/core/sql/parser/StmtDDLCreate.cpp
@@ -5222,8 +5222,10 @@ StmtDDLCreateTable::setPartitions(ElemDDLPartitionClause * pPartitionClause)
     // "hash2 partitioning") and a partitioning count (e.g. 
     // "number of partitions 2")   But, if "no partitions" is specified 
     // (number of partitions 0) then we don't allow any other partn spec
-    *SqlParser_Diags << DgSqlCode(-3103);
+    *SqlParser_Diags << DgSqlCode(-3103)
+                     << DgString0("PARTITION");
   }
+
   isPartitionClauseSpec_ = TRUE;
 
   //
@@ -5570,7 +5572,8 @@ StmtDDLCreateTable::setTableOption(ElemDDLNode * pTableOption)
       // "hash2 partitioning") and a partitioning count (e.g. 
       // "number of partitions 2")   But, if "no partitions" is specified 
       // (number of partitions 0) then we don't allow any other partn spec
-      *SqlParser_Diags << DgSqlCode(-3103);
+      *SqlParser_Diags << DgSqlCode(-3103)
+                       << DgString0("PARTITION");
     }
 
     isPOSNumPartnsSpecified_ = TRUE;    
@@ -6669,7 +6672,8 @@ StmtDDLCreateMV::checkPartitionDefinitionclause(
   if (isPartitionDefinitionSpecified_ || isPartitionByClauseSpecified_)
   {
     // Duplicate PARTITION clauses.
-    *SqlParser_Diags << DgSqlCode(-3103);
+    *SqlParser_Diags << DgSqlCode(-3103)
+                     << DgString0("PARTITION");
   }
   isPartitionDefinitionSpecified_ = TRUE;
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1e60a9b8/core/sql/regress/charsets/DIFF002.KNOWN.SB
----------------------------------------------------------------------
diff --git a/core/sql/regress/charsets/DIFF002.KNOWN.SB b/core/sql/regress/charsets/DIFF002.KNOWN.SB
deleted file mode 100644
index 5481b53..0000000
--- a/core/sql/regress/charsets/DIFF002.KNOWN.SB
+++ /dev/null
@@ -1,14 +0,0 @@
-111c111,114
-< --- SQL operation complete.
----
-> *** ERROR[4222] The DDL feature is not supported in this software version.
-> 
-> *** ERROR[8822] The statement was not prepared.
-> 
-116c119,122
-< --- SQL operation complete.
----
-> *** ERROR[4222] The DDL feature is not supported in this software version.
-> 
-> *** ERROR[8822] The statement was not prepared.
-> 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1e60a9b8/core/sql/regress/charsets/DIFF002.KNOWN.SB.OS
----------------------------------------------------------------------
diff --git a/core/sql/regress/charsets/DIFF002.KNOWN.SB.OS b/core/sql/regress/charsets/DIFF002.KNOWN.SB.OS
deleted file mode 100644
index 5481b53..0000000
--- a/core/sql/regress/charsets/DIFF002.KNOWN.SB.OS
+++ /dev/null
@@ -1,14 +0,0 @@
-111c111,114
-< --- SQL operation complete.
----
-> *** ERROR[4222] The DDL feature is not supported in this software version.
-> 
-> *** ERROR[8822] The statement was not prepared.
-> 
-116c119,122
-< --- SQL operation complete.
----
-> *** ERROR[4222] The DDL feature is not supported in this software version.
-> 
-> *** ERROR[8822] The statement was not prepared.
-> 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1e60a9b8/core/sql/regress/charsets/EXPECTED002
----------------------------------------------------------------------
diff --git a/core/sql/regress/charsets/EXPECTED002 b/core/sql/regress/charsets/EXPECTED002
new file mode 100755
index 0000000..3d40878
--- /dev/null
+++ b/core/sql/regress/charsets/EXPECTED002
@@ -0,0 +1,260 @@
+>>
+>>--HEADING can only be character_string_literal without Phase I work
+>>create table t001 (c char(10) HEADING 'MYHEADING');
+
+--- SQL operation complete.
+>>create table t002 (c char(10) HEADING _ISO88591'MYISOHEADING');
+
+--- SQL operation complete.
+>>create table t003 (c char(10) default 'asdf');
+
+--- SQL operation complete.
+>>
+>>--default can be UCS2
+>>create table t004 (c char(10) character set UCS2 default _UCS2'adf');
+
+--- SQL operation complete.
+>>
+>>create table t005 (c char(10) check (c > 'aaaa'));
+
+--- SQL operation complete.
+>>create table t006 (c char(10), check (c > 'aaaa'));
+
+--- SQL operation complete.
+>>create table t007 (c char(10), constraint myc1 check (c > 'qwew'));
+
+--- SQL operation complete.
+>>
+>>--UNIQUE constraint can be specified on UCS2 columns
+>>create table t008 (c char(10) character set UCS2 NOT NULL, 
++>                   d char(10) character set UCS2 NOT NULL, 
++>                   primary key(c), 
++>                   constraint myc5 unique(c,d));
+
+--- SQL operation complete.
+>>
+>>--Referential Integrity on UCS2 colums
+>>create table t009 (x char(10) character set UCS2, y int NOT NULL NOT DROPPABLE,
++>		   primary key(y),
++>                   foreign key(x) references $$TEST_SCHEMA$$.t008(c));
+
+--- SQL operation complete.
+>>
+>>
+>>create table t010 (c char(10) character set UCS2);
+
+--- SQL operation complete.
+>>
+>>--view can be defined on a UCS2 column
+>>create view t010v2 as select c from t010;
+
+--- SQL operation complete.
+>>
+>>--index can be created on a UCS2 column
+>>create table t011(c char(10) character set UCS2, d char(10) character set UCS2);
+
+--- SQL operation complete.
+>>create index t011i1 on t011(c,d);
+
+--- SQL operation complete.
+>>
+>>--the COLLATION clause can be specified on the UCS2 or ISO88591 column
+>>--and DEFAULT/BINARY is the only allowed collation
+>>create table t012 (a char(10) character set ISO88591 COLLATE default,
++>                   b char(10) character set UCS2 COLLATE default);
+
+--- SQL operation complete.
+>>
+>>
+>>create table nt001 (c char(10) HEADING _UCS2'MYUCS2HEADING');
+
+--- SQL operation complete.
+>>create table nt002 (c char(10) character set UCS2 default _UCS2'default');
+
+--- SQL operation complete.
+>>
+>>--UCS2 strings are NOW allowed in a constraint
+>>create table nt003 (c char(10) character set UCS2 check (c > _UCS2'aaaa'));
+
+--- SQL operation complete.
+>>
+>>--UCS2 strings are NOW allowed in a constraint
+>>create table nt004 (c char(10) character set UCS2, check (c = _UCS2'aaaa'));
+
+--- SQL operation complete.
+>>
+>>--UCS2 strings are NOW allowed in a constraint
+>>create table nt005 (c char(10) character set UCS2, constraint myc2 check (c >
++>_UCS2'asdf'));
+
+--- SQL operation complete.
+>>
+>>--no UCS2 strings in a view text
+>>create view nt006v1 as select * from t013 where c > _UCS2'aaaa';
+
+*** ERROR[4082] Object CAT.SCH.T013 does not exist or is inaccessible.
+
+--- SQL operation failed with errors.
+>>
+>>--no UCS2 strings in a trigger text
+>>create table nt007 (d char(10) character set UCS2, i int);
+
+--- SQL operation complete.
+>>
+>>--ok
+>>create table nt008 (d char(10) character set UCS2, i int);
+
+--- SQL operation complete.
+>>create trigger t013t1 after insert on nt008
++>	update nt008 set i = 7 where i = 9;
+
+*** ERROR[4222] The DDL feature is not supported in this software version.
+
+*** ERROR[8822] The statement was not prepared.
+
+>>--not ok
+>>create trigger t013t2 after insert on nt008
++>	update nt007 set d = _UCS2'qwer' where d = _UCS2'aaaa';
+
+*** ERROR[4222] The DDL feature is not supported in this software version.
+
+*** ERROR[8822] The statement was not prepared.
+
+>>
+>>--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$$);
+
+*** 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';
+
+--- SQL operation complete.
+>>create table t013(a char(10) character set ucs2 default 'aa');
+
+--- SQL operation complete.
+>>create table t013a(a char(10));
+
+--- SQL operation complete.
+>>invoke t013;
+
+-- Definition of table CAT.SCH.T013
+-- Definition current  Fri Jul 23 16:05:50 2010
+
+  (
+    A                                CHAR(10) CHARACTER SET UCS2 COLLATE
+      DEFAULT DEFAULT _UCS2'aa'
+  )
+
+--- SQL operation complete.
+>>
+>>-- test INFER_CHARSET fixes:
+>>-- test fix to genesis case 10-060317-2228
+>>select *,case when a is null then 'A' else 'B' end as test_fld from t013;
+
+--- 0 row(s) selected.
+>>-- select used to get error 4035
+>>
+>>-- test fix to genesis case 10-060315-0580
+>>select * from (values('A'),('B')) as t(c);
+
+C
+-
+
+A
+B
+
+--- 2 row(s) selected.
+>> -- used to get error 4035
+>>
+>>-- test fix to case 10-081022-6724 
+>>prepare xx from insert into t013 select 'a' from t013a;
+
+--- SQL command prepared.
+>>prepare xx from insert into t013 select 'a' from t013a group by 'a';
+
+--- 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.
+
+>>
+>>control query default infer_charset 'off';
+
+--- SQL operation complete.
+>>
+>>?section dml
+>>
+>>?section clnup
+>>drop table t001;
+
+--- SQL operation complete.
+>>drop table t002;
+
+--- SQL operation complete.
+>>drop table t003;
+
+--- SQL operation complete.
+>>drop table t004;
+
+--- SQL operation complete.
+>>drop table t005;
+
+--- SQL operation complete.
+>>drop table t006;
+
+--- SQL operation complete.
+>>drop table t007;
+
+--- SQL operation complete.
+>>drop table t008 cascade;
+
+--- SQL operation complete.
+>>drop table t009;
+
+--- SQL operation complete.
+>>drop table t010 cascade;
+
+--- SQL operation complete.
+>>drop table t011;
+
+--- SQL operation complete.
+>>drop table t012;
+
+--- SQL operation complete.
+>>drop table t013;
+
+--- SQL operation complete.
+>>drop table t013a;
+
+--- SQL operation complete.
+>>drop table nt001;
+
+--- SQL operation complete.
+>>drop table nt002;
+
+--- SQL operation complete.
+>>drop table nt003;
+
+--- SQL operation complete.
+>>drop table nt004;
+
+--- SQL operation complete.
+>>drop table nt005;
+
+--- SQL operation complete.
+>>drop table nt007 cascade;
+
+--- SQL operation complete.
+>>drop table nt008 cascade;
+
+--- SQL operation complete.
+>>
+>>log;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1e60a9b8/core/sql/regress/charsets/EXPECTED002.SB
----------------------------------------------------------------------
diff --git a/core/sql/regress/charsets/EXPECTED002.SB b/core/sql/regress/charsets/EXPECTED002.SB
deleted file mode 100755
index a897a3d..0000000
--- a/core/sql/regress/charsets/EXPECTED002.SB
+++ /dev/null
@@ -1,254 +0,0 @@
->>
->>--HEADING can only be character_string_literal without Phase I work
->>create table t001 (c char(10) HEADING 'MYHEADING');
-
---- SQL operation complete.
->>create table t002 (c char(10) HEADING _ISO88591'MYISOHEADING');
-
---- SQL operation complete.
->>create table t003 (c char(10) default 'asdf');
-
---- SQL operation complete.
->>
->>--default can be UCS2
->>create table t004 (c char(10) character set UCS2 default _UCS2'adf');
-
---- SQL operation complete.
->>
->>create table t005 (c char(10) check (c > 'aaaa'));
-
---- SQL operation complete.
->>create table t006 (c char(10), check (c > 'aaaa'));
-
---- SQL operation complete.
->>create table t007 (c char(10), constraint myc1 check (c > 'qwew'));
-
---- SQL operation complete.
->>
->>--UNIQUE constraint can be specified on UCS2 columns
->>create table t008 (c char(10) character set UCS2 NOT NULL, 
-+>                   d char(10) character set UCS2 NOT NULL, 
-+>                   primary key(c), 
-+>                   constraint myc5 unique(c,d));
-
---- SQL operation complete.
->>
->>--Referential Integrity on UCS2 colums
->>create table t009 (x char(10) character set UCS2, y int NOT NULL NOT DROPPABLE,
-+>		   primary key(y),
-+>                   foreign key(x) references $$TEST_SCHEMA$$.t008(c));
-
---- SQL operation complete.
->>
->>
->>create table t010 (c char(10) character set UCS2);
-
---- SQL operation complete.
->>
->>--view can be defined on a UCS2 column
->>create view t010v2 as select c from t010;
-
---- SQL operation complete.
->>
->>--index can be created on a UCS2 column
->>create table t011(c char(10) character set UCS2, d char(10) character set UCS2);
-
---- SQL operation complete.
->>create index t011i1 on t011(c,d);
-
---- SQL operation complete.
->>
->>--the COLLATION clause can be specified on the UCS2 or ISO88591 column
->>--and DEFAULT/BINARY is the only allowed collation
->>create table t012 (a char(10) character set ISO88591 COLLATE default,
-+>                   b char(10) character set UCS2 COLLATE default);
-
---- SQL operation complete.
->>
->>
->>create table nt001 (c char(10) HEADING _UCS2'MYUCS2HEADING');
-
---- SQL operation complete.
->>create table nt002 (c char(10) character set UCS2 default _UCS2'default');
-
---- SQL operation complete.
->>
->>--UCS2 strings are NOW allowed in a constraint
->>create table nt003 (c char(10) character set UCS2 check (c > _UCS2'aaaa'));
-
---- SQL operation complete.
->>
->>--UCS2 strings are NOW allowed in a constraint
->>create table nt004 (c char(10) character set UCS2, check (c = _UCS2'aaaa'));
-
---- SQL operation complete.
->>
->>--UCS2 strings are NOW allowed in a constraint
->>create table nt005 (c char(10) character set UCS2, constraint myc2 check (c >
-+>_UCS2'asdf'));
-
---- SQL operation complete.
->>
->>--no UCS2 strings in a view text
->>create view nt006v1 as select * from t013 where c > _UCS2'aaaa';
-
-*** ERROR[4082] Object CAT.SCH.T013 does not exist or is inaccessible.
-
---- SQL operation failed with errors.
->>
->>--no UCS2 strings in a trigger text
->>create table nt007 (d char(10) character set UCS2, i int);
-
---- SQL operation complete.
->>
->>--ok
->>create table nt008 (d char(10) character set UCS2, i int);
-
---- SQL operation complete.
->>create trigger t013t1 after insert on nt008
-+>	update nt008 set i = 7 where i = 9;
-
---- SQL operation complete.
->>--not ok
->>create trigger t013t2 after insert on nt008
-+>	update nt007 set d = _UCS2'qwer' where d = _UCS2'aaaa';
-
---- SQL operation complete.
->>
->>--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$$);
-
-*** 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';
-
---- SQL operation complete.
->>create table t013(a char(10) character set ucs2 default 'aa');
-
---- SQL operation complete.
->>create table t013a(a char(10));
-
---- SQL operation complete.
->>invoke t013;
-
--- Definition of table CAT.SCH.T013
--- Definition current  Fri Jul 23 16:05:50 2010
-
-  (
-    A                                CHAR(10) CHARACTER SET UCS2 COLLATE
-      DEFAULT DEFAULT _UCS2'aa'
-  )
-
---- SQL operation complete.
->>
->>-- test INFER_CHARSET fixes:
->>-- test fix to genesis case 10-060317-2228
->>select *,case when a is null then 'A' else 'B' end as test_fld from t013;
-
---- 0 row(s) selected.
->>-- select used to get error 4035
->>
->>-- test fix to genesis case 10-060315-0580
->>select * from (values('A'),('B')) as t(c);
-
-C
--
-
-A
-B
-
---- 2 row(s) selected.
->> -- used to get error 4035
->>
->>-- test fix to case 10-081022-6724 
->>prepare xx from insert into t013 select 'a' from t013a;
-
---- SQL command prepared.
->>prepare xx from insert into t013 select 'a' from t013a group by 'a';
-
---- 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.
-
->>
->>control query default infer_charset 'off';
-
---- SQL operation complete.
->>
->>?section dml
->>
->>?section clnup
->>drop table t001;
-
---- SQL operation complete.
->>drop table t002;
-
---- SQL operation complete.
->>drop table t003;
-
---- SQL operation complete.
->>drop table t004;
-
---- SQL operation complete.
->>drop table t005;
-
---- SQL operation complete.
->>drop table t006;
-
---- SQL operation complete.
->>drop table t007;
-
---- SQL operation complete.
->>drop table t008 cascade;
-
---- SQL operation complete.
->>drop table t009;
-
---- SQL operation complete.
->>drop table t010 cascade;
-
---- SQL operation complete.
->>drop table t011;
-
---- SQL operation complete.
->>drop table t012;
-
---- SQL operation complete.
->>drop table t013;
-
---- SQL operation complete.
->>drop table t013a;
-
---- SQL operation complete.
->>drop table nt001;
-
---- SQL operation complete.
->>drop table nt002;
-
---- SQL operation complete.
->>drop table nt003;
-
---- SQL operation complete.
->>drop table nt004;
-
---- SQL operation complete.
->>drop table nt005;
-
---- SQL operation complete.
->>drop table nt007 cascade;
-
---- SQL operation complete.
->>drop table nt008 cascade;
-
---- SQL operation complete.
->>
->>log;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1e60a9b8/core/sql/regress/charsets/EXPECTED003
----------------------------------------------------------------------
diff --git a/core/sql/regress/charsets/EXPECTED003 b/core/sql/regress/charsets/EXPECTED003
new file mode 100755
index 0000000..af07866
--- /dev/null
+++ b/core/sql/regress/charsets/EXPECTED003
@@ -0,0 +1,217 @@
+>>
+>>--test the exposure of UCS2 and disabling of UNICODE 
+>>--as a character set name.
+>>
+>>--positive
+>>--Table columns can be created to be associated with character set UCS2.
+>>create table t002(c char(10) character set UCS2);
+
+--- SQL operation complete.
+>>
+>>--INVOKE and SHOWDDL work for tables with columns associated with UCS2.
+>>invoke t002;
+
+-- Definition of table CAT.SCH.T002
+-- Definition current  Fri Apr 23 14:40:12 2010
+
+  (
+    C                                CHAR(10) CHARACTER SET UCS2 COLLATE
+      DEFAULT DEFAULT NULL
+  )
+
+--- SQL operation complete.
+>>showddl t002;
+
+CREATE TABLE CAT.SCH.T002
+  (
+    C                                CHAR(10) CHARACTER SET UCS2 COLLATE
+      DEFAULT DEFAULT NULL
+  )
+;
+
+--- SQL operation complete.
+>>
+>>--negative
+>>--Table columns can not be created to be assocated with UNICODE.
+>>create table t003(c char(10) character set UNICODE);
+
+*** ERROR[15001] A syntax error occurred at or before: 
+create table t003(c char(10) character set UNICODE);
+                                                 ^ (50 characters from start of SQL statement)
+
+*** ERROR[8822] The statement was not prepared.
+
+>>
+>>
+>>?section dml
+>>
+>>--positive
+>>insert into t002 values(_ucs2'qwer');
+
+--- 1 row(s) inserted.
+>>update t002 set c = _UCS2'xxxx' where c = _UCS2'qwer';
+
+--- 1 row(s) updated.
+>>delete from t002 where c = _UCS2'asdf';
+
+--- 0 row(s) deleted.
+>>select _UCS2'ucs2', _ISO88591'iso88591', c from t002;
+
+(EXPR)    (EXPR)    C                   
+--------  --------  --------------------
+
+ucs2      iso88591  xxxx                
+
+--- 1 row(s) selected.
+>>
+>>--negative
+>>insert into t002 values(_UNICODE'asdf');
+
+*** ERROR[3127] An invalid character was found in identifier _UNICODE.
+
+*** ERROR[15001] A syntax error occurred at or before: 
+insert into t002 values(_UNICODE'asdf');
+                        ^ (25 characters from start of SQL statement)
+
+*** ERROR[8822] The statement was not prepared.
+
+>>
+>>--VARNCHAR disallowed
+>>create table t004(c varnchar(10));
+
+*** ERROR[15001] A syntax error occurred at or before: 
+create table t004(c varnchar(10));
+                           ^ (28 characters from start of SQL statement)
+
+*** ERROR[8822] The statement was not prepared.
+
+>>
+>>
+>>-------------------------------
+>>--test translation name changes
+>>-------------------------------
+>>
+>>create table t001(c char(10));
+
+--- SQL operation complete.
+>>insert into t001 values(x'4e');
+
+--- 1 row(s) inserted.
+>>
+>>?section dml
+>>--New valid name. Case insensitive
+>>select translate(_kanji'asdf' using KANJITOISO88591) from (values(1))x;
+
+*** ERROR[3010] Character set KANJI is not yet supported.
+
+*** ERROR[15001] A syntax error occurred at or before: 
+select translate(_kanji'asdf' using KANJITOISO88591) from (values(1))x;
+                      ^ (23 characters from start of SQL statement)
+
+*** ERROR[8822] The statement was not prepared.
+
+>>select translate(_ksc5601'1234' using KSC5601TOISO88591) from (values(1))x;
+
+*** ERROR[3010] Character set KSC5601 is not yet supported.
+
+*** ERROR[15001] A syntax error occurred at or before: 
+select translate(_ksc5601'1234' using KSC5601TOISO88591) from (values(1))x;
+                        ^ (25 characters from start of SQL statement)
+
+*** ERROR[8822] The statement was not prepared.
+
+>>select translate(_UCS2'asdf' using UCS2TOISO88591) from (values(1))x;
+
+(EXPR)
+------
+
+asdf  
+
+--- 1 row(s) selected.
+>>insert into t002 
++>  select translate(c using iso88591ToUCS2) from t001 
++>     where c = x'4e';
+
+--- 1 row(s) inserted.
+>>
+>>--old name not allowed
+>>insert into t001 values(translate(_UCS2'qwer' using UToL1));
+
+*** ERROR[4105] Translation name is not recognized.
+
+*** ERROR[8822] The statement was not prepared.
+
+>>insert into t001 values(translate(_UCS2'ewrt' using UNICODE_TO_ISO88591));
+
+*** ERROR[4105] Translation name is not recognized.
+
+*** ERROR[8822] The statement was not prepared.
+
+>>insert into t002 values(translate('asdf' using ISO88591TOUCS2));
+
+--- 1 row(s) inserted.
+>>insert into t002 values(translate('qwer' using L1ToU));
+
+*** ERROR[4105] Translation name is not recognized.
+
+*** ERROR[8822] The statement was not prepared.
+
+>>insert into t002 values(translate('ewrt' using ISO88591_TO_UNICODE));
+
+*** ERROR[4105] Translation name is not recognized.
+
+*** ERROR[8822] The statement was not prepared.
+
+>>
+>>-------------------------------
+>>--test TERMINAL_CHARSETS 
+>>-------------------------------
+>>
+>>set terminal_charset iso88591;
+>>
+>>-- the following should fail
+>>set terminal_charset iso88592;
+
+*** ERROR[15990] Character set name for SQLCI attribute TERMINAL_CHARSET is not valid.
+
+>>set terminal_charset ucs2;
+
+*** ERROR[2038] Character set ucs2 is not supported for SQLCI attribute TERMINAL_CHARSET.
+
+>>set terminal_charset sjis;
+>>set terminal_charset x0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789;
+
+*** ERROR[15990] Character set name for SQLCI attribute TERMINAL_CHARSET is not valid.
+
+>>
+>>-- the default is ucs2. this is a no-op.
+>>control query default national_charset 'ucs2';
+
+--- SQL operation complete.
+>>
+>>--test CQD NATIONAL_CHARSET (should fail)
+>>-------------------------------
+>>control query default national_charset 'ios88591';
+
+*** ERROR[4130] NATIONAL_CHARSET is a read-only DEFAULTS attribute and cannot be updated.
+
+*** ERROR[8822] The statement was not prepared.
+
+>>
+>>-- an invalid sqlci command, exercise the single-byte version of StoreSyntaxError()
+>>bad_sqlci_cmd 1;
+
+*** ERROR[15001] A syntax error occurred at or before: 
+bad_sqlci_cmd 1;
+              ^ (15 characters from start of SQL statement)
+
+>>
+>>?section clnup
+>>drop table t001;
+
+--- SQL operation complete.
+>>drop table t002;
+
+--- SQL operation complete.
+>>
+>>log;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1e60a9b8/core/sql/regress/charsets/EXPECTED003.SB
----------------------------------------------------------------------
diff --git a/core/sql/regress/charsets/EXPECTED003.SB b/core/sql/regress/charsets/EXPECTED003.SB
deleted file mode 100755
index af07866..0000000
--- a/core/sql/regress/charsets/EXPECTED003.SB
+++ /dev/null
@@ -1,217 +0,0 @@
->>
->>--test the exposure of UCS2 and disabling of UNICODE 
->>--as a character set name.
->>
->>--positive
->>--Table columns can be created to be associated with character set UCS2.
->>create table t002(c char(10) character set UCS2);
-
---- SQL operation complete.
->>
->>--INVOKE and SHOWDDL work for tables with columns associated with UCS2.
->>invoke t002;
-
--- Definition of table CAT.SCH.T002
--- Definition current  Fri Apr 23 14:40:12 2010
-
-  (
-    C                                CHAR(10) CHARACTER SET UCS2 COLLATE
-      DEFAULT DEFAULT NULL
-  )
-
---- SQL operation complete.
->>showddl t002;
-
-CREATE TABLE CAT.SCH.T002
-  (
-    C                                CHAR(10) CHARACTER SET UCS2 COLLATE
-      DEFAULT DEFAULT NULL
-  )
-;
-
---- SQL operation complete.
->>
->>--negative
->>--Table columns can not be created to be assocated with UNICODE.
->>create table t003(c char(10) character set UNICODE);
-
-*** ERROR[15001] A syntax error occurred at or before: 
-create table t003(c char(10) character set UNICODE);
-                                                 ^ (50 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
->>
->>
->>?section dml
->>
->>--positive
->>insert into t002 values(_ucs2'qwer');
-
---- 1 row(s) inserted.
->>update t002 set c = _UCS2'xxxx' where c = _UCS2'qwer';
-
---- 1 row(s) updated.
->>delete from t002 where c = _UCS2'asdf';
-
---- 0 row(s) deleted.
->>select _UCS2'ucs2', _ISO88591'iso88591', c from t002;
-
-(EXPR)    (EXPR)    C                   
---------  --------  --------------------
-
-ucs2      iso88591  xxxx                
-
---- 1 row(s) selected.
->>
->>--negative
->>insert into t002 values(_UNICODE'asdf');
-
-*** ERROR[3127] An invalid character was found in identifier _UNICODE.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-insert into t002 values(_UNICODE'asdf');
-                        ^ (25 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
->>
->>--VARNCHAR disallowed
->>create table t004(c varnchar(10));
-
-*** ERROR[15001] A syntax error occurred at or before: 
-create table t004(c varnchar(10));
-                           ^ (28 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
->>
->>
->>-------------------------------
->>--test translation name changes
->>-------------------------------
->>
->>create table t001(c char(10));
-
---- SQL operation complete.
->>insert into t001 values(x'4e');
-
---- 1 row(s) inserted.
->>
->>?section dml
->>--New valid name. Case insensitive
->>select translate(_kanji'asdf' using KANJITOISO88591) from (values(1))x;
-
-*** ERROR[3010] Character set KANJI is not yet supported.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-select translate(_kanji'asdf' using KANJITOISO88591) from (values(1))x;
-                      ^ (23 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
->>select translate(_ksc5601'1234' using KSC5601TOISO88591) from (values(1))x;
-
-*** ERROR[3010] Character set KSC5601 is not yet supported.
-
-*** ERROR[15001] A syntax error occurred at or before: 
-select translate(_ksc5601'1234' using KSC5601TOISO88591) from (values(1))x;
-                        ^ (25 characters from start of SQL statement)
-
-*** ERROR[8822] The statement was not prepared.
-
->>select translate(_UCS2'asdf' using UCS2TOISO88591) from (values(1))x;
-
-(EXPR)
-------
-
-asdf  
-
---- 1 row(s) selected.
->>insert into t002 
-+>  select translate(c using iso88591ToUCS2) from t001 
-+>     where c = x'4e';
-
---- 1 row(s) inserted.
->>
->>--old name not allowed
->>insert into t001 values(translate(_UCS2'qwer' using UToL1));
-
-*** ERROR[4105] Translation name is not recognized.
-
-*** ERROR[8822] The statement was not prepared.
-
->>insert into t001 values(translate(_UCS2'ewrt' using UNICODE_TO_ISO88591));
-
-*** ERROR[4105] Translation name is not recognized.
-
-*** ERROR[8822] The statement was not prepared.
-
->>insert into t002 values(translate('asdf' using ISO88591TOUCS2));
-
---- 1 row(s) inserted.
->>insert into t002 values(translate('qwer' using L1ToU));
-
-*** ERROR[4105] Translation name is not recognized.
-
-*** ERROR[8822] The statement was not prepared.
-
->>insert into t002 values(translate('ewrt' using ISO88591_TO_UNICODE));
-
-*** ERROR[4105] Translation name is not recognized.
-
-*** ERROR[8822] The statement was not prepared.
-
->>
->>-------------------------------
->>--test TERMINAL_CHARSETS 
->>-------------------------------
->>
->>set terminal_charset iso88591;
->>
->>-- the following should fail
->>set terminal_charset iso88592;
-
-*** ERROR[15990] Character set name for SQLCI attribute TERMINAL_CHARSET is not valid.
-
->>set terminal_charset ucs2;
-
-*** ERROR[2038] Character set ucs2 is not supported for SQLCI attribute TERMINAL_CHARSET.
-
->>set terminal_charset sjis;
->>set terminal_charset x0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789;
-
-*** ERROR[15990] Character set name for SQLCI attribute TERMINAL_CHARSET is not valid.
-
->>
->>-- the default is ucs2. this is a no-op.
->>control query default national_charset 'ucs2';
-
---- SQL operation complete.
->>
->>--test CQD NATIONAL_CHARSET (should fail)
->>-------------------------------
->>control query default national_charset 'ios88591';
-
-*** ERROR[4130] NATIONAL_CHARSET is a read-only DEFAULTS attribute and cannot be updated.
-
-*** ERROR[8822] The statement was not prepared.
-
->>
->>-- an invalid sqlci command, exercise the single-byte version of StoreSyntaxError()
->>bad_sqlci_cmd 1;
-
-*** ERROR[15001] A syntax error occurred at or before: 
-bad_sqlci_cmd 1;
-              ^ (15 characters from start of SQL statement)
-
->>
->>?section clnup
->>drop table t001;
-
---- SQL operation complete.
->>drop table t002;
-
---- SQL operation complete.
->>
->>log;


[4/4] incubator-trafodion git commit: Merge [TRAFODION-1457] PR 60 HBase region keys decoding and TEXT

Posted by db...@apache.org.
Merge [TRAFODION-1457] PR 60 HBase region keys decoding and TEXT


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

Branch: refs/heads/master
Commit: 5f9c7b31f3e0d72f5a7c3ef1855ee29f014a7c45
Parents: d081b7d 4e9bb03
Author: Dave Birdsall <db...@apache.org>
Authored: Tue Aug 18 15:17:31 2015 +0000
Committer: Dave Birdsall <db...@apache.org>
Committed: Tue Aug 18 15:17:31 2015 +0000

----------------------------------------------------------------------
 core/sql/bin/SqlciErrors.txt                    |   9 +-
 core/sql/common/CharType.cpp                    | 266 ++++++-------------
 core/sql/common/CharType.h                      |   7 +
 core/sql/common/ComSmallDefs.h                  |   7 +-
 core/sql/common/IntervalType.cpp                |   2 +-
 core/sql/common/NAType.h                        |   7 +
 core/sql/common/csconvert.cpp                   |  21 ++
 core/sql/common/csconvert.h                     |  14 +-
 core/sql/optimizer/BindItemExpr.cpp             |  14 +-
 core/sql/optimizer/EncodedKeyValue.cpp          |   1 +
 core/sql/optimizer/ItemCache.cpp                |   1 -
 core/sql/optimizer/ItemColRef.h                 |  10 -
 core/sql/optimizer/ItemExpr.cpp                 | 108 +-------
 core/sql/optimizer/NATable.cpp                  | 227 +++++++++++-----
 core/sql/optimizer/NATable.h                    |   1 -
 core/sql/optimizer/QRDescGenerator.cpp          |   4 +-
 core/sql/parser/ElemDDLNode.cpp                 |   2 +-
 core/sql/parser/StmtDDLCreate.cpp               |  10 +-
 core/sql/regress/charsets/DIFF002.KNOWN.SB      |  14 -
 core/sql/regress/charsets/DIFF002.KNOWN.SB.OS   |  14 -
 core/sql/regress/charsets/EXPECTED002           | 260 ++++++++++++++++++
 core/sql/regress/charsets/EXPECTED002.SB        | 254 ------------------
 core/sql/regress/charsets/EXPECTED003           | 217 +++++++++++++++
 core/sql/regress/charsets/EXPECTED003.SB        | 217 ---------------
 core/sql/regress/charsets/EXPECTED012           | 205 ++++++++++++++
 core/sql/regress/charsets/EXPECTED012.SB        | 205 --------------
 core/sql/regress/compGeneral/DIFF042.KNOWN.SB   |  38 +--
 core/sql/regress/compGeneral/EXPECTED042        | 105 ++++----
 core/sql/regress/compGeneral/EXPECTEDTOK2       |  46 ++++
 core/sql/regress/compGeneral/EXPECTEDTOK2.LINUX |  46 ----
 core/sql/regress/compGeneral/TEST015            |  10 +-
 core/sql/regress/compGeneral/TEST042            |  16 +-
 core/sql/regress/core/TEST056                   |  10 +-
 core/sql/sqlcomp/CmpDescribe.cpp                |   2 +-
 core/sql/sqlcomp/CmpSeabaseDDL.h                |  22 +-
 core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp        | 216 +++++++++------
 core/sql/sqlcomp/CmpSeabaseDDLindex.cpp         |  10 +-
 core/sql/sqlcomp/CmpSeabaseDDLtable.cpp         |  59 ++--
 core/sql/sqlcomp/CmpSeabaseDDLupgrade.cpp       |   9 +-
 core/sql/sqlcomp/CmpSeabaseDDLview.cpp          |  13 +-
 core/sql/sqlcomp/DefaultConstants.h             |   2 +
 core/sql/sqlcomp/nadefaults.cpp                 |   6 +
 42 files changed, 1349 insertions(+), 1358 deletions(-)
----------------------------------------------------------------------