Product Documentation

c-treeACE V10.0 Release Notes

Previous Topic

Next Topic

Corrected VARCHAR String Handling for Empty Strings

It was found that an empty VARCHAR string could be considered a NULL value resulting in unexpected query results.

A recent enhancement to improve the performance of variable length string handling was found to inappropriately set empty VARCHAR fields to NULL when reading them from the file. This occurred only in recent V9.3 builds for tables created with the new VARCHAR mapping to a c-treeACE CT_2STRING type (the new default) and for imported tables using a CT_PSTRING type.

For tables having NULL field support ($NULFLD$, such as created trough c-treeACE SQL) a NULL value is cached earlier in the record handling and a NULL value is correctly returned. However, if the string was empty, a NULL value was incorrectly returned instead of the empty string. For tables without $NULFLD$ support, in theory there should be no NULL values at all, yet empty VARCHAR strings were also returned as NULL.

The logic was changed such that in cases for a VARCHAR field type and where the field buffer is null (indicating an empty string) an empty VARCHAR string is returned instead of the NULL value.

TOCIndex