MySQL behaviour on connection failure
You have to understand that the underlying protocol that you're using to send dta(http://en.wikipedia.org/wiki/Transmission_Control_Protocol). The TC-Protocol is designed to deal with network breaks. Ultimately if you send a transmission to the remote server saying, for instance "insert into table (id, name) values (1, 'test');" then the TC-Protocol will handle not only delivering it, but also making sure it arrives in tact. In fact, it will even retry... but if there's a persistent network break it'll tell your application that the connection to the remote server was lost.

Thus, the answer is simply you do not need to do anything about this. TCP will make sure you don't get garbage data. TCP is the reason that you do not see garbage web-pages when you are on a shoddy connection. It also makes sure that you don't deliver garbage to your DB's. 

We run about 500 million transactions a month into the DB and not one are garbage - because of TCP.