Comment 3 for bug 1436450

Revision history for this message
Weishiun Tsai (wei-shiun-tsai) wrote :

Verified on the v0407 build installed on a workstation. This problem has been fixed:

>>create schema mytest;

--- SQL operation complete.
>>set schema mytest;

--- SQL operation complete.
>>
>>create library qaTmudfLib file '<mydir>/qaTmudfTest.so';

--- SQL operation complete.
>>
>>create table mytable (c1 nchar(10), c2 nchar varying(10));

--- SQL operation complete.
>>insert into mytable values (_ucs2'aaa', _ucs2'bbb');

--- 1 row(s) inserted.
>>
>>create table_mapping function qaTmudfGeneral()
+>external name 'QA_TMUDF'
+>language cpp
+>library qaTmudfLib;

--- SQL operation complete.
>>
>>select char_length(c1), converttohex(c1), char_length(c2), converttohex(c2) from mytable;

(EXPR) (EXPR) (EXPR) (EXPR)
---------- ---------------------------------------- ---------- ----------------------------------------

        10 0061006100610020002000200020002000200020 3 006200620062

--- 1 row(s) selected.
>>
>>select char_length(c1), converttohex(c1), char_length(c2), converttohex(c2) from
+>UDF(qaTmudfGeneral(TABLE(select * from mytable)));

(EXPR) (EXPR) (EXPR) (EXPR)
---------- ---------------------------------------- ---------- ----------------------------------------

        10 0061006100610020002000200020002000200020 3 006200620062

--- 1 row(s) selected.
>>
>>select * from
+>UDF(qaTmudfGeneral(TABLE(select * from mytable))) x1, mytable x2
+>where x1.c1 = x2.c1;

C1 C2 C1 C2
-------------------- -------------------- -------------------- --------------------

aaa bbb aaa bbb

--- 1 row(s) selected.
>>
>>select * from
+>UDF(qaTmudfGeneral(TABLE(select * from mytable))) x1, mytable x2
+>where x1.c2 = x2.c2;

C1 C2 C1 C2
-------------------- -------------------- -------------------- --------------------

aaa bbb aaa bbb

--- 1 row(s) selected.
>>
>>drop schema mytest cascade;

--- SQL operation complete.