From 03993d03a75049d2df659b46f8ec5e263b7ff1bd Mon Sep 17 00:00:00 2001 From: Sujatha Sivakumar Date: Tue, 24 Jul 2012 16:26:16 +0530 Subject: 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". --- mysys/mf_iocache.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'mysys') 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; -- cgit v1.2.1 From aca566d79888293ad5e0a6bad10c35d0a9b36893 Mon Sep 17 00:00:00 2001 From: Sujatha Sivakumar Date: Wed, 25 Jul 2012 14:56:37 +0530 Subject: Follow up patch for BUG#13961678. Fixing compilation warning given below. "warning: integer constant is too large for 'long' type" --- mysys/mf_iocache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mysys') diff --git a/mysys/mf_iocache.c b/mysys/mf_iocache.c index 8c91befe905..7aa0934096f 100644 --- a/mysys/mf_iocache.c +++ b/mysys/mf_iocache.c @@ -1532,7 +1532,7 @@ int _my_b_write(register IO_CACHE *info, const uchar *Buffer, size_t Count) DBUG_EXECUTE_IF("simulate_huge_load_data_file", { - pos_in_file=5000000000; + pos_in_file=(my_off_t)(5000000000ULL); }); if (pos_in_file+info->buffer_length > info->end_of_file) { -- cgit v1.2.1 From 61f064eb6d69e4c5116ee1f7d56c67c5fad9477c Mon Sep 17 00:00:00 2001 From: Georgi Kodinov Date: Fri, 17 Aug 2012 18:02:44 +0300 Subject: Bug #14399795 : ISSUES RELATED TO SETTING AUDIT_LOG_STRATEGY DURING SERVER STARTUP The options parser now correctly checks for ambiguous prefixes in enumerated variables and emits an error when the value supplied is ambiguous. No test added since mysql-test-run.pl can't handle server startup failures as an expected state. --- mysys/my_getopt.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'mysys') diff --git a/mysys/my_getopt.c b/mysys/my_getopt.c index ac4ae46eab5..2ab9d44893c 100644 --- a/mysys/my_getopt.c +++ b/mysys/my_getopt.c @@ -710,6 +710,11 @@ static int setval(const struct my_option *opts, void *value, char *argument, } *(ulong*)value= arg; } + else if (type < 0) + { + res= EXIT_AMBIGUOUS_OPTION; + goto ret; + } else *(ulong*)value= type - 1; } -- cgit v1.2.1