http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/911f1d64/core/sql/regress/qat/eqatdml13
----------------------------------------------------------------------
diff --git a/core/sql/regress/qat/eqatdml13 b/core/sql/regress/qat/eqatdml13
index d68b752..0cc7570 100755
--- a/core/sql/regress/qat/eqatdml13
+++ b/core/sql/regress/qat/eqatdml13
@@ -372,14 +372,14 @@ sue Q on 200 400 100 100 400 100 100 5
+> OR pic_decimal_3 <> ?p3
+> AND pic_decimal_3 >= 6;
-CHAR_1 CHAR_10 PIC_X_1 PIC_X_7 PIC_X_LONG VAR_CHAR
BINARY_SIGNED BINARY_32_U BINARY_64_S PIC_COMP_1 PIC_COMP_2 PIC_COMP_3 SMALL_INT MEDIUM_INT LARGE_INT DECIMAL_1 DECIMAL_2_SIGNED DECIMAL_3_UNSIGNED PIC_DECIMAL_1 PIC_DECIMAL_2 PIC_DECIMAL_3
------- ---------------------------------------- ------- ------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ------------- ----------- --------------------- -------------------- ---------- ------------ --------- ---------- -------------------- --------- ---------------- ------------------ ------------- ------------- -------------
+CHAR_1 CHAR_10 PIC_X_1 PIC_X_7 PIC_X_LONG VAR_CHAR BINARY_SIGNED BINARY_32_U BINARY_64_S PIC_COMP_1 PIC_COMP_2 PIC_COMP_3 SMALL_INT MEDIUM_INT LARGE_INT DECIMAL_1 DECIMAL_2_SIGNED DECIMAL_3_UNSIGNED PIC_DECIMAL_1 PIC_DECIMAL_2 PIC_DECIMAL_3
+------ ---------- ------- ------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ------------- ----------- --------------------- -------------------- ---------- ------------ --------- ---------- -------------------- --------- ---------------- ------------------ ------------- ------------- -------------
-D michelle D michael rat thomas
-5000 90.00 2000.000 500 .40 100.80000 90 8000 200 7 .93 140 6.1 .600 6
-D melissa C 7 pop jimmy
1000 80.00 1500.000 500 .20 100.99990 80 9000 999 5 .80 120 4.1 .400 4
-E monica Q sue pat christopher
2000 90.00 1200.000 3000 .30 100.99999 2000 8000 -1000000 1 .90 80 5.1 .500 5
-C maureen E jimmy rum marilyn
3000 80.00 2000.000 500 .50 100.70000 9000 1000 2000 8 .97 150 7.1 .700 7
-D steven B 9 bat thomas
8000 70.00 2000.000 500 .10 100.99900 90 10000 1000 7 .70 110 3.1 .300 3
+D michelle D michael rat thomas -5000 90.00 2000.000 500 .40 100.80000 90 8000 200 7 .93 140 6.1 .600 6
+D melissa C 7 pop jimmy 1000 80.00 1500.000 500 .20 100.99990 80 9000 999 5 .80 120 4.1 .400 4
+E monica Q sue pat christopher 2000 90.00 1200.000 3000 .30 100.99999 2000 8000 -1000000 1 .90 80 5.1 .500 5
+C maureen E jimmy rum marilyn 3000 80.00 2000.000 500 .50 100.70000 9000 1000 2000 8 .97 150 7.1 .700 7
+D steven B 9 bat thomas 8000 70.00 2000.000 500 .10 100.99900 90 10000 1000 7 .70 110 3.1 .300 3
--- 5 row(s) selected.
>>
@@ -396,14 +396,14 @@ D steven B 9 bat
+> OR pic_decimal_3 <> ?p3)
+> AND pic_decimal_3 >= 6;
-CHAR_1 CHAR_10 PIC_X_1 PIC_X_7 PIC_X_LONG VAR_CHAR
BINARY_SIGNED BINARY_32_U BINARY_64_S PIC_COMP_1 PIC_COMP_2 PIC_COMP_3 SMALL_INT MEDIUM_INT LARGE_INT DECIMAL_1 DECIMAL_2_SIGNED DECIMAL_3_UNSIGNED PIC_DECIMAL_1 PIC_DECIMAL_2 PIC_DECIMAL_3
------- ---------------------------------------- ------- ------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ------------- ----------- --------------------- -------------------- ---------- ------------ --------- ---------- -------------------- --------- ---------------- ------------------ ------------- ------------- -------------
+CHAR_1 CHAR_10 PIC_X_1 PIC_X_7 PIC_X_LONG VAR_CHAR BINARY_SIGNED BINARY_32_U BINARY_64_S PIC_COMP_1 PIC_COMP_2 PIC_COMP_3 SMALL_INT MEDIUM_INT LARGE_INT DECIMAL_1 DECIMAL_2_SIGNED DECIMAL_3_UNSIGNED PIC_DECIMAL_1 PIC_DECIMAL_2 PIC_DECIMAL_3
+------ ---------- ------- ------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ------------- ----------- --------------------- -------------------- ---------- ------------ --------- ---------- -------------------- --------- ---------------- ------------------ ------------- ------------- -------------
-D michelle D michael rat thomas
-5000 90.00 2000.000 500 .40 100.80000 90 8000 200 7 .93 140 6.1 .600 6
-D melissa C 7 pop jimmy
1000 80.00 1500.000 500 .20 100.99990 80 9000 999 5 .80 120 4.1 .400 4
-E monica Q sue pat christopher
2000 90.00 1200.000 3000 .30 100.99999 2000 8000 -1000000 1 .90 80 5.1 .500 5
-C maureen E jimmy rum marilyn
3000 80.00 2000.000 500 .50 100.70000 9000 1000 2000 8 .97 150 7.1 .700 7
-D steven B 9 bat thomas
8000 70.00 2000.000 500 .10 100.99900 90 10000 1000 7 .70 110 3.1 .300 3
+D michelle D michael rat thomas -5000 90.00 2000.000 500 .40 100.80000 90 8000 200 7 .93 140 6.1 .600 6
+D melissa C 7 pop jimmy 1000 80.00 1500.000 500 .20 100.99990 80 9000 999 5 .80 120 4.1 .400 4
+E monica Q sue pat christopher 2000 90.00 1200.000 3000 .30 100.99999 2000 8000 -1000000 1 .90 80 5.1 .500 5
+C maureen E jimmy rum marilyn 3000 80.00 2000.000 500 .50 100.70000 9000 1000 2000 8 .97 150 7.1 .700 7
+D steven B 9 bat thomas 8000 70.00 2000.000 500 .10 100.99900 90 10000 1000 7 .70 110 3.1 .300 3
--- 5 row(s) selected.
>>
@@ -419,14 +419,14 @@ D steven B 9 bat
+> OR (pic_decimal_3 <> ?p3
+> AND pic_decimal_3 >= 6) ;
-CHAR_1 CHAR_10 PIC_X_1 PIC_X_7 PIC_X_LONG VAR_CHAR
BINARY_SIGNED BINARY_32_U BINARY_64_S PIC_COMP_1 PIC_COMP_2 PIC_COMP_3 SMALL_INT MEDIUM_INT LARGE_INT DECIMAL_1 DECIMAL_2_SIGNED DECIMAL_3_UNSIGNED PIC_DECIMAL_1 PIC_DECIMAL_2 PIC_DECIMAL_3
------- ---------------------------------------- ------- ------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ------------- ----------- --------------------- -------------------- ---------- ------------ --------- ---------- -------------------- --------- ---------------- ------------------ ------------- ------------- -------------
+CHAR_1 CHAR_10 PIC_X_1 PIC_X_7 PIC_X_LONG VAR_CHAR BINARY_SIGNED BINARY_32_U BINARY_64_S PIC_COMP_1 PIC_COMP_2 PIC_COMP_3 SMALL_INT MEDIUM_INT LARGE_INT DECIMAL_1 DECIMAL_2_SIGNED DECIMAL_3_UNSIGNED PIC_DECIMAL_1 PIC_DECIMAL_2 PIC_DECIMAL_3
+------ ---------- ------- ------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ------------- ----------- --------------------- -------------------- ---------- ------------ --------- ---------- -------------------- --------- ---------------- ------------------ ------------- ------------- -------------
-D michelle D michael rat thomas
-5000 90.00 2000.000 500 .40 100.80000 90 8000 200 7 .93 140 6.1 .600 6
-D melissa C 7 pop jimmy
1000 80.00 1500.000 500 .20 100.99990 80 9000 999 5 .80 120 4.1 .400 4
-E monica Q sue pat christopher
2000 90.00 1200.000 3000 .30 100.99999 2000 8000 -1000000 1 .90 80 5.1 .500 5
-C maureen E jimmy rum marilyn
3000 80.00 2000.000 500 .50 100.70000 9000 1000 2000 8 .97 150 7.1 .700 7
-D steven B 9 bat thomas
8000 70.00 2000.000 500 .10 100.99900 90 10000 1000 7 .70 110 3.1 .300 3
+D michelle D michael rat thomas -5000 90.00 2000.000 500 .40 100.80000 90 8000 200 7 .93 140 6.1 .600 6
+D melissa C 7 pop jimmy 1000 80.00 1500.000 500 .20 100.99990 80 9000 999 5 .80 120 4.1 .400 4
+E monica Q sue pat christopher 2000 90.00 1200.000 3000 .30 100.99999 2000 8000 -1000000 1 .90 80 5.1 .500 5
+C maureen E jimmy rum marilyn 3000 80.00 2000.000 500 .50 100.70000 9000 1000 2000 8 .97 150 7.1 .700 7
+D steven B 9 bat thomas 8000 70.00 2000.000 500 .10 100.99900 90 10000 1000 7 .70 110 3.1 .300 3
--- 5 row(s) selected.
>>
@@ -815,7 +815,7 @@ D steven B 9 bat
(EXPR)
---------------------
- 2.20000000
+ 2.200000000
--- 1 row(s) selected.
>>
@@ -828,7 +828,7 @@ D steven B 9 bat
(EXPR)
---------------------
- 2.20000000
+ 2.200000000
--- 1 row(s) selected.
>>
@@ -843,7 +843,7 @@ D steven B 9 bat
(EXPR)
---------------------
- 999999999.99999999
+ 999999999.999999999
--- 1 row(s) selected.
>>
@@ -856,7 +856,7 @@ D steven B 9 bat
(EXPR)
---------------------
- 999999999.99999999
+ 999999999.999999999
--- 1 row(s) selected.
>>
@@ -867,10 +867,10 @@ D steven B 9 bat
+> from btsel26
+> where selector = ?p;
-(EXPR)
----------------------
+(EXPR)
+----------------------
- 1000000000.9999999
+ 1000000000.999999998
--- 1 row(s) selected.
>>
@@ -881,10 +881,10 @@ D steven B 9 bat
+> from btsel26
+> where selector = ?p;
-(EXPR)
----------------------
+(EXPR)
+----------------------
- 1000000000.9999999
+ 1000000000.999999998
--- 1 row(s) selected.
>>
@@ -1129,25 +1129,25 @@ D steven B 9 bat
>> select 10.999999999999999999
+> from btsel26;
-(EXPR)
-----------------------
+(EXPR)
+---------------------
- 10.999999999999999999
- 10.999999999999999999
- 10.999999999999999999
- 10.999999999999999999
- 10.999999999999999999
- 10.999999999999999999
- 10.999999999999999999
- 10.999999999999999999
- 10.999999999999999999
- 10.999999999999999999
- 10.999999999999999999
- 10.999999999999999999
- 10.999999999999999999
- 10.999999999999999999
- 10.999999999999999999
- 10.999999999999999999
+10.999999999999999999
+10.999999999999999999
+10.999999999999999999
+10.999999999999999999
+10.999999999999999999
+10.999999999999999999
+10.999999999999999999
+10.999999999999999999
+10.999999999999999999
+10.999999999999999999
+10.999999999999999999
+10.999999999999999999
+10.999999999999999999
+10.999999999999999999
+10.999999999999999999
+10.999999999999999999
--- 16 row(s) selected.
>>
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/911f1d64/core/sql/regress/seabase/EXPECTED003
----------------------------------------------------------------------
diff --git a/core/sql/regress/seabase/EXPECTED003 b/core/sql/regress/seabase/EXPECTED003
index d526b7f..d46cdb8 100644
--- a/core/sql/regress/seabase/EXPECTED003
+++ b/core/sql/regress/seabase/EXPECTED003
@@ -9,7 +9,7 @@
--- SQL operation complete.
>>
->>obey TEST003(setup);
+>>obey TEST003(setup_tiny);
>>create table t003t1(a tinyint not null primary key, b tinyint,
+> c tinyint unsigned default 10 not null, d tinyint unsigned);
@@ -17,7 +17,7 @@
>>invoke t003t1;
-- Definition of Trafodion table TRAFODION.SCH.T003T1
--- Definition current Tue Jun 14 17:33:52 2016
+-- Definition current Sat Jun 25 16:24:14 2016
(
A TINYINT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -36,7 +36,7 @@
>>invoke t003t1_like;
-- Definition of Trafodion table TRAFODION.SCH.T003T1_LIKE
--- Definition current Tue Jun 14 17:34:00 2016
+-- Definition current Sat Jun 25 16:24:23 2016
(
A TINYINT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -49,26 +49,26 @@
--- SQL operation complete.
>>
->>create table t003t1_as as select * from t003t1;
+>>create table t003t1_as primary key (a) as select * from t003t1;
--- 0 row(s) inserted.
>>invoke t003t1_as;
-- Definition of Trafodion table TRAFODION.SCH.T003T1_AS
--- Definition current Tue Jun 14 17:34:03 2016
+-- Definition current Sat Jun 25 16:24:27 2016
(
- SYSKEY LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
- , A TINYINT NO DEFAULT NOT NULL NOT DROPPABLE
+ A TINYINT NO DEFAULT NOT NULL NOT DROPPABLE
, B TINYINT DEFAULT NULL
, C TINYINT UNSIGNED NO DEFAULT NOT NULL NOT
DROPPABLE
, D TINYINT UNSIGNED DEFAULT NULL
)
+ PRIMARY KEY (A ASC)
--- SQL operation complete.
>>
->>obey TEST003(dml);
+>>obey TEST003(dml_tiny);
>>insert into t003t1 values (1, 2, 3, 4);
--- 1 row(s) inserted.
@@ -288,7 +288,7 @@ A B C D
--- SQL operation complete.
>>
->>obey TEST003(tinyhive);
+>>obey TEST003(hive_tiny);
>>sh echo "drop table ttiny;" > TEST003_junk;
>>sh regrhive.ksh -f TEST003_junk;
>>
@@ -301,13 +301,13 @@ A B C D
>>invoke hive.hive.ttiny;
-- Definition of hive table TTINY
--- Definition current Tue Jun 14 17:34:44 2016
+-- Definition current Sat Jun 25 16:25:08 2016
(
A TINYINT
, B TINYINT
)
- /* stored as textfile */
+ /* stored as textfile */
--- SQL operation complete.
>>select * from hive.hive.ttiny;
@@ -346,7 +346,7 @@ A B
--- 4 row(s) selected.
>>
->>obey TEST003(errors);
+>>obey TEST003(errors_tiny);
>>update t003t1 set b = b + 1;
*** ERROR[8411] A numeric overflow occurred during an arithmetic computation or data conversion. Conversion of Source Type:SMALLINT SIGNED(REC_BIN16_SIGNED) Source Value:128 to Target Type:TINYINT SIGNED(REC_BIN8_SIGNED).
@@ -422,4 +422,993 @@ A B
--- 0 row(s) inserted.
>>
>>
+>>
+>>cqd traf_largeint_unsigned_io 'ON';
+
+--- SQL operation complete.
+>>cqd traf_create_signed_numeric_literal 'ON';
+
+--- SQL operation complete.
+>>obey TEST003(setup_lu);
+>>drop table if exists t003t2;
+
+--- SQL operation complete.
+>>drop table if exists t003t2_like;
+
+--- SQL operation complete.
+>>drop table if exists t003t2_as;
+
+--- SQL operation complete.
+>>
+>>create table t003t2(a largeint unsigned not null primary key, b largeint unsigned);
+
+--- SQL operation complete.
+>>invoke t003t2;
+
+-- Definition of Trafodion table TRAFODION.SCH.T003T2
+-- Definition current Sat Jun 25 16:25:17 2016
+
+ (
+ A LARGEINT UNSIGNED NO DEFAULT NOT NULL NOT
+ DROPPABLE
+ , B LARGEINT UNSIGNED DEFAULT NULL
+ )
+ PRIMARY KEY (A ASC)
+
+--- SQL operation complete.
+>>
+>>create table t003t2_like like t003t2;
+
+--- SQL operation complete.
+>>invoke t003t2_like;
+
+-- Definition of Trafodion table TRAFODION.SCH.T003T2_LIKE
+-- Definition current Sat Jun 25 16:25:22 2016
+
+ (
+ A LARGEINT UNSIGNED NO DEFAULT NOT NULL NOT
+ DROPPABLE
+ , B LARGEINT UNSIGNED DEFAULT NULL
+ )
+ PRIMARY KEY (A ASC)
+
+--- SQL operation complete.
+>>
+>>create table t003t2_as primary key(a) as select * from t003t2;
+
+--- 0 row(s) inserted.
+>>invoke t003t2_as;
+
+-- Definition of Trafodion table TRAFODION.SCH.T003T2_AS
+-- Definition current Sat Jun 25 16:25:25 2016
+
+ (
+ A LARGEINT UNSIGNED NO DEFAULT NOT NULL NOT
+ DROPPABLE
+ , B LARGEINT UNSIGNED DEFAULT NULL
+ )
+ PRIMARY KEY (A ASC)
+
+--- SQL operation complete.
+>>
+>>obey TEST003(dml_lu);
+>>insert into t003t2 values (1, 2);
+
+--- 1 row(s) inserted.
+>>insert into t003t2 values (18446744073709551615, 18446744073709551615);
+
+--- 1 row(s) inserted.
+>>
+>>select * from t003t2;
+
+A B
+-------------------- --------------------
+
+ 1 2
+18446744073709551615 18446744073709551615
+
+--- 2 row(s) selected.
+>>
+>>insert into t003t2_as select * from t003t2;
+
+--- 2 row(s) inserted.
+>>select * from t003t2_as;
+
+A B
+-------------------- --------------------
+
+ 1 2
+18446744073709551615 18446744073709551615
+
+--- 2 row(s) selected.
+>>
+>>select * from t003t2 where a = 1;
+
+A B
+-------------------- --------------------
+
+ 1 2
+
+--- 1 row(s) selected.
+>>select * from t003t2 where a = -1;
+
+--- 0 row(s) selected.
+>>select * from t003t2 where a < 1;
+
+--- 0 row(s) selected.
+>>select * from t003t2 where a <= -1;
+
+--- 0 row(s) selected.
+>>select * from t003t2 where a < 1000;
+
+A B
+-------------------- --------------------
+
+ 1 2
+
+--- 1 row(s) selected.
+>>select * from t003t2 where a > -1000;
+
+A B
+-------------------- --------------------
+
+ 1 2
+18446744073709551615 18446744073709551615
+
+--- 2 row(s) selected.
+>>select * from t003t2 where a = 18446744073709551615;
+
+A B
+-------------------- --------------------
+
+18446744073709551615 18446744073709551615
+
+--- 1 row(s) selected.
+>>
+>>select * from t003t2 where b = 2;
+
+A B
+-------------------- --------------------
+
+ 1 2
+
+--- 1 row(s) selected.
+>>select * from t003t2 where b < -1;
+
+--- 0 row(s) selected.
+>>select * from t003t2 where b < 1000;
+
+A B
+-------------------- --------------------
+
+ 1 2
+
+--- 1 row(s) selected.
+>>select * from t003t2 where b > -1000;
+
+A B
+-------------------- --------------------
+
+ 1 2
+18446744073709551615 18446744073709551615
+
+--- 2 row(s) selected.
+>>select * from t003t2 where b = 18446744073709551615;
+
+A B
+-------------------- --------------------
+
+18446744073709551615 18446744073709551615
+
+--- 1 row(s) selected.
+>>
+>>select a, cast(cast(a as varchar(40)) as largeint unsigned) from t003t2;
+
+A (EXPR)
+-------------------- --------------------
+
+ 1 1
+18446744073709551615 18446744073709551615
+
+--- 2 row(s) selected.
+>>
+>>select a+10 from t003t2 where a = 1 or a = -1;
+
+(EXPR)
+--------------------
+
+ 11
+
+--- 1 row(s) selected.
+>>
+>>select cast(100 as largeint unsigned) from (values(1)) x(a);
+
+(EXPR)
+--------------------
+
+ 100
+
+--- 1 row(s) selected.
+>>
+>>select cast(a as char(21)), cast (b as varchar(22)) from t003t2;
+
+(EXPR) (EXPR)
+--------------------- ----------------------
+
+1 2
+18446744073709551615 18446744073709551615
+
+--- 2 row(s) selected.
+>>
+>>prepare s from insert into t003t2 values (?, ?);
+
+--- SQL command prepared.
+>>execute s using 251, 0;
+
+--- 1 row(s) inserted.
+>>execute s using 11, 18446744073709551615;
+
+--- 1 row(s) inserted.
+>>select * from t003t2;
+
+A B
+-------------------- --------------------
+
+ 1 2
+ 11 18446744073709551615
+ 251 0
+18446744073709551615 18446744073709551615
+
+--- 4 row(s) selected.
+>>
+>>begin work;
+
+--- SQL operation complete.
+>>delete from t003t2 where b = 1;
+
+--- 0 row(s) deleted.
+>>select * from t003t2;
+
+A B
+-------------------- --------------------
+
+ 1 2
+ 11 18446744073709551615
+ 251 0
+18446744073709551615 18446744073709551615
+
+--- 4 row(s) selected.
+>>rollback work;
+
+--- SQL operation complete.
+>>
+>>begin work;
+
+--- SQL operation complete.
+>>update t003t2 set b = b + 1 where b = 2;
+
+--- 1 row(s) updated.
+>>select * from t003t2;
+
+A B
+-------------------- --------------------
+
+ 1 3
+ 11 18446744073709551615
+ 251 0
+18446744073709551615 18446744073709551615
+
+--- 4 row(s) selected.
+>>rollback work;
+
+--- SQL operation complete.
+>>
+>>obey TEST003(errors_lu);
+>>update t003t2 set b = b + 1;
+
+*** ERROR[8411] A numeric overflow occurred during an arithmetic computation or data conversion. Conversion of Source Type:NUMERIC(REC_NUM_BIG_SIGNED) Source Value:0x00000000000000000100 to Target Type:LARGEINT UNSIGNED(REC_BIN64_UNSIGNED).
+
+--- 0 row(s) updated.
+>>
+>>delete from t003t2;
+
+--- 4 row(s) deleted.
+>>
+>>insert into t003t2 values (18446744073709551616, 2);
+
+*** ERROR[8411] A numeric overflow occurred during an arithmetic computation or data conversion. Conversion of Source Type:NUMERIC(REC_NUM_BIG_SIGNED) Source Value:0x00000000000000000100 to Target Type:LARGEINT UNSIGNED(REC_BIN64_UNSIGNED).
+
+--- 0 row(s) inserted.
+>>insert into t003t2 values (2, 18446744073709551616);
+
+*** ERROR[8411] A numeric overflow occurred during an arithmetic computation or data conversion. Conversion of Source Type:NUMERIC(REC_NUM_BIG_SIGNED) Source Value:0x00000000000000000100 to Target Type:LARGEINT UNSIGNED(REC_BIN64_UNSIGNED).
+
+--- 0 row(s) inserted.
+>>insert into t003t2 values (-1, 1);
+
+*** ERROR[8432] A negative value cannot be converted to an unsigned numeric datatype.
+
+--- 0 row(s) inserted.
+>>
+>>select cast(-1 as largeint unsigned) from (values(1)) x(a);
+
+*** ERROR[8432] A negative value cannot be converted to an unsigned numeric datatype.
+
+--- 0 row(s) selected.
+>>select cast(18446744073709551616 as largeint unsigned) from (values(1)) x(a);
+
+*** ERROR[8411] A numeric overflow occurred during an arithmetic computation or data conversion. Conversion of Source Type:NUMERIC(REC_NUM_BIG_SIGNED) Source Value:0x00000000000000000100 to Target Type:LARGEINT UNSIGNED(REC_BIN64_UNSIGNED).
+
+--- 0 row(s) selected.
+>>
+>>prepare s from insert into t003t2 values (?, ?);
+
+--- SQL command prepared.
+>>execute s using 18446744073709551616, 2;
+
+*** ERROR[8411] A numeric overflow occurred during an arithmetic computation or data conversion. Conversion of Source Type:CHAR(REC_BYTE_F_ASCII,20 BYTES,ISO88591) Source Value:18446744073709551616 to Target Type:LARGEINT(REC_BIN64_SIGNED).
+
+*** ERROR[15015] PARAM ?(UNNAMED_1) (value 18446744073709551616) cannot be converted to type LARGEINT UNSIGNED.
+
+--- 0 row(s) inserted.
+>>
+>>
+>>
+>>cqd traf_create_signed_numeric_literal 'OFF';
+
+--- SQL operation complete.
+>>obey TEST003(setup_lu);
+>>drop table if exists t003t2;
+
+--- SQL operation complete.
+>>drop table if exists t003t2_like;
+
+--- SQL operation complete.
+>>drop table if exists t003t2_as;
+
+--- SQL operation complete.
+>>
+>>create table t003t2(a largeint unsigned not null primary key, b largeint unsigned);
+
+--- SQL operation complete.
+>>invoke t003t2;
+
+-- Definition of Trafodion table TRAFODION.SCH.T003T2
+-- Definition current Sat Jun 25 16:25:51 2016
+
+ (
+ A LARGEINT UNSIGNED NO DEFAULT NOT NULL NOT
+ DROPPABLE
+ , B LARGEINT UNSIGNED DEFAULT NULL
+ )
+ PRIMARY KEY (A ASC)
+
+--- SQL operation complete.
+>>
+>>create table t003t2_like like t003t2;
+
+--- SQL operation complete.
+>>invoke t003t2_like;
+
+-- Definition of Trafodion table TRAFODION.SCH.T003T2_LIKE
+-- Definition current Sat Jun 25 16:25:55 2016
+
+ (
+ A LARGEINT UNSIGNED NO DEFAULT NOT NULL NOT
+ DROPPABLE
+ , B LARGEINT UNSIGNED DEFAULT NULL
+ )
+ PRIMARY KEY (A ASC)
+
+--- SQL operation complete.
+>>
+>>create table t003t2_as primary key(a) as select * from t003t2;
+
+--- 0 row(s) inserted.
+>>invoke t003t2_as;
+
+-- Definition of Trafodion table TRAFODION.SCH.T003T2_AS
+-- Definition current Sat Jun 25 16:25:58 2016
+
+ (
+ A LARGEINT UNSIGNED NO DEFAULT NOT NULL NOT
+ DROPPABLE
+ , B LARGEINT UNSIGNED DEFAULT NULL
+ )
+ PRIMARY KEY (A ASC)
+
+--- SQL operation complete.
+>>
+>>obey TEST003(dml_lu);
+>>insert into t003t2 values (1, 2);
+
+--- 1 row(s) inserted.
+>>insert into t003t2 values (18446744073709551615, 18446744073709551615);
+
+--- 1 row(s) inserted.
+>>
+>>select * from t003t2;
+
+A B
+-------------------- --------------------
+
+ 1 2
+18446744073709551615 18446744073709551615
+
+--- 2 row(s) selected.
+>>
+>>insert into t003t2_as select * from t003t2;
+
+--- 2 row(s) inserted.
+>>select * from t003t2_as;
+
+A B
+-------------------- --------------------
+
+ 1 2
+18446744073709551615 18446744073709551615
+
+--- 2 row(s) selected.
+>>
+>>select * from t003t2 where a = 1;
+
+A B
+-------------------- --------------------
+
+ 1 2
+
+--- 1 row(s) selected.
+>>select * from t003t2 where a = -1;
+
+--- 0 row(s) selected.
+>>select * from t003t2 where a < 1;
+
+--- 0 row(s) selected.
+>>select * from t003t2 where a <= -1;
+
+--- 0 row(s) selected.
+>>select * from t003t2 where a < 1000;
+
+A B
+-------------------- --------------------
+
+ 1 2
+
+--- 1 row(s) selected.
+>>select * from t003t2 where a > -1000;
+
+A B
+-------------------- --------------------
+
+ 1 2
+18446744073709551615 18446744073709551615
+
+--- 2 row(s) selected.
+>>select * from t003t2 where a = 18446744073709551615;
+
+A B
+-------------------- --------------------
+
+18446744073709551615 18446744073709551615
+
+--- 1 row(s) selected.
+>>
+>>select * from t003t2 where b = 2;
+
+A B
+-------------------- --------------------
+
+ 1 2
+
+--- 1 row(s) selected.
+>>select * from t003t2 where b < -1;
+
+--- 0 row(s) selected.
+>>select * from t003t2 where b < 1000;
+
+A B
+-------------------- --------------------
+
+ 1 2
+
+--- 1 row(s) selected.
+>>select * from t003t2 where b > -1000;
+
+A B
+-------------------- --------------------
+
+ 1 2
+18446744073709551615 18446744073709551615
+
+--- 2 row(s) selected.
+>>select * from t003t2 where b = 18446744073709551615;
+
+A B
+-------------------- --------------------
+
+18446744073709551615 18446744073709551615
+
+--- 1 row(s) selected.
+>>
+>>select a, cast(cast(a as varchar(40)) as largeint unsigned) from t003t2;
+
+A (EXPR)
+-------------------- --------------------
+
+ 1 1
+18446744073709551615 18446744073709551615
+
+--- 2 row(s) selected.
+>>
+>>select a+10 from t003t2 where a = 1 or a = -1;
+
+(EXPR)
+--------------------
+
+ 11
+
+--- 1 row(s) selected.
+>>
+>>select cast(100 as largeint unsigned) from (values(1)) x(a);
+
+(EXPR)
+--------------------
+
+ 100
+
+--- 1 row(s) selected.
+>>
+>>select cast(a as char(21)), cast (b as varchar(22)) from t003t2;
+
+(EXPR) (EXPR)
+--------------------- ----------------------
+
+1 2
+18446744073709551615 18446744073709551615
+
+--- 2 row(s) selected.
+>>
+>>prepare s from insert into t003t2 values (?, ?);
+
+--- SQL command prepared.
+>>execute s using 251, 0;
+
+--- 1 row(s) inserted.
+>>execute s using 11, 18446744073709551615;
+
+--- 1 row(s) inserted.
+>>select * from t003t2;
+
+A B
+-------------------- --------------------
+
+ 1 2
+ 11 18446744073709551615
+ 251 0
+18446744073709551615 18446744073709551615
+
+--- 4 row(s) selected.
+>>
+>>begin work;
+
+--- SQL operation complete.
+>>delete from t003t2 where b = 1;
+
+--- 0 row(s) deleted.
+>>select * from t003t2;
+
+A B
+-------------------- --------------------
+
+ 1 2
+ 11 18446744073709551615
+ 251 0
+18446744073709551615 18446744073709551615
+
+--- 4 row(s) selected.
+>>rollback work;
+
+--- SQL operation complete.
+>>
+>>begin work;
+
+--- SQL operation complete.
+>>update t003t2 set b = b + 1 where b = 2;
+
+--- 1 row(s) updated.
+>>select * from t003t2;
+
+A B
+-------------------- --------------------
+
+ 1 3
+ 11 18446744073709551615
+ 251 0
+18446744073709551615 18446744073709551615
+
+--- 4 row(s) selected.
+>>rollback work;
+
+--- SQL operation complete.
+>>
+>>obey TEST003(errors_lu);
+>>update t003t2 set b = b + 1;
+
+*** ERROR[8411] A numeric overflow occurred during an arithmetic computation or data conversion. Conversion of Source Type:NUMERIC(REC_NUM_BIG_SIGNED) Source Value:0x00000000000000000100 to Target Type:LARGEINT UNSIGNED(REC_BIN64_UNSIGNED).
+
+--- 0 row(s) updated.
+>>
+>>delete from t003t2;
+
+--- 4 row(s) deleted.
+>>
+>>insert into t003t2 values (18446744073709551616, 2);
+
+*** ERROR[8411] A numeric overflow occurred during an arithmetic computation or data conversion. Conversion of Source Type:NUMERIC(REC_NUM_BIG_SIGNED) Source Value:0x00000000000000000100 to Target Type:LARGEINT UNSIGNED(REC_BIN64_UNSIGNED).
+
+--- 0 row(s) inserted.
+>>insert into t003t2 values (2, 18446744073709551616);
+
+*** ERROR[8411] A numeric overflow occurred during an arithmetic computation or data conversion. Conversion of Source Type:NUMERIC(REC_NUM_BIG_SIGNED) Source Value:0x00000000000000000100 to Target Type:LARGEINT UNSIGNED(REC_BIN64_UNSIGNED).
+
+--- 0 row(s) inserted.
+>>insert into t003t2 values (-1, 1);
+
+*** ERROR[8432] A negative value cannot be converted to an unsigned numeric datatype.
+
+--- 0 row(s) inserted.
+>>
+>>select cast(-1 as largeint unsigned) from (values(1)) x(a);
+
+*** ERROR[8432] A negative value cannot be converted to an unsigned numeric datatype.
+
+--- 0 row(s) selected.
+>>select cast(18446744073709551616 as largeint unsigned) from (values(1)) x(a);
+
+*** ERROR[8411] A numeric overflow occurred during an arithmetic computation or data conversion. Conversion of Source Type:NUMERIC(REC_NUM_BIG_SIGNED) Source Value:0x00000000000000000100 to Target Type:LARGEINT UNSIGNED(REC_BIN64_UNSIGNED).
+
+--- 0 row(s) selected.
+>>
+>>prepare s from insert into t003t2 values (?, ?);
+
+--- SQL command prepared.
+>>execute s using 18446744073709551616, 2;
+
+*** ERROR[8411] A numeric overflow occurred during an arithmetic computation or data conversion. Conversion of Source Type:CHAR(REC_BYTE_F_ASCII,20 BYTES,ISO88591) Source Value:18446744073709551616 to Target Type:LARGEINT(REC_BIN64_SIGNED).
+
+*** ERROR[15015] PARAM ?(UNNAMED_1) (value 18446744073709551616) cannot be converted to type LARGEINT UNSIGNED.
+
+--- 0 row(s) inserted.
+>>
+>>
+>>
+>>cqd traf_create_signed_numeric_literal 'ON';
+
+--- SQL operation complete.
+>>cqd traf_largeint_unsigned_io 'OFF';
+
+--- SQL operation complete.
+>>obey TEST003(setup_lu);
+>>drop table if exists t003t2;
+
+--- SQL operation complete.
+>>drop table if exists t003t2_like;
+
+--- SQL operation complete.
+>>drop table if exists t003t2_as;
+
+--- SQL operation complete.
+>>
+>>create table t003t2(a largeint unsigned not null primary key, b largeint unsigned);
+
+--- SQL operation complete.
+>>invoke t003t2;
+
+-- Definition of Trafodion table TRAFODION.SCH.T003T2
+-- Definition current Sat Jun 25 16:26:23 2016
+
+ (
+ A LARGEINT UNSIGNED NO DEFAULT NOT NULL NOT
+ DROPPABLE
+ , B LARGEINT UNSIGNED DEFAULT NULL
+ )
+ PRIMARY KEY (A ASC)
+
+--- SQL operation complete.
+>>
+>>create table t003t2_like like t003t2;
+
+--- SQL operation complete.
+>>invoke t003t2_like;
+
+-- Definition of Trafodion table TRAFODION.SCH.T003T2_LIKE
+-- Definition current Sat Jun 25 16:26:28 2016
+
+ (
+ A LARGEINT UNSIGNED NO DEFAULT NOT NULL NOT
+ DROPPABLE
+ , B LARGEINT UNSIGNED DEFAULT NULL
+ )
+ PRIMARY KEY (A ASC)
+
+--- SQL operation complete.
+>>
+>>create table t003t2_as primary key(a) as select * from t003t2;
+
+--- 0 row(s) inserted.
+>>invoke t003t2_as;
+
+-- Definition of Trafodion table TRAFODION.SCH.T003T2_AS
+-- Definition current Sat Jun 25 16:26:31 2016
+
+ (
+ A LARGEINT UNSIGNED NO DEFAULT NOT NULL NOT
+ DROPPABLE
+ , B LARGEINT UNSIGNED DEFAULT NULL
+ )
+ PRIMARY KEY (A ASC)
+
+--- SQL operation complete.
+>>
+>>obey TEST003(dml_lu);
+>>insert into t003t2 values (1, 2);
+
+--- 1 row(s) inserted.
+>>insert into t003t2 values (18446744073709551615, 18446744073709551615);
+
+--- 1 row(s) inserted.
+>>
+>>select * from t003t2;
+
+A B
+--------------------- ---------------------
+
+ 1 2
+ 18446744073709551615 18446744073709551615
+
+--- 2 row(s) selected.
+>>
+>>insert into t003t2_as select * from t003t2;
+
+--- 2 row(s) inserted.
+>>select * from t003t2_as;
+
+A B
+--------------------- ---------------------
+
+ 1 2
+ 18446744073709551615 18446744073709551615
+
+--- 2 row(s) selected.
+>>
+>>select * from t003t2 where a = 1;
+
+A B
+--------------------- ---------------------
+
+ 1 2
+
+--- 1 row(s) selected.
+>>select * from t003t2 where a = -1;
+
+--- 0 row(s) selected.
+>>select * from t003t2 where a < 1;
+
+--- 0 row(s) selected.
+>>select * from t003t2 where a <= -1;
+
+--- 0 row(s) selected.
+>>select * from t003t2 where a < 1000;
+
+A B
+--------------------- ---------------------
+
+ 1 2
+
+--- 1 row(s) selected.
+>>select * from t003t2 where a > -1000;
+
+A B
+--------------------- ---------------------
+
+ 1 2
+ 18446744073709551615 18446744073709551615
+
+--- 2 row(s) selected.
+>>select * from t003t2 where a = 18446744073709551615;
+
+A B
+--------------------- ---------------------
+
+ 18446744073709551615 18446744073709551615
+
+--- 1 row(s) selected.
+>>
+>>select * from t003t2 where b = 2;
+
+A B
+--------------------- ---------------------
+
+ 1 2
+
+--- 1 row(s) selected.
+>>select * from t003t2 where b < -1;
+
+--- 0 row(s) selected.
+>>select * from t003t2 where b < 1000;
+
+A B
+--------------------- ---------------------
+
+ 1 2
+
+--- 1 row(s) selected.
+>>select * from t003t2 where b > -1000;
+
+A B
+--------------------- ---------------------
+
+ 1 2
+ 18446744073709551615 18446744073709551615
+
+--- 2 row(s) selected.
+>>select * from t003t2 where b = 18446744073709551615;
+
+A B
+--------------------- ---------------------
+
+ 18446744073709551615 18446744073709551615
+
+--- 1 row(s) selected.
+>>
+>>select a, cast(cast(a as varchar(40)) as largeint unsigned) from t003t2;
+
+A (EXPR)
+--------------------- ---------------------
+
+ 1 1
+ 18446744073709551615 18446744073709551615
+
+--- 2 row(s) selected.
+>>
+>>select a+10 from t003t2 where a = 1 or a = -1;
+
+(EXPR)
+--------------------
+
+ 11
+
+--- 1 row(s) selected.
+>>
+>>select cast(100 as largeint unsigned) from (values(1)) x(a);
+
+(EXPR)
+---------------------
+
+ 100
+
+--- 1 row(s) selected.
+>>
+>>select cast(a as char(21)), cast (b as varchar(22)) from t003t2;
+
+(EXPR) (EXPR)
+--------------------- ----------------------
+
+1 2
+18446744073709551615 18446744073709551615
+
+--- 2 row(s) selected.
+>>
+>>prepare s from insert into t003t2 values (?, ?);
+
+--- SQL command prepared.
+>>execute s using 251, 0;
+
+--- 1 row(s) inserted.
+>>execute s using 11, 18446744073709551615;
+
+--- 1 row(s) inserted.
+>>select * from t003t2;
+
+A B
+--------------------- ---------------------
+
+ 1 2
+ 11 18446744073709551615
+ 251 0
+ 18446744073709551615 18446744073709551615
+
+--- 4 row(s) selected.
+>>
+>>begin work;
+
+--- SQL operation complete.
+>>delete from t003t2 where b = 1;
+
+--- 0 row(s) deleted.
+>>select * from t003t2;
+
+A B
+--------------------- ---------------------
+
+ 1 2
+ 11 18446744073709551615
+ 251 0
+ 18446744073709551615 18446744073709551615
+
+--- 4 row(s) selected.
+>>rollback work;
+
+--- SQL operation complete.
+>>
+>>begin work;
+
+--- SQL operation complete.
+>>update t003t2 set b = b + 1 where b = 2;
+
+--- 1 row(s) updated.
+>>select * from t003t2;
+
+A B
+--------------------- ---------------------
+
+ 1 3
+ 11 18446744073709551615
+ 251 0
+ 18446744073709551615 18446744073709551615
+
+--- 4 row(s) selected.
+>>rollback work;
+
+--- SQL operation complete.
+>>
+>>obey TEST003(errors_lu);
+>>update t003t2 set b = b + 1;
+
+*** ERROR[8411] A numeric overflow occurred during an arithmetic computation or data conversion. Conversion of Source Type:NUMERIC(REC_NUM_BIG_SIGNED) Source Value:0x00000000000000000100 to Target Type:LARGEINT UNSIGNED(REC_BIN64_UNSIGNED).
+
+--- 0 row(s) updated.
+>>
+>>delete from t003t2;
+
+--- 4 row(s) deleted.
+>>
+>>insert into t003t2 values (18446744073709551616, 2);
+
+*** ERROR[8411] A numeric overflow occurred during an arithmetic computation or data conversion. Conversion of Source Type:NUMERIC(REC_NUM_BIG_SIGNED) Source Value:0x00000000000000000100 to Target Type:LARGEINT UNSIGNED(REC_BIN64_UNSIGNED).
+
+--- 0 row(s) inserted.
+>>insert into t003t2 values (2, 18446744073709551616);
+
+*** ERROR[8411] A numeric overflow occurred during an arithmetic computation or data conversion. Conversion of Source Type:NUMERIC(REC_NUM_BIG_SIGNED) Source Value:0x00000000000000000100 to Target Type:LARGEINT UNSIGNED(REC_BIN64_UNSIGNED).
+
+--- 0 row(s) inserted.
+>>insert into t003t2 values (-1, 1);
+
+*** ERROR[8432] A negative value cannot be converted to an unsigned numeric datatype.
+
+--- 0 row(s) inserted.
+>>
+>>select cast(-1 as largeint unsigned) from (values(1)) x(a);
+
+*** ERROR[8432] A negative value cannot be converted to an unsigned numeric datatype.
+
+--- 0 row(s) selected.
+>>select cast(18446744073709551616 as largeint unsigned) from (values(1)) x(a);
+
+*** ERROR[8411] A numeric overflow occurred during an arithmetic computation or data conversion. Conversion of Source Type:NUMERIC(REC_NUM_BIG_SIGNED) Source Value:0x00000000000000000100 to Target Type:LARGEINT UNSIGNED(REC_BIN64_UNSIGNED).
+
+--- 0 row(s) selected.
+>>
+>>prepare s from insert into t003t2 values (?, ?);
+
+--- SQL command prepared.
+>>execute s using 18446744073709551616, 2;
+
+*** ERROR[8411] A numeric overflow occurred during an arithmetic computation or data conversion. Conversion of Source Type:NUMERIC(REC_NUM_BIG_SIGNED) Source Value:0x00000000000000000100 to Target Type:LARGEINT UNSIGNED(REC_BIN64_UNSIGNED).
+
+--- 0 row(s) inserted.
+>>
+>>
+>>
>>log;
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/911f1d64/core/sql/regress/seabase/EXPECTED020
----------------------------------------------------------------------
diff --git a/core/sql/regress/seabase/EXPECTED020 b/core/sql/regress/seabase/EXPECTED020
index 25bda60..23636e3 100644
--- a/core/sql/regress/seabase/EXPECTED020
+++ b/core/sql/regress/seabase/EXPECTED020
@@ -6,7 +6,7 @@
>>invoke test020t1;
-- Definition of Trafodion table TRAFODION.SCH.TEST020T1
--- Definition current Sun Mar 13 06:02:17 2016
+-- Definition current Wed Jun 22 05:43:20 2016
(
C1 INT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -49,7 +49,7 @@ C1 C2
>>invoke test020t2;
-- Definition of Trafodion table TRAFODION.SCH.TEST020T2
--- Definition current Thu Mar 24 20:57:21 2016
+-- Definition current Wed Jun 22 05:43:23 2016
(
C CHAR(15) CHARACTER SET ISO88591 COLLATE
@@ -161,7 +161,7 @@ G0
>>invoke test020t5;
-- Definition of Trafodion table TRAFODION.SCH.TEST020T5
--- Definition current Thu Mar 24 20:57:29 2016
+-- Definition current Wed Jun 22 05:43:36 2016
(
C INT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -260,7 +260,7 @@ ALTER TABLE TRAFODION.SCH.TEST020T5 ADD CONSTRAINT TRAFODION.SCH.TEST020T5C1
>>invoke test020t6;
-- Definition of Trafodion table TRAFODION.SCH.TEST020T6
--- Definition current Thu Mar 24 20:58:14 2016
+-- Definition current Wed Jun 22 05:44:27 2016
(
SYSKEY LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/911f1d64/core/sql/regress/seabase/TEST003
----------------------------------------------------------------------
diff --git a/core/sql/regress/seabase/TEST003 b/core/sql/regress/seabase/TEST003
index f55a6ca..b2068a5 100644
--- a/core/sql/regress/seabase/TEST003
+++ b/core/sql/regress/seabase/TEST003
@@ -19,7 +19,7 @@
--
-- @@@ END COPYRIGHT @@@
--- Tests for tinyint datatype
+-- Tests for tinyint, largeint unsigned datatypes
obey TEST003(clean_up);
@@ -30,14 +30,32 @@ cqd traf_tinyint_support 'ON';
cqd traf_tinyint_return_values 'ON';
cqd traf_tinyint_input_params 'ON';
-obey TEST003(setup);
-obey TEST003(dml);
-obey TEST003(tinyhive);
-obey TEST003(errors);
+obey TEST003(setup_tiny);
+obey TEST003(dml_tiny);
+obey TEST003(hive_tiny);
+obey TEST003(errors_tiny);
+
+cqd traf_largeint_unsigned_io 'ON';
+cqd traf_create_signed_numeric_literal 'ON';
+obey TEST003(setup_lu);
+obey TEST003(dml_lu);
+obey TEST003(errors_lu);
+
+cqd traf_create_signed_numeric_literal 'OFF';
+obey TEST003(setup_lu);
+obey TEST003(dml_lu);
+obey TEST003(errors_lu);
+
+cqd traf_create_signed_numeric_literal 'ON';
+cqd traf_largeint_unsigned_io 'OFF';
+obey TEST003(setup_lu);
+obey TEST003(dml_lu);
+obey TEST003(errors_lu);
+
log;
exit;
-?section setup
+?section setup_tiny
create table t003t1(a tinyint not null primary key, b tinyint,
c tinyint unsigned default 10 not null, d tinyint unsigned);
invoke t003t1;
@@ -45,10 +63,10 @@ invoke t003t1;
create table t003t1_like like t003t1;
invoke t003t1_like;
-create table t003t1_as as select * from t003t1;
+create table t003t1_as primary key (a) as select * from t003t1;
invoke t003t1_as;
-?section dml
+?section dml_tiny
insert into t003t1 values (1, 2, 3, 4);
insert into t003t1 values (-1, -2, 255, 255);
insert into t003t1 values (-128, 127, 0, 0);
@@ -91,7 +109,7 @@ update t003t1 set b = b + 1 where b <> 127;
select * from t003t1;
rollback work;
-?section tinyhive
+?section hive_tiny
sh echo "drop table ttiny;" > TEST003_junk;
sh regrhive.ksh -f TEST003_junk;
@@ -108,7 +126,7 @@ select * from hive.hive.ttiny;
insert overwrite table hive.hive.ttiny select a, b from t003t1;
select * from hive.hive.ttiny;
-?section errors
+?section errors_tiny
update t003t1 set b = b + 1;
delete from t003t1;
@@ -128,11 +146,92 @@ execute s using 128, 2, 3, 4;
execute s using 4, 4, 256, -4;
+?section setup_lu
+drop table if exists t003t2;
+drop table if exists t003t2_like;
+drop table if exists t003t2_as;
+
+create table t003t2(a largeint unsigned not null primary key, b largeint unsigned);
+invoke t003t2;
+
+create table t003t2_like like t003t2;
+invoke t003t2_like;
+
+create table t003t2_as primary key(a) as select * from t003t2;
+invoke t003t2_as;
+
+?section dml_lu
+insert into t003t2 values (1, 2);
+insert into t003t2 values (18446744073709551615, 18446744073709551615);
+
+select * from t003t2;
+
+insert into t003t2_as select * from t003t2;
+select * from t003t2_as;
+
+select * from t003t2 where a = 1;
+select * from t003t2 where a = -1;
+select * from t003t2 where a < 1;
+select * from t003t2 where a <= -1;
+select * from t003t2 where a < 1000;
+select * from t003t2 where a > -1000;
+select * from t003t2 where a = 18446744073709551615;
+
+select * from t003t2 where b = 2;
+select * from t003t2 where b < -1;
+select * from t003t2 where b < 1000;
+select * from t003t2 where b > -1000;
+select * from t003t2 where b = 18446744073709551615;
+
+select a, cast(cast(a as varchar(40)) as largeint unsigned) from t003t2;
+
+select a+10 from t003t2 where a = 1 or a = -1;
+
+select cast(100 as largeint unsigned) from (values(1)) x(a);
+
+select cast(a as char(21)), cast (b as varchar(22)) from t003t2;
+
+prepare s from insert into t003t2 values (?, ?);
+execute s using 251, 0;
+execute s using 11, 18446744073709551615;
+select * from t003t2;
+
+begin work;
+delete from t003t2 where b = 1;
+select * from t003t2;
+rollback work;
+
+begin work;
+update t003t2 set b = b + 1 where b = 2;
+select * from t003t2;
+rollback work;
+
+?section errors_lu
+update t003t2 set b = b + 1;
+
+delete from t003t2;
+
+insert into t003t2 values (18446744073709551616, 2);
+insert into t003t2 values (2, 18446744073709551616);
+insert into t003t2 values (-1, 1);
+
+select cast(-1 as largeint unsigned) from (values(1)) x(a);
+select cast(18446744073709551616 as largeint unsigned) from (values(1)) x(a);
+
+prepare s from insert into t003t2 values (?, ?);
+execute s using 18446744073709551616, 2;
+
+
?section clean_up
drop table t003t1;
drop table t003t1_like;
drop table t003t1_as;
+drop table t003t2;
+drop table t003t2_like;
+drop table t003t2_as;
+
+
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/911f1d64/core/sql/sqlci/SqlciEnv.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlci/SqlciEnv.cpp b/core/sql/sqlci/SqlciEnv.cpp
index 8cb63f1..a8d9bab 100644
--- a/core/sql/sqlci/SqlciEnv.cpp
+++ b/core/sql/sqlci/SqlciEnv.cpp
@@ -482,12 +482,15 @@ void SqlciEnv::generateExplain()
}
}
-void SqlciEnv::tinyintSupport()
+void SqlciEnv::datatypeSupport()
{
// Can handle tinyint datatype
SqlCmd::executeQuery("CONTROL QUERY DEFAULT TRAF_TINYINT_SUPPORT 'ON';", this);
SqlCmd::executeQuery("CONTROL QUERY DEFAULT TRAF_TINYINT_RETURN_VALUES 'ON';", this);
SqlCmd::executeQuery("CONTROL QUERY DEFAULT TRAF_TINYINT_INPUT_PARAMS 'ON';", this);
+
+ // can handle largeint unsigned datatype
+ SqlCmd::executeQuery("CONTROL QUERY DEFAULT TRAF_LARGEINT_UNSIGNED_IO 'ON';", this);
if (!specialError_)
{
exit(EXIT_FAILURE);
@@ -548,7 +551,7 @@ static void SqlciEnv_prologue_to_run(SqlciEnv *sqlciEnv)
sqlciEnv->readonlyCursors();
sqlciEnv->pertableStatistics();
sqlciEnv->generateExplain();
- sqlciEnv->tinyintSupport();
+ sqlciEnv->datatypeSupport();
sqlciEnv->sqlmxRegress();
// see catman/CatWellKnownTables.cpp for this envvar need.
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/911f1d64/core/sql/sqlci/SqlciEnv.h
----------------------------------------------------------------------
diff --git a/core/sql/sqlci/SqlciEnv.h b/core/sql/sqlci/SqlciEnv.h
index 122439b..f4b5019 100644
--- a/core/sql/sqlci/SqlciEnv.h
+++ b/core/sql/sqlci/SqlciEnv.h
@@ -328,7 +328,7 @@ public:
void readonlyCursors();
void pertableStatistics();
void generateExplain();
- void tinyintSupport();
+ void datatypeSupport();
void sqlmxRegress();
void welcomeMessage();
|