Skip to content
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

Online DDL/VReplication: fail on existence of FOREIGN KEY #8228

Merged

Conversation

shlomi-noach
Copy link
Contributor

Description

Importing fail-fk test from the gh-ost suite:

This PR ensures the migrated table does not participate in a foreign key relationship.

Today, we reject any ALTER/CREATE statements that include any FOREIGN KEY clause. But what if the user created a table with foreign keys directly on MySQL?

With this PR, a online strategy migration validates that no FKs exist on the table, child side or parent side.

It's noteworth ythat gh-ost runs this same test internally; so I've only added the logic to online/vreplication strategy.

Related Issue(s)

Checklist

  • Tests were added or are not required
  • Documentation was added or is not required

Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
…arget table

Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
…t broke is irrelevant to vreplication

Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
Copy link
Member

@GuptaManan100 GuptaManan100 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 😃

@shlomi-noach shlomi-noach merged commit 157232f into vitessio:main Jun 2, 2021
@shlomi-noach shlomi-noach deleted the online-ddl-vrpel-suite-fail-fk branch June 2, 2021 06:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants