Open ghost opened 5 years ago
Ref: https://groups.google.com/d/msg/golang-nuts/WMw_vsiFpvU/uwvCJus8DwAJ
This is the subthread about this difference.
Another reference is this: https://golang.org/pkg/database/sql/driver/#RowsNextResultSet
// HasNextResultSet is called at the end of the current result set and
// reports whether there is another result set after the current one.
HasNextResultSet() bool
// NextResultSet advances the driver to the next result set even
// if there are remaining rows in the current result set.
//
// NextResultSet should return io.EOF when there are no more result sets.
NextResultSet() error
Maybe, lib/pq doesn't have full implementation of NextResultSet? It can not "skip remaining rows in the current result set."
Calling
NextResultSet()
onrows
returned bybehaves inconsistent between
lib/pq
andgo-sql-driver/mysql
. While it istrue
forpq
, it is false formysql
. This gists shows complete code that demonstrates this behaviour:https://gist.github.com/lutzhorn/1aa7de538d1edd0b3904799b5bb972fd
The maintainers of
mysql
claim on the go-nuts mailinglist that returningfalse
ist correct in this scenario.What is the correct behaviour?