Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
When converting the Sarg
x IS NULL OR x NOT IN (1, 2)
to SQL, Calcite currently generates
x IS NULL OR x < 1 OR x > 1 AND x < 2 OR x > 2
This is correct SQL, but is difficult to read unless you know that AND has higher precedence than OR. Either of the following would be better:
x IS NULL OR x <> 1 AND x <> 2
x IS NULL OR x NOT IN (1, 2)