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

Foreign key cascade with SET DEFAULT uses the default value of the moment of the FK creation [CORE3073] #3452

Closed
firebird-automations opened this issue Jul 18, 2010 · 5 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @asfernandes

Depends on CORE1311

Test case:

-----------------
isql
create database 't.fdb';

create domain d1 integer default 3;

create table pk (a integer primary key);
create table fk (b d1 references pk on delete set default);

alter domain d1 set default 2;

-- Optional reconnection
exit;
isql t.fdb
--

insert into pk values (1);
insert into pk values (2);
insert into pk values (3);

insert into fk values (1);
insert into fk values (2);

delete from pk where a = 1;

-- Displays: "3; 2" instead of "2; 2"
select * from fk;
-----------------

The problem is that there is no BLR verb to modify a field to its default value, so the cascade trigger is created with the current default value of the field.

Commits: 7bb6ceb

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

Link: This issue depends on CORE1311 [ CORE1311 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

assignee: Adriano dos Santos Fernandes [ asfernandes ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 4.0 Alpha 1 [ 10731 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Resolved [ 5 ]

QA Status: Done successfully

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Closed [ 6 ]

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

2 participants