You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I call the following with BLOB_IS_NULL('abc', NULL, CURRENT_TIMESTAMP) the blob in the udf will get corrupted.
This only happens on a 64 bit system as I've tested it on a 32bit system and it works as I would expect.
If I rearrange the parameters as BLOB_IS_NULL('abc', CURRENT_TIMESTAMP, NULL) things seem to be ok.
If I try to cast the timestamp explicitly BLOB_IS_NULL('abc', NULL, CAST(CURRENT_TIMESTAMP AS CHAR(30))) the blob still gets corrupted.
If I just pass a regular string as parameter 3 everything is fine also. BLOB_IS_NULL('abc', NULL, 'abc')
DECLARE EXTERNAL FUNCTION BLOB_IS_NULL
RETURNS INTEGER BY VALUE
ENTRY_POINT 'blobisnull' MODULE_NAME 'mptfbudf';
Bug happened only for NULL BLOBS. This was due to incorrect space allocation for them on UDF parameters' stack. On 64-bit builds it was more destructive cause blob_handle could be overwritten by next parameter (not a case for 32-bit builds due to smaller pointer size).