Verified on the v0307 build installed on a workstation. This problem has been fixed.
With the line in qaTmudfTest.cpp remains as info.out().setLong(2, -3333); the execution returns error 11252, as a numeric unsigned output can't take a negative value -3333:
With the line in qaTmudfTest.cpp changed to info.out().setLong(2, 3333); the execution output indicates that the input data type for column c2 is now correctly mapped to TypeInfo::NUMERIC_UNSIGNED
Verified on the v0307 build installed on a workstation. This problem has been fixed.
With the line in qaTmudfTest.cpp remains as info.out( ).setLong( 2, -3333); the execution returns error 11252, as a numeric unsigned output can't take a negative value -3333:
>>create schema mytest;
--- SQL operation complete.
>>set schema mytest;
--- SQL operation complete. /qaTmudfTest. so';
>>
>>create library qaTmudfLib file '<mydir>
--- SQL operation complete.
>>
>>create table mytable (
+>c1 numeric(9,2),
+>c2 numeric(9,2) unsigned
+>);
--- SQL operation complete.
>>
>>insert into mytable values (-11.11, 22.22);
--- 1 row(s) inserted.
>>
>>create table_mapping function qaTmudfGeneral()
+>returns (
+>o1 char(50),
+>o2 char(50),
+>o3 numeric(9,2) unsigned
+>)
+>external name 'QA_TMUDF'
+>language cpp
+>library qaTmudfLib;
--- SQL operation complete.
>>
>>select * from mytable;
C1 C2
------------ -----------
-11.11 22.22
--- 1 row(s) selected. ral(TABLE( select * from mytable)));
>>
>>select * from UDF(qaTmudfGene
*** ERROR[11252] Trying to assign a negative value to an INT UNSIGNED type (SQLSTATE 38900)
--- 0 row(s) selected.
>>
>>drop schema mytest cascade;
--- SQL operation complete.
------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------
With the line in qaTmudfTest.cpp changed to info.out( ).setLong( 2, 3333); the execution output indicates that the input data type for column c2 is now correctly mapped to TypeInfo: :NUMERIC_ UNSIGNED
>>create schema mytest;
--- SQL operation complete.
>>set schema mytest;
--- SQL operation complete. /qaTmudfTest. so';
>>
>>create library qaTmudfLib file '<mydir>
--- SQL operation complete.
>>
>>create table mytable (
+>c1 numeric(9,2),
+>c2 numeric(9,2) unsigned
+>);
--- SQL operation complete.
>>
>>insert into mytable values (-11.11, 22.22);
--- 1 row(s) inserted.
>>
>>create table_mapping function qaTmudfGeneral()
+>returns (
+>o1 char(50),
+>o2 char(50),
+>o3 numeric(9,2) unsigned
+>)
+>external name 'QA_TMUDF'
+>language cpp
+>library qaTmudfLib;
--- SQL operation complete.
>>
>>select * from mytable;
C1 C2
------------ -----------
-11.11 22.22
--- 1 row(s) selected. ral(TABLE( select * from mytable)));
>>
>>select * from UDF(qaTmudfGene
O1 O2 O3 ------- ------- ------- ------- ------- ------- - ------- ------- ------- ------- ------- ------- ------- - -----------
-------
c[1]: TypeInfo::NUMERIC c[2]: TypeInfo: :NUMERIC_ UNSIGNED 33.33
--- 1 row(s) selected.
>>
>>drop schema mytest cascade;
--- SQL operation complete.