borinquenkid commented on PR #16875:
URL: https://github.com/apache/grails-core/pull/16875#issuecomment-6689702313
Pushed de7100cf35, by point:
- **`get()` on MongoDB:** the single-result branch built its filter from the
original criteria. It now builds it from the resolved ones, so
`inList('firstName', Person.where { age > 46 }.property('firstName')).get()`
returns Barney, and null when the subquery selects nothing.
- **Association block:** `resolveSubqueries` now descends into an
association block and returns a copy of it with the subquery results, so
`address { inList('city', City.where { }.property('name')) }` finds the person
who lives in Paris, and `notIn` the others. Checked on MongoDB with an embedded
address and on Neo4j with a related node (`owner { inList('firstName', ...) }`).
- **Empty scalar subquery:** a comparison with an empty subquery no longer
becomes a comparison with null. It matches no row, as in SQL, where the
comparison is unknown. Inside a `not { }` the result is every row rather than
none, because the datastore negates the empty match. SQL gives none there too,
so that case still differs.
Each new feature fails with the old code and passes with the change (the
Neo4j one only for the association block, as `n.age = null` already matched
nothing there). The datastore-core, MongoDB core and Neo4j core suites and
`codeStyle` pass. The upgrade note and the `where` reference say the three
behaviors.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]