Skip to content
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

row_event.go: fix the set bytes value in revert order #319

Merged
merged 2 commits into from
Sep 17, 2018

Conversation

july2993
Copy link
Contributor

@july2993 july2993 commented Sep 12, 2018

fix pingcap/tidb-tools#70

according to the binlog, we should handle it in little end
i have test more when the set num is 18 (need 3 bytes), but i can't find a doc from mysql about this

@IANTHEREAL
Copy link
Collaborator

if no document about it, we should test enum, bit and set in common versions. one of our intern is working on it

@siddontang
Copy link
Collaborator

should add a test @july2993

@ghost
Copy link

ghost commented Sep 14, 2018

Similar bug occurs when handle MYSQL_TYPE_ENUM which is using more than one bytes to represent enum elements. Thus, it should decode in little-endian form. @july2993

@july2993
Copy link
Contributor Author

will fix it later and add test

@july2993
Copy link
Contributor Author

@siddontang PTAL

@siddontang siddontang merged commit 0f2e7f6 into go-mysql-org:master Sep 17, 2018
@july2993 july2993 deleted the fix_set branch September 17, 2018 01:48
@@ -523,6 +523,71 @@ func (_ *testDecodeSuite) TestParseJsonDecimal(c *C) {
}
}

func (_ *testDecodeSuite) TestEnum(c *C) {
Copy link

Choose a reason for hiding this comment

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

Maybe we should add test that covers case length=2 in row_event.go

Copy link
Contributor Author

Choose a reason for hiding this comment

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

😯 i make a mistake, should add more than 256 enum num but not more than 8 to test case length=2

Copy link
Collaborator

Choose a reason for hiding this comment

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

please add a new test later @july2993

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@siddontang add here #320

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.

syncer can't decode set datatype
3 participants