-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
schemadiff: validate() table structure at the end of apply() #10189
schemadiff: validate() table structure at the end of apply() #10189
Conversation
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
go/vt/schemadiff/table_test.go
Outdated
{ | ||
name: "drop column, break key", | ||
from: "create table t (id int primary key, i int, key i_idx(i))", | ||
alter: "alter table t drop column i", | ||
expectErr: ErrInvalidColumnInKey, | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right now this makes sense as a safeguard until we improve the drop column logic to also drop references from the index to mimic MySQL behavior.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we choose to go that path then I'll update this PR; no need to postpone that to a future PR.
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
Bug fixes
Non-trivial changes
New/Existing features
Backward compatibility
|
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
… validate that Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
…odify columns, then add columns, then add keys, ... Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
Tracking issue: #10203 |
Description
First PR of several. This PR kicks schema validation for a
CreateTableEntity
. Some stuff we can validate delaratively; this PR validates that keys-to-columns relationship are valid. That is, that all columns referenced by keys do actually exist.