Bryan Pendleton wrote:
-- But this one returns 1 row...
ij> select * from t1 where i in (2.8, 4.23);
I
-----------
4

Is the 2-element IN list being converted to a BETWEEN expression, perhaps?

The code in InListOperatorNode that does the conversion to BETWEEN is:

        if (rightOperandList.size() == 1)
        {
                // just use an equality predicate
        }
        else if ((leftOperand instanceof ColumnReference) &&
                 rightOperandList.containsAllConstantNodes())
        {
                // convert to BETWEEN.
        }

So Yes, it looks like that is what is happening here.  That also explains why

  select * from t1 where i in (4.23);

correctly returns zero rows (because it is simply treated as an equality predicate). I'll add a comment saying as much to the Jira.

Thanks for the suggestion!

Army

Reply via email to