-
-
Notifications
You must be signed in to change notification settings - Fork 480
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
Prevent panic when dropping columns in schema merge #7821
Conversation
…e and modified in the other: if the only change is the column tag, we allow the merge to proceed. Tags are useful for detecting column renames, but should not otherwise affect the merge result.
@nicktobey DOLT
|
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.
LGTM
@@ -223,14 +223,14 @@ func OutputProllyNode(ctx context.Context, w io.Writer, node Node, ns NodeStore, | |||
w.Write([]byte(", ")) | |||
} | |||
|
|||
isAddr := val.IsAddrEncoding(kd.Types[i].Enc) |
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.
This is kind of alarming, good catch.
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.
I think this code only gets hit in tests, and only when tests fail. So we weren't seeing it.
@@ -717,13 +707,11 @@ var columnDefaultTests = []schemaMergeTest{ | |||
// one side changes columns, the other inserts rows | |||
{ | |||
// TODO: this test silently does the wrong thing without erroring |
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.
TODO no longer accurate?
@nicktobey DOLT
|
Fixes #7762
In certain cases, performing a schema merge when the merged schema had fewer columns than the base schema would cause a panic.
We actually had a test for this, but the test was disabled because a limitation in how the test harness generated column tags was causing incorrect detection of merge conflicts.
To re-enable these tests, this PR slightly relaxes the logic for merge conflicts wrt column tags. This is safe to do because column tags shouldn't influence the result of merges outside of helping to identify renamed columns, so long as the merge behaves the same in both directions.