summaryrefslogtreecommitdiff
path: root/mysql-test/suite
diff options
context:
space:
mode:
authorAlfranio Correia <alfranio.correia@oracle.com>2010-12-03 01:06:56 +0000
committerAlfranio Correia <alfranio.correia@oracle.com>2010-12-03 01:06:56 +0000
commitb28d2c25a71c0be09af0e5f1760d17b70530885f (patch)
tree17b03034adacba5198daf59764421d0d94a325d9 /mysql-test/suite
parent3ffab566196fb596e91eb9260d791d8578401b16 (diff)
parent3f5a9c7ea03e5c6a62f41bb90f6b1655c59d3d75 (diff)
downloadmariadb-git-b28d2c25a71c0be09af0e5f1760d17b70530885f.tar.gz
merge mysql-5.5-bugteam(local) --> mysql-5.5-bugteam
Diffstat (limited to 'mysql-test/suite')
-rw-r--r--mysql-test/suite/binlog/r/binlog_innodb.result4
-rw-r--r--mysql-test/suite/binlog/r/binlog_mix_innodb_stat.result25
-rw-r--r--mysql-test/suite/binlog/r/binlog_mixed_cache_stat.result66
-rw-r--r--mysql-test/suite/binlog/r/binlog_row_cache_stat.result66
-rw-r--r--mysql-test/suite/binlog/r/binlog_row_innodb_stat.result25
-rw-r--r--mysql-test/suite/binlog/r/binlog_stm_cache_stat.result66
-rw-r--r--mysql-test/suite/binlog/r/binlog_stm_innodb_stat.result25
-rw-r--r--mysql-test/suite/binlog/t/binlog_mixed_cache_stat.test (renamed from mysql-test/suite/binlog/t/binlog_mix_innodb_stat.test)2
-rw-r--r--mysql-test/suite/binlog/t/binlog_row_cache_stat.test (renamed from mysql-test/suite/binlog/t/binlog_row_innodb_stat.test)2
-rw-r--r--mysql-test/suite/binlog/t/binlog_stm_cache_stat.test (renamed from mysql-test/suite/binlog/t/binlog_stm_innodb_stat.test)2
-rw-r--r--mysql-test/suite/rpl/r/rpl_mixed_binlog_max_cache_size.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_binlog_max_cache_size.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_binlog_max_cache_size.result9
-rw-r--r--mysql-test/suite/sys_vars/inc/binlog_stmt_cache_size_basic.inc154
-rw-r--r--mysql-test/suite/sys_vars/r/binlog_stmt_cache_size_basic_32.result108
-rw-r--r--mysql-test/suite/sys_vars/r/binlog_stmt_cache_size_basic_64.result108
-rw-r--r--mysql-test/suite/sys_vars/r/max_binlog_stmt_cache_size_basic.result152
-rw-r--r--mysql-test/suite/sys_vars/t/binlog_stmt_cache_size_basic_32.test7
-rw-r--r--mysql-test/suite/sys_vars/t/binlog_stmt_cache_size_basic_64.test7
-rw-r--r--mysql-test/suite/sys_vars/t/max_binlog_cache_size_func-master.opt2
-rw-r--r--mysql-test/suite/sys_vars/t/max_binlog_stmt_cache_size_basic.test184
21 files changed, 950 insertions, 82 deletions
diff --git a/mysql-test/suite/binlog/r/binlog_innodb.result b/mysql-test/suite/binlog/r/binlog_innodb.result
index dc170361026..cdb72aad902 100644
--- a/mysql-test/suite/binlog/r/binlog_innodb.result
+++ b/mysql-test/suite/binlog/r/binlog_innodb.result
@@ -123,7 +123,7 @@ Binlog_cache_disk_use 0
create table t1 (a int) engine=innodb;
show status like "binlog_cache_use";
Variable_name Value
-Binlog_cache_use 2
+Binlog_cache_use 1
show status like "binlog_cache_disk_use";
Variable_name Value
Binlog_cache_disk_use 1
@@ -132,7 +132,7 @@ delete from t1;
commit;
show status like "binlog_cache_use";
Variable_name Value
-Binlog_cache_use 4
+Binlog_cache_use 2
show status like "binlog_cache_disk_use";
Variable_name Value
Binlog_cache_disk_use 1
diff --git a/mysql-test/suite/binlog/r/binlog_mix_innodb_stat.result b/mysql-test/suite/binlog/r/binlog_mix_innodb_stat.result
deleted file mode 100644
index 637be940383..00000000000
--- a/mysql-test/suite/binlog/r/binlog_mix_innodb_stat.result
+++ /dev/null
@@ -1,25 +0,0 @@
-flush status;
-show status like "binlog_cache_use";
-Variable_name Value
-Binlog_cache_use 0
-show status like "binlog_cache_disk_use";
-Variable_name Value
-Binlog_cache_disk_use 0
-drop table if exists t1;
-create table t1 (a int) engine=innodb;
-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
-begin;
-delete from t1;
-commit;
-show status like "binlog_cache_use";
-Variable_name Value
-Binlog_cache_use 4
-show status like "binlog_cache_disk_use";
-Variable_name Value
-Binlog_cache_disk_use 1
-drop table t1;
diff --git a/mysql-test/suite/binlog/r/binlog_mixed_cache_stat.result b/mysql-test/suite/binlog/r/binlog_mixed_cache_stat.result
new file mode 100644
index 00000000000..09cdab8414a
--- /dev/null
+++ b/mysql-test/suite/binlog/r/binlog_mixed_cache_stat.result
@@ -0,0 +1,66 @@
+drop table if exists t1, t2;
+create table t1 (a int) engine=innodb;
+create table t2 (a int) engine=myisam;
+**** Preparing the enviroment to check commit and its effect on status variables.
+**** Expected: binlog_cache_use = 0, binlog_cache_disk_use = 0.
+**** Expected: binlog_stmt_cache_use = 0, binlog_stmt_cache_disk_use = 0.
+flush status;
+**** Transactional changes which are long enough so they will be flushed to disk...
+**** Expected: binlog_cache_use = 1, binlog_cache_disk_use = 1.
+**** Expected: binlog_stmt_cache_use = 0, binlog_stmt_cache_disk_use = 0.
+**** Transactional changes which should not be flushed to disk and so should not
+**** increase either binlog_cache_disk_use or binlog_stmt_cache_disk_use.
+**** Expected: binlog_cache_use = 2, binlog_cache_disk_use = 1.
+**** Expected: binlog_stmt_cache_use = 0, binlog_stmt_cache_disk_use = 0.
+begin;
+insert into t1 values( 1 );
+commit;
+**** Non-Transactional changes which should not be flushed to disk and so should not
+**** increase either binlog_cache_disk_use or binlog_stmt_cache_disk_use.
+**** Expected: binlog_cache_use = 2, binlog_cache_disk_use = 1.
+**** Expected: binlog_stmt_cache_use = 1, binlog_stmt_cache_disk_use = 0.
+begin;
+insert into t2 values( 1 );
+commit;
+**** Mixed changes which should not be flushed to disk and so should not
+**** increase either binlog_cache_disk_use or binlog_stmt_cache_disk_use.
+**** Expected: binlog_cache_use = 3, binlog_cache_disk_use = 1.
+**** Expected: binlog_stmt_cache_use = 2, binlog_stmt_cache_disk_use = 0.
+begin;
+insert into t1 values( 1 );
+insert into t2 values( 1 );
+commit;
+**** Preparing the enviroment to check abort and its effect on the status variables.
+**** Expected: binlog_cache_use = 0, binlog_cache_disk_use = 0.
+**** Expected: binlog_stmt_cache_use = 0, binlog_stmt_cache_disk_use = 0.
+flush status;
+**** Transactional changes which are long enough so they will be flushed to disk...
+**** Expected: binlog_cache_use = 1, binlog_cache_disk_use = 1.
+**** Expected: binlog_stmt_cache_use = 0, binlog_stmt_cache_disk_use = 0.
+**** Transactional changes which should not be flushed to disk and so should not
+**** increase either binlog_cache_disk_use or binlog_stmt_cache_disk_use.
+**** Expected: binlog_cache_use = 2, binlog_cache_disk_use = 1.
+**** Expected: binlog_stmt_cache_use = 0, binlog_stmt_cache_disk_use = 0.
+begin;
+insert into t1 values( 1 );
+rollback;
+**** Non-Transactional changes which should not be flushed to disk and so should not
+**** increase either binlog_cache_disk_use or binlog_stmt_cache_disk_use.
+**** Expected: binlog_cache_use = 2, binlog_cache_disk_use = 1.
+**** Expected: binlog_stmt_cache_use = 1, binlog_stmt_cache_disk_use = 0.
+begin;
+insert into t2 values( 1 );
+rollback;
+Warnings:
+Warning 1196 Some non-transactional changed tables couldn't be rolled back
+**** Mixed changes which should not be flushed to disk and so should not
+**** increase either binlog_cache_disk_use or binlog_stmt_cache_disk_use.
+**** Expected: binlog_cache_use = 3, binlog_cache_disk_use = 1.
+**** Expected: binlog_stmt_cache_use = 2, binlog_stmt_cache_disk_use = 0.
+begin;
+insert into t1 values( 1 );
+insert into t2 values( 1 );
+rollback;
+Warnings:
+Warning 1196 Some non-transactional changed tables couldn't be rolled back
+drop table t1, t2;
diff --git a/mysql-test/suite/binlog/r/binlog_row_cache_stat.result b/mysql-test/suite/binlog/r/binlog_row_cache_stat.result
new file mode 100644
index 00000000000..09cdab8414a
--- /dev/null
+++ b/mysql-test/suite/binlog/r/binlog_row_cache_stat.result
@@ -0,0 +1,66 @@
+drop table if exists t1, t2;
+create table t1 (a int) engine=innodb;
+create table t2 (a int) engine=myisam;
+**** Preparing the enviroment to check commit and its effect on status variables.
+**** Expected: binlog_cache_use = 0, binlog_cache_disk_use = 0.
+**** Expected: binlog_stmt_cache_use = 0, binlog_stmt_cache_disk_use = 0.
+flush status;
+**** Transactional changes which are long enough so they will be flushed to disk...
+**** Expected: binlog_cache_use = 1, binlog_cache_disk_use = 1.
+**** Expected: binlog_stmt_cache_use = 0, binlog_stmt_cache_disk_use = 0.
+**** Transactional changes which should not be flushed to disk and so should not
+**** increase either binlog_cache_disk_use or binlog_stmt_cache_disk_use.
+**** Expected: binlog_cache_use = 2, binlog_cache_disk_use = 1.
+**** Expected: binlog_stmt_cache_use = 0, binlog_stmt_cache_disk_use = 0.
+begin;
+insert into t1 values( 1 );
+commit;
+**** Non-Transactional changes which should not be flushed to disk and so should not
+**** increase either binlog_cache_disk_use or binlog_stmt_cache_disk_use.
+**** Expected: binlog_cache_use = 2, binlog_cache_disk_use = 1.
+**** Expected: binlog_stmt_cache_use = 1, binlog_stmt_cache_disk_use = 0.
+begin;
+insert into t2 values( 1 );
+commit;
+**** Mixed changes which should not be flushed to disk and so should not
+**** increase either binlog_cache_disk_use or binlog_stmt_cache_disk_use.
+**** Expected: binlog_cache_use = 3, binlog_cache_disk_use = 1.
+**** Expected: binlog_stmt_cache_use = 2, binlog_stmt_cache_disk_use = 0.
+begin;
+insert into t1 values( 1 );
+insert into t2 values( 1 );
+commit;
+**** Preparing the enviroment to check abort and its effect on the status variables.
+**** Expected: binlog_cache_use = 0, binlog_cache_disk_use = 0.
+**** Expected: binlog_stmt_cache_use = 0, binlog_stmt_cache_disk_use = 0.
+flush status;
+**** Transactional changes which are long enough so they will be flushed to disk...
+**** Expected: binlog_cache_use = 1, binlog_cache_disk_use = 1.
+**** Expected: binlog_stmt_cache_use = 0, binlog_stmt_cache_disk_use = 0.
+**** Transactional changes which should not be flushed to disk and so should not
+**** increase either binlog_cache_disk_use or binlog_stmt_cache_disk_use.
+**** Expected: binlog_cache_use = 2, binlog_cache_disk_use = 1.
+**** Expected: binlog_stmt_cache_use = 0, binlog_stmt_cache_disk_use = 0.
+begin;
+insert into t1 values( 1 );
+rollback;
+**** Non-Transactional changes which should not be flushed to disk and so should not
+**** increase either binlog_cache_disk_use or binlog_stmt_cache_disk_use.
+**** Expected: binlog_cache_use = 2, binlog_cache_disk_use = 1.
+**** Expected: binlog_stmt_cache_use = 1, binlog_stmt_cache_disk_use = 0.
+begin;
+insert into t2 values( 1 );
+rollback;
+Warnings:
+Warning 1196 Some non-transactional changed tables couldn't be rolled back
+**** Mixed changes which should not be flushed to disk and so should not
+**** increase either binlog_cache_disk_use or binlog_stmt_cache_disk_use.
+**** Expected: binlog_cache_use = 3, binlog_cache_disk_use = 1.
+**** Expected: binlog_stmt_cache_use = 2, binlog_stmt_cache_disk_use = 0.
+begin;
+insert into t1 values( 1 );
+insert into t2 values( 1 );
+rollback;
+Warnings:
+Warning 1196 Some non-transactional changed tables couldn't be rolled back
+drop table t1, t2;
diff --git a/mysql-test/suite/binlog/r/binlog_row_innodb_stat.result b/mysql-test/suite/binlog/r/binlog_row_innodb_stat.result
deleted file mode 100644
index 637be940383..00000000000
--- a/mysql-test/suite/binlog/r/binlog_row_innodb_stat.result
+++ /dev/null
@@ -1,25 +0,0 @@
-flush status;
-show status like "binlog_cache_use";
-Variable_name Value
-Binlog_cache_use 0
-show status like "binlog_cache_disk_use";
-Variable_name Value
-Binlog_cache_disk_use 0
-drop table if exists t1;
-create table t1 (a int) engine=innodb;
-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
-begin;
-delete from t1;
-commit;
-show status like "binlog_cache_use";
-Variable_name Value
-Binlog_cache_use 4
-show status like "binlog_cache_disk_use";
-Variable_name Value
-Binlog_cache_disk_use 1
-drop table t1;
diff --git a/mysql-test/suite/binlog/r/binlog_stm_cache_stat.result b/mysql-test/suite/binlog/r/binlog_stm_cache_stat.result
new file mode 100644
index 00000000000..09cdab8414a
--- /dev/null
+++ b/mysql-test/suite/binlog/r/binlog_stm_cache_stat.result
@@ -0,0 +1,66 @@
+drop table if exists t1, t2;
+create table t1 (a int) engine=innodb;
+create table t2 (a int) engine=myisam;
+**** Preparing the enviroment to check commit and its effect on status variables.
+**** Expected: binlog_cache_use = 0, binlog_cache_disk_use = 0.
+**** Expected: binlog_stmt_cache_use = 0, binlog_stmt_cache_disk_use = 0.
+flush status;
+**** Transactional changes which are long enough so they will be flushed to disk...
+**** Expected: binlog_cache_use = 1, binlog_cache_disk_use = 1.
+**** Expected: binlog_stmt_cache_use = 0, binlog_stmt_cache_disk_use = 0.
+**** Transactional changes which should not be flushed to disk and so should not
+**** increase either binlog_cache_disk_use or binlog_stmt_cache_disk_use.
+**** Expected: binlog_cache_use = 2, binlog_cache_disk_use = 1.
+**** Expected: binlog_stmt_cache_use = 0, binlog_stmt_cache_disk_use = 0.
+begin;
+insert into t1 values( 1 );
+commit;
+**** Non-Transactional changes which should not be flushed to disk and so should not
+**** increase either binlog_cache_disk_use or binlog_stmt_cache_disk_use.
+**** Expected: binlog_cache_use = 2, binlog_cache_disk_use = 1.
+**** Expected: binlog_stmt_cache_use = 1, binlog_stmt_cache_disk_use = 0.
+begin;
+insert into t2 values( 1 );
+commit;
+**** Mixed changes which should not be flushed to disk and so should not
+**** increase either binlog_cache_disk_use or binlog_stmt_cache_disk_use.
+**** Expected: binlog_cache_use = 3, binlog_cache_disk_use = 1.
+**** Expected: binlog_stmt_cache_use = 2, binlog_stmt_cache_disk_use = 0.
+begin;
+insert into t1 values( 1 );
+insert into t2 values( 1 );
+commit;
+**** Preparing the enviroment to check abort and its effect on the status variables.
+**** Expected: binlog_cache_use = 0, binlog_cache_disk_use = 0.
+**** Expected: binlog_stmt_cache_use = 0, binlog_stmt_cache_disk_use = 0.
+flush status;
+**** Transactional changes which are long enough so they will be flushed to disk...
+**** Expected: binlog_cache_use = 1, binlog_cache_disk_use = 1.
+**** Expected: binlog_stmt_cache_use = 0, binlog_stmt_cache_disk_use = 0.
+**** Transactional changes which should not be flushed to disk and so should not
+**** increase either binlog_cache_disk_use or binlog_stmt_cache_disk_use.
+**** Expected: binlog_cache_use = 2, binlog_cache_disk_use = 1.
+**** Expected: binlog_stmt_cache_use = 0, binlog_stmt_cache_disk_use = 0.
+begin;
+insert into t1 values( 1 );
+rollback;
+**** Non-Transactional changes which should not be flushed to disk and so should not
+**** increase either binlog_cache_disk_use or binlog_stmt_cache_disk_use.
+**** Expected: binlog_cache_use = 2, binlog_cache_disk_use = 1.
+**** Expected: binlog_stmt_cache_use = 1, binlog_stmt_cache_disk_use = 0.
+begin;
+insert into t2 values( 1 );
+rollback;
+Warnings:
+Warning 1196 Some non-transactional changed tables couldn't be rolled back
+**** Mixed changes which should not be flushed to disk and so should not
+**** increase either binlog_cache_disk_use or binlog_stmt_cache_disk_use.
+**** Expected: binlog_cache_use = 3, binlog_cache_disk_use = 1.
+**** Expected: binlog_stmt_cache_use = 2, binlog_stmt_cache_disk_use = 0.
+begin;
+insert into t1 values( 1 );
+insert into t2 values( 1 );
+rollback;
+Warnings:
+Warning 1196 Some non-transactional changed tables couldn't be rolled back
+drop table t1, t2;
diff --git a/mysql-test/suite/binlog/r/binlog_stm_innodb_stat.result b/mysql-test/suite/binlog/r/binlog_stm_innodb_stat.result
deleted file mode 100644
index 637be940383..00000000000
--- a/mysql-test/suite/binlog/r/binlog_stm_innodb_stat.result
+++ /dev/null
@@ -1,25 +0,0 @@
-flush status;
-show status like "binlog_cache_use";
-Variable_name Value
-Binlog_cache_use 0
-show status like "binlog_cache_disk_use";
-Variable_name Value
-Binlog_cache_disk_use 0
-drop table if exists t1;
-create table t1 (a int) engine=innodb;
-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
-begin;
-delete from t1;
-commit;
-show status like "binlog_cache_use";
-Variable_name Value
-Binlog_cache_use 4
-show status like "binlog_cache_disk_use";
-Variable_name Value
-Binlog_cache_disk_use 1
-drop table t1;
diff --git a/mysql-test/suite/binlog/t/binlog_mix_innodb_stat.test b/mysql-test/suite/binlog/t/binlog_mixed_cache_stat.test
index 0be097c78ed..3e63fb3bc9c 100644
--- a/mysql-test/suite/binlog/t/binlog_mix_innodb_stat.test
+++ b/mysql-test/suite/binlog/t/binlog_mixed_cache_stat.test
@@ -2,4 +2,4 @@
# For both statement and row based bin logs 9/19/2005 [jbm]
-- source include/have_binlog_format_mixed.inc
--- source extra/binlog_tests/innodb_stat.test
+-- source extra/binlog_tests/binlog_cache_stat.test
diff --git a/mysql-test/suite/binlog/t/binlog_row_innodb_stat.test b/mysql-test/suite/binlog/t/binlog_row_cache_stat.test
index e4e6762226b..03f9c53f0cc 100644
--- a/mysql-test/suite/binlog/t/binlog_row_innodb_stat.test
+++ b/mysql-test/suite/binlog/t/binlog_row_cache_stat.test
@@ -2,4 +2,4 @@
# For both statement and row based bin logs 9/19/2005 [jbm]
-- source include/have_binlog_format_row.inc
--- source extra/binlog_tests/innodb_stat.test
+-- source extra/binlog_tests/binlog_cache_stat.test
diff --git a/mysql-test/suite/binlog/t/binlog_stm_innodb_stat.test b/mysql-test/suite/binlog/t/binlog_stm_cache_stat.test
index c6017246e6d..0f5aa9f6013 100644
--- a/mysql-test/suite/binlog/t/binlog_stm_innodb_stat.test
+++ b/mysql-test/suite/binlog/t/binlog_stm_cache_stat.test
@@ -2,4 +2,4 @@
# For both statement and row based bin logs 9/19/2005 [jbm]
-- source include/have_binlog_format_statement.inc
--- source extra/binlog_tests/innodb_stat.test
+-- source extra/binlog_tests/binlog_cache_stat.test
diff --git a/mysql-test/suite/rpl/r/rpl_mixed_binlog_max_cache_size.result b/mysql-test/suite/rpl/r/rpl_mixed_binlog_max_cache_size.result
index 479caed8e6b..c7f2ffab47a 100644
--- a/mysql-test/suite/rpl/r/rpl_mixed_binlog_max_cache_size.result
+++ b/mysql-test/suite/rpl/r/rpl_mixed_binlog_max_cache_size.result
@@ -7,6 +7,8 @@ start slave;
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
SET GLOBAL max_binlog_cache_size = 4096;
SET GLOBAL binlog_cache_size = 4096;
+SET GLOBAL max_binlog_stmt_cache_size = 4096;
+SET GLOBAL binlog_stmt_cache_size = 4096;
CREATE TABLE t1(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=Innodb;
CREATE TABLE t2(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=MyIsam;
CREATE TABLE t3(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=Innodb;
@@ -129,13 +131,18 @@ source include/diff_master_slave.inc;
# [ On Slave ]
SET GLOBAL max_binlog_cache_size = 4096;
SET GLOBAL binlog_cache_size = 4096;
+SET GLOBAL max_binlog_stmt_cache_size = 4096;
+SET GLOBAL binlog_stmt_cache_size = 4096;
include/stop_slave.inc
include/start_slave.inc
CALL mtr.add_suppression("Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage.*");
+CALL mtr.add_suppression("Multi-statement transaction required more than 'max_binlog_stmt_cache_size' bytes of storage.*");
CALL mtr.add_suppression("Writing one row to the row-based binary log failed.*");
TRUNCATE t1;
SET GLOBAL max_binlog_cache_size= ORIGINAL_VALUE;
SET GLOBAL binlog_cache_size= ORIGINAL_VALUE;
+SET GLOBAL max_binlog_stmt_cache_size= ORIGINAL_VALUE;
+SET GLOBAL binlog_stmt_cache_size= ORIGINAL_VALUE;
BEGIN;
Repeat statement 'INSERT INTO t1 VALUES($n, repeat("a", 32))' 128 times
COMMIT;
@@ -146,6 +153,8 @@ show binlog events in 'slave-bin.000001' from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
SET GLOBAL max_binlog_cache_size= ORIGINAL_VALUE;
SET GLOBAL binlog_cache_size= ORIGINAL_VALUE;
+SET GLOBAL max_binlog_stmt_cache_size= ORIGINAL_VALUE;
+SET GLOBAL binlog_stmt_cache_size= ORIGINAL_VALUE;
include/stop_slave.inc
include/start_slave.inc
SELECT count(*) FROM t1;
diff --git a/mysql-test/suite/rpl/r/rpl_row_binlog_max_cache_size.result b/mysql-test/suite/rpl/r/rpl_row_binlog_max_cache_size.result
index 9c1dfebebaf..f04c229a9b6 100644
--- a/mysql-test/suite/rpl/r/rpl_row_binlog_max_cache_size.result
+++ b/mysql-test/suite/rpl/r/rpl_row_binlog_max_cache_size.result
@@ -7,6 +7,8 @@ start slave;
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
SET GLOBAL max_binlog_cache_size = 4096;
SET GLOBAL binlog_cache_size = 4096;
+SET GLOBAL max_binlog_stmt_cache_size = 4096;
+SET GLOBAL binlog_stmt_cache_size = 4096;
CREATE TABLE t1(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=Innodb;
CREATE TABLE t2(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=MyIsam;
CREATE TABLE t3(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=Innodb;
@@ -130,13 +132,18 @@ source include/diff_master_slave.inc;
# [ On Slave ]
SET GLOBAL max_binlog_cache_size = 4096;
SET GLOBAL binlog_cache_size = 4096;
+SET GLOBAL max_binlog_stmt_cache_size = 4096;
+SET GLOBAL binlog_stmt_cache_size = 4096;
include/stop_slave.inc
include/start_slave.inc
CALL mtr.add_suppression("Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage.*");
+CALL mtr.add_suppression("Multi-statement transaction required more than 'max_binlog_stmt_cache_size' bytes of storage.*");
CALL mtr.add_suppression("Writing one row to the row-based binary log failed.*");
TRUNCATE t1;
SET GLOBAL max_binlog_cache_size= ORIGINAL_VALUE;
SET GLOBAL binlog_cache_size= ORIGINAL_VALUE;
+SET GLOBAL max_binlog_stmt_cache_size= ORIGINAL_VALUE;
+SET GLOBAL binlog_stmt_cache_size= ORIGINAL_VALUE;
BEGIN;
Repeat statement 'INSERT INTO t1 VALUES($n, repeat("a", 32))' 128 times
COMMIT;
@@ -147,6 +154,8 @@ show binlog events in 'slave-bin.000001' from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
SET GLOBAL max_binlog_cache_size= ORIGINAL_VALUE;
SET GLOBAL binlog_cache_size= ORIGINAL_VALUE;
+SET GLOBAL max_binlog_stmt_cache_size= ORIGINAL_VALUE;
+SET GLOBAL binlog_stmt_cache_size= ORIGINAL_VALUE;
include/stop_slave.inc
include/start_slave.inc
SELECT count(*) FROM t1;
diff --git a/mysql-test/suite/rpl/r/rpl_stm_binlog_max_cache_size.result b/mysql-test/suite/rpl/r/rpl_stm_binlog_max_cache_size.result
index 479caed8e6b..c7f2ffab47a 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_binlog_max_cache_size.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_binlog_max_cache_size.result
@@ -7,6 +7,8 @@ start slave;
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
SET GLOBAL max_binlog_cache_size = 4096;
SET GLOBAL binlog_cache_size = 4096;
+SET GLOBAL max_binlog_stmt_cache_size = 4096;
+SET GLOBAL binlog_stmt_cache_size = 4096;
CREATE TABLE t1(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=Innodb;
CREATE TABLE t2(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=MyIsam;
CREATE TABLE t3(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=Innodb;
@@ -129,13 +131,18 @@ source include/diff_master_slave.inc;
# [ On Slave ]
SET GLOBAL max_binlog_cache_size = 4096;
SET GLOBAL binlog_cache_size = 4096;
+SET GLOBAL max_binlog_stmt_cache_size = 4096;
+SET GLOBAL binlog_stmt_cache_size = 4096;
include/stop_slave.inc
include/start_slave.inc
CALL mtr.add_suppression("Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage.*");
+CALL mtr.add_suppression("Multi-statement transaction required more than 'max_binlog_stmt_cache_size' bytes of storage.*");
CALL mtr.add_suppression("Writing one row to the row-based binary log failed.*");
TRUNCATE t1;
SET GLOBAL max_binlog_cache_size= ORIGINAL_VALUE;
SET GLOBAL binlog_cache_size= ORIGINAL_VALUE;
+SET GLOBAL max_binlog_stmt_cache_size= ORIGINAL_VALUE;
+SET GLOBAL binlog_stmt_cache_size= ORIGINAL_VALUE;
BEGIN;
Repeat statement 'INSERT INTO t1 VALUES($n, repeat("a", 32))' 128 times
COMMIT;
@@ -146,6 +153,8 @@ show binlog events in 'slave-bin.000001' from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
SET GLOBAL max_binlog_cache_size= ORIGINAL_VALUE;
SET GLOBAL binlog_cache_size= ORIGINAL_VALUE;
+SET GLOBAL max_binlog_stmt_cache_size= ORIGINAL_VALUE;
+SET GLOBAL binlog_stmt_cache_size= ORIGINAL_VALUE;
include/stop_slave.inc
include/start_slave.inc
SELECT count(*) FROM t1;
diff --git a/mysql-test/suite/sys_vars/inc/binlog_stmt_cache_size_basic.inc b/mysql-test/suite/sys_vars/inc/binlog_stmt_cache_size_basic.inc
new file mode 100644
index 00000000000..f5df54b7acd
--- /dev/null
+++ b/mysql-test/suite/sys_vars/inc/binlog_stmt_cache_size_basic.inc
@@ -0,0 +1,154 @@
+################ mysql-test\t\binlog_stmt_cache_size_basic.test ################
+# #
+# Variable Name: binlog_stmt_cache_size #
+# Scope: GLOBAL #
+# Access Type: Dynamic #
+# Data Type: Numeric #
+# Default Value: 32768 #
+# Range: 4096 - 4294967295 #
+# #
+# #
+# Creation Date: 2010-10-12 #
+# Author: Alfranio Correia #
+# #
+# Description: Test Cases of Dynamic System Variable "binlog_stmt_cache_size" #
+# that checks behavior of this variable in the following ways #
+# * Default Value #
+# * Valid & Invalid values #
+# * Scope & Access method #
+# * Data Integrity . #
+# #
+# Reference: http://dev.mysql.com/doc/refman/5.5/en/ #
+# server-system-variables.html#option_mysqld_binlog_stmt_cache_size #
+# #
+################################################################################
+
+#################################################################
+# START OF binlog_stmt_cache_size TESTS #
+#################################################################
+
+#########################################################################
+# Saving initial value of binlog_stmt_cache_size in a temporary variable #
+#########################################################################
+
+SET @start_value = @@global.binlog_stmt_cache_size;
+SELECT @start_value;
+
+--echo '#--------------------FN_DYNVARS_006_01------------------------#'
+#########################################################################
+# Display the DEFAULT value of binlog_stmt_cache_size #
+#########################################################################
+
+SET @@global.binlog_stmt_cache_size = 100;
+SET @@global.binlog_stmt_cache_size = DEFAULT;
+SELECT @@global.binlog_stmt_cache_size;
+
+
+--echo '#---------------------FN_DYNVARS_006_02-------------------------#'
+###############################################
+# Verify default value of variable #
+###############################################
+
+SET @@global.binlog_stmt_cache_size = @start_value;
+SELECT @@global.binlog_stmt_cache_size = 32768;
+
+
+--echo '#--------------------FN_DYNVARS_006_03------------------------#'
+#########################################################################
+# Change the value of binlog_stmt_cache_size to a valid value #
+#########################################################################
+
+SET @@global.binlog_stmt_cache_size = 4096;
+SELECT @@global.binlog_stmt_cache_size;
+SET @@global.binlog_stmt_cache_size = 4294967295;
+SELECT @@global.binlog_stmt_cache_size;
+SET @@global.binlog_stmt_cache_size = 10000;
+SELECT @@global.binlog_stmt_cache_size;
+SET @@global.binlog_stmt_cache_size = 21221204;
+SELECT @@global.binlog_stmt_cache_size;
+echo 'Bug: Invalid values are coming in variable on assigning valid values';
+
+
+--echo '#--------------------FN_DYNVARS_006_04-------------------------#'
+############################################################################
+# Change the value of binlog_stmt_cache_size to invalid value #
+############################################################################
+
+SET @@global.binlog_stmt_cache_size = 1024;
+SELECT @@global.binlog_stmt_cache_size;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.binlog_stmt_cache_size = 10000.01;
+SET @@global.binlog_stmt_cache_size = -1024;
+SELECT @@global.binlog_stmt_cache_size;
+SET @@global.binlog_stmt_cache_size = 42949672950;
+SELECT @@global.binlog_stmt_cache_size;
+echo 'Bug: Errors are not coming on assigning invalid values to variable';
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.binlog_stmt_cache_size = ON;
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.binlog_stmt_cache_size = 'test';
+
+
+--echo '#-------------------FN_DYNVARS_006_05----------------------------#'
+############################################################################
+# Test if accessing session binlog_stmt_cache_size gives error #
+############################################################################
+
+--Error ER_GLOBAL_VARIABLE
+SET @@session.binlog_stmt_cache_size = 0;
+
+
+--echo '#----------------------FN_DYNVARS_006_06------------------------#'
+##############################################################################
+# Check if the value in GLOBAL Tables matches values in variable #
+##############################################################################
+
+SELECT @@global.binlog_stmt_cache_size = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='binlog_stmt_cache_size';
+
+--echo '#---------------------FN_DYNVARS_006_07----------------------#'
+###################################################################
+# Check if TRUE and FALSE values can be used on variable #
+###################################################################
+
+SET @@global.binlog_stmt_cache_size = TRUE;
+SELECT @@global.binlog_stmt_cache_size;
+SET @@global.binlog_stmt_cache_size = FALSE;
+SELECT @@global.binlog_stmt_cache_size;
+echo 'Bug: Errors are not coming on assigning TRUE/FALSE to variable';
+
+--echo '#---------------------FN_DYNVARS_006_08----------------------#'
+###############################################################################
+# Check if accessing variable without SCOPE points to same global variable #
+###############################################################################
+
+SET @@global.binlog_stmt_cache_size = 1;
+SELECT @@binlog_stmt_cache_size = @@global.binlog_stmt_cache_size;
+
+--echo '#---------------------FN_DYNVARS_006_09----------------------#'
+###########################################################################
+# Check if binlog_stmt_cache_size can be accessed with and without @@ sign#
+###########################################################################
+
+--Error ER_GLOBAL_VARIABLE
+SET binlog_stmt_cache_size = 1;
+--Error ER_PARSE_ERROR
+SET global.binlog_stmt_cache_size = 1;
+--Error ER_UNKNOWN_TABLE
+SELECT global.binlog_stmt_cache_size;
+--Error ER_BAD_FIELD_ERROR
+SELECT binlog_stmt_cache_size = @@session.binlog_stmt_cache_size;
+
+
+##############################
+# Restore initial value #
+##############################
+
+SET @@global.binlog_stmt_cache_size = @start_value;
+SELECT @@global.binlog_stmt_cache_size;
+
+
+###########################################################
+# END OF binlog_stmt_cache_size TESTS #
+###########################################################
diff --git a/mysql-test/suite/sys_vars/r/binlog_stmt_cache_size_basic_32.result b/mysql-test/suite/sys_vars/r/binlog_stmt_cache_size_basic_32.result
new file mode 100644
index 00000000000..604f671d5a4
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/binlog_stmt_cache_size_basic_32.result
@@ -0,0 +1,108 @@
+SET @start_value = @@global.binlog_stmt_cache_size;
+SELECT @start_value;
+@start_value
+32768
+'#--------------------FN_DYNVARS_006_01------------------------#'
+SET @@global.binlog_stmt_cache_size = 100;
+Warnings:
+Warning 1292 Truncated incorrect binlog_stmt_cache_size value: '100'
+SET @@global.binlog_stmt_cache_size = DEFAULT;
+SELECT @@global.binlog_stmt_cache_size;
+@@global.binlog_stmt_cache_size
+32768
+'#---------------------FN_DYNVARS_006_02-------------------------#'
+SET @@global.binlog_stmt_cache_size = @start_value;
+SELECT @@global.binlog_stmt_cache_size = 32768;
+@@global.binlog_stmt_cache_size = 32768
+1
+'#--------------------FN_DYNVARS_006_03------------------------#'
+SET @@global.binlog_stmt_cache_size = 4096;
+SELECT @@global.binlog_stmt_cache_size;
+@@global.binlog_stmt_cache_size
+4096
+SET @@global.binlog_stmt_cache_size = 4294967295;
+Warnings:
+Warning 1292 Truncated incorrect binlog_stmt_cache_size value: '4294967295'
+SELECT @@global.binlog_stmt_cache_size;
+@@global.binlog_stmt_cache_size
+4294963200
+SET @@global.binlog_stmt_cache_size = 10000;
+Warnings:
+Warning 1292 Truncated incorrect binlog_stmt_cache_size value: '10000'
+SELECT @@global.binlog_stmt_cache_size;
+@@global.binlog_stmt_cache_size
+8192
+SET @@global.binlog_stmt_cache_size = 21221204;
+Warnings:
+Warning 1292 Truncated incorrect binlog_stmt_cache_size value: '21221204'
+SELECT @@global.binlog_stmt_cache_size;
+@@global.binlog_stmt_cache_size
+21217280
+'Bug: Invalid values are coming in variable on assigning valid values'
+'#--------------------FN_DYNVARS_006_04-------------------------#'
+SET @@global.binlog_stmt_cache_size = 1024;
+Warnings:
+Warning 1292 Truncated incorrect binlog_stmt_cache_size value: '1024'
+SELECT @@global.binlog_stmt_cache_size;
+@@global.binlog_stmt_cache_size
+4096
+SET @@global.binlog_stmt_cache_size = 10000.01;
+ERROR 42000: Incorrect argument type to variable 'binlog_stmt_cache_size'
+SET @@global.binlog_stmt_cache_size = -1024;
+Warnings:
+Warning 1292 Truncated incorrect binlog_stmt_cache_size value: '-1024'
+SELECT @@global.binlog_stmt_cache_size;
+@@global.binlog_stmt_cache_size
+4096
+SET @@global.binlog_stmt_cache_size = 42949672950;
+Warnings:
+Warning 1292 Truncated incorrect binlog_stmt_cache_size value: '42949672950'
+SELECT @@global.binlog_stmt_cache_size;
+@@global.binlog_stmt_cache_size
+4294963200
+'Bug: Errors are not coming on assigning invalid values to variable'
+SET @@global.binlog_stmt_cache_size = ON;
+ERROR 42000: Incorrect argument type to variable 'binlog_stmt_cache_size'
+SET @@global.binlog_stmt_cache_size = 'test';
+ERROR 42000: Incorrect argument type to variable 'binlog_stmt_cache_size'
+'#-------------------FN_DYNVARS_006_05----------------------------#'
+SET @@session.binlog_stmt_cache_size = 0;
+ERROR HY000: Variable 'binlog_stmt_cache_size' is a GLOBAL variable and should be set with SET GLOBAL
+'#----------------------FN_DYNVARS_006_06------------------------#'
+SELECT @@global.binlog_stmt_cache_size = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='binlog_stmt_cache_size';
+@@global.binlog_stmt_cache_size = VARIABLE_VALUE
+1
+'#---------------------FN_DYNVARS_006_07----------------------#'
+SET @@global.binlog_stmt_cache_size = TRUE;
+Warnings:
+Warning 1292 Truncated incorrect binlog_stmt_cache_size value: '1'
+SELECT @@global.binlog_stmt_cache_size;
+@@global.binlog_stmt_cache_size
+4096
+SET @@global.binlog_stmt_cache_size = FALSE;
+Warnings:
+Warning 1292 Truncated incorrect binlog_stmt_cache_size value: '0'
+SELECT @@global.binlog_stmt_cache_size;
+@@global.binlog_stmt_cache_size
+4096
+'Bug: Errors are not coming on assigning TRUE/FALSE to variable'
+'#---------------------FN_DYNVARS_006_08----------------------#'
+SET @@global.binlog_stmt_cache_size = 1;
+Warnings:
+Warning 1292 Truncated incorrect binlog_stmt_cache_size value: '1'
+SELECT @@binlog_stmt_cache_size = @@global.binlog_stmt_cache_size;
+@@binlog_stmt_cache_size = @@global.binlog_stmt_cache_size
+1
+'#---------------------FN_DYNVARS_006_09----------------------#'
+SET binlog_stmt_cache_size = 1;
+ERROR HY000: Variable 'binlog_stmt_cache_size' is a GLOBAL variable and should be set with SET GLOBAL
+SET global.binlog_stmt_cache_size = 1;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'binlog_stmt_cache_size = 1' at line 1
+SELECT global.binlog_stmt_cache_size;
+ERROR 42S02: Unknown table 'global' in field list
+SELECT binlog_stmt_cache_size = @@session.binlog_stmt_cache_size;
+ERROR 42S22: Unknown column 'binlog_stmt_cache_size' in 'field list'
+SET @@global.binlog_stmt_cache_size = @start_value;
+SELECT @@global.binlog_stmt_cache_size;
+@@global.binlog_stmt_cache_size
+32768
diff --git a/mysql-test/suite/sys_vars/r/binlog_stmt_cache_size_basic_64.result b/mysql-test/suite/sys_vars/r/binlog_stmt_cache_size_basic_64.result
new file mode 100644
index 00000000000..604f671d5a4
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/binlog_stmt_cache_size_basic_64.result
@@ -0,0 +1,108 @@
+SET @start_value = @@global.binlog_stmt_cache_size;
+SELECT @start_value;
+@start_value
+32768
+'#--------------------FN_DYNVARS_006_01------------------------#'
+SET @@global.binlog_stmt_cache_size = 100;
+Warnings:
+Warning 1292 Truncated incorrect binlog_stmt_cache_size value: '100'
+SET @@global.binlog_stmt_cache_size = DEFAULT;
+SELECT @@global.binlog_stmt_cache_size;
+@@global.binlog_stmt_cache_size
+32768
+'#---------------------FN_DYNVARS_006_02-------------------------#'
+SET @@global.binlog_stmt_cache_size = @start_value;
+SELECT @@global.binlog_stmt_cache_size = 32768;
+@@global.binlog_stmt_cache_size = 32768
+1
+'#--------------------FN_DYNVARS_006_03------------------------#'
+SET @@global.binlog_stmt_cache_size = 4096;
+SELECT @@global.binlog_stmt_cache_size;
+@@global.binlog_stmt_cache_size
+4096
+SET @@global.binlog_stmt_cache_size = 4294967295;
+Warnings:
+Warning 1292 Truncated incorrect binlog_stmt_cache_size value: '4294967295'
+SELECT @@global.binlog_stmt_cache_size;
+@@global.binlog_stmt_cache_size
+4294963200
+SET @@global.binlog_stmt_cache_size = 10000;
+Warnings:
+Warning 1292 Truncated incorrect binlog_stmt_cache_size value: '10000'
+SELECT @@global.binlog_stmt_cache_size;
+@@global.binlog_stmt_cache_size
+8192
+SET @@global.binlog_stmt_cache_size = 21221204;
+Warnings:
+Warning 1292 Truncated incorrect binlog_stmt_cache_size value: '21221204'
+SELECT @@global.binlog_stmt_cache_size;
+@@global.binlog_stmt_cache_size
+21217280
+'Bug: Invalid values are coming in variable on assigning valid values'
+'#--------------------FN_DYNVARS_006_04-------------------------#'
+SET @@global.binlog_stmt_cache_size = 1024;
+Warnings:
+Warning 1292 Truncated incorrect binlog_stmt_cache_size value: '1024'
+SELECT @@global.binlog_stmt_cache_size;
+@@global.binlog_stmt_cache_size
+4096
+SET @@global.binlog_stmt_cache_size = 10000.01;
+ERROR 42000: Incorrect argument type to variable 'binlog_stmt_cache_size'
+SET @@global.binlog_stmt_cache_size = -1024;
+Warnings:
+Warning 1292 Truncated incorrect binlog_stmt_cache_size value: '-1024'
+SELECT @@global.binlog_stmt_cache_size;
+@@global.binlog_stmt_cache_size
+4096
+SET @@global.binlog_stmt_cache_size = 42949672950;
+Warnings:
+Warning 1292 Truncated incorrect binlog_stmt_cache_size value: '42949672950'
+SELECT @@global.binlog_stmt_cache_size;
+@@global.binlog_stmt_cache_size
+4294963200
+'Bug: Errors are not coming on assigning invalid values to variable'
+SET @@global.binlog_stmt_cache_size = ON;
+ERROR 42000: Incorrect argument type to variable 'binlog_stmt_cache_size'
+SET @@global.binlog_stmt_cache_size = 'test';
+ERROR 42000: Incorrect argument type to variable 'binlog_stmt_cache_size'
+'#-------------------FN_DYNVARS_006_05----------------------------#'
+SET @@session.binlog_stmt_cache_size = 0;
+ERROR HY000: Variable 'binlog_stmt_cache_size' is a GLOBAL variable and should be set with SET GLOBAL
+'#----------------------FN_DYNVARS_006_06------------------------#'
+SELECT @@global.binlog_stmt_cache_size = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='binlog_stmt_cache_size';
+@@global.binlog_stmt_cache_size = VARIABLE_VALUE
+1
+'#---------------------FN_DYNVARS_006_07----------------------#'
+SET @@global.binlog_stmt_cache_size = TRUE;
+Warnings:
+Warning 1292 Truncated incorrect binlog_stmt_cache_size value: '1'
+SELECT @@global.binlog_stmt_cache_size;
+@@global.binlog_stmt_cache_size
+4096
+SET @@global.binlog_stmt_cache_size = FALSE;
+Warnings:
+Warning 1292 Truncated incorrect binlog_stmt_cache_size value: '0'
+SELECT @@global.binlog_stmt_cache_size;
+@@global.binlog_stmt_cache_size
+4096
+'Bug: Errors are not coming on assigning TRUE/FALSE to variable'
+'#---------------------FN_DYNVARS_006_08----------------------#'
+SET @@global.binlog_stmt_cache_size = 1;
+Warnings:
+Warning 1292 Truncated incorrect binlog_stmt_cache_size value: '1'
+SELECT @@binlog_stmt_cache_size = @@global.binlog_stmt_cache_size;
+@@binlog_stmt_cache_size = @@global.binlog_stmt_cache_size
+1
+'#---------------------FN_DYNVARS_006_09----------------------#'
+SET binlog_stmt_cache_size = 1;
+ERROR HY000: Variable 'binlog_stmt_cache_size' is a GLOBAL variable and should be set with SET GLOBAL
+SET global.binlog_stmt_cache_size = 1;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'binlog_stmt_cache_size = 1' at line 1
+SELECT global.binlog_stmt_cache_size;
+ERROR 42S02: Unknown table 'global' in field list
+SELECT binlog_stmt_cache_size = @@session.binlog_stmt_cache_size;
+ERROR 42S22: Unknown column 'binlog_stmt_cache_size' in 'field list'
+SET @@global.binlog_stmt_cache_size = @start_value;
+SELECT @@global.binlog_stmt_cache_size;
+@@global.binlog_stmt_cache_size
+32768
diff --git a/mysql-test/suite/sys_vars/r/max_binlog_stmt_cache_size_basic.result b/mysql-test/suite/sys_vars/r/max_binlog_stmt_cache_size_basic.result
new file mode 100644
index 00000000000..f2229a0090b
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/max_binlog_stmt_cache_size_basic.result
@@ -0,0 +1,152 @@
+SET @start_value = @@global.max_binlog_stmt_cache_size;
+SELECT @start_value;
+@start_value
+18446744073709547520
+'#--------------------FN_DYNVARS_072_01------------------------#'
+SET @@global.max_binlog_stmt_cache_size = 5000;
+Warnings:
+Warning 1292 Truncated incorrect max_binlog_stmt_cache_size value: '5000'
+SET @@global.max_binlog_stmt_cache_size = DEFAULT;
+SELECT @@global.max_binlog_stmt_cache_size;
+@@global.max_binlog_stmt_cache_size
+18446744073709547520
+'#---------------------FN_DYNVARS_072_02-------------------------#'
+SET @@global.max_binlog_stmt_cache_size = @start_value;
+SELECT @@global.max_binlog_stmt_cache_size = 4294967295;
+@@global.max_binlog_stmt_cache_size = 4294967295
+0
+'#--------------------FN_DYNVARS_072_03------------------------#'
+SET @@global.max_binlog_stmt_cache_size = 4096;
+SELECT @@global.max_binlog_stmt_cache_size;
+@@global.max_binlog_stmt_cache_size
+4096
+SET @@global.max_binlog_stmt_cache_size = 4294967295;
+Warnings:
+Warning 1292 Truncated incorrect max_binlog_stmt_cache_size value: '4294967295'
+SELECT @@global.max_binlog_stmt_cache_size;
+@@global.max_binlog_stmt_cache_size
+4294963200
+SET @@global.max_binlog_stmt_cache_size = 4294967294;
+Warnings:
+Warning 1292 Truncated incorrect max_binlog_stmt_cache_size value: '4294967294'
+SELECT @@global.max_binlog_stmt_cache_size;
+@@global.max_binlog_stmt_cache_size
+4294963200
+SET @@global.max_binlog_stmt_cache_size = 4097;
+Warnings:
+Warning 1292 Truncated incorrect max_binlog_stmt_cache_size value: '4097'
+SELECT @@global.max_binlog_stmt_cache_size;
+@@global.max_binlog_stmt_cache_size
+4096
+SET @@global.max_binlog_stmt_cache_size = 65535;
+Warnings:
+Warning 1292 Truncated incorrect max_binlog_stmt_cache_size value: '65535'
+SELECT @@global.max_binlog_stmt_cache_size;
+@@global.max_binlog_stmt_cache_size
+61440
+'#--------------------FN_DYNVARS_072_04-------------------------#'
+SET @@global.max_binlog_stmt_cache_size = -1;
+Warnings:
+Warning 1292 Truncated incorrect max_binlog_stmt_cache_size value: '-1'
+SELECT @@global.max_binlog_stmt_cache_size;
+@@global.max_binlog_stmt_cache_size
+4096
+SET @@global.max_binlog_stmt_cache_size = 100000000000;
+Warnings:
+Warning 1292 Truncated incorrect max_binlog_stmt_cache_size value: '100000000000'
+SELECT @@global.max_binlog_stmt_cache_size;
+@@global.max_binlog_stmt_cache_size
+99999997952
+SET @@global.max_binlog_stmt_cache_size = 10000.01;
+ERROR 42000: Incorrect argument type to variable 'max_binlog_stmt_cache_size'
+SELECT @@global.max_binlog_stmt_cache_size;
+@@global.max_binlog_stmt_cache_size
+99999997952
+SET @@global.max_binlog_stmt_cache_size = -1024;
+Warnings:
+Warning 1292 Truncated incorrect max_binlog_stmt_cache_size value: '-1024'
+SELECT @@global.max_binlog_stmt_cache_size;
+@@global.max_binlog_stmt_cache_size
+4096
+SET @@global.max_binlog_stmt_cache_size = 1024;
+Warnings:
+Warning 1292 Truncated incorrect max_binlog_stmt_cache_size value: '1024'
+SELECT @@global.max_binlog_stmt_cache_size;
+@@global.max_binlog_stmt_cache_size
+4096
+SET @@global.max_binlog_stmt_cache_size = 4294967296;
+SELECT @@global.max_binlog_stmt_cache_size;
+@@global.max_binlog_stmt_cache_size
+4294967296
+SET @@global.max_binlog_stmt_cache_size = 4095;
+Warnings:
+Warning 1292 Truncated incorrect max_binlog_stmt_cache_size value: '4095'
+SELECT @@global.max_binlog_stmt_cache_size;
+@@global.max_binlog_stmt_cache_size
+4096
+SET @@global.max_binlog_stmt_cache_size = ON;
+ERROR 42000: Incorrect argument type to variable 'max_binlog_stmt_cache_size'
+SELECT @@global.max_binlog_stmt_cache_size;
+@@global.max_binlog_stmt_cache_size
+4096
+SET @@global.max_binlog_stmt_cache_size = 'test';
+ERROR 42000: Incorrect argument type to variable 'max_binlog_stmt_cache_size'
+SELECT @@global.max_binlog_stmt_cache_size;
+@@global.max_binlog_stmt_cache_size
+4096
+'#-------------------FN_DYNVARS_072_05----------------------------#'
+SET @@session.max_binlog_stmt_cache_size = 4096;
+ERROR HY000: Variable 'max_binlog_stmt_cache_size' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT @@session.max_binlog_stmt_cache_size;
+ERROR HY000: Variable 'max_binlog_stmt_cache_size' is a GLOBAL variable
+'#----------------------FN_DYNVARS_072_06------------------------#'
+SELECT @@global.max_binlog_stmt_cache_size = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='max_binlog_stmt_cache_size';
+@@global.max_binlog_stmt_cache_size = VARIABLE_VALUE
+1
+SELECT @@max_binlog_stmt_cache_size = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES
+WHERE VARIABLE_NAME='max_binlog_stmt_cache_size';
+@@max_binlog_stmt_cache_size = VARIABLE_VALUE
+1
+'#---------------------FN_DYNVARS_072_07----------------------#'
+SET @@global.max_binlog_stmt_cache_size = TRUE;
+Warnings:
+Warning 1292 Truncated incorrect max_binlog_stmt_cache_size value: '1'
+SELECT @@global.max_binlog_stmt_cache_size;
+@@global.max_binlog_stmt_cache_size
+4096
+SET @@global.max_binlog_stmt_cache_size = FALSE;
+Warnings:
+Warning 1292 Truncated incorrect max_binlog_stmt_cache_size value: '0'
+SELECT @@global.max_binlog_stmt_cache_size;
+@@global.max_binlog_stmt_cache_size
+4096
+'#---------------------FN_DYNVARS_072_08----------------------#'
+SET @@global.max_binlog_stmt_cache_size = 5000;
+Warnings:
+Warning 1292 Truncated incorrect max_binlog_stmt_cache_size value: '5000'
+SELECT @@max_binlog_stmt_cache_size = @@global.max_binlog_stmt_cache_size;
+@@max_binlog_stmt_cache_size = @@global.max_binlog_stmt_cache_size
+1
+'#---------------------FN_DYNVARS_072_09----------------------#'
+SET max_binlog_stmt_cache_size = 6000;
+ERROR HY000: Variable 'max_binlog_stmt_cache_size' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT @@max_binlog_stmt_cache_size;
+@@max_binlog_stmt_cache_size
+4096
+SET local.max_binlog_stmt_cache_size = 7000;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'max_binlog_stmt_cache_size = 7000' at line 1
+SELECT local.max_binlog_stmt_cache_size;
+ERROR 42S02: Unknown table 'local' in field list
+SET global.max_binlog_stmt_cache_size = 8000;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'max_binlog_stmt_cache_size = 8000' at line 1
+SELECT global.max_binlog_stmt_cache_size;
+ERROR 42S02: Unknown table 'global' in field list
+SELECT max_binlog_stmt_cache_size = @@session.max_binlog_stmt_cache_size;
+ERROR 42S22: Unknown column 'max_binlog_stmt_cache_size' in 'field list'
+SET @@global.max_binlog_stmt_cache_size = @start_value;
+SELECT @@global.max_binlog_stmt_cache_size;
+@@global.max_binlog_stmt_cache_size
+18446744073709547520
diff --git a/mysql-test/suite/sys_vars/t/binlog_stmt_cache_size_basic_32.test b/mysql-test/suite/sys_vars/t/binlog_stmt_cache_size_basic_32.test
new file mode 100644
index 00000000000..fe8f89ccc16
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/binlog_stmt_cache_size_basic_32.test
@@ -0,0 +1,7 @@
+################################################################################
+# Wrapper for 32 bit machines #
+################################################################################
+
+--source include/have_32bit.inc
+--source suite/sys_vars/inc/binlog_stmt_cache_size_basic.inc
+
diff --git a/mysql-test/suite/sys_vars/t/binlog_stmt_cache_size_basic_64.test b/mysql-test/suite/sys_vars/t/binlog_stmt_cache_size_basic_64.test
new file mode 100644
index 00000000000..c4a2c95d42b
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/binlog_stmt_cache_size_basic_64.test
@@ -0,0 +1,7 @@
+################################################################################
+# Wrapper for 64 bit machines #
+################################################################################
+
+--source include/have_64bit.inc
+--source suite/sys_vars/inc/binlog_stmt_cache_size_basic.inc
+
diff --git a/mysql-test/suite/sys_vars/t/max_binlog_cache_size_func-master.opt b/mysql-test/suite/sys_vars/t/max_binlog_cache_size_func-master.opt
deleted file mode 100644
index 6e00d7157d6..00000000000
--- a/mysql-test/suite/sys_vars/t/max_binlog_cache_size_func-master.opt
+++ /dev/null
@@ -1,2 +0,0 @@
---log-bin
---innodb
diff --git a/mysql-test/suite/sys_vars/t/max_binlog_stmt_cache_size_basic.test b/mysql-test/suite/sys_vars/t/max_binlog_stmt_cache_size_basic.test
new file mode 100644
index 00000000000..07a030c35a7
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/max_binlog_stmt_cache_size_basic.test
@@ -0,0 +1,184 @@
+############ mysql-test\t\max_binlog_stmt_cache_size_basic.test ###############
+# #
+# Variable Name: max_binlog_stmt_cache_size #
+# Scope: GLOBAL #
+# Access Type: Dynamic #
+# Data Type: numeric #
+# Default Value:4294967295 #
+# Range: 4096-4294967295 #
+# #
+# #
+# #
+# #
+# #
+# Creation Date: 2010-11-05 #
+# Author: Alfranio #
+# #
+# Description: Test Cases of Dynamic System Variable #
+# max_binlog_stmt_cache_size that checks #
+# the behavior of this variable in the following ways #
+# * Default Value #
+# * Valid & Invalid values #
+# * Scope & Access method #
+# * Data Integrity #
+# #
+# Reference: http://dev.mysql.com/doc/refman/5.5/en/ #
+# server-system-variables.html #
+# #
+###############################################################################
+
+--source include/load_sysvars.inc
+
+##########################################################################
+# START OF max_binlog_stmt_cache_size TESTS #
+##########################################################################
+
+
+##############################################################################
+# Saving initial value of max_binlog_stmt_cache_size in a temporary variable #
+##############################################################################
+
+SET @start_value = @@global.max_binlog_stmt_cache_size;
+SELECT @start_value;
+
+
+--echo '#--------------------FN_DYNVARS_072_01------------------------#'
+########################################################################
+# Display the DEFAULT value of max_binlog_stmt_cache_size #
+########################################################################
+
+SET @@global.max_binlog_stmt_cache_size = 5000;
+SET @@global.max_binlog_stmt_cache_size = DEFAULT;
+SELECT @@global.max_binlog_stmt_cache_size;
+
+
+--echo '#---------------------FN_DYNVARS_072_02-------------------------#'
+###############################################
+# Verify default value of variable #
+###############################################
+
+SET @@global.max_binlog_stmt_cache_size = @start_value;
+SELECT @@global.max_binlog_stmt_cache_size = 4294967295;
+
+--echo '#--------------------FN_DYNVARS_072_03------------------------#'
+########################################################################
+# Change the value of max_binlog_stmt_cache_size to a valid value #
+########################################################################
+
+SET @@global.max_binlog_stmt_cache_size = 4096;
+SELECT @@global.max_binlog_stmt_cache_size;
+SET @@global.max_binlog_stmt_cache_size = 4294967295;
+SELECT @@global.max_binlog_stmt_cache_size;
+SET @@global.max_binlog_stmt_cache_size = 4294967294;
+SELECT @@global.max_binlog_stmt_cache_size;
+SET @@global.max_binlog_stmt_cache_size = 4097;
+SELECT @@global.max_binlog_stmt_cache_size;
+SET @@global.max_binlog_stmt_cache_size = 65535;
+SELECT @@global.max_binlog_stmt_cache_size;
+
+
+--echo '#--------------------FN_DYNVARS_072_04-------------------------#'
+###########################################################################
+# Change the value of max_binlog_stmt_cache_size to invalid value #
+###########################################################################
+
+SET @@global.max_binlog_stmt_cache_size = -1;
+SELECT @@global.max_binlog_stmt_cache_size;
+SET @@global.max_binlog_stmt_cache_size = 100000000000;
+SELECT @@global.max_binlog_stmt_cache_size;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.max_binlog_stmt_cache_size = 10000.01;
+SELECT @@global.max_binlog_stmt_cache_size;
+SET @@global.max_binlog_stmt_cache_size = -1024;
+SELECT @@global.max_binlog_stmt_cache_size;
+SET @@global.max_binlog_stmt_cache_size = 1024;
+SELECT @@global.max_binlog_stmt_cache_size;
+SET @@global.max_binlog_stmt_cache_size = 4294967296;
+SELECT @@global.max_binlog_stmt_cache_size;
+SET @@global.max_binlog_stmt_cache_size = 4095;
+SELECT @@global.max_binlog_stmt_cache_size;
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.max_binlog_stmt_cache_size = ON;
+SELECT @@global.max_binlog_stmt_cache_size;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.max_binlog_stmt_cache_size = 'test';
+SELECT @@global.max_binlog_stmt_cache_size;
+
+
+--echo '#-------------------FN_DYNVARS_072_05----------------------------#'
+###########################################################################
+# Test if accessing session max_binlog_stmt_cache_size gives error #
+###########################################################################
+
+--Error ER_GLOBAL_VARIABLE
+SET @@session.max_binlog_stmt_cache_size = 4096;
+--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.max_binlog_stmt_cache_size;
+
+
+--echo '#----------------------FN_DYNVARS_072_06------------------------#'
+##############################################################################
+# Check if the value in GLOBAL & SESSION Tables matches values in variable #
+##############################################################################
+
+SELECT @@global.max_binlog_stmt_cache_size = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='max_binlog_stmt_cache_size';
+
+SELECT @@max_binlog_stmt_cache_size = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES
+WHERE VARIABLE_NAME='max_binlog_stmt_cache_size';
+
+
+--echo '#---------------------FN_DYNVARS_072_07----------------------#'
+###################################################################
+# Check if TRUE and FALSE values can be used on variable #
+###################################################################
+
+SET @@global.max_binlog_stmt_cache_size = TRUE;
+SELECT @@global.max_binlog_stmt_cache_size;
+SET @@global.max_binlog_stmt_cache_size = FALSE;
+SELECT @@global.max_binlog_stmt_cache_size;
+
+
+--echo '#---------------------FN_DYNVARS_072_08----------------------#'
+########################################################################################################
+# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable #
+########################################################################################################
+
+SET @@global.max_binlog_stmt_cache_size = 5000;
+SELECT @@max_binlog_stmt_cache_size = @@global.max_binlog_stmt_cache_size;
+
+
+--echo '#---------------------FN_DYNVARS_072_09----------------------#'
+################################################################################
+# Check if max_binlog_stmt_cache_size can be accessed with and without @@ sign #
+################################################################################
+
+--Error ER_GLOBAL_VARIABLE
+SET max_binlog_stmt_cache_size = 6000;
+SELECT @@max_binlog_stmt_cache_size;
+--Error ER_PARSE_ERROR
+SET local.max_binlog_stmt_cache_size = 7000;
+--Error ER_UNKNOWN_TABLE
+SELECT local.max_binlog_stmt_cache_size;
+--Error ER_PARSE_ERROR
+SET global.max_binlog_stmt_cache_size = 8000;
+--Error ER_UNKNOWN_TABLE
+SELECT global.max_binlog_stmt_cache_size;
+--Error ER_BAD_FIELD_ERROR
+SELECT max_binlog_stmt_cache_size = @@session.max_binlog_stmt_cache_size;
+
+
+##############################
+# Restore initial value #
+##############################
+
+SET @@global.max_binlog_stmt_cache_size = @start_value;
+SELECT @@global.max_binlog_stmt_cache_size;
+
+
+########################################################################
+# END OF max_binlog_stmt_cache_size TESTS #
+########################################################################