Bug #34841 Invalid values are coming in max_allowed_packet on assigning valid value to it.
Submitted: 26 Feb 2008 13:20 Modified: 25 Apr 2008 14:09
Reporter: Salman Rawala Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:5.1.22 OS:Any
Assigned to: Paul DuBois CPU Architecture:Any
Tags: Dynamic System Variable, max_allowed_packet

[26 Feb 2008 13:20] Salman Rawala
Description:
Whenever we set value of variable within range of max_allowed_packet, it automatically changes its value to any other value.

How to repeat:
You can reproduce bug using following code

Sample Code:
SET @@global.max_allowed_packet = 1025;
SELECT @@global.max_allowed_packet;
SET @@global.max_allowed_packet = 1073741823;
SELECT @@global.max_allowed_packet;

Actual Output:
SET @@global.max_allowed_packet = 1025;
SELECT @@global.max_allowed_packet;
@@global.max_allowed_packet
1024
SET @@global.max_allowed_packet = 1073741823;
SELECT @@global.max_allowed_packet;
@@global.max_allowed_packet
1073740800

Suggested fix:
On assigning valid value to variable, it should show valid value as the expected output is given below:

SET @@global.max_allowed_packet = 1025;
SELECT @@global.max_allowed_packet;
@@global.max_allowed_packet
1025
SET @@global.max_allowed_packet = 1073741823;
SELECT @@global.max_allowed_packet;
@@global.max_allowed_packet
1073741823
[27 Feb 2008 14:15] Valeriy Kravchuk
Looks like max_allowed_packet should be multiple of 1024 (1K). This should be explicitely documented (at http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html#option_mysqld_max_allo...).
[25 Apr 2008 14:09] Paul DuBois
Thank you for your bug report. This issue has been addressed in the documentation. The updated documentation will appear on our website shortly, and will be included in the next release of the relevant products.