Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
-
None
-
None
Description
Underflow exception occurs when executing query with more then 19 values in the in-clause.
Example below illustrates the problem in the csv example:
select e.name from emps as e where e.empno in (130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130 ); Error: Error while executing SQL "select e.name from emps as e where e.empno in (130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130 )": Underflow (state=,code=0)
The SqlToRelConverter will convert this to a SemiJoin. Literals in the IN clause value list are scaled. When the type of the literal does not have a scale set, as happens with a java.lang.Integer, the default value of the type.scale is chosen, which is Integer.MIN_VALUE. Scaling to this value causes the underflow.
You can find a patch attached to show where the code could potentially be fixed.