server icon indicating copy to clipboard operation
server copied to clipboard

MDEV-33927 Wrong error message while altering the table with foreign key relationship

Open Thirunarayanan opened this issue 1 year ago • 1 comments
trafficstars

  • [x] The Jira issue number for this PR is: MDEV-33927

Description

  • Alter statement using copy algorithm throws wrong message "Cannot delete rows from table which is parent in a foreign key constraint" even though we expect duplicate key for the index.

copy_data_between_tables(): Remove the error condition to throw ER_FK_CANNOT_DELETE_PARENT and make sure that ALTER IGNORE shouldn't allow to break unique of foreign key constraints.

How can this PR be tested?

./mtr innodb.fk_col_alter

Basing the PR against the correct MariaDB version

  • [ ] This is a new feature or a refactoring, and the PR is based against the latest MariaDB development branch.
  • [x] This is a bug fix, and the PR is based against the earliest maintained branch in which the bug can be reproduced.

PR quality check

  • [x] I checked the CODING_STANDARDS.md file and my PR conforms to this where appropriate.
  • [x] For any trivial modifications to the PR, I am ok with the reviewer making the changes themselves.

Thirunarayanan avatar Aug 09 '24 10:08 Thirunarayanan

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

CLAassistant avatar Aug 09 '24 10:08 CLAassistant