Skip to content

fix(canal): fix "Index of range error" for unsigned columns #405

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

Merged
merged 6 commits into from
Aug 23, 2019

Conversation

mefcorvi
Copy link
Contributor

@mefcorvi mefcorvi commented Aug 2, 2019

It seems that several errors were introduced in the #399

https://github.com/siddontang/go-mysql/blob/046188b858f9a4b47cdedb11068eb868463fcb75/canal/rows.go#L53-L72

  • i in L61 is an index of the row, not an index of the column. I guess index should be used.
  • i in L64 is always >= 0 since it's an index of the row. Probably it should be t here.
  • Weird return in L69. I don't know why we must stop processing other rows after we've found a first mediumint column.
  • Duplicated code in L65 and L71 could be avoided by combining conditions in L61 and L64.

Also I suggest to rename index to columnIdx, t to value.

Fixes #404

@mefcorvi mefcorvi changed the title fix(canal): fix "Index of range error" for unsigned columns fix(canal): fix "Index of range error" for unsigned columns #404 Aug 2, 2019
@mefcorvi mefcorvi changed the title fix(canal): fix "Index of range error" for unsigned columns #404 fix(canal): fix "Index of range error" for unsigned columns Aug 2, 2019
@mefcorvi
Copy link
Contributor Author

mefcorvi commented Aug 2, 2019

@Ryan-Git could you please take a look? Am I right in my assumptions about this code?

@Ryan-Git
Copy link
Contributor

Ryan-Git commented Aug 2, 2019

yes, u'r right. what the hell I've written...

@mefcorvi
Copy link
Contributor Author

@siddontang Could you please advise how can I fix issues with CI? It seems that by some reason travis was not able to install mysql. Any comments on PR also are welcome :-)

@siddontang
Copy link
Collaborator

siddontang commented Aug 19, 2019

thanks @mefcorvi

#410 tries to fix the CI issue but failed with a data race problem.

@siddontang siddontang merged commit 3380367 into go-mysql-org:master Aug 23, 2019
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.

Canal: Index of range error when table contains int(10) unsigned column
3 participants