mirror of
https://github.com/MariaDB/server.git
synced 2025-01-25 00:04:33 +01:00
130 lines
4 KiB
Text
130 lines
4 KiB
Text
|
# Embedded server doesn't support binlog
|
||
|
-- source include/not_embedded.inc
|
||
|
-- source include/have_innodb.inc
|
||
|
|
||
|
# Creating tables
|
||
|
--disable_warnings
|
||
|
drop table if exists t1, t2;
|
||
|
--enable_warnings
|
||
|
|
||
|
create table t1 (a int) engine=innodb;
|
||
|
create table t2 (a int) engine=myisam;
|
||
|
|
||
|
#
|
||
|
# 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.
|
||
|
#
|
||
|
# This test checks binlog_cache_use and binlog_cache_disk_use when
|
||
|
# transactions are committed and after when they are aborted.
|
||
|
#
|
||
|
|
||
|
#
|
||
|
# Checking commit.
|
||
|
#
|
||
|
--echo **** Preparing the enviroment to check commit and its effect on
|
||
|
--echo **** the binlog_cache_use and binlog_cache_disk_use.
|
||
|
--echo **** Expected: binlog_cache_use = 0, binlog_cache_disk_use = 0.
|
||
|
flush status;
|
||
|
show status like "binlog_cache_use";
|
||
|
show status like "binlog_cache_disk_use";
|
||
|
|
||
|
--echo **** Now we are going to create transactional changes which are long enough so
|
||
|
--echo **** they will be flushed to disk...
|
||
|
--echo **** Expected: binlog_cache_use = 1, binlog_cache_disk_use = 1.
|
||
|
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";
|
||
|
|
||
|
--echo **** Transactional changes which should not be flushed to disk and so should not
|
||
|
--echo **** increase binlog_cache_disk_use.
|
||
|
--echo **** Expected: binlog_cache_use = 2, binlog_cache_disk_use = 1.
|
||
|
begin;
|
||
|
insert into t1 values( 1 );
|
||
|
commit;
|
||
|
show status like "binlog_cache_use";
|
||
|
show status like "binlog_cache_disk_use";
|
||
|
|
||
|
--echo **** Non-Transactional changes which should not be flushed to disk and so should not
|
||
|
--echo **** increase binlog_cache_disk_use.
|
||
|
--echo **** Expected: binlog_cache_use = 3, binlog_cache_disk_use = 1.
|
||
|
begin;
|
||
|
insert into t2 values( 1 );
|
||
|
commit;
|
||
|
show status like "binlog_cache_use";
|
||
|
show status like "binlog_cache_disk_use";
|
||
|
|
||
|
--echo **** Mixed changes which should not be flushed to disk and so should not
|
||
|
--echo **** increase binlog_cache_disk_use.
|
||
|
--echo **** Expected: binlog_cache_use = 5, binlog_cache_disk_use = 1.
|
||
|
begin;
|
||
|
insert into t1 values( 1 );
|
||
|
insert into t2 values( 1 );
|
||
|
commit;
|
||
|
show status like "binlog_cache_use";
|
||
|
show status like "binlog_cache_disk_use";
|
||
|
|
||
|
#
|
||
|
# Checking abort.
|
||
|
#
|
||
|
--echo **** Preparing the enviroment to check abort and its effect on
|
||
|
--echo **** the binlog_cache_use and binlog_cache_disk_use
|
||
|
--echo **** Expected: binlog_cache_use = 0, binlog_cache_disk_use = 0.
|
||
|
flush status;
|
||
|
show status like "binlog_cache_use";
|
||
|
show status like "binlog_cache_disk_use";
|
||
|
|
||
|
--echo **** Now we are going to create transactional changes which are long enough so
|
||
|
--echo **** they will be flushed to disk...
|
||
|
--echo **** Expected: binlog_cache_use = 1, binlog_cache_disk_use = 1.
|
||
|
let $1=2000;
|
||
|
disable_query_log;
|
||
|
begin;
|
||
|
while ($1)
|
||
|
{
|
||
|
eval insert into t1 values( $1 );
|
||
|
dec $1;
|
||
|
}
|
||
|
rollback;
|
||
|
enable_query_log;
|
||
|
show status like "binlog_cache_use";
|
||
|
show status like "binlog_cache_disk_use";
|
||
|
|
||
|
--echo **** Transactional changes which should not be flushed to disk and so should not
|
||
|
--echo **** increase binlog_cache_disk_use.
|
||
|
--echo **** Expected: binlog_cache_use = 2, binlog_cache_disk_use = 1.
|
||
|
begin;
|
||
|
insert into t1 values( 1 );
|
||
|
rollback;
|
||
|
show status like "binlog_cache_use";
|
||
|
show status like "binlog_cache_disk_use";
|
||
|
|
||
|
--echo **** Non-Transactional changes which should not be flushed to disk and so should not
|
||
|
--echo **** increase binlog_cache_disk_use.
|
||
|
--echo **** Expected: binlog_cache_use = 3, binlog_cache_disk_use = 1.
|
||
|
begin;
|
||
|
insert into t2 values( 1 );
|
||
|
rollback;
|
||
|
show status like "binlog_cache_use";
|
||
|
show status like "binlog_cache_disk_use";
|
||
|
|
||
|
--echo **** Mixed changes which should not be flushed to disk and so should not
|
||
|
--echo **** increase binlog_cache_disk_use.
|
||
|
--echo **** Expected: binlog_cache_use = 5, binlog_cache_disk_use = 1.
|
||
|
begin;
|
||
|
insert into t1 values( 1 );
|
||
|
insert into t2 values( 1 );
|
||
|
rollback;
|
||
|
show status like "binlog_cache_use";
|
||
|
show status like "binlog_cache_disk_use";
|
||
|
drop table t1, t2;
|