Skip to content

Conversation

@github-actions
Copy link
Contributor

Cherry-picked from #58958

Problem Summary:
Create two tables, t1 and t2. Create a primary key on table t1 and a
foreign key on table t2 referencing t1 primary key. Then drop table t2,
and then try to delete the primary key on t1.
doris will report error:

errCode = 2, detailMessage = Can not find table XXXX in constraint.

This is because the `foreignTables` metadata in the
`PrimaryKeyConstraint` was not updated when the foreign key table was
dropped. `foreignTables` stores the table IDs of the foreign key tables
that reference the primary key. When dropping the foreign key table or
drop the foreign key, the corresponding entries in `foreignTables`
should also be removed.
@github-actions github-actions bot requested a review from yiguolei as a code owner December 19, 2025 04:07
@hello-stephen
Copy link
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@dataroaring dataroaring reopened this Dec 19, 2025
@hello-stephen
Copy link
Contributor

run buildall

@hello-stephen
Copy link
Contributor

FE UT Coverage Report

Increment line coverage 73.47% (36/49) 🎉
Increment coverage report
Complete coverage report

@yiguolei yiguolei merged commit d4e1fba into branch-4.0 Dec 22, 2025
24 of 27 checks passed
@github-actions github-actions bot deleted the auto-pick-58958-branch-4.0 branch December 22, 2025 03:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants