Issue Details (XML | Word | Printable)

Key: CORE-2385
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Unassigned
Reporter: hardnut
Votes: 0
Watchers: 0

If you were logged in you would be able to see more operations.
Firebird Core

update t set i=i+1 get a violation error

Created: 23/Mar/09 12:47 AM   Updated: 23/Mar/09 01:39 AM
Component/s: None
Affects Version/s: None
Fix Version/s: None

Environment: windows xp sp2

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

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Dmitry Yemanov added a comment - 23/Mar/09 01:39 AM
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.