-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Scan receives unexpected type []uint8 when using db.QueryRow #441
Labels
Comments
Yeah, I looked at those issues, your reply was to not scan into |
Any update on this? |
Is this issue resloved? |
it's a specification of the driver. |
scbizu
added a commit
to ezbuy/ezorm
that referenced
this issue
Jul 26, 2023
…ToResult helper MySQL driver will scan `any` type field into `[]byte` as [it mentioned](go-sql-driver/mysql#441) However, we cannot determine the underlying type of every mysql functions currently. We need a helper function to generic the `[]byte` -> wellknown SQL type(e.g.: `NullInt64`) to avoid spamming the conversion code all over our business codebase.
scbizu
added a commit
to ezbuy/ezorm
that referenced
this issue
Jul 26, 2023
…ToResult helper MySQL driver will scan `any` type field into `[]byte` as [it mentioned](go-sql-driver/mysql#441) However, we cannot determine the underlying type of every mysql functions currently. We need a helper function to generic the `[]byte` -> wellknown SQL type(e.g.: `NullInt64`) to avoid spamming the conversion code all over our business codebase.
scbizu
added a commit
to ezbuy/ezorm
that referenced
this issue
Jul 26, 2023
…ToResult helper MySQL driver will scan `any` type field into `[]byte` as [it mentioned](go-sql-driver/mysql#441) However, we cannot determine the underlying type of every mysql functions currently. We need a helper function to generic the `[]byte` -> wellknown SQL type(e.g.: `NullInt64`) to avoid spamming the conversion code all over our business codebase.
scbizu
added a commit
to ezbuy/ezorm
that referenced
this issue
Jul 26, 2023
…ToResult helper MySQL driver will scan `any` type field into `[]byte` as [it mentioned](go-sql-driver/mysql#441) However, we cannot determine the underlying type of every mysql functions currently. We need a helper function to generic the `[]byte` -> wellknown SQL type(e.g.: `NullInt64`) to avoid spamming the conversion code all over our business codebase.
scbizu
added a commit
to ezbuy/ezorm
that referenced
this issue
Jul 27, 2023
…ToResult helper MySQL driver will scan `any` type field into `[]byte` as [it mentioned](go-sql-driver/mysql#441) However, we cannot determine the underlying type of every mysql functions currently. We need a helper function to generic the `[]byte` -> wellknown SQL type(e.g.: `NullInt64`) to avoid spamming the conversion code all over our business codebase.
scbizu
added a commit
to ezbuy/ezorm
that referenced
this issue
Jul 27, 2023
…ToResult helper MySQL driver will scan `any` type field into `[]byte` as [it mentioned](go-sql-driver/mysql#441) However, we cannot determine the underlying type of every mysql functions currently. We need a helper function to generic the `[]byte` -> wellknown SQL type(e.g.: `NullInt64`) to avoid spamming the conversion code all over our business codebase.
scbizu
added a commit
to ezbuy/ezorm
that referenced
this issue
Jul 27, 2023
…ToResult helper MySQL driver will scan `any` type field into `[]byte` as [it mentioned](go-sql-driver/mysql#441) However, we cannot determine the underlying type of every mysql functions currently. We need a helper function to generic the `[]byte` -> wellknown SQL type(e.g.: `NullInt64`) to avoid spamming the conversion code all over our business codebase.
scbizu
added a commit
to ezbuy/ezorm
that referenced
this issue
Jul 27, 2023
…ToResult helper MySQL driver will scan `any` type field into `[]byte` as [it mentioned](go-sql-driver/mysql#441) However, we cannot determine the underlying type of every mysql functions currently. We need a helper function to generic the `[]byte` -> wellknown SQL type(e.g.: `NullInt64`) to avoid spamming the conversion code all over our business codebase.
scbizu
added a commit
to ezbuy/ezorm
that referenced
this issue
Jul 27, 2023
…ToResult helper MySQL driver will scan `any` type field into `[]byte` as [it mentioned](go-sql-driver/mysql#441) However, we cannot determine the underlying type of every mysql functions currently. We need a helper function to generic the `[]byte` -> wellknown SQL type(e.g.: `NullInt64`) to avoid spamming the conversion code all over our business codebase.
scbizu
added a commit
to ezbuy/ezorm
that referenced
this issue
Jul 27, 2023
…ToResult helper MySQL driver will scan `any` type field into `[]byte` as [it mentioned](go-sql-driver/mysql#441) However, we cannot determine the underlying type of every mysql functions currently. We need a helper function to generic the `[]byte` -> wellknown SQL type(e.g.: `NullInt64`) to avoid spamming the conversion code all over our business codebase.
scbizu
added a commit
to ezbuy/ezorm
that referenced
this issue
Jul 27, 2023
…ToResult helper MySQL driver will scan `any` type field into `[]byte` as [it mentioned](go-sql-driver/mysql#441) However, we cannot determine the underlying type of every mysql functions currently. We need a helper function to generic the `[]byte` -> wellknown SQL type(e.g.: `NullInt64`) to avoid spamming the conversion code all over our business codebase.
scbizu
added a commit
to ezbuy/ezorm
that referenced
this issue
Jul 27, 2023
…ToResult helper (#296) MySQL driver will scan `any` type field into `[]byte` as [it mentioned](go-sql-driver/mysql#441) However, we cannot determine the underlying type of every mysql functions currently. We need a helper function to generic the `[]byte` -> wellknown SQL type(e.g.: `NullInt64`) to avoid spamming the conversion code all over our business codebase.
scbizu
added a commit
to ezbuy/ezorm
that referenced
this issue
Jul 27, 2023
…ToResult helper (#296) MySQL driver will scan `any` type field into `[]byte` as [it mentioned](go-sql-driver/mysql#441) However, we cannot determine the underlying type of every mysql functions currently. We need a helper function to generic the `[]byte` -> wellknown SQL type(e.g.: `NullInt64`) to avoid spamming the conversion code all over our business codebase.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Issue description
I've created a custom type that implements sql.Scanner.
The documentation of this interface claims that Scan will receive one of the following types:
If I use a prepared statement, it receives an
int64
, which is correct. If I just usedb.QueryRow
, it receives a[]uint8
with the value[52 50]
instead, which is actually the string"42"
. It should receive int64 in both cases.Example code
Configuration
Driver version (or git SHA): 66312f7
Go version: go1.6 linux/amd64
Server version: 5.6.28-0ubuntu0.15.10.1
Server OS: Ubuntu 15.10
The text was updated successfully, but these errors were encountered: