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

Wrong error message on violating foreign key constraint #3938

Closed
monetdb-team opened this issue Nov 30, 2020 · 0 comments
Closed

Wrong error message on violating foreign key constraint #3938

monetdb-team opened this issue Nov 30, 2020 · 0 comments
Labels
bug Something isn't working normal SQL

Comments

@monetdb-team
Copy link

Date: 2016-03-01 16:36:30 +0100
From: Robin Cijvat <<robin.cijvat>>
To: SQL devs <>
Version: 11.21.5 (Jul2015)
CC: @njnes

Last updated: 2016-03-25 09:59:43 +0100

Comment 21847

Date: 2016-03-01 16:36:30 +0100
From: Robin Cijvat <<robin.cijvat>>

User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.63 Safari/537.36
Build Identifier:

When a table references multiple other tables via mandatory (not null) foreign key constraints, and you try to insert a tuple that misses one of the two, the error message can state the wrong constraint name.

Reproducible: Always

Steps to Reproduce:

1.Open mclient and execute the following

create table t1 (
a int primary key
);

create table t2 (
b int primary key
);

create table t3 (
a int not null references t1 (a),
b int not null references t2 (b)
);

insert into t1 values (1);
insert into t2 values (1);
insert into t3 (b) values (1);

Actual Results:

INSERT INTO: FOREIGN KEY constraint 't3.t3_b_fkey' violated

Expected Results:

INSERT INTO: FOREIGN KEY constraint 't3.t3_a_fkey' violated

Comment 21917

Date: 2016-03-16 15:56:21 +0100
From: MonetDB Mercurial Repository <>

Changeset c108eba2d5a4 made by Niels Nes niels@cwi.nl in the MonetDB repo, refers to this bug.

For complete details, see http//devmonetdborg/hg/MonetDB?cmd=changeset;node=c108eba2d5a4

Changeset description:

fix bug #3938, ie check keys in the proper order

Comment 21918

Date: 2016-03-16 16:09:47 +0100
From: @njnes

Fixed by checking the keys in the proper order

Comment 21973

Date: 2016-03-25 09:59:43 +0100
From: @sjoerdmullender

Jul2015-SP3 has been released.

@monetdb-team monetdb-team added bug Something isn't working normal SQL labels Nov 30, 2020
@sjoerdmullender sjoerdmullender added this to the Ancient Release milestone Feb 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working normal SQL
Projects
None yet
Development

No branches or pull requests

2 participants