Commit 7ff9e457 authored by Nikita Malyavin's avatar Nikita Malyavin

binlog_cache_data: use the correct cache size in reset()

parent 06a7352d
...@@ -94,9 +94,9 @@ class binlog_cache_data ...@@ -94,9 +94,9 @@ class binlog_cache_data
void reset() void reset()
{ {
bool cache_was_empty= empty(); bool cache_was_empty= empty();
my_off_t trunc_len= MY_MIN(CACHE_FILE_TRUNC_SIZE, cache_log.buffer_length);
bool truncate_file= (cache_log.file != -1 && bool truncate_file= (cache_log.file != -1 &&
my_b_write_tell(&cache_log) > my_b_write_tell(&cache_log) > trunc_len);
MY_MIN(CACHE_FILE_TRUNC_SIZE, binlog_stmt_cache_size));
truncate(0,1); // Forget what's in cache truncate(0,1); // Forget what's in cache
checksum_opt= !precompute_checksums ? BINLOG_CHECKSUM_ALG_OFF : checksum_opt= !precompute_checksums ? BINLOG_CHECKSUM_ALG_OFF :
(enum_binlog_checksum_alg)binlog_checksum_options; (enum_binlog_checksum_alg)binlog_checksum_options;
......
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