Bug #1459 max_allowed_packet does not just control the maximum allowed packet size
Submitted: 1 Oct 2003 14:24 Modified: 26 Nov 2005 12:53
Reporter: Justin Patrin Email Updates:
Status: Verified Impact on me:
Category:MySQL Server: DML Severity:S4 (Feature request)
Version:4.0.15a OS:Any (All)
Assigned to: CPU Architecture:Any

[1 Oct 2003 14:24] Justin Patrin
When storing large values in a column, the maximum size of the columns is controlled by max_allowed_packet because it controls the maximum size of the buffer, not the packet itself.

How to repeat:
For instance, if I send a query like this:
  UPDATE bigColumnTable SET bigColumn = CONCAT(bigColumn, "a");
1024 * 1024 times with max_allowed_packet = 1M, the update fills the buffer, I get a max_allowed_packet error, and the column ends up null. The packet was not nearly 1M, but the buffer gets to 1M anyway.

Suggested fix:
I would propose that another setting be introduced (max_record_size or similar) that controls the buffer (or, in actuality, the maximum record / column size). This would allow for keeping communication packets small, but allowing for large values to be stored.
[26 Nov 2005 12:53] Valeriy Kravchuk
Thank you for a feature request. 

I agree that separate parameter will be useful, even with the same default value. max_allowed_packet is a misleading name for a parameter that controls the size of any intermediate strings (and the error message you get from your UPDATE is even more misleading), but, at least, this function of it is documented in http://dev.mysql.com/doc/refman/5.0/en/server-system-variables.html...