Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upImplement 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. |
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: |
fw42
Oct 23, 2017
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?
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?
fw42
Oct 23, 2017
Oh nvm I just saw that this is from golang/go@d7c0de9
Oh nvm I just saw that this is from golang/go@d7c0de9
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
@julienschmidt ping |
Seems good. |
#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
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