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

args do not support uint64 #1089

Closed
zhixinwen opened this issue May 1, 2020 · 6 comments
Closed

args do not support uint64 #1089

zhixinwen opened this issue May 1, 2020 · 6 comments

Comments

@zhixinwen
Copy link
Contributor

Issue description

We upgrade the driver from 1.4.1 to 1.5, and all the select statements with uint64 as args are failing.

I think the issue is introduced by #838., which would fail https://github.com/golang/go/blob/master/src/database/sql/convert.go#L83.

For

	var err error
	arg := nv.Value
	nv.Value, err = c.cci.ColumnConverter(index).ConvertValue(arg)
	if err != nil {
		return err
	}
	if !driver.IsValue(nv.Value) {
		return fmt.Errorf("driver ColumnConverter error converted %T to unsupported type %T", arg, nv.Value)
	}
	return nil

In 1.4, nv.Value would be casted to int64, so driver.IsValue returns true. Now, nv.Value would remainuint64, and driver.IsValue would return false, and cause the error above.

Error log

converting argument $1 type: driver ColumnConverter error converted uint64 to unsupported type uint64"```

### Configuration
*Driver version (or git SHA):*
1.5
*Go version:* run `go version` in your console
go version go1.14.2 darwin/amd64

@zhixinwen
Copy link
Contributor Author

We are using https://github.com/luna-duclos/instrumentedsql for instrumentation, and I notice this error only occurs when we use it combined with driver version 1.5.

I am feeling the combination triggers the call path above, and that is why many people do not see the error before..

@zhixinwen
Copy link
Contributor Author

zhixinwen commented May 2, 2020

In instrumentedsql it checks is mysqlStmt implements driver.NamedValueChecker, since it does not implement driver.NamedValueChecker it would use ccChecker.CheckNamedValue. And this code path changes triggers the bug.

If no instrument is used, it would fall back to driver.NamedValueChecker in mysqlConn

@zhixinwen
Copy link
Contributor Author

send out a fix in #1090

@cristaloleg
Copy link

Looks like it can be closed.

@zhixinwen
Copy link
Contributor Author

Can we please cut a release for the patch? We still accidentally get upgraded.

@kavimehta
Copy link

+1 This bug has caused issues for my team. Cutting a new release would be great

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

No branches or pull requests

4 participants