diff options
author | Alfranio Correia <alfranio.correia@oracle.com> | 2010-10-06 09:34:49 +0100 |
---|---|---|
committer | Alfranio Correia <alfranio.correia@oracle.com> | 2010-10-06 09:34:49 +0100 |
commit | 8504580ced8b2161630f14489ab206d5e313f000 (patch) | |
tree | 1de6162b82eca3d444edb826057c965b2d3d3766 /mysql-test/suite/binlog/t/binlog_stm_cache_stat.test | |
parent | 3f975a7fcfc86893923fd72c48c26cdeccdbb60e (diff) | |
download | mariadb-git-8504580ced8b2161630f14489ab206d5e313f000.tar.gz |
BUG#56343 binlog_cache_use status is bigger than expected
The binlog_cache_use is incremented twice when changes to a transactional table
are committed, i.e. TC_LOG_BINLOG::log_xid calls is called. The problem happens
because log_xid calls both binlog_flush_stmt_cache and binlog_flush_trx_cache
without checking if such caches are empty thus unintentionally increasing the
binlog_cache_use value twice.
To fix the problem we avoided incrementing the binlog_cache_use if the cache is
empty. We also decided to increment binlog_cache_use when the cache is truncated
as the cache is used although its content is discarded and is not written to the
binary log.
Note that binlog_cache_use is incremented for both types of cache, transactional
and non-transactional and that the behavior presented in this patch also applies
to the binlog_cache_disk_use.
Finally, we re-organized the code around the functions binlog_flush_trx_cache and
binlog_flush_stmt_cache.
mysql-test/extra/binlog_tests/binlog_cache_stat.test:
Updated the test case with comments and additional tests to check both
transactional and non-transactional changes and what happens when a
is transaction either committed or aborted.
mysql-test/suite/binlog/r/binlog_innodb.result:
Updated the result file.
mysql-test/suite/binlog/r/binlog_mixed_cache_stat.result:
Updated the result file.
mysql-test/suite/binlog/r/binlog_row_cache_stat.result:
Updated the result file.
mysql-test/suite/binlog/r/binlog_stm_cache_stat.result:
Updated the result file.
mysql-test/suite/binlog/t/binlog_mixed_cache_stat.test:
Updated the test case with a new source file.
mysql-test/suite/binlog/t/binlog_row_cache_stat.test:
Updated the test case with a new source file.
mysql-test/suite/binlog/t/binlog_stm_cache_stat.test:
Updated the test case with a new source file.
sql/log_event.cc:
Introduced debug information to check if Query_log_event("BEGIN"),
Query_log_event("COMMIT") and Query_log_event("ROLLBACK").
sql/log_event.h:
Guaranteed Xid_log_event is always classified as a transactional event.
Diffstat (limited to 'mysql-test/suite/binlog/t/binlog_stm_cache_stat.test')
-rw-r--r-- | mysql-test/suite/binlog/t/binlog_stm_cache_stat.test | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/mysql-test/suite/binlog/t/binlog_stm_cache_stat.test b/mysql-test/suite/binlog/t/binlog_stm_cache_stat.test new file mode 100644 index 00000000000..0f5aa9f6013 --- /dev/null +++ b/mysql-test/suite/binlog/t/binlog_stm_cache_stat.test @@ -0,0 +1,5 @@ +# This is a wrapper for binlog.test so that the same test case can be used +# For both statement and row based bin logs 9/19/2005 [jbm] + +-- source include/have_binlog_format_statement.inc +-- source extra/binlog_tests/binlog_cache_stat.test |