Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update t set i=i+1 get a violation error [CORE2385] #2807

Open
firebird-automations opened this issue Mar 23, 2009 · 1 comment
Open

update t set i=i+1 get a violation error [CORE2385] #2807

firebird-automations opened this issue Mar 23, 2009 · 1 comment

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: hardnut (hardnut)

the following script get a violation error:
create table t2(i integer primary key);
commit;
insert into t2(i) values(1);
insert into t2(i) values(2);
commit;
update t2 set i=i+1;
commit;

@firebird-automations
Copy link
Collaborator Author

Commented by: @dyemanov

While I agree this violates the SQL specification and thus may be considered being a bug, in fact this is a design pitfall. In Firebird, constraints are checked per row (not per statement as you expected). There's a workaround though: UPDATE T2 SET I = I+1 ORDER BY I DESC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant