borinquenkid commented on issue #14503:
URL: https://github.com/apache/grails-core/issues/14503#issuecomment-6367753936

   For #16583: the reading of a `null` in a unique composite key is now 
selectable, per constraint (`unique: [group: 'country', nulls: 'skip']`) and 
for the application (`grails.gorm.unique.nulls`): `wildcard` (today), `skip` 
(SQL), `value` (#16583 as it was) and `database`.
   
   **Proposed default: `database`**, the reading of the unique index Hibernate 
creates, so the validation and the index agree. Checked on containers: Oracle 
compares the non-null columns of a partly null key (`value`); H2, PostgreSQL, 
MySQL and MariaDB treat nulls as distinct (`skip`). Hibernate renders the SQL 
Server and DB2 index with a filter that leaves null rows out, so they read 
`skip` too (from the DDL; not run on those servers). MongoDB, which has no such 
index, reads `value`.
   
   Trade-off: the default becomes `skip` on most databases, not `value`.
   
   Question: is `database` the default we want, with `wildcard` as the way to 
keep the old behavior?
   


-- 
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]

Reply via email to