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 up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
database/sql: driver restriction on Scan value type seems useless #5066
What steps will reproduce the problem? Just look at the existing tests in database/sql/convert_test.go where the source type is string. What is the expected output? According to the documentation, the tests should fail: a) "IsScanValue reports whether v is a valid Value scan type. Unlike IsValue, IsScanValue does not permit the string type." b) And driver.Rows.Next: "The dest slice may be populated only with a driver Value type, but excluding string. All string values must be converted to byte." What do you see instead? All tests pass. Which compiler are you using (5g, 6g, 8g, gccgo)? 6g Which operating system are you using? Linux Which version are you using? (run 'go version') go version devel +77e6fc536a7d Thu Mar 14 14:35:47 2013 -0400 linux/amd64 Please provide any additional information below. Maybe the documentation should be updated to remove the restriction on string type.
These drivers return only byte (no string). - github.com/ziutek/mymysql - github.com/Go-SQL-Driver/MySQL - github.com/lxn/go-pgsql - github.com/bmizerany/pq - github.com/gwenn/gosqlite - code.google.com/p/go-sqlite - bitbucket.org/phiggins/go-db2-cli These drivers may return string: - github.com/weigj/go-odbc - github.com/jgallagher/go-libpq - github.com/mattn/go-sqlite3 - github.com/mattn/go-oci8 - github.com/mattn/go-adodb
Here is a patch. No regression in standard library test suite. No regression in 'github.com/bradfitz/go-sql-test/src/sqltest'. I don't know if the change made to 'IsScanValue' method can be considered as a Go1 api break or not.