Bug #56408 Default value of max_binlog_cache_size not as expected on 64 bit platforms.
Submitted: 31 Aug 2010 14:26 Modified: 26 Oct 2010 13:15
Reporter: Horst Hunger Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Options Severity:S3 (Non-critical)
Version:5.1-bugteam OS:Linux
Assigned to: CPU Architecture:Any

[31 Aug 2010 14:26] Horst Hunger
Description:
The test max_binlog_cache_size_basic_64 in the suite sys_vars failed. The default value is not 18446744073709547520 as specified in the user manual, but -4096, which is also not in the range of only positive values for that variable.

How to repeat:
Run sys_vars.max_binlog_cache_size_basic_64 in mysql-5.1-bugteam.
[2 Sep 2010 14:11] Horst Hunger
Negative values will also be assigned to the variable as -4096 instead of 4096 (positive), which is the lowest value in the valid range of values.
[10 Sep 2010 21:30] Sveta Smirnova
Thank you for the report.

Verified as described in 5.1-main.
[7 Oct 2010 19:08] Konstantin Osipov
Sveta, don't know about trunk, but here you go:
kostja@ibbur:~/work/5.5-runtime/mysql-test/suite/sys_vars/t$ ls -al binlog_cache_size_basic_64.test 
-rw-r--r-- 1 kostja kostja 495 2010-05-24 16:26 binlog_cache_size_basic_64.test
[7 Oct 2010 19:10] Konstantin Osipov
Even in case the test file itself is not there, we need a test case that doesn't involve the test file, verified on a 64 bit platform.
Please coordinate with Horst, and take the test case from 5.1 version of the server, and try it against 5.5 version.
[7 Oct 2010 19:11] Konstantin Osipov
(Acknowledge that there was a rename of the test file apparently).
[7 Oct 2010 21:12] Sveta Smirnova
With 5.5.7-runtime it fails as follow:

--- /users/ssmirnova/blade12/src/mysql-5.5-runtime/mysql-test/suite/sys_vars/r/max_binlog_cache_size_basic_64.result    2010-10-08 00:08:25.000000000 +0300
+++ /users/ssmirnova/blade12/src/mysql-5.5-runtime/mysql-test/suite/sys_vars/r/max_binlog_cache_size_basic_64.reject    2010-10-08 00:09:23.000000000 +0300
@@ -4,6 +4,8 @@
 18446744073709547520
 '#--------------------FN_DYNVARS_072_01------------------------#'
 SET @@global.max_binlog_cache_size = 5000;
+Warnings:
+Warning        1292    Truncated incorrect max_binlog_cache_size value: '5000'
 SET @@global.max_binlog_cache_size = DEFAULT;
 SELECT @@global.max_binlog_cache_size;
 @@global.max_binlog_cache_size
@@ -20,18 +22,26 @@
 @@global.max_binlog_cache_size
 4096
 SET @@global.max_binlog_cache_size = 4294967295;
+Warnings:
+Warning        1292    Truncated incorrect max_binlog_cache_size value: '4294967295'
 SELECT @@global.max_binlog_cache_size;
 @@global.max_binlog_cache_size
 4294963200
 SET @@global.max_binlog_cache_size = 4294967294;
+Warnings:
+Warning        1292    Truncated incorrect max_binlog_cache_size value: '4294967294'
 SELECT @@global.max_binlog_cache_size;
 @@global.max_binlog_cache_size
 4294963200
 SET @@global.max_binlog_cache_size = 4097;
+Warnings:
+Warning        1292    Truncated incorrect max_binlog_cache_size value: '4097'
 SELECT @@global.max_binlog_cache_size;
 @@global.max_binlog_cache_size
 4096
 SET @@global.max_binlog_cache_size = 65535;
+Warnings:
+Warning        1292    Truncated incorrect max_binlog_cache_size value: '65535'
 SELECT @@global.max_binlog_cache_size;
 @@global.max_binlog_cache_size
 61440
@@ -44,6 +54,8 @@
 @@global.max_binlog_cache_size
 4096
 SET @@global.max_binlog_cache_size = 100000000000;
+Warnings:
+Warning        1292    Truncated incorrect max_binlog_cache_size value: '100000000000'
 SELECT @@global.max_binlog_cache_size;
 @@global.max_binlog_cache_size
 99999997952
@@ -116,6 +128,8 @@
 4096
 '#---------------------FN_DYNVARS_072_08----------------------#'
 SET @@global.max_binlog_cache_size = 5000;
+Warnings:
+Warning        1292    Truncated incorrect max_binlog_cache_size value: '5000'
 SELECT @@max_binlog_cache_size = @@global.max_binlog_cache_size;
 @@max_binlog_cache_size = @@global.max_binlog_cache_size
 1

With 5.1 with different error:

CURRENT_TEST: sys_vars.max_binlog_cache_size_basic_64
--- /users/ssmirnova/blade12/src/mysql-5.1/mysql-test/suite/sys_vars/r/max_binlog_cache_size_basic_64.result    2010-05-31 10:32:07.000000000 +0300
+++ /users/ssmirnova/blade12/src/mysql-5.1/mysql-test/suite/sys_vars/r/max_binlog_cache_size_basic_64.reject    2010-10-08 00:10:44.000000000 +0300
@@ -1,13 +1,13 @@
 SET @start_value = @@global.max_binlog_cache_size;
 SELECT @start_value;
 @start_value
-18446744073709547520
+-4096
 '#--------------------FN_DYNVARS_072_01------------------------#'
 SET @@global.max_binlog_cache_size = 5000;
 SET @@global.max_binlog_cache_size = DEFAULT;
 SELECT @@global.max_binlog_cache_size;
 @@global.max_binlog_cache_size
-18446744073709547520
+-4096
 '#---------------------FN_DYNVARS_072_02-------------------------#'
 SET @@global.max_binlog_cache_size = @start_value;
 SELECT @@global.max_binlog_cache_size = 4294967295;
@@ -38,11 +38,9 @@
 'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
 '#--------------------FN_DYNVARS_072_04-------------------------#'
 SET @@global.max_binlog_cache_size = -1;
-Warnings:
-Warning        1292    Truncated incorrect max_binlog_cache_size value: '-1'
 SELECT @@global.max_binlog_cache_size;
 @@global.max_binlog_cache_size
-4096
+-4096
 SET @@global.max_binlog_cache_size = 100000000000;
 SELECT @@global.max_binlog_cache_size;
 @@global.max_binlog_cache_size
@@ -53,11 +51,9 @@
 @@global.max_binlog_cache_size
 99999997952
 SET @@global.max_binlog_cache_size = -1024;
-Warnings:
-Warning        1292    Truncated incorrect max_binlog_cache_size value: '-1024'
 SELECT @@global.max_binlog_cache_size;
 @@global.max_binlog_cache_size
-4096
+-4096
 SET @@global.max_binlog_cache_size = 1024;
 Warnings:
 Warning        1292    Truncated incorrect max_binlog_cache_size value: '1024'
@@ -138,4 +134,4 @@
 SET @@global.max_binlog_cache_size = @start_value;
 SELECT @@global.max_binlog_cache_size;
 @@global.max_binlog_cache_size
-18446744073709547520
+-4096
[18 Oct 2010 13:39] Ståle Deraas
This bug seems to have been fixed in 5.5 with WL#4738 .

From Guilhem:

- 5.1 is indeed broken, it sets a variable to a negative value which should not be (this variable intends to be the maximum size of a buffer; -4096 makes no sense)
- 5.5 is ok, all warnings which it shows are correct, the variable has to be a multiple of 4096, so if you pass for example 65535 as argument, MySQL rounds it to 65535/4096*4096 = 61440 and shows a warning to warn that it has rounded. Works fine.
[26 Oct 2010 13:15] Paul DuBois
Fixed in 5.5.3 in connection with the changes made to command option and system variable handling.