Skip to content

VDiff: fix panic for tables with a unicode_loose_md5 vindex#6640

Merged
systay merged 3 commits intovitessio:masterfrom
planetscale:rn-vdiff-unicode-vindex
Sep 1, 2020
Merged

VDiff: fix panic for tables with a unicode_loose_md5 vindex#6640
systay merged 3 commits intovitessio:masterfrom
planetscale:rn-vdiff-unicode-vindex

Conversation

@rohit-nayak-ps
Copy link
Copy Markdown
Member

A customer had an issue while running VDiff after MoveTables. VDiff panic-ed due to an invalid cast while dealing with the weight_string() that is generated as part of the vdiff plan, which is a FuncExpr type and not a Colname.

Signed-off-by: Rohit Nayak rohit@planetscale.com

Signed-off-by: Rohit Nayak <rohit@planetscale.com>
Signed-off-by: Rohit Nayak <rohit@planetscale.com>
@rohit-nayak-ps rohit-nayak-ps marked this pull request as ready for review August 27, 2020 20:50
@rohit-nayak-ps rohit-nayak-ps requested a review from sougou as a code owner August 27, 2020 20:50
@systay
Copy link
Copy Markdown
Collaborator

systay commented Aug 28, 2020

We should add a test or two to vdiff_test.go, and maybe even an end-to-end test if that is possible

log.Warningf("Unhandled type found for column in vdiff: %v(%v)", selExpr, ct)
colname = ""
}
if strings.EqualFold(pk, colname) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the weight_string() can't be the PK, right? shouldn't we do this only for ColNames?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • I had added the e2e earlier by adding collation to a table in the existing vreplication e2e.
  • Refactored the code to isolate the logic that was changed and added unit tests.
  • I was not sure if there were FuncExprs other than weight_string() that could serve as a PK in MySQL. So just to confirm: only ColNames can be PKs, right? I updated the code to only allow ColNames

@rohit-nayak-ps rohit-nayak-ps marked this pull request as draft August 30, 2020 18:29
Signed-off-by: Rohit Nayak <rohit@planetscale.com>
@rohit-nayak-ps rohit-nayak-ps marked this pull request as ready for review August 30, 2020 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants