My situation is pretty straight forward.
I have a server configured with max_allowed_packet set to 16M. It’s running Percona Server 5.1.52.
I wrote a simple script in perl to do huge bulk inserts. I know roughly the size the packets are going to be by knowing how big the data string I’m sending through DBI is.
No matter what size the bulk insert MySQL seems to accept the packet and do the insert, but I’m expecting it to give me a Packet Too Large error for anything over 16M.
Here’s where it gets really weird…
If I set the max_allowed_packet to 16777215 (one byte less that 16M) or anything lower I get the error for packets over that size and obviously don’t get the error for packets under that size.
So, it appears as if at anything below 16M the packet limit is obeyed, but 16M or greater and it’s completely ignored.
Any thoughts as to what could be causing this? It’s really bizarre and the opposite problem most people have with max_allowed_packet.
Is it possible that the mysql client could be doing some auto-chunking? The server only appears to be running one big query, so auto-chunking seems really unlikely since it’d probably show up as more than one insert.
Any variables I could check to get more information about what’s going on?