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

leeoniya's profile image leeoniya posted 14 years ago in Feature discussion Permalink
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's profile image ansgar posted 14 years ago Permalink
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's profile image leeoniya posted 14 years ago Permalink
yup, NULLs were allowed in the unique column.

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