Move validation for InsertInto nodes into the analyzer's validation phase#2283
Closed
Move validation for InsertInto nodes into the analyzer's validation phase#2283
InsertInto nodes into the analyzer's validation phase#2283Conversation
…runs during the validation batch.
Contributor
|
closing in favor of #2286 |
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.
The
resolveInsertRowsanalyzer rule contains various validation checks forInsertIntoplan nodes. A customer reported a panic in dolthub/dolt#7313 because anInsertIntovalidation error wasn't caught before theassignExecIndexesrule ran. Moving the validation fromresolveInsertRowsup into a new rule in the validation batch catches the validation error before theassignExecIndexesrule runs and prevents the panic the customer hit.The only difference I see in this refactoring is that the new
validateInsertsrule doesn't invoke the analyzer onInsertInto.Sourcewhen the source is aTriggerExecutor. This is still done in theresolveInsertRowsrule and the result is used to transform the node being processed, but the functions used by the new validation rule (i.eexistsNonZeroValueCount,validateColumns,validateValueCounts) don't seem to actually need theTriggerExecutorto be analyzed independently yet at that point.Related to: dolthub/dolt#7313