borinquenkid opened a new issue, #16805:
URL: https://github.com/apache/grails-core/issues/16805
Split from monolithic audit #16674 (findings F8, F9, F10, F11, F12, F20).
### Problem Description
Bulk write operations (`updateAll` and `deleteAll`) in the Hibernate 7
implementation have several defects and a critical silent-data-loss behavior
when combined with pagination:
1. **Batch Pagination Silent Data Loss Guard (F20)**:
`Person.where { }.max(2).deleteAll()` deleted **every** matching row
because bulk HQL statements (`delete from Person where ...`) have no `LIMIT`
clause and the builder ignored `defaultMax`. Batch operations with `max` or
`offset` must throw `InvalidDataAccessResourceUsageException` (naming the
unsupported values) to prevent accidental mass deletion.
2. **Subqueries in Bulk Writes (F8, F12)**:
- Multiple subqueries in a single bulk write statement shared parameter
positions, corrupting parameter bindings.
- Deferred subqueries were not properly supported in the HQL write path.
3. **Association Filtering & Aliases in Bulk Writes (F9, F10, F11)**:
- `exists` and `notExists` subqueries were unsupported in the bulk write
path.
- Bulk write operations failed to filter through to-one association paths.
- Association aliases and the `{alias}` placeholder were not handled in
bulk writes.
### Expected Behavior
Bulk writes should reject unsupported pagination explicitly with an
exception, and properly support parameter positions, `exists`, to-one
associations, and association aliases.
--
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]