Commit 143d70a9 authored by Satya B's avatar Satya B

Fix for BUG#10206 - InnoDB: Transaction requiring Max_BinLog_Cache_size > 4GB

                    always rollsback.

The global variable max_binlog_cache_size cannot be set more than 4GB on
32 bit systems, limiting transactions of all storage engines to 4G of changes.

The problem is max_binlog_cache_size is declared as ulong which is 4 bytes
on 32 bit and 8 bytes on 64 bit machines.

Fixed by using ulonglong for max_binlog_cache_size which is 8bytes on 32 
and 64 bit machines.The range for max_binlog_cache_size on 32 bit and 64 bit
systems is 4096-18446744073709547520 bytes.

mysql-test/r/variables.result:
  Result file for BUG#10206
mysql-test/t/variables.test:
  Testcase for BUG#10206
sql/mysql_priv.h:
  change the extern declaration of max_binlog_cache_size to ulonglong
sql/mysqld.cc:
  change the declaration of max_binlog_cache_size to ulonglong and the option is fixed to extend the range of max_binlog_cache_size
sql/set_var.cc:
  change the variable declaration of max_binlog_cache_size to ulonglong
parent 57d7b826
...@@ -1467,4 +1467,14 @@ SELECT @@GLOBAL.server_id; ...@@ -1467,4 +1467,14 @@ SELECT @@GLOBAL.server_id;
@@GLOBAL.server_id @@GLOBAL.server_id
0 0
SET GLOBAL server_id = @old_server_id; SET GLOBAL server_id = @old_server_id;
#
# BUG#10206 - InnoDB: Transaction requiring Max_BinLog_Cache_size > 4GB always rollsback
#
SET @old_max_binlog_cache_size = @@GLOBAL.max_binlog_cache_size;
# Set the max_binlog_cache_size to size more than 4GB.
SET GLOBAL max_binlog_cache_size = 5 * 1024 * 1024 * 1024;
SELECT @@GLOBAL.max_binlog_cache_size;
@@GLOBAL.max_binlog_cache_size
5368709120
SET GLOBAL max_binlog_cache_size = @old_max_binlog_cache_size;
End of 5.1 tests End of 5.1 tests
...@@ -1201,4 +1201,13 @@ SET GLOBAL server_id = -1; ...@@ -1201,4 +1201,13 @@ SET GLOBAL server_id = -1;
SELECT @@GLOBAL.server_id; SELECT @@GLOBAL.server_id;
SET GLOBAL server_id = @old_server_id; SET GLOBAL server_id = @old_server_id;
--echo #
--echo # BUG#10206 - InnoDB: Transaction requiring Max_BinLog_Cache_size > 4GB always rollsback
--echo #
SET @old_max_binlog_cache_size = @@GLOBAL.max_binlog_cache_size;
--echo # Set the max_binlog_cache_size to size more than 4GB.
SET GLOBAL max_binlog_cache_size = 5 * 1024 * 1024 * 1024;
SELECT @@GLOBAL.max_binlog_cache_size;
SET GLOBAL max_binlog_cache_size = @old_max_binlog_cache_size;
--echo End of 5.1 tests --echo End of 5.1 tests
...@@ -1935,7 +1935,8 @@ extern uint max_user_connections; ...@@ -1935,7 +1935,8 @@ extern uint max_user_connections;
extern ulong what_to_log,flush_time; extern ulong what_to_log,flush_time;
extern ulong query_buff_size; extern ulong query_buff_size;
extern ulong max_prepared_stmt_count, prepared_stmt_count; extern ulong max_prepared_stmt_count, prepared_stmt_count;
extern ulong binlog_cache_size, max_binlog_cache_size, open_files_limit; extern ulong binlog_cache_size, open_files_limit;
extern ulonglong max_binlog_cache_size;
extern ulong max_binlog_size, max_relay_log_size; extern ulong max_binlog_size, max_relay_log_size;
extern ulong opt_binlog_rows_event_max_size; extern ulong opt_binlog_rows_event_max_size;
extern ulong rpl_recovery_rank, thread_cache_size, thread_pool_size; extern ulong rpl_recovery_rank, thread_cache_size, thread_pool_size;
......
...@@ -507,7 +507,8 @@ ulong slave_net_timeout, slave_trans_retries; ...@@ -507,7 +507,8 @@ ulong slave_net_timeout, slave_trans_retries;
ulong slave_exec_mode_options; ulong slave_exec_mode_options;
const char *slave_exec_mode_str= "STRICT"; const char *slave_exec_mode_str= "STRICT";
ulong thread_cache_size=0, thread_pool_size= 0; ulong thread_cache_size=0, thread_pool_size= 0;
ulong binlog_cache_size=0, max_binlog_cache_size=0; ulong binlog_cache_size=0;
ulonglong max_binlog_cache_size=0;
ulong query_cache_size=0; ulong query_cache_size=0;
ulong refresh_version; /* Increments on each reload */ ulong refresh_version; /* Increments on each reload */
query_id_t global_query_id; query_id_t global_query_id;
...@@ -6582,7 +6583,7 @@ log and this option does nothing anymore.", ...@@ -6582,7 +6583,7 @@ log and this option does nothing anymore.",
{"max_binlog_cache_size", OPT_MAX_BINLOG_CACHE_SIZE, {"max_binlog_cache_size", OPT_MAX_BINLOG_CACHE_SIZE,
"Can be used to restrict the total size used to cache a multi-transaction query.", "Can be used to restrict the total size used to cache a multi-transaction query.",
(uchar**) &max_binlog_cache_size, (uchar**) &max_binlog_cache_size, 0, (uchar**) &max_binlog_cache_size, (uchar**) &max_binlog_cache_size, 0,
GET_ULONG, REQUIRED_ARG, ULONG_MAX, IO_SIZE, ULONG_MAX, 0, IO_SIZE, 0}, GET_ULL, REQUIRED_ARG, ULONG_MAX, IO_SIZE, ULLONG_MAX, 0, IO_SIZE, 0},
{"max_binlog_size", OPT_MAX_BINLOG_SIZE, {"max_binlog_size", OPT_MAX_BINLOG_SIZE,
"Binary log will be rotated automatically when the size exceeds this \ "Binary log will be rotated automatically when the size exceeds this \
value. Will also apply to relay logs if max_relay_log_size is 0. \ value. Will also apply to relay logs if max_relay_log_size is 0. \
......
...@@ -359,8 +359,8 @@ static sys_var_const sys_lower_case_table_names(&vars, ...@@ -359,8 +359,8 @@ static sys_var_const sys_lower_case_table_names(&vars,
&lower_case_table_names); &lower_case_table_names);
static sys_var_thd_ulong_session_readonly sys_max_allowed_packet(&vars, "max_allowed_packet", static sys_var_thd_ulong_session_readonly sys_max_allowed_packet(&vars, "max_allowed_packet",
&SV::max_allowed_packet); &SV::max_allowed_packet);
static sys_var_long_ptr sys_max_binlog_cache_size(&vars, "max_binlog_cache_size", static sys_var_ulonglong_ptr sys_max_binlog_cache_size(&vars, "max_binlog_cache_size",
&max_binlog_cache_size); &max_binlog_cache_size);
static sys_var_long_ptr sys_max_binlog_size(&vars, "max_binlog_size", static sys_var_long_ptr sys_max_binlog_size(&vars, "max_binlog_size",
&max_binlog_size, &max_binlog_size,
fix_max_binlog_size); fix_max_binlog_size);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment