[MDEV-21083] Non-deferrable uniqueness constraints are always checked immediately Created: 2019-11-19  Updated: 2019-12-29

Status: Open
Project: MariaDB Server
Component/s: Data Manipulation - Update
Affects Version/s: 5.5, 10.1, 10.2, 10.3, 10.4
Fix Version/s: 10.4

Type: Bug Priority: Minor
Reporter: Ian Gilfillan Assignee: Michael Widenius
Resolution: Unresolved Votes: 0
Labels: Compatibility


 Description   

The following, as expected, produces an error in all versions:

create table t (n int not null unique);
insert into t values(1);
insert into t values(2);
update t set n=n+1;
ERROR 1062 (23000): Duplicate entry '2' for key 'n'

However, the above runs without error in Oracle and the SQL standard suggests that non-deferrable uniqueness constraints should be checked only at the end of the statement. PostgreSQL, MySQL, Firebird all behave as MariaDB does. DB2 behaves as Oracle does. Should this be changed for Oracle mode?


Generated at Thu Feb 08 09:04:28 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.