Skip to content

Issue #26 sign-extend int8/int16/int24/int32 when widening to int64 #27

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

Conversation

karmakaze
Copy link
Contributor

No description provided.

@@ -39,7 +39,7 @@ func (p RowData) ParseText(f []*Field) ([]interface{}, error) {
if isNull {
data[i] = nil
} else {
isUnsigned = (f[i].Flag&UNSIGNED_FLAG > 0)
isUnsigned := f[i].Flag & UNSIGNED_FLAG != 0
Copy link
Contributor Author

Choose a reason for hiding this comment

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

small style change--advantage being that the var isUnsigned can't be read without having being properly initialized

@siddontang
Copy link
Collaborator

Cool, @karmakaze , I will see it later, Thank you.

@siddontang
Copy link
Collaborator

Hi @karmakaze , can you add some tests?

@karmakaze
Copy link
Contributor Author

I can see about adding some tests over the weekend. This library has been working out pretty well so far. Performance so far hasn't been an issue, so just looking at correctly handling all the datatypes we're using.

…o int64)

Adds funcs mysql.ParseBinaryInt8/Uint8/Int16/Uint16/Int24/Uint24/Int32/Uint32/Int64/Uint64 and tests
@karmakaze karmakaze force-pushed the sign-extend-ints-when-widening branch from 2e121d1 to 879f46c Compare January 10, 2016 02:27
@karmakaze
Copy link
Contributor Author

Added tests, put common implementation in mysql/parse_binary.go used by mysql/resultset.go and replication/row_event.go

@siddontang
Copy link
Collaborator

LGTM, Thank you @karmakaze

siddontang added a commit that referenced this pull request Jan 11, 2016
Issue #26 sign-extend int8/int16/int24/int32 when widening to int64
@siddontang siddontang merged commit fcea4fe into go-mysql-org:master Jan 11, 2016
@karmakaze karmakaze deleted the sign-extend-ints-when-widening branch January 11, 2016 16:59
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.

2 participants