Skip to content

Disallow foreign key constraint on ddl#7780

Merged
harshit-gangal merged 5 commits intovitessio:masterfrom
planetscale:restrict-fkey
Apr 4, 2021
Merged

Disallow foreign key constraint on ddl#7780
harshit-gangal merged 5 commits intovitessio:masterfrom
planetscale:restrict-fkey

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

Signed-off-by: Harshit Gangal <harshit@planetscale.com>
Signed-off-by: Harshit Gangal <harshit@planetscale.com>
Signed-off-by: Harshit Gangal <harshit@planetscale.com>
@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
Signed-off-by: Harshit Gangal <harshit@planetscale.com>
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!

Signed-off-by: Harshit Gangal <harshit@planetscale.com>
@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