in absence of PRIMARY key, use UNIQUE key (if available) for record updates

leeoniya posted 7 years ago in Feature discussion
i noticed if there is no primary key, every column is used in the WHERE clause for the record updates. i think if any unique key exists in the table, it can be used like a primary key.

minor, but thought i'd mention it.
ansgar posted 7 years ago
This is already the case. When you see all columns in an UPDATE there is
- neither primary nor unique key
- or you selected not all columns from the key
- or one or more columns in the UNIQUE key allows NULLs, which turns the unique key non-unique
leeoniya posted 7 years ago
yup, NULLs were allowed in the unique column.

Please login to leave a reply, or register at first.