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

Disallow foreign key constraint on ddl #7780

Merged
merged 5 commits into from
Apr 4, 2021

Conversation

harshit-gangal
Copy link
Member

@harshit-gangal harshit-gangal commented Apr 1, 2021

Description

Vitess today allowed foreign keys constraint to be sent down to the mysql to be applied on the table.

In a sharded keyspace, they might not be correctly set and would fail user queries.

This change is to provide a -foreign_key flag on VTGate with default "allow" but with an option to change it to "disallow"

Checklist

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

Impacted Areas in Vitess

Components that this PR will affect:

  • Query Serving

@harshit-gangal harshit-gangal marked this pull request as ready for review April 1, 2021 18:25
@harshit-gangal harshit-gangal requested a review from systay as a code owner April 1, 2021 18:25
@deepthi deepthi requested a review from shlomi-noach April 1, 2021 18:37
go/vt/vtgate/vtgate.go Outdated Show resolved Hide resolved
Copy link
Contributor

@shlomi-noach shlomi-noach left a comment

Choose a reason for hiding this comment

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

Suggesting a few changes, otherwise this looks good!

go/vt/vtgate/planbuilder/ddl.go Outdated Show resolved Hide resolved
go/vt/vtgate/planbuilder/ddl.go Outdated Show resolved Hide resolved
go/vt/vtgate/vcursor_impl.go Outdated Show resolved Hide resolved
Signed-off-by: Harshit Gangal <[email protected]>
@harshit-gangal harshit-gangal merged commit 7a38317 into vitessio:master Apr 4, 2021
@harshit-gangal harshit-gangal deleted the restrict-fkey branch April 4, 2021 17:23
@askdba askdba added this to the v10.0 milestone Apr 5, 2021
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.

5 participants