-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CALCITE-6265] Type coercion is failing for numeric values in prepare…
…d statements 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) ```
- Loading branch information
1 parent
1f5ba75
commit 4e6a320
Showing
4 changed files
with
185 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters