Schema tracking: initial schema insert#6435
Merged
sougou merged 6 commits intovitessio:masterfrom Jul 16, 2020
Merged
Conversation
fff5af4 to
52389b7
Compare
Signed-off-by: Rohit Nayak <rohit@planetscale.com>
…I errors Signed-off-by: Rohit Nayak <rohit@planetscale.com>
Signed-off-by: Rohit Nayak <rohit@planetscale.com>
52389b7 to
cfe1867
Compare
Signed-off-by: Rohit Nayak <rohit@planetscale.com>
Signed-off-by: Rohit Nayak <rohit@planetscale.com>
Member
Author
|
Sugu, Can you check if the way I am getting the current gtid is fine (tr.currentPosition()) using engine.cp.connect() ... Also is it possible that there are some ts lifecycle issues that could come up: the schema engine should be properly initialized when the tracker Open() is called, right? I ask because legacy example test failed a couple of times but finally ran in CI. However they worked fine locally. |
sougou
reviewed
Jul 13, 2020
| if err != nil { | ||
| return false, err | ||
| } | ||
| if result == nil { |
Contributor
There was a problem hiding this comment.
This check is not needed. All APIs guarantee this will not be nil if there's no error.
| if result == nil { | ||
| return false, fmt.Errorf("error querying _vt.schema_version") | ||
| } | ||
| if result.RowsAffected == 0 { |
Contributor
There was a problem hiding this comment.
It's better to check len(result.Rows). There is no guarantee that this number will be accurate for non-DMLs. In the future, when we switch to streaming, this will always be 0.
Signed-off-by: Rohit Nayak <rohit@planetscale.com>
sougou
approved these changes
Jul 16, 2020
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.
Signed-off-by: Rohit Nayak rohit@planetscale.com