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

support insert argument type json.RawMessage #627

Merged
merged 4 commits into from
Oct 7, 2021

Conversation

domyway
Copy link
Contributor

@domyway domyway commented Sep 16, 2021

if use type json.RawMessage for the args, return fmt.Errorf("invalid argument type %T", args[i]) .

i have write some test .

go-sql-driver/mysql@1.6.0 handle json.RawMessage inside :

for i, arg := range args {
			// build NULL-bitmap
			if arg == nil {
				nullMask[i/8] |= 1 << (uint(i) & 7)
				paramTypes[i+i] = byte(fieldTypeNULL)
				paramTypes[i+i+1] = 0x00
				continue
			}

			if v, ok := arg.(json.RawMessage); ok {
				arg = []byte(v)
			}
			// cache types and values
			switch v := arg.(type) {
			case int64:
                          blablablabla.....

@lance6716 lance6716 merged commit 42e81ef into go-mysql-org:master Oct 7, 2021
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.

3 participants