New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ClassCastException caused by empty inSet
on Option column
#771
Comments
here is the test from @ijuma's commit:
added to the end of MainTest |
Looks unrelated to the recent changes with Option handling moving from JdbcType into ResultConverter. It's actually a bug in the hoistClientOps phase. This needs to be double-checked against 2.0.0 and 2.0.1 to make sure the bug is not there (I would expect it to be). Working on a fix for 2.1. |
Our test passes with Slick 2.0.1 and fails with 2.1.0-M1. So something changed that caused this to be triggered. |
Patching the types was wrong and only worked for view columns, where the wrong type is equivalent to the correct one, and for computed values, where the wrong type is not used at all. It failed for LiteralNodes. The solution is to leave OptionApply intact in hoistClientOps and ignore it in QueryBuilder. Test in MainTest.test. Fixes issue #771.
The bug in hoistClientOps is the same in 2.0 but it's cancelled out by another bug: https://github.com/slick/slick/blob/2.0/src/main/scala/scala/slick/driver/JdbcStatementBuilderComponent.scala#L192 - Notice that this looks at tpe (the special statically known type of a TypedNode), not nodeType (the dynamically computed type), so it still sees the original (correct) type and not the wrong one produced by hoistClientOps. |
Got to love bugs that cancel other bugs. :) |
This is a regression in Slick 2.1.0-M1.
Here's a commit that updates a test to include the failing case:
https://github.com/ijuma/slick/commit/911ca04468959278457bd544cbb40e4eee742bd0
The stacktrace:
The text was updated successfully, but these errors were encountered: