TMUDF: User defined error number for UDRException() not returned at run time
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Trafodion |
Fix Released
|
Medium
|
Hans Zeller |
Bug Description
Throwing an UDRException() from a compile time interface, such as describeParamsA
As shown here in the example, the TMUDF throws an UDRException() with the user defined error number 38001. But when executed, only the error message was propagated back.
void QATmudf:
{
throw UDRException(38001, "test exception in process data");
}
This is seen on the v0305 build installed on a workstation. To reproduce it:
(1) Download the attached tar file and untar it to get the 3 files in there. Put the files in any directory <mydir>
(2) Make sure that you have run ./sqenv.sh of your Trafodion instance first as building UDF needs $MY_SQROOT for the header files.
(3) Run build.sh from <mydir> to build the UDF so file.
(4) Change the line create library qaTmudfLib file '<mydir>
(5) From sqlci, obey mytest.sql
-------
Here is the execution output:
>>log mytest.log clear;
>>drop schema mytest cascade;
*** ERROR[1003] Schema TRAFODION.MYTEST does not exist.
--- SQL operation failed with errors.
>>create schema mytest;
--- SQL operation complete.
>>set schema mytest;
--- SQL operation complete.
>>
>>create library qaTmudfLib file '/designs/
--- SQL operation complete.
>>
>>create table mytable (a int, b int);
--- SQL operation complete.
>>insert into mytable values (1,1),(2,2);
--- 2 row(s) inserted.
>>
>>create table_mapping function qa_tmudf()
+>external name 'QA_TMUDF'
+>language cpp
+>library qaTmudfLib;
--- SQL operation complete.
>>
>>select * from UDF(qa_
*** ERROR[11249] User-defined function QA_TMUDF completed with an error with SQLSTATE . Details: test exception in process data.
*** ERROR[2037] $Z0001XI:172: A message from process $Z00029T:175 was incorrectly formatted and could not be processed.
*** ERROR[8906] An invalid or corrupt MXUDR reply could not be processed, possibly due to memory corruption in MXUDR while executing user-defined routines or an internal error in SQL.
--- 0 row(s) selected.
>>
>>drop schema mytest cascade;
--- SQL operation complete.
>>
>>exit;
End of MXCI Session
Changed in trafodion: | |
assignee: | nobody → Hans Zeller (hans-zeller) |
With my latest change this testcase works now. Unfortunately I didn't validate the problem earlier, so I'm not sure what the cause or the fix are.