After changing our development from 2.11 to 2.20.09, I'm cleaning up the broken programs. In several I see code like the following remarkable example:
if p_dmrefn.fil_typ is not null
and p_dmrefn.fil_typ matches [0-9]
then
select doc_dsc into p_dmrefn.doc_dsc from audmmprm
Anyone who can't see it, look again closely. Now the 2.20 compiler is correctly complaining. I never even conceived to try that crime before. Was it ever legal for Informix RDS? I hope not...
Another thing I've found is an improvement to the detection of illegal fields. Consider this paraphrased slab of code:
define
k_rec record
key_num integer
end
function blah()
....
delete from some_tab
where some_tab.trn_num = k_rec.trn_num
In the past, Informix and 4JS would fail to find k_rec.trn_num as a legal variable so it would assume it's a table in the database and allow the database engine to worry about it. Now, the 2.20 compiler is thinking:
k_rec is a real record, so we know it's a variable reference. However, trn_num is not a field of k_rec so issue an error.
This is A Good Thing. I like it, although it might cause problems for people with particularly bad ambiguity in their table and variable naming conventions. What I don't like is the dozen or so samples in allegedly correct working code of ours that have now been caught by this compiler improvement!
Please keep these improvements coming; but can we get these sorts of things documented in a new-features page? I don't recall seeing either of these changes mentioned in the New Features section of the 2.20 BDL manual. Am I failing to find a more technical file describing stuff like this?