summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSujatha Sivakumar <sujatha.sivakumar@oracle.com>2012-07-24 16:26:16 +0530
committerSujatha Sivakumar <sujatha.sivakumar@oracle.com>2012-07-24 16:26:16 +0530
commit03993d03a75049d2df659b46f8ec5e263b7ff1bd (patch)
tree02b7ba5a14b9e97ee4a1b95d39cba3158596a6fa
parentd4caad52a524c6607ad37680226f7a3d8c0b4c35 (diff)
downloadmariadb-git-03993d03a75049d2df659b46f8ec5e263b7ff1bd.tar.gz
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". mysys/mf_iocache.c: Added debug statement to simulate a scenario where the cache file's current position is set to >4GB sql/log.cc: Replaced the type of `saved_max_binlog_cache_size' from "ulong" to "my_off_t", which is a type def for "ulonglong".
-rw-r--r--mysys/mf_iocache.c7
-rw-r--r--sql/log.cc8
2 files changed, 10 insertions, 5 deletions
diff --git a/mysys/mf_iocache.c b/mysys/mf_iocache.c
index 03d11c6f6af..8c91befe905 100644
--- a/mysys/mf_iocache.c
+++ b/mysys/mf_iocache.c
@@ -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;
diff --git a/sql/log.cc b/sql/log.cc
index fc11dcc77ce..1cc94d2fb02 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -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,