Possible bug with IT33524 fix ?
Posted in 2023
Topics: Stored Procedures & SPL, Data Types & Schema Design
Hi all,
The followoing test code exhibits different behaviour between 12.10.xC14 -> xC15, and 14.10.xC4 -> xC5:
CREATE PROCEDURE test_nvl_trailing_spaces ()
RETURNING LVARCHAR, LVARCHAR;DEFINE t_int INTEGER;
DEFINE o_int VARCHAR(20);
DEFINE e_int LVARCHAR;
LET t_int = 65535;
LET o_int = null;
LET e_int = 'BEGIN:' || NVL(o_int, t_int::LVARCHAR) || ':END';
RETURN
'BEGIN:' || t_int || ':END', e_int;
END PROCEDURE;
Basically, additional spaces are appended to the NVL() output in 12.10.xC15 and 14.10.xC5, but, not in the previous corresponding Informix version.
The proc outputs 2 results, the 1st is the expected result, and the 2nd is the actual NVL() result.
In xC15/xC5 the additional trailing spaces is about 2K in length (possibly some 2048 byte preset?).
Obviously, it's a somewhat contrived example. But, the actual production equivalent uses our own opaque data type which requires the cast, otherwise the SPL compiler complains.
However, since the issue is easily reproducible using built-in data types, have decided to use that instead.
The common difference appears to be the IT33524 fix (?)
So, it seems to be a bug, at least with respect to the change of behaviour in the pre-IT33524 versions, in a relatively large code base that goes back years (possibly a couple of decades).
Happy to raise it formally as an issue with HCL/IBM, but, thought I'd just check with the community first.
TIA.