new definition of udf not being picked up after drop/recreate

Bug #1351471 reported by Aruna Sadashiva
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Trafodion
Fix Released
High
Cliff Gray

Bug Description

When a function is dropped and new one with the same name but different defn. is created it is not picked by.
This is from trafci:

SQL>cqd allow_udf 'on';
--- SQL operation complete.

SQL>create function ADD2(int, char) returns (ADD2 int)
language c parameter style sql external name 'add2'
library TEST107;
--- SQL operation complete.

SQL>values(add2(1,'a'));
ADD2
-----------
         98
--- 1 row(s) selected.

SQL>values(add2(2,'abc'));
*** ERROR[8402] A string overflow occurred during the evaluation of a character expression. Conversion of Source Type:CHAR(REC_BYTE_F_ASCII) Source Value:abc to Target Type:CHAR(REC_BYTE_F_ASCII). [2014-05-30 07:16:41]

SQL>values(add2(3,40));
*** ERROR[4455] The supplied type for input value 2 of user-defined function TRAFODION.UDF_FUNCTIONS.ADD2 was NUMERIC(2) SIGNED which is not compatible with the expected type CHAR(1) CHARACTER SET ISO88591. [2014-05-30 07:16:41]

SQL>drop function add2;
--- SQL operation complete.
SQL>control query default query_cache '0';
--- SQL operation complete.
SQL>control query default query_cache reset;
--- SQL operation complete.
SQL>control query default COMP_BOOL_215 reset;
--- SQL operation complete.
SQL>control query default ROUTINE_CACHE_SIZE reset;
--- SQL operation complete.
SQL>create function ADD2(int,int) returns (ADD2 int)
language c parameter style sql external name 'add2'
library TEST107;
--- SQL operation complete.

SQL>values(add2(-1,NULL));
ADD2
-----------
       NULL
--- 1 row(s) selected.

SQL>values(add2(2,3.9997));
*** ERROR[4455] The supplied type for input value 2 of user-defined function TRAFODION.UDF_FUNCTIONS.ADD2 was NUMERIC(5,4) SIGNED which is not compatible with the expected type CHAR(1) CHARACTER SET ISO88591. [2014-05-30 07:16:42]

SQL>values(add2(3,'x'));
ADD2
-----------
        123
--- 1 row(s) selected.

SQL>drop function add2;
--- SQL operation complete.

Tags: sql-general
Changed in trafodion:
milestone: none → r1.1
Cliff Gray (cliff-gray)
Changed in trafodion:
assignee: Suresh Subbiah (suresh-subbiah) → Cliff Gray (cliff-gray)
status: New → In Progress
Revision history for this message
Cliff Gray (cliff-gray) wrote :

Fixed as of change 1296.

Changed in trafodion:
status: In Progress → Fix Committed
Paul Low (paul-low-x)
Changed in trafodion:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.