fix(canal): fix "Index of range error" for unsigned columns #405
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.
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 guessindex
should be used.i
in L64 is always >= 0 since it's an index of the row. Probably it should bet
here.return
in L69. I don't know why we must stop processing other rows after we've found a first mediumint column.Also I suggest to rename
index
tocolumnIdx
,t
tovalue
.Fixes #404