Bug 6982 - Wrong constraint name in error message of constraint violation
Summary: Wrong constraint name in error message of constraint violation
Status: NEW
Alias: None
Product: SQL
Classification: Unclassified
Component: all (show other bugs)
Version: 11.37.11 (Jun2020-SP1)
Hardware: Other Linux
: Normal normal
Assignee: SQL devs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-10-05 07:28 CEST by Karl Seguin
Modified: 2020-10-07 18:29 CEST (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Karl Seguin 2020-10-05 07:28:57 CEST
User-Agent:       Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:81.0) Gecko/20100101 Firefox/81.0
Build Identifier: 

Seems like when there's a failed foreign constraint, the MonetDB server returns the first defined foreign key, not the one the one that actually failed.



Reproducible: Always

Steps to Reproduce:
create table a (id int primary key);
insert into a values (1);

create table b (id int primary key);

create table c (a int references a(id), b int references b(id));
insert into c (a, b) values (1, 2);

Actual Results:  
40002!INSERT INTO: FOREIGN KEY constraint 'c.c_a_fkey' violated

Expected Results:  
40002!INSERT INTO: FOREIGN KEY constraint 'c.c_b_fkey' violated
Comment 1 Pedro Ferreira 2020-10-07 18:29:31 CEST
We noticed this, thanks for your report. We will fix it on a future release.