Please sign in to comment.
Prevent repetition of bind variables used in GROUP BY:
Any expression from a GROUP BY clause may be inlined into later clauses (like SELECT or ORDER BY) which can lead to duplication of expressions. This is usually not a problem, in fact SQL is designed to allow reuse of GROUP BY expressions without aggregation functions in these clauses. This change prevents such reuse when a GROUP BY expression contains a bind variable because the database could no longer know that the expressions are indeed the same. If a leaked GROUP BY key is detected, we push the source of the GroupBy into a subquery. Test in AggregateTest.testFusedGroupBy. Fixes #1282.
- Loading branch information...
Showing with 58 additions and 11 deletions.
- +26 −0 slick-testkit/src/main/scala/com/typesafe/slick/testkit/tests/AggregateTest.scala
- +5 −5 slick/src/main/scala/slick/ast/Node.scala
- +25 −4 slick/src/main/scala/slick/compiler/MergeToComprehensions.scala
- +1 −1 slick/src/main/scala/slick/driver/JdbcStatementBuilderComponent.scala
- +1 −1 slick/src/main/scala/slick/memory/QueryInterpreter.scala