Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.30.0
Description
As described in the title, xx < 1 OR xx > 1 should be simplified to xx <> 1.
See discussion in ML: https://lists.apache.org/thread/hsdgx0jb3214v6k9p7slbkk3xsbl0b7f
The original problem is that ename <> '' and ename <> '3' could be simplified to Sarg while (ename < '' or ename > '') and (ename < '3' or ename > '3') cannot.
Since < and <> have different SqlOperandTypeChecker.Consistency, the type inference result is different for these two cases. We suspect that the type inference result leads to the difference of simplification.
However, the real reason is that xx < 1 OR xx > 1 cannot be simplified to xx <> 1 in simplification, which prevents (ename < '' or ename > '') and (ename < '3' or ename > '3') being simplified to ename <> '' and ename <> '3'.
Attachments
Issue Links
- links to