summaryrefslogtreecommitdiff
path: root/mysys/mf_iocache.c
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 /mysys/mf_iocache.c
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".
Diffstat (limited to 'mysys/mf_iocache.c')
-rw-r--r--mysys/mf_iocache.c7
1 files changed, 6 insertions, 1 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;