Bug#13961678:MULTI-STATEMENT TRANSACTION REQUIRED MORE THAN

'MAX_BINLOG_CACHE_SIZE' ERROR
      
Problem:
=======
MySQL returns following error in win64.
"ERROR 1197 (HY000): Multi-statement transaction required more than
'max_binlog_cache_size' bytes of storage; increase this mysqld variable
and try again" when user tries to load >4G file even if
max_binlog_cache_size set to maximum value. On Linux everything
works fine.
      
Analysis:
========
The `max_binlog_cache_size' variable is of type `ulonglong'.  This
value is set to `ULONGLONG_MAX' at the time of server start up. The
above value is stored in an intermediate variable named
`saved_max_binlog_cache_size' which is of type `ulong'. In visual
c++ complier the `ulong' type is of 4bytes in size and hence the value
is getting truncated to '4GB' and the cache is not able to grow beyond
4GB size. The same limitation is observed with 
"max_binlog_stmt_cache_size" as well. Similar fix has been applied.
      
Fix:
===
As part of fix the type "ulong" is replaced with "my_off_t" which is of
type "ulonglong".
This commit is contained in:
Sujatha Sivakumar 2012-07-24 16:26:16 +05:30
parent 02565667ac
commit f9e6613bd4
2 changed files with 10 additions and 5 deletions

View file

@ -1528,8 +1528,13 @@ int _my_b_get(IO_CACHE *info)
int _my_b_write(register IO_CACHE *info, const uchar *Buffer, size_t Count)
{
size_t rest_length,length;
my_off_t pos_in_file= info->pos_in_file;
if (info->pos_in_file+info->buffer_length > info->end_of_file)
DBUG_EXECUTE_IF("simulate_huge_load_data_file",
{
pos_in_file=5000000000;
});
if (pos_in_file+info->buffer_length > info->end_of_file)
{
my_errno=errno=EFBIG;
return info->error = -1;

View file

@ -300,7 +300,7 @@ public:
before_stmt_pos= MY_OFF_T_UNDEF;
}
void set_binlog_cache_info(ulong param_max_binlog_cache_size,
void set_binlog_cache_info(my_off_t param_max_binlog_cache_size,
ulong *param_ptr_binlog_cache_use,
ulong *param_ptr_binlog_cache_disk_use)
{
@ -377,7 +377,7 @@ private:
is configured. This corresponds to either
. max_binlog_cache_size or max_binlog_stmt_cache_size.
*/
ulong saved_max_binlog_cache_size;
my_off_t saved_max_binlog_cache_size;
/*
Stores a pointer to the status variable that keeps track of the in-memory
@ -415,8 +415,8 @@ private:
class binlog_cache_mngr {
public:
binlog_cache_mngr(ulong param_max_binlog_stmt_cache_size,
ulong param_max_binlog_cache_size,
binlog_cache_mngr(my_off_t param_max_binlog_stmt_cache_size,
my_off_t param_max_binlog_cache_size,
ulong *param_ptr_binlog_stmt_cache_use,
ulong *param_ptr_binlog_stmt_cache_disk_use,
ulong *param_ptr_binlog_cache_use,