Skip to content

ignore io.EOF error if data was fully read #109

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

Merged
merged 1 commit into from
Jul 11, 2013

Conversation

arnehormann
Copy link
Member

This should fix Issue 108.
In buffer, we pass io.EOF to the caller where it's always checked for nil.
This can cause false positive errors when the data was fully read.
io.Reader is allowed to return the number of bytes read AND io.EOF, which is not an error in our case.

I'd love to add a test for this (and for closed issues for bugs in the code in general), but I don't know how to do it without a fake packet, which seems to be a little over the top. Any ideas?

@julienschmidt
Copy link
Member

LGTM

Sending a fake packet would require a connection mock, I think this wouldn't be worth it.

arnehormann added a commit that referenced this pull request Jul 11, 2013
ignore io.EOF error if data was fully read
@arnehormann arnehormann merged commit ceeeaea into go-sql-driver:master Jul 11, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

EOF error in packets.go readPacket() not propagating
2 participants