-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#24663] YSQL: Fix foreign key on unique index with different column …
…orders Summary: For a foreign key constraint on the unique index of the referenced relation, the function YBCBuildYBTupleIdDescriptor() incorrectly assumes that the order of columns in foreign and unique key constraints would be the same. This leads to incorrect foreign key violation errors and data inconsistency issues when that is not the case (see the added test). Fix it by using the correct attribute number in the index relation. Jira: DB-13730 Test Plan: ./yb_build.sh --java-test org.yb.pgsql.TestPgForeignKey ./yb_build.sh --java-test org.yb.pgsql.TestPgForeignKeyBatching ./yb_build.sh --java-test org.yb.pgsql.TestPgRegressForeignKey Reviewers: dmitry Reviewed By: dmitry Subscribers: smishra, yql Differential Revision: https://phorge.dev.yugabyte.com/D39538
- Loading branch information
Showing
6 changed files
with
44 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters