go-sql-driver/mysql — pull request #164 by cxmcc (2013-11-06 11:46:07+00:00)
Title: Possible factorization for writePacket

This patch basically do the following things:

1. merge writePacket() and splitPacket(), this avoids the two functions calling each other, also they share some code (length checking, error handling, write data) can be reused.

2. move the header length calculation logics into writePacket(), since for large packets we need to split them and calculate/write the header in writePacket() anyway.

What do you think? :)