From 067b2e3bb0096cd14e220656decfaca0ea9d61ed Mon Sep 17 00:00:00 2001 From: "dlenev@brandersnatch.localdomain" <> Date: Wed, 19 May 2004 17:43:50 +0400 Subject: [PATCH] Moved testing of binlog_cache_use/binlog_cache_disk_use statistical variables from rpl_relayrotate.test to innodb.test since this test requires innodb support. --- mysql-test/r/innodb.result | 23 +++++++++++++ mysql-test/r/rpl_relayrotate.result | 15 --------- ...layrotate-master.opt => innodb-master.opt} | 0 mysql-test/t/innodb.test | 33 +++++++++++++++++++ mysql-test/t/rpl_relayrotate.test | 16 --------- 5 files changed, 56 insertions(+), 31 deletions(-) rename mysql-test/t/{rpl_relayrotate-master.opt => innodb-master.opt} (100%) diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result index 981ef23c779..83d042cd279 100644 --- a/mysql-test/r/innodb.result +++ b/mysql-test/r/innodb.result @@ -1595,3 +1595,26 @@ t2 CREATE TABLE `t2` ( CONSTRAINT `t2_ibfk_2` FOREIGN KEY (`b`) REFERENCES `t1` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 drop table t2, t1; +show status like "binlog_cache_use"; +Variable_name Value +Binlog_cache_use 24 +show status like "binlog_cache_disk_use"; +Variable_name Value +Binlog_cache_disk_use 0 +create table t1 (a int) engine=innodb; +show status like "binlog_cache_use"; +Variable_name Value +Binlog_cache_use 25 +show status like "binlog_cache_disk_use"; +Variable_name Value +Binlog_cache_disk_use 1 +begin; +delete from t1; +commit; +show status like "binlog_cache_use"; +Variable_name Value +Binlog_cache_use 26 +show status like "binlog_cache_disk_use"; +Variable_name Value +Binlog_cache_disk_use 1 +drop table t1; diff --git a/mysql-test/r/rpl_relayrotate.result b/mysql-test/r/rpl_relayrotate.result index 96ec06a69aa..bf9bbbb9b93 100644 --- a/mysql-test/r/rpl_relayrotate.result +++ b/mysql-test/r/rpl_relayrotate.result @@ -16,19 +16,4 @@ master_pos_wait('master-bin.001',3000)>=0 select * from t1 where a=8000; a 8000 -show status like "binlog_cache_use"; -Variable_name Value -Binlog_cache_use 1 -show status like "binlog_cache_disk_use"; -Variable_name Value -Binlog_cache_disk_use 1 -begin; -delete from t1; -commit; -show status like "binlog_cache_use"; -Variable_name Value -Binlog_cache_use 2 -show status like "binlog_cache_disk_use"; -Variable_name Value -Binlog_cache_disk_use 1 drop table t1; diff --git a/mysql-test/t/rpl_relayrotate-master.opt b/mysql-test/t/innodb-master.opt similarity index 100% rename from mysql-test/t/rpl_relayrotate-master.opt rename to mysql-test/t/innodb-master.opt diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test index 47e82db2dc4..e0cc96ccb32 100644 --- a/mysql-test/t/innodb.test +++ b/mysql-test/t/innodb.test @@ -1106,4 +1106,37 @@ show create table t2; drop table t2, t1; +# +# Let us test binlog_cache_use and binlog_cache_disk_use status vars. +# Actually this test has nothing to do with innodb per se, it just requires +# transactional table. +# +show status like "binlog_cache_use"; +show status like "binlog_cache_disk_use"; +create table t1 (a int) engine=innodb; + +# Now we are going to create transaction which is long enough so its +# transaction binlog will be flushed to disk... +let $1=2000; +disable_query_log; +begin; +while ($1) +{ + eval insert into t1 values( $1 ); + dec $1; +} +commit; +enable_query_log; +show status like "binlog_cache_use"; +show status like "binlog_cache_disk_use"; + +# Transaction which should not be flushed to disk and so should not +# increase binlog_cache_disk_use. +begin; +delete from t1; +commit; +show status like "binlog_cache_use"; +show status like "binlog_cache_disk_use"; + +drop table t1; diff --git a/mysql-test/t/rpl_relayrotate.test b/mysql-test/t/rpl_relayrotate.test index ca3bff81608..46e6f1bd157 100644 --- a/mysql-test/t/rpl_relayrotate.test +++ b/mysql-test/t/rpl_relayrotate.test @@ -60,22 +60,6 @@ select * from t1 where a=8000; connection master; -# binlog_cache_use and binlog_cache_disk_use status vars test -# This test uses the previous test. Namely, it needs the long -# transaction that adds 8000 lines to the t1 table. - -show status like "binlog_cache_use"; -show status like "binlog_cache_disk_use"; - -# transaction which should not be flushed to disk and so should not -# increase binlog_cache_disk_use -begin; -delete from t1; -commit; - -show status like "binlog_cache_use"; -show status like "binlog_cache_disk_use"; - # The following DROP is a very important cleaning task: # imagine the next test is run with --skip-innodb: it will do # DROP TABLE IF EXISTS t1; but this will delete the frm and leave