-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Implement NamedValueChecker for mysqlConn #690
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
Implement NamedValueChecker for mysqlConn #690
Conversation
This breaks the build for Go 1.7 and earlier, so I moved the implementation into the go1.8 file. |
0ce6231
to
5e3001f
Compare
I assume that means that your binary will only include the fix to this issue if you compile with a newer version of Go? Compiling it with older Go versions will give you an unfixed version (same as before)? |
@@ -157,6 +157,16 @@ func (c converter) ConvertValue(v interface{}) (driver.Value, error) { | |||
return int64(u64), nil | |||
case reflect.Float32, reflect.Float64: | |||
return rv.Float(), nil | |||
case reflect.Bool: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes in this file affect all versions (not just 1.8). Can you explain what this does? In particular what does this do to 1.7 and lower?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh nvm I just saw that this is from golang/go@d7c0de9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM as far as I can tell 👍
Right, the API for making the fix possible is not available in older Go versions. |
The general approach looks fine to me 👍 . |
8f556d3
to
4214b36
Compare
@julienschmidt ping |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems good.
I'd like to merge #623 first though. The author of that PR is responsive again.
#623 is merged. This PR now needs a rebase on (or merge with) the current |
* Also add conversions for additional types in ConvertValue ref golang/go@d7c0de9
4214b36
to
e281d84
Compare
Done. |
Thanks for contributing! |
…rnally Added a test that Valuer types are handled correctly. This test fails without the fix. CheckNamedValue code was included recently and breaks existing applications: go-sql-driver#690 Reported in: go-sql-driver#708
…rnally Added a test that Valuer types are handled correctly. This test fails without the fix. CheckNamedValue code was included recently and breaks existing applications: go-sql-driver#690 Reported in: go-sql-driver#708
* Also add conversions for additional types in ConvertValue ref golang/go@d7c0de9
Fixes #342
Calls to
Exec
for non-prepared statements with uint64 arguments having high-bits set are currently broken. The typical "uint64 values with high bit set are not supported" error is returned.Now that the
NamedValueChecker
interface is in Go, this can be solved by implementing it formysqlConn
. The implementation is based ondefaultCheckNamedValue
.I also included changes from golang/go@d7c0de9
cc @shuhaowu @daniellaniyo @hkdsun @fw42