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 (primary) constraint name is reported for the foreign key violation during FK creation [CORE2289] #2714
Comments
Commented by: @asfernandes What commands caused all the errors? From your description, I understand all caused by the alter table, but I doubt, because FB system tables does not have foreign keys. |
Commented by: Eugenk Konkov (kes) You are right, all errors caused by alter statement. |
Commented by: Sean Leyne (seanleyne) Eugenk, This issue should really discussed in the support list/forum, not here in the bug tracker. |
Commented by: @dyemanov "Target" means the primary/unique key the foreign key refers to. So, as far as I understand, column PACKET_DETAIL.PACKET_ID has values not found in http://PACKET.ID, hence the violation. However, I'd agree that the text "FOREIGN KEY" along with the *primary key* name and table look not much clear to understand. I'm assigning this ticket to Vlad in a hope for an explanation whether this is a bug or as designed. |
Modified by: @dyemanovassignee: Vlad Khorsun [ hvlad ] |
Commented by: @hvlad I have no idea of what is #1 message. isql didn't report it while IBE does. (NULL, NULL, NULL, NULL, 13, 470, NULL, 'violation of FOREIGN KEY constraint "@1"', NULL, NULL); Message #2 was wrong and i fixed it in HEAD Message #3 requires just some knowledge of english language or access to some translator :-) |
Modified by: @hvladstatus: Open [ 1 ] => Resolved [ 5 ] resolution: Fixed [ 1 ] Fix Version: 2.5 Beta 1 [ 10251 ] |
Commented by: @asfernandes Message #3 means the record on the FK table references a non existent record of the PK table. There is two types of FK violation: SQL> create database 't.fdb'; And I still don't understand why/how the error was caused by the ALTER TABLE statement as the user was said. |
Commented by: @hvlad Adriano> And I still don't understand why/how the error was caused by the ALTER TABLE statement as the user was said. Because detail table have records for which there is no corresponding parent record at time when FK is created. |
Commented by: Eugenk Konkov (kes) I have restart server and >This issue should really discussed in the support list/forum, not here in the bug tracker. |
Commented by: @dyemanov I'm changing the ticket type and its title to reflect what has been actually fixed. |
Modified by: @dyemanovissuetype: Improvement [ 4 ] => Bug [ 1 ] summary: Do error reporting more meaningfull => Wrong (primary) constraint name is reported for the foreign key violation during FK creation |
Modified by: @pcisarstatus: Resolved [ 5 ] => Closed [ 6 ] |
Modified by: @dyemanovFix Version: 2.1.4 [ 10361 ] |
Submitted by: Eugenk Konkov (kes)
Can not uderstand what is wrong:
alter table PACKET_DETAIL
add constraint PACKET_DETAIL_FK_PACKET_ID
foreign key (PACKET_ID)
references PACKET(ID)
1# violation of FOREIGN KEY constraint "".
2# violation of FOREIGN KEY constraint "PK_PACKET" on table "PACKET".
3# Foreign key reference target does not exist.
1- what violation?
2- what wrong on this violation?
3- What is target? For whick FK? What does not exist?
Commits: ba4d4fa 8c3db43 bf29465
The text was updated successfully, but these errors were encountered: