Allow c-treeACE V9 Conditional Expression Parser Field Names to Match Data Type NamesIt was found that c-treeACE V9 failed to parse some conditional expressions that were allowed in the c-tree Plus V8 SDK. In V9, the expression parser for conditional indexes has been moved into the c-treeDB layer and that logic includes support for a CAST function: F_CAST '(' Expression F_AS ATYPE ')'
F_CAST '(' Expression ',' ATYPE ')'
ATYPE is a data type which can be any of the type names from the symtab list defined in ctdbcrun.c. This new logic could cause some prior expressions to fail. For example, one data type is named NUMBER and when used in an expression such as: strlen(Number) > 0 c-treeACE V9 considers "Number" as a data type and not as a field name, and fails to parse the expression. To support previous expressions, the grammar rules for the cast function have been modified to use the symbolic IDENTIFIER instead of ATYPE. Now, in the rules for the cast function, after finding an IDENTIFIER, a check is made if the IDENTIFIER is the name of a data type. If not, an error is returned. Otherwise, the data type is added to the parse tree and expression parsing continues. |
|||