-
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
Schema tracking: initial schema insert #6435
Schema tracking: initial schema insert #6435
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>
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. |
if err != nil { | ||
return false, err | ||
} | ||
if result == nil { |
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 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 { |
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.
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>
Signed-off-by: Rohit Nayak rohit@planetscale.com