We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Please answer these questions before submitting your issue. Thanks!
package main import ( "database/sql" "fmt" "log" _ "github.com/go-sql-driver/mysql" ) func main() { db, err := sql.Open("mysql", "root@tcp(127.0.0.1:4000)/test") if err != nil { log.Fatal(err) } defer db.Close() db.Exec("CREATE TABLE IF NOT Exists `t1` (`id` bigint(20) UNSIGNED NOT NULL, PRIMARY KEY (`id`) )") db.Exec("insert into t1 values (18446744073709551615)") var i = ^uint64(0) rows, err := db.Query("select id from t1 where id=?", i) if err != nil { log.Fatal(err) } defer rows.Close() var r uint64 for rows.Next() { rows.Scan(&r) fmt.Printf("GOT: %d \n", r) } rows, err = db.Query("select id from t1 where id=?", -1) if err != nil { log.Fatal(err) } defer rows.Close() for rows.Next() { rows.Scan(&r) fmt.Printf("GOT: %d \n", r) } }
run against MySQL it returns
GOT: 18446744073709551615
run against TiDB it returns:
GOT: 18446744073709551615 GOT: 18446744073709551615
tidb-server -V
select tidb_version();
Release Version: v3.0.0-beta.1-68-ge48b258f9 Git Commit Hash: e48b258f9226ed8d4e6147154afb26ab7d8c59b2 Git Branch: master UTC Build Time: 2019-04-04 05:05:01 GoVersion: go version go1.12.1 darwin/amd64 Race Enabled: false TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e Check Table Before Drop: false
related issue: go-sql-driver/mysql#838
The text was updated successfully, but these errors were encountered:
Thanks for your feedback! @darren It's a bug, we will take a look, and also welcome to issue PR if you interesting this :D
Sorry, something went wrong.
lysu
Successfully merging a pull request may close this issue.
Bug Report
Please answer these questions before submitting your issue. Thanks!
If possible, provide a recipe for reproducing the error.
run against MySQL it returns
run against TiDB it returns:
tidb-server -V
or runselect tidb_version();
on TiDB)?related issue: go-sql-driver/mysql#838
The text was updated successfully, but these errors were encountered: