Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
Description
Given a column of type INT. When providing a short value as a placeholder in a prepared statement, a ClassCastException is thrown.
Test case
final String sql =
"select \"empid\" from \"hr\".\"emps\" where \"empid\" in (?, ?)"; CalciteAssert.hr()
.query(sql)
.consumesPreparedStatement(p -> {
p.setShort(1, (short) 100);
p.setShort(2, (short) 110);
})
.returnsUnordered("empid=100", "empid=110");
Stack trace
java.lang.ClassCastException: class java.lang.Short cannot be cast to class java.lang.Integer (java.lang.Short and java.lang.Integer are in module java.base of loader 'bootstrap')
at Baz$1$1.moveNext(Unknown Source)
at org.apache.calcite.linq4j.Linq4j$EnumeratorIterator.<init>(Linq4j.java:679)
Attachments
Issue Links
- is related to
-
CALCITE-6284 Invalid conversion triggers ClassCastException
- Open
-
CALCITE-6366 Code generated by EnumUtils#convert should throw an exception if the target type is overflowed
- Open
- links to