When dolt diff -r sql encounters a schema change, it should either print the full diff or return an error#11002
Merged
Conversation
…s changed, in limited cases. In cases where we can't, we should return a nonzero status code in addition to the error, to make it clear that the returned SQL script is not a full diff.
…he tables, then report all errors.
dolt diff -r sql encounters, a schema change, it should either print the full diff or return an errordolt diff -r sql encounters a schema change, it should either print the full diff or return an error
Contributor
|
@nicktobey DOLT
|
Contributor
|
@nicktobey DOLT
|
Contributor
|
@nicktobey DOLT
|
… passed, and correctly lists all unsupported schema changes as causes.
Contributor
|
@nicktobey DOLT
|
Contributor
|
@coffeegoddd DOLT
|
…or columns that will actually exist when the SQL is run.
Contributor
|
@nicktobey DOLT
|
Contributor
|
@nicktobey DOLT
|
Contributor
|
@nicktobey DOLT
|
elianddb
approved these changes
May 8, 2026
Contributor
elianddb
left a comment
There was a problem hiding this comment.
lgtm! one comment on the error printing
| verr := diffUserTable(queryist, sqlCtx, delta, dArgs, dw) | ||
| if verr != nil { | ||
| return verr | ||
| cli.PrintErrln(verr.Verbose()) |
Contributor
There was a problem hiding this comment.
I think this is generating duplicate errors on the CLI.
Contributor
Author
There was a problem hiding this comment.
The idea was to show the error both inline in the output, and summarized again at the end. But it ends up looking repetitive when there's only one skipped table.
I changed it to not repeat the error messages at the end.
Contributor
|
@nicktobey DOLT
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously, whenever a table had a schema change,
dolt diff -r sqlwould skip printing the data diff for that table. It would print a message to stderr, but still return a 0 error code. This is misleading, especially if the diff command is called by an automated process.This PR improves the situations where we successfully render the data diff. In situations where we can't, we return a nonzero error code.