Online 5 --> 7 Engine differences
Posted in 1995
We are preparing to upgrade from Informix Online 5 to version 7, and have uncovered a change in query behavior with date and numeric column types. Thoughout our existing code, some queries use the construct: (DATECOL IS NULL OR DATECOL = "") which is a bit silly, but hey, I didn't write all the code, and also, it happens to work fine in both v.5 and v.7. The problem lies in the converse of this statement NOT (DATECOL IS NULL OR DATECOL = "") Apparently v.7 is internally applying the principle of DeMorgan, and executing this as: (DATECOL IS NOT NULL AND DATECOL != "") which (in v.5) identifies all rows where DATECOL is non-NULL. Apparently, in v.7, the first clause evaluates to TRUE, but the second fails in converting string to date, and winds up effectively comparing DATECOL != NULL, which always yields UNKNOWN. ANDing TRUE and UNKNOWN gives UNKNOWN, and the query returns zero rows, rather than all non-NULL rows. We recently went on a seek and destroy mission for all offending query sub-clauses that try comparing non-CHAR columns to "". I admit, it is a poor query construct, but until now, we didn't need to fix it, because it wasn't broken. Has anyone come across other query behavior differences when migrating from version 5 to version 7? Paul Kapp ----> PLKapp@aol.com -OR- plk@usorder.com