Skip to content

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