mirror of
https://github.com/MariaDB/server.git
synced 2025-01-23 15:24:16 +01:00
fc4ae9bc11
into maint1.mysql.com:/data/localhome/tsmith/bk/maint/51 include/m_ctype.h: Auto merged mysql-test/Makefile.am: Auto merged mysql-test/lib/mtr_report.pl: Auto merged mysql-test/r/rpl_ssl.result: Auto merged mysql-test/t/innodb.test: Auto merged mysql-test/t/multi_update.test: Auto merged mysql-test/t/rpl_row_until.test: Auto merged mysql-test/t/rpl_ssl.test: Auto merged mysql-test/t/rpl_stm_until.test: Auto merged mysys/charset-def.c: Auto merged mysys/charset.c: Auto merged sql/item_create.cc: Auto merged sql/log_event.cc: Auto merged sql/mysql_priv.h: Auto merged sql/mysqld.cc: Auto merged sql/sql_acl.cc: Auto merged sql/sql_base.cc: Auto merged sql/sql_class.cc: Auto merged sql/sql_update.cc: Auto merged strings/ctype-big5.c: Auto merged strings/ctype-gbk.c: Auto merged strings/ctype-sjis.c: Auto merged strings/ctype-uca.c: Auto merged strings/ctype.c: Auto merged BitKeeper/deleted/.del-binlog_innodb.result: Delete: mysql-test/r/binlog_innodb.result BitKeeper/deleted/.del-binlog_innodb.test: Delete: mysql-test/t/binlog_innodb.test mysql-test/r/binlog_innodb.result: Fix merge of two independent binlog_innodb tests (from -rpl and -maint) mysql-test/t/binlog_innodb.test: Fix merge of two independent binlog_innodb tests (from -rpl and -maint) mysql-test/r/innodb.result: Use local (manual merge) mysql-test/r/multi_update.result: Use remote (manual merge) mysql-test/t/rpl_log_pos.test: Manual merge mysql-test/r/rpl_log_pos.result: Manual merge, part 2
133 lines
2.9 KiB
Text
133 lines
2.9 KiB
Text
source include/have_innodb.inc;
|
|
source include/have_log_bin.inc;
|
|
|
|
SET BINLOG_FORMAT=MIXED;
|
|
|
|
RESET MASTER;
|
|
|
|
CREATE TABLE t1 (a INT PRIMARY KEY, b INT) ENGINE=INNODB;
|
|
INSERT INTO t1 VALUES (1,1),(2,2),(3,3),(4,4),(5,5),(6,6);
|
|
|
|
BEGIN;
|
|
SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ;
|
|
# Should be logged as statement
|
|
UPDATE t1 SET b = 2*a WHERE a > 1;
|
|
COMMIT;
|
|
|
|
BEGIN;
|
|
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
|
|
# Should be logged as rows
|
|
UPDATE t1 SET b = a * a WHERE a > 3;
|
|
COMMIT;
|
|
|
|
# Check that errors are generated when trying to use READ COMMITTED
|
|
# transaction isolation level in STATEMENT binlog mode.
|
|
|
|
SET BINLOG_FORMAT=STATEMENT;
|
|
|
|
BEGIN;
|
|
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
|
error ER_BINLOG_LOGGING_IMPOSSIBLE;
|
|
UPDATE t1 SET b = 1*a WHERE a > 1;
|
|
COMMIT;
|
|
|
|
BEGIN;
|
|
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
|
|
error ER_BINLOG_LOGGING_IMPOSSIBLE;
|
|
UPDATE t1 SET b = 2*a WHERE a > 2;
|
|
COMMIT;
|
|
|
|
BEGIN;
|
|
SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ;
|
|
UPDATE t1 SET b = 3*a WHERE a > 3;
|
|
COMMIT;
|
|
|
|
BEGIN;
|
|
SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
|
|
UPDATE t1 SET b = 4*a WHERE a > 4;
|
|
COMMIT;
|
|
|
|
SET BINLOG_FORMAT=MIXED;
|
|
|
|
BEGIN;
|
|
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
|
UPDATE t1 SET b = 1*a WHERE a > 1;
|
|
COMMIT;
|
|
|
|
BEGIN;
|
|
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
|
|
UPDATE t1 SET b = 2*a WHERE a > 2;
|
|
COMMIT;
|
|
|
|
BEGIN;
|
|
SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ;
|
|
UPDATE t1 SET b = 3*a WHERE a > 3;
|
|
COMMIT;
|
|
|
|
BEGIN;
|
|
SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
|
|
UPDATE t1 SET b = 4*a WHERE a > 4;
|
|
COMMIT;
|
|
|
|
SET BINLOG_FORMAT=ROW;
|
|
|
|
BEGIN;
|
|
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
|
UPDATE t1 SET b = 1*a WHERE a > 1;
|
|
COMMIT;
|
|
|
|
BEGIN;
|
|
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
|
|
UPDATE t1 SET b = 2*a WHERE a > 2;
|
|
COMMIT;
|
|
|
|
BEGIN;
|
|
SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ;
|
|
UPDATE t1 SET b = 3*a WHERE a > 3;
|
|
COMMIT;
|
|
|
|
BEGIN;
|
|
SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
|
|
UPDATE t1 SET b = 4*a WHERE a > 4;
|
|
COMMIT;
|
|
|
|
source include/show_binlog_events.inc;
|
|
|
|
DROP TABLE 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;
|
|
|
|
--echo End of tests
|