TMUDF: TableInfo::getNumRows() returns wrong count
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Trafodion |
Fix Released
|
High
|
Hans Zeller |
Bug Description
As shown in the following example, TableInfo:
This is seen on the v0312 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 showing that the program raised a user-defined exception when TableInfo:
>>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 '<mydir>
--- SQL operation complete.
>>
>>create table mytable (a int, b int);
--- SQL operation complete.
>>insert into mytable values (1,1),(
--- 5 row(s) inserted.
>>
>>create table_mapping function qaTmudfGeneral()
+>external name 'QA_TMUDF'
+>language cpp
+>library qaTmudfLib;
--- SQL operation complete.
>>
>>select * from UDF(qaTmudfGene
*** ERROR[11252] Wrong input table row count:
Invalid getNumRows(): expecting 5 got -1
(SQLSTATE 38001)
*** ERROR[2037] $Z000QRX:79: A message from process $Z000RKV:82 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;
Changed in trafodion: | |
milestone: | none → r1.2 |
Changed in trafodion: | |
status: | Confirmed → In Progress |
Yes, the histogram statistics and cost parts of the C++ compiler interface are not yet implemented. I'll keep this bug until we support this interface (at least a basic version of it).