-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't panic if driverRows.Next is called after Close
Previously this would panic with an index out of range error. Which was misleading as the indexing itself wasn't the problem. The problem was that fetch returns a nil error if the error channel was closed, which led the Next function to believe there was more data ready to be processed, but this was not the case. The error channel is only closed if Close is called on driverRows or driverStmt, so this panic was caused by a premature closing of the rows or statement, but that hard to tell from the panic message. This commit changes removes the panic and instead returns an io.EOF error if we detect that fetch was called on a closed statement or rows.
- Loading branch information
Showing
2 changed files
with
37 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters