mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Merge next-mr -> next-4284.
mysql-test/t/disabled.def: Restore disabled ssl tests: SSL certificates were updated. Disable sp_sync.test, the test case can't work in next-4284. mysql-test/t/partition_innodb.test: Disable parsing of the test case for Bug#47343, the test can not work in next-4284. mysql-test/t/ps_ddl.test: Update results (CREATE TABLE IF NOT EXISTS takes into account existence of the temporary table).
This commit is contained in:
@ -20,7 +20,7 @@ show binlog events from <binlog_start>;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query # # BEGIN
|
||||
master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=#
|
||||
master-bin.000001 # Execute_load_query # # use `test`; LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE `t2` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (a, b) ;file_id=#
|
||||
master-bin.000001 # Execute_load_query # # use `test`; LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE `t2` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a`, `b`) ;file_id=#
|
||||
master-bin.000001 # Query # # COMMIT
|
||||
select
|
||||
(@a:=load_file("MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog"))
|
||||
|
@ -33,9 +33,11 @@ mysqld-bin.000001 # Query # # BEGIN
|
||||
mysqld-bin.000001 # Query # # use `test`; UPDATE t1m, t1b SET m = 2, b = 3 WHERE n = c
|
||||
mysqld-bin.000001 # Query # # COMMIT
|
||||
mysqld-bin.000001 # Query # # BEGIN
|
||||
mysqld-bin.000001 # Query # # use `test`; UPDATE t1n, t1b SET e = 2, b = 3 WHERE f = c
|
||||
mysqld-bin.000001 # Query # # COMMIT
|
||||
mysqld-bin.000001 # Query # # BEGIN
|
||||
mysqld-bin.000001 # Query # # use `test`; INSERT INTO t1n VALUES (1,1), (1,2), (2,1), (2,2)
|
||||
mysqld-bin.000001 # Query # # use `test`; UPDATE t1m, t1n SET m = 2, e = 3 WHERE n = f
|
||||
mysqld-bin.000001 # Query # # use `test`; UPDATE t1n, t1b SET e = 2, b = 3 WHERE f = c
|
||||
mysqld-bin.000001 # Query # # COMMIT
|
||||
mysqld-bin.000001 # Query # # BEGIN
|
||||
mysqld-bin.000001 # Table_map # # table_id: # (test.t1n)
|
||||
|
@ -128,7 +128,7 @@ master-bin.000001 # Query # # COMMIT
|
||||
master-bin.000001 # Query # # use `test`; create table t2 (a varchar(200)) engine=blackhole
|
||||
master-bin.000001 # Query # # BEGIN
|
||||
master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=581
|
||||
master-bin.000001 # Execute_load_query # # use `test`; LOAD DATA INFILE '../../std_data/words.dat' INTO TABLE `t2` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (a) ;file_id=#
|
||||
master-bin.000001 # Execute_load_query # # use `test`; LOAD DATA INFILE '../../std_data/words.dat' INTO TABLE `t2` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a`) ;file_id=#
|
||||
master-bin.000001 # Query # # COMMIT
|
||||
master-bin.000001 # Query # # use `test`; alter table t1 add b int
|
||||
master-bin.000001 # Query # # use `test`; alter table t1 drop b
|
||||
|
@ -702,7 +702,7 @@ master-bin.000001 # Query # # BEGIN
|
||||
master-bin.000001 # Intvar # # INSERT_ID=10
|
||||
master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=#
|
||||
master-bin.000001 # Intvar # # INSERT_ID=10
|
||||
master-bin.000001 # Execute_load_query # # use `test`; LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE `t4` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (a, @b) SET b=((@b) + `bug27417`(2)) ;file_id=#
|
||||
master-bin.000001 # Execute_load_query # # use `test`; LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE `t4` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a`, @b) SET `b`=((@b) + `bug27417`(2)) ;file_id=#
|
||||
master-bin.000001 # Query # # ROLLBACK
|
||||
/* the output must denote there is the query */;
|
||||
drop trigger trg_del_t2;
|
||||
@ -960,7 +960,7 @@ master-bin.000001 # User var # # @`b`=_latin1 0x3135 COLLATE latin1_swedish_ci
|
||||
master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=#
|
||||
master-bin.000001 # Intvar # # INSERT_ID=10
|
||||
master-bin.000001 # User var # # @`b`=_latin1 0x3135 COLLATE latin1_swedish_ci
|
||||
master-bin.000001 # Execute_load_query # # use `test`; LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE `t4` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (a, @b) SET b=((@b) + `bug27417`(2)) ;file_id=#
|
||||
master-bin.000001 # Execute_load_query # # use `test`; LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE `t4` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a`, @b) SET `b`=((@b) + `bug27417`(2)) ;file_id=#
|
||||
master-bin.000001 # Query # # ROLLBACK
|
||||
drop trigger trg_del_t2;
|
||||
drop table t1,t2,t3,t4,t5;
|
||||
|
@ -1,4 +1,5 @@
|
||||
set @save_binlog_format= @@global.binlog_format;
|
||||
set @save_binlog_dirct= @@global.binlog_direct_non_transactional_updates;
|
||||
create table t1 (a int) engine= myisam;
|
||||
create table t2 (a int) engine= innodb;
|
||||
SELECT @@session.binlog_format;
|
||||
@ -8,19 +9,27 @@ SET AUTOCOMMIT=1;
|
||||
# Test that the session variable 'binlog_format'
|
||||
# is writable outside a transaction.
|
||||
set @@session.binlog_format= statement;
|
||||
set @@session.binlog_direct_non_transactional_updates= TRUE;
|
||||
SELECT @@session.binlog_format;
|
||||
@@session.binlog_format
|
||||
STATEMENT
|
||||
SELECT @@session.binlog_direct_non_transactional_updates;
|
||||
@@session.binlog_direct_non_transactional_updates
|
||||
1
|
||||
begin;
|
||||
# Test that the session variable 'binlog_format' is read-only
|
||||
# inside a transaction with no preceding updates.
|
||||
set @@session.binlog_format= mixed;
|
||||
ERROR HY000: Cannot modify @@session.binlog_format inside a transaction
|
||||
set @@session.binlog_direct_non_transactional_updates= FALSE;
|
||||
ERROR HY000: Cannot modify @@session.binlog_direct_non_transactional_updates inside a transaction
|
||||
insert into t2 values (1);
|
||||
# Test that the session variable 'binlog_format' is read-only
|
||||
# inside a transaction with preceding transactional updates.
|
||||
set @@session.binlog_format= row;
|
||||
ERROR HY000: Cannot modify @@session.binlog_format inside a transaction
|
||||
set @@session.binlog_direct_non_transactional_updates= FALSE;
|
||||
ERROR HY000: Cannot modify @@session.binlog_direct_non_transactional_updates inside a transaction
|
||||
commit;
|
||||
begin;
|
||||
insert into t1 values (2);
|
||||
@ -28,31 +37,47 @@ insert into t1 values (2);
|
||||
# inside a transaction with preceding non-transactional updates.
|
||||
set @@session.binlog_format= statement;
|
||||
ERROR HY000: Cannot modify @@session.binlog_format inside a transaction
|
||||
set @@session.binlog_direct_non_transactional_updates= FALSE;
|
||||
ERROR HY000: Cannot modify @@session.binlog_direct_non_transactional_updates inside a transaction
|
||||
commit;
|
||||
# Test that the session variable 'binlog_format' is writable
|
||||
# when AUTOCOMMIT=0, before a transaction has started.
|
||||
set AUTOCOMMIT=0;
|
||||
set @@session.binlog_format= row;
|
||||
set @@session.binlog_direct_non_transactional_updates= FALSE;
|
||||
SELECT @@session.binlog_format;
|
||||
@@session.binlog_format
|
||||
ROW
|
||||
SELECT @@session.binlog_direct_non_transactional_updates;
|
||||
@@session.binlog_direct_non_transactional_updates
|
||||
0
|
||||
insert into t1 values (4);
|
||||
# Test that the session variable 'binlog_format' is read-only inside an
|
||||
# AUTOCOMMIT=0 transaction with preceding non-transactional updates.
|
||||
set @@session.binlog_format= statement;
|
||||
ERROR HY000: Cannot modify @@session.binlog_format inside a transaction
|
||||
set @@session.binlog_direct_non_transactional_updates= TRUE;
|
||||
ERROR HY000: Cannot modify @@session.binlog_direct_non_transactional_updates inside a transaction
|
||||
SELECT @@session.binlog_format;
|
||||
@@session.binlog_format
|
||||
ROW
|
||||
SELECT @@session.binlog_direct_non_transactional_updates;
|
||||
@@session.binlog_direct_non_transactional_updates
|
||||
0
|
||||
commit;
|
||||
insert into t2 values (5);
|
||||
# Test that the session variable 'binlog_format' is read-only inside an
|
||||
# AUTOCOMMIT=0 transaction with preceding transactional updates.
|
||||
set @@session.binlog_format= row;
|
||||
ERROR HY000: Cannot modify @@session.binlog_format inside a transaction
|
||||
set @@session.binlog_direct_non_transactional_updates= TRUE;
|
||||
ERROR HY000: Cannot modify @@session.binlog_direct_non_transactional_updates inside a transaction
|
||||
SELECT @@session.binlog_format;
|
||||
@@session.binlog_format
|
||||
ROW
|
||||
SELECT @@session.binlog_direct_non_transactional_updates;
|
||||
@@session.binlog_direct_non_transactional_updates
|
||||
0
|
||||
commit;
|
||||
begin;
|
||||
insert into t2 values (6);
|
||||
@ -62,15 +87,20 @@ SELECT @@global.binlog_format;
|
||||
@@global.binlog_format
|
||||
ROW
|
||||
set @@global.binlog_format= statement;
|
||||
set @@global.binlog_direct_non_transactional_updates= TRUE;
|
||||
SELECT @@global.binlog_format;
|
||||
@@global.binlog_format
|
||||
STATEMENT
|
||||
SELECT @@global.binlog_direct_non_transactional_updates;
|
||||
@@global.binlog_direct_non_transactional_updates
|
||||
1
|
||||
commit;
|
||||
set @@global.binlog_format= @save_binlog_format;
|
||||
set @@global.binlog_direct_non_transactional_updates= @save_binlog_dirct;
|
||||
create table t3(a int, b int) engine= innodb;
|
||||
create table t4(a int) engine= innodb;
|
||||
create table t5(a int) engine= innodb;
|
||||
create trigger tr2 after insert on t3 for each row begin
|
||||
create trigger tr1 after insert on t3 for each row begin
|
||||
insert into t4(a) values(1);
|
||||
set @@session.binlog_format= statement;
|
||||
insert into t4(a) values(2);
|
||||
@ -83,8 +113,27 @@ ERROR HY000: Cannot change the binary logging format inside a stored function or
|
||||
SELECT @@session.binlog_format;
|
||||
@@session.binlog_format
|
||||
ROW
|
||||
create table t6(a int, b int) engine= innodb;
|
||||
create table t7(a int) engine= innodb;
|
||||
create table t8(a int) engine= innodb;
|
||||
create trigger tr2 after insert on t6 for each row begin
|
||||
insert into t7(a) values(1);
|
||||
set @@global.binlog_direct_non_transactional_updates= FALSE;
|
||||
insert into t7(a) values(2);
|
||||
insert into t8(a) values(3);
|
||||
end |
|
||||
# Test that the session variable 'binlog_format' is read-only
|
||||
# in sub-statements.
|
||||
insert into t6(a,b) values(1,1);
|
||||
ERROR HY000: Cannot change the binlog direct flag inside a stored function or trigger
|
||||
SELECT @@session.binlog_direct_non_transactional_updates;
|
||||
@@session.binlog_direct_non_transactional_updates
|
||||
0
|
||||
drop table t1;
|
||||
drop table t2;
|
||||
drop table t3;
|
||||
drop table t4;
|
||||
drop table t5;
|
||||
drop table t6;
|
||||
drop table t7;
|
||||
drop table t8;
|
@ -1,156 +0,0 @@
|
||||
RESET MASTER;
|
||||
DROP TABLE IF EXISTS `t1`;
|
||||
CREATE TABLE `t1` (
|
||||
`c1` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`c2` varchar(30) NOT NULL,
|
||||
`c3` varchar(30) DEFAULT NULL,
|
||||
`c4` varchar(30) DEFAULT NULL,
|
||||
`c5` varchar(30) DEFAULT NULL,
|
||||
`c6` varchar(30) DEFAULT NULL,
|
||||
`c7` varchar(30) DEFAULT NULL,
|
||||
`c8` varchar(30) DEFAULT NULL,
|
||||
`c9` varchar(30) DEFAULT NULL,
|
||||
`c10` varchar(30) DEFAULT NULL,
|
||||
`c11` varchar(30) DEFAULT NULL,
|
||||
`c12` varchar(30) DEFAULT NULL,
|
||||
`c13` varchar(30) DEFAULT NULL,
|
||||
`c14` varchar(30) DEFAULT NULL,
|
||||
`c15` varchar(30) DEFAULT NULL,
|
||||
`c16` varchar(30) DEFAULT NULL,
|
||||
`c17` varchar(30) DEFAULT NULL,
|
||||
`c18` varchar(30) DEFAULT NULL,
|
||||
`c19` varchar(30) DEFAULT NULL,
|
||||
`c20` varchar(30) DEFAULT NULL,
|
||||
`c21` varchar(30) DEFAULT NULL,
|
||||
`c22` varchar(30) DEFAULT NULL,
|
||||
`c23` varchar(30) DEFAULT NULL,
|
||||
`c24` varchar(30) DEFAULT NULL,
|
||||
`c25` varchar(30) DEFAULT NULL,
|
||||
`c26` varchar(30) DEFAULT NULL,
|
||||
`c27` varchar(30) DEFAULT NULL,
|
||||
`c28` varchar(30) DEFAULT NULL,
|
||||
`c29` varchar(30) DEFAULT NULL,
|
||||
`c30` varchar(30) DEFAULT NULL,
|
||||
`c31` varchar(30) DEFAULT NULL,
|
||||
`c32` varchar(30) DEFAULT NULL,
|
||||
`c33` varchar(30) DEFAULT NULL,
|
||||
`c34` varchar(30) DEFAULT NULL,
|
||||
`c35` varchar(30) DEFAULT NULL,
|
||||
`c36` varchar(30) DEFAULT NULL,
|
||||
`c37` varchar(30) DEFAULT NULL,
|
||||
`c38` varchar(30) DEFAULT NULL,
|
||||
`c39` varchar(30) DEFAULT NULL,
|
||||
`c40` varchar(30) DEFAULT NULL,
|
||||
`c41` varchar(30) DEFAULT NULL,
|
||||
`c42` varchar(30) DEFAULT NULL,
|
||||
`c43` varchar(30) DEFAULT NULL,
|
||||
`c44` varchar(30) DEFAULT NULL,
|
||||
`c45` varchar(30) DEFAULT NULL,
|
||||
`c46` varchar(30) DEFAULT NULL,
|
||||
`c47` varchar(30) DEFAULT NULL,
|
||||
`c48` varchar(30) DEFAULT NULL,
|
||||
`c49` varchar(30) DEFAULT NULL,
|
||||
`c50` varchar(30) DEFAULT NULL,
|
||||
`c51` varchar(30) DEFAULT NULL,
|
||||
`c52` varchar(30) DEFAULT NULL,
|
||||
`c53` varchar(30) DEFAULT NULL,
|
||||
`c54` varchar(30) DEFAULT NULL,
|
||||
`c55` varchar(30) DEFAULT NULL,
|
||||
`c56` varchar(30) DEFAULT NULL,
|
||||
`c57` varchar(30) DEFAULT NULL,
|
||||
`c58` varchar(30) DEFAULT NULL,
|
||||
`c59` varchar(30) DEFAULT NULL,
|
||||
`c60` varchar(30) DEFAULT NULL,
|
||||
`c61` varchar(30) DEFAULT NULL,
|
||||
`c62` varchar(30) DEFAULT NULL,
|
||||
`c63` varchar(30) DEFAULT NULL,
|
||||
`c64` varchar(30) DEFAULT NULL,
|
||||
`c65` varchar(30) DEFAULT NULL,
|
||||
`c66` varchar(30) DEFAULT NULL,
|
||||
`c67` varchar(30) DEFAULT NULL,
|
||||
`c68` varchar(30) DEFAULT NULL,
|
||||
`c69` varchar(30) DEFAULT NULL,
|
||||
`c70` varchar(30) DEFAULT NULL,
|
||||
`c71` varchar(30) DEFAULT NULL,
|
||||
`c72` varchar(30) DEFAULT NULL,
|
||||
`c73` varchar(30) DEFAULT NULL,
|
||||
`c74` varchar(30) DEFAULT NULL,
|
||||
`c75` varchar(30) DEFAULT NULL,
|
||||
`c76` varchar(30) DEFAULT NULL,
|
||||
`c77` varchar(30) DEFAULT NULL,
|
||||
`c78` varchar(30) DEFAULT NULL,
|
||||
`c79` varchar(30) DEFAULT NULL,
|
||||
`c80` varchar(30) DEFAULT NULL,
|
||||
`c81` varchar(30) DEFAULT NULL,
|
||||
`c82` varchar(30) DEFAULT NULL,
|
||||
`c83` varchar(30) DEFAULT NULL,
|
||||
`c84` varchar(30) DEFAULT NULL,
|
||||
`c85` varchar(30) DEFAULT NULL,
|
||||
`c86` varchar(30) DEFAULT NULL,
|
||||
`c87` varchar(30) DEFAULT NULL,
|
||||
`c88` varchar(30) DEFAULT NULL,
|
||||
`c89` varchar(30) DEFAULT NULL,
|
||||
`c90` varchar(30) DEFAULT NULL,
|
||||
`c91` varchar(30) DEFAULT NULL,
|
||||
`c92` varchar(30) DEFAULT NULL,
|
||||
`c93` varchar(30) DEFAULT NULL,
|
||||
`c94` varchar(30) DEFAULT NULL,
|
||||
`c95` varchar(30) DEFAULT NULL,
|
||||
`c96` varchar(30) DEFAULT NULL,
|
||||
`c97` varchar(30) DEFAULT NULL,
|
||||
`c98` varchar(30) DEFAULT NULL,
|
||||
`c99` varchar(30) DEFAULT NULL,
|
||||
`c100` varchar(30) DEFAULT NULL,
|
||||
`c101` varchar(30) DEFAULT NULL,
|
||||
`c102` varchar(30) DEFAULT NULL,
|
||||
`c103` varchar(30) DEFAULT NULL,
|
||||
`c104` varchar(30) DEFAULT NULL,
|
||||
`c105` varchar(30) DEFAULT NULL,
|
||||
`c106` varchar(30) DEFAULT NULL,
|
||||
`c107` varchar(30) DEFAULT NULL,
|
||||
`c108` varchar(30) DEFAULT NULL,
|
||||
`c109` varchar(30) DEFAULT NULL,
|
||||
`c110` varchar(30) DEFAULT NULL,
|
||||
`c111` varchar(30) DEFAULT NULL,
|
||||
`c112` varchar(30) DEFAULT NULL,
|
||||
`c113` varchar(30) DEFAULT NULL,
|
||||
`c114` varchar(30) DEFAULT NULL,
|
||||
`c115` varchar(30) DEFAULT NULL,
|
||||
`c116` varchar(30) DEFAULT NULL,
|
||||
`c117` varchar(30) DEFAULT NULL,
|
||||
`c118` varchar(30) DEFAULT NULL,
|
||||
`c119` varchar(30) DEFAULT NULL,
|
||||
`c120` varchar(30) DEFAULT NULL,
|
||||
`c121` varchar(30) DEFAULT NULL,
|
||||
`c122` varchar(30) DEFAULT NULL,
|
||||
`c123` varchar(30) DEFAULT NULL,
|
||||
`c124` varchar(30) DEFAULT NULL,
|
||||
`c125` varchar(30) DEFAULT NULL,
|
||||
`c126` varchar(30) DEFAULT NULL,
|
||||
`c127` varchar(30) DEFAULT NULL,
|
||||
`c128` varchar(30) DEFAULT NULL,
|
||||
`c129` varchar(30) DEFAULT NULL,
|
||||
`c130` varchar(30) DEFAULT NULL,
|
||||
`c131` varchar(30) DEFAULT NULL,
|
||||
`c132` varchar(30) DEFAULT NULL,
|
||||
`c133` varchar(30) DEFAULT NULL,
|
||||
`c134` varchar(30) DEFAULT NULL,
|
||||
`c135` varchar(30) DEFAULT NULL,
|
||||
`c136` varchar(30) DEFAULT NULL,
|
||||
`c137` varchar(30) DEFAULT NULL,
|
||||
`c138` varchar(30) DEFAULT NULL,
|
||||
`c139` varchar(30) DEFAULT NULL,
|
||||
`c140` varchar(30) DEFAULT NULL,
|
||||
`c141` varchar(30) DEFAULT NULL,
|
||||
`c142` varchar(30) DEFAULT NULL,
|
||||
`c143` varchar(30) DEFAULT NULL,
|
||||
`c144` varchar(30) DEFAULT NULL,
|
||||
`c145` varchar(30) DEFAULT NULL,
|
||||
`c146` varchar(30) DEFAULT NULL,
|
||||
PRIMARY KEY (`c1`)
|
||||
) ENGINE=InnoDB;
|
||||
LOCK TABLES `t1` WRITE;
|
||||
INSERT INTO `t1` VALUES ('1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1');
|
||||
DROP TABLE `t1`;
|
||||
FLUSH LOGS;
|
||||
=== Using mysqlbinlog to detect failure. Before the patch mysqlbinlog would find a corrupted event, thence would fail.
|
@ -3240,7 +3240,10 @@ Warnings:
|
||||
Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave.
|
||||
INSERT INTO t1 VALUES (VERSION());
|
||||
Warnings:
|
||||
Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave.
|
||||
Note 1592 Statement may not be safe to log in statement format.
|
||||
INSERT INTO t1 VALUES (RAND());
|
||||
Warnings:
|
||||
Note 1592 Statement may not be safe to log in statement format.
|
||||
DELETE FROM t1;
|
||||
SET TIMESTAMP=1000000;
|
||||
INSERT INTO t1 VALUES
|
||||
|
@ -1 +1 @@
|
||||
--innodb_lock_wait_timeout=2
|
||||
--innodb_lock_wait_timeout=2 --binlog-direct-non-transactional-updates=FALSE
|
||||
|
@ -8,6 +8,7 @@ source include/have_innodb.inc;
|
||||
source include/have_binlog_format_row.inc;
|
||||
|
||||
set @save_binlog_format= @@global.binlog_format;
|
||||
set @save_binlog_dirct= @@global.binlog_direct_non_transactional_updates;
|
||||
create table t1 (a int) engine= myisam;
|
||||
create table t2 (a int) engine= innodb;
|
||||
|
||||
@ -16,19 +17,25 @@ SET AUTOCOMMIT=1;
|
||||
--echo # Test that the session variable 'binlog_format'
|
||||
--echo # is writable outside a transaction.
|
||||
set @@session.binlog_format= statement;
|
||||
set @@session.binlog_direct_non_transactional_updates= TRUE;
|
||||
SELECT @@session.binlog_format;
|
||||
SELECT @@session.binlog_direct_non_transactional_updates;
|
||||
|
||||
begin;
|
||||
--echo # Test that the session variable 'binlog_format' is read-only
|
||||
--echo # inside a transaction with no preceding updates.
|
||||
--error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_FORMAT
|
||||
set @@session.binlog_format= mixed;
|
||||
--error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_DIRECT
|
||||
set @@session.binlog_direct_non_transactional_updates= FALSE;
|
||||
|
||||
insert into t2 values (1);
|
||||
--echo # Test that the session variable 'binlog_format' is read-only
|
||||
--echo # inside a transaction with preceding transactional updates.
|
||||
--error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_FORMAT
|
||||
set @@session.binlog_format= row;
|
||||
--error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_DIRECT
|
||||
set @@session.binlog_direct_non_transactional_updates= FALSE;
|
||||
commit;
|
||||
|
||||
begin;
|
||||
@ -37,20 +44,27 @@ begin;
|
||||
--echo # inside a transaction with preceding non-transactional updates.
|
||||
--error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_FORMAT
|
||||
set @@session.binlog_format= statement;
|
||||
--error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_DIRECT
|
||||
set @@session.binlog_direct_non_transactional_updates= FALSE;
|
||||
commit;
|
||||
|
||||
--echo # Test that the session variable 'binlog_format' is writable
|
||||
--echo # when AUTOCOMMIT=0, before a transaction has started.
|
||||
set AUTOCOMMIT=0;
|
||||
set @@session.binlog_format= row;
|
||||
set @@session.binlog_direct_non_transactional_updates= FALSE;
|
||||
SELECT @@session.binlog_format;
|
||||
SELECT @@session.binlog_direct_non_transactional_updates;
|
||||
|
||||
insert into t1 values (4);
|
||||
--echo # Test that the session variable 'binlog_format' is read-only inside an
|
||||
--echo # AUTOCOMMIT=0 transaction with preceding non-transactional updates.
|
||||
--error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_FORMAT
|
||||
set @@session.binlog_format= statement;
|
||||
--error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_DIRECT
|
||||
set @@session.binlog_direct_non_transactional_updates= TRUE;
|
||||
SELECT @@session.binlog_format;
|
||||
SELECT @@session.binlog_direct_non_transactional_updates;
|
||||
commit;
|
||||
|
||||
insert into t2 values (5);
|
||||
@ -58,7 +72,10 @@ insert into t2 values (5);
|
||||
--echo # AUTOCOMMIT=0 transaction with preceding transactional updates.
|
||||
--error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_FORMAT
|
||||
set @@session.binlog_format= row;
|
||||
--error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_DIRECT
|
||||
set @@session.binlog_direct_non_transactional_updates= TRUE;
|
||||
SELECT @@session.binlog_format;
|
||||
SELECT @@session.binlog_direct_non_transactional_updates;
|
||||
commit;
|
||||
|
||||
begin;
|
||||
@ -67,16 +84,19 @@ begin;
|
||||
--echo # inside a transaction.
|
||||
SELECT @@global.binlog_format;
|
||||
set @@global.binlog_format= statement;
|
||||
set @@global.binlog_direct_non_transactional_updates= TRUE;
|
||||
SELECT @@global.binlog_format;
|
||||
SELECT @@global.binlog_direct_non_transactional_updates;
|
||||
commit;
|
||||
|
||||
set @@global.binlog_format= @save_binlog_format;
|
||||
set @@global.binlog_direct_non_transactional_updates= @save_binlog_dirct;
|
||||
|
||||
create table t3(a int, b int) engine= innodb;
|
||||
create table t4(a int) engine= innodb;
|
||||
create table t5(a int) engine= innodb;
|
||||
delimiter |;
|
||||
eval create trigger tr2 after insert on t3 for each row begin
|
||||
eval create trigger tr1 after insert on t3 for each row begin
|
||||
insert into t4(a) values(1);
|
||||
set @@session.binlog_format= statement;
|
||||
insert into t4(a) values(2);
|
||||
@ -90,9 +110,29 @@ delimiter ;|
|
||||
insert into t3(a,b) values(1,1);
|
||||
SELECT @@session.binlog_format;
|
||||
|
||||
create table t6(a int, b int) engine= innodb;
|
||||
create table t7(a int) engine= innodb;
|
||||
create table t8(a int) engine= innodb;
|
||||
delimiter |;
|
||||
eval create trigger tr2 after insert on t6 for each row begin
|
||||
insert into t7(a) values(1);
|
||||
set @@global.binlog_direct_non_transactional_updates= FALSE;
|
||||
insert into t7(a) values(2);
|
||||
insert into t8(a) values(3);
|
||||
end |
|
||||
delimiter ;|
|
||||
|
||||
--echo # Test that the session variable 'binlog_format' is read-only
|
||||
--echo # in sub-statements.
|
||||
--error ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_DIRECT
|
||||
insert into t6(a,b) values(1,1);
|
||||
SELECT @@session.binlog_direct_non_transactional_updates;
|
||||
|
||||
drop table t1;
|
||||
drop table t2;
|
||||
drop table t3;
|
||||
drop table t4;
|
||||
drop table t5;
|
||||
|
||||
drop table t6;
|
||||
drop table t7;
|
||||
drop table t8;
|
@ -1,199 +0,0 @@
|
||||
#
|
||||
# BUG#42749: infinite loop writing to row based binlog - processlist shows
|
||||
# "freeing items"
|
||||
#
|
||||
# WHY
|
||||
# ===
|
||||
#
|
||||
# This bug would make table map event to report data_written one byte less
|
||||
# than what would actually be written in its body. This would cause one byte shorter
|
||||
# event end_log_pos. The ultimate impact was that it would make fixing the
|
||||
# position in MYSQL_BIN_LOG::write_cache bogus or end up in an infinite loop.
|
||||
#
|
||||
# HOW
|
||||
# ===
|
||||
#
|
||||
# Checking that the patch fixes the problem is done as follows:
|
||||
# i) a table with several fields is created;
|
||||
# ii) an insert is performed;
|
||||
# iii) the logs are flushed;
|
||||
# iv) mysqlbinlog is used to check if it succeeds.
|
||||
#
|
||||
# In step iv), before the bug was fixed, the test case would fail with
|
||||
# mysqlbinlog reporting that it was unable to succeed in reading the event.
|
||||
#
|
||||
|
||||
-- source include/have_log_bin.inc
|
||||
-- source include/have_innodb.inc
|
||||
-- source include/have_binlog_format_row.inc
|
||||
-- connection default
|
||||
|
||||
RESET MASTER;
|
||||
|
||||
-- disable_warnings
|
||||
DROP TABLE IF EXISTS `t1`;
|
||||
-- enable_warnings
|
||||
|
||||
CREATE TABLE `t1` (
|
||||
`c1` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`c2` varchar(30) NOT NULL,
|
||||
`c3` varchar(30) DEFAULT NULL,
|
||||
`c4` varchar(30) DEFAULT NULL,
|
||||
`c5` varchar(30) DEFAULT NULL,
|
||||
`c6` varchar(30) DEFAULT NULL,
|
||||
`c7` varchar(30) DEFAULT NULL,
|
||||
`c8` varchar(30) DEFAULT NULL,
|
||||
`c9` varchar(30) DEFAULT NULL,
|
||||
`c10` varchar(30) DEFAULT NULL,
|
||||
`c11` varchar(30) DEFAULT NULL,
|
||||
`c12` varchar(30) DEFAULT NULL,
|
||||
`c13` varchar(30) DEFAULT NULL,
|
||||
`c14` varchar(30) DEFAULT NULL,
|
||||
`c15` varchar(30) DEFAULT NULL,
|
||||
`c16` varchar(30) DEFAULT NULL,
|
||||
`c17` varchar(30) DEFAULT NULL,
|
||||
`c18` varchar(30) DEFAULT NULL,
|
||||
`c19` varchar(30) DEFAULT NULL,
|
||||
`c20` varchar(30) DEFAULT NULL,
|
||||
`c21` varchar(30) DEFAULT NULL,
|
||||
`c22` varchar(30) DEFAULT NULL,
|
||||
`c23` varchar(30) DEFAULT NULL,
|
||||
`c24` varchar(30) DEFAULT NULL,
|
||||
`c25` varchar(30) DEFAULT NULL,
|
||||
`c26` varchar(30) DEFAULT NULL,
|
||||
`c27` varchar(30) DEFAULT NULL,
|
||||
`c28` varchar(30) DEFAULT NULL,
|
||||
`c29` varchar(30) DEFAULT NULL,
|
||||
`c30` varchar(30) DEFAULT NULL,
|
||||
`c31` varchar(30) DEFAULT NULL,
|
||||
`c32` varchar(30) DEFAULT NULL,
|
||||
`c33` varchar(30) DEFAULT NULL,
|
||||
`c34` varchar(30) DEFAULT NULL,
|
||||
`c35` varchar(30) DEFAULT NULL,
|
||||
`c36` varchar(30) DEFAULT NULL,
|
||||
`c37` varchar(30) DEFAULT NULL,
|
||||
`c38` varchar(30) DEFAULT NULL,
|
||||
`c39` varchar(30) DEFAULT NULL,
|
||||
`c40` varchar(30) DEFAULT NULL,
|
||||
`c41` varchar(30) DEFAULT NULL,
|
||||
`c42` varchar(30) DEFAULT NULL,
|
||||
`c43` varchar(30) DEFAULT NULL,
|
||||
`c44` varchar(30) DEFAULT NULL,
|
||||
`c45` varchar(30) DEFAULT NULL,
|
||||
`c46` varchar(30) DEFAULT NULL,
|
||||
`c47` varchar(30) DEFAULT NULL,
|
||||
`c48` varchar(30) DEFAULT NULL,
|
||||
`c49` varchar(30) DEFAULT NULL,
|
||||
`c50` varchar(30) DEFAULT NULL,
|
||||
`c51` varchar(30) DEFAULT NULL,
|
||||
`c52` varchar(30) DEFAULT NULL,
|
||||
`c53` varchar(30) DEFAULT NULL,
|
||||
`c54` varchar(30) DEFAULT NULL,
|
||||
`c55` varchar(30) DEFAULT NULL,
|
||||
`c56` varchar(30) DEFAULT NULL,
|
||||
`c57` varchar(30) DEFAULT NULL,
|
||||
`c58` varchar(30) DEFAULT NULL,
|
||||
`c59` varchar(30) DEFAULT NULL,
|
||||
`c60` varchar(30) DEFAULT NULL,
|
||||
`c61` varchar(30) DEFAULT NULL,
|
||||
`c62` varchar(30) DEFAULT NULL,
|
||||
`c63` varchar(30) DEFAULT NULL,
|
||||
`c64` varchar(30) DEFAULT NULL,
|
||||
`c65` varchar(30) DEFAULT NULL,
|
||||
`c66` varchar(30) DEFAULT NULL,
|
||||
`c67` varchar(30) DEFAULT NULL,
|
||||
`c68` varchar(30) DEFAULT NULL,
|
||||
`c69` varchar(30) DEFAULT NULL,
|
||||
`c70` varchar(30) DEFAULT NULL,
|
||||
`c71` varchar(30) DEFAULT NULL,
|
||||
`c72` varchar(30) DEFAULT NULL,
|
||||
`c73` varchar(30) DEFAULT NULL,
|
||||
`c74` varchar(30) DEFAULT NULL,
|
||||
`c75` varchar(30) DEFAULT NULL,
|
||||
`c76` varchar(30) DEFAULT NULL,
|
||||
`c77` varchar(30) DEFAULT NULL,
|
||||
`c78` varchar(30) DEFAULT NULL,
|
||||
`c79` varchar(30) DEFAULT NULL,
|
||||
`c80` varchar(30) DEFAULT NULL,
|
||||
`c81` varchar(30) DEFAULT NULL,
|
||||
`c82` varchar(30) DEFAULT NULL,
|
||||
`c83` varchar(30) DEFAULT NULL,
|
||||
`c84` varchar(30) DEFAULT NULL,
|
||||
`c85` varchar(30) DEFAULT NULL,
|
||||
`c86` varchar(30) DEFAULT NULL,
|
||||
`c87` varchar(30) DEFAULT NULL,
|
||||
`c88` varchar(30) DEFAULT NULL,
|
||||
`c89` varchar(30) DEFAULT NULL,
|
||||
`c90` varchar(30) DEFAULT NULL,
|
||||
`c91` varchar(30) DEFAULT NULL,
|
||||
`c92` varchar(30) DEFAULT NULL,
|
||||
`c93` varchar(30) DEFAULT NULL,
|
||||
`c94` varchar(30) DEFAULT NULL,
|
||||
`c95` varchar(30) DEFAULT NULL,
|
||||
`c96` varchar(30) DEFAULT NULL,
|
||||
`c97` varchar(30) DEFAULT NULL,
|
||||
`c98` varchar(30) DEFAULT NULL,
|
||||
`c99` varchar(30) DEFAULT NULL,
|
||||
`c100` varchar(30) DEFAULT NULL,
|
||||
`c101` varchar(30) DEFAULT NULL,
|
||||
`c102` varchar(30) DEFAULT NULL,
|
||||
`c103` varchar(30) DEFAULT NULL,
|
||||
`c104` varchar(30) DEFAULT NULL,
|
||||
`c105` varchar(30) DEFAULT NULL,
|
||||
`c106` varchar(30) DEFAULT NULL,
|
||||
`c107` varchar(30) DEFAULT NULL,
|
||||
`c108` varchar(30) DEFAULT NULL,
|
||||
`c109` varchar(30) DEFAULT NULL,
|
||||
`c110` varchar(30) DEFAULT NULL,
|
||||
`c111` varchar(30) DEFAULT NULL,
|
||||
`c112` varchar(30) DEFAULT NULL,
|
||||
`c113` varchar(30) DEFAULT NULL,
|
||||
`c114` varchar(30) DEFAULT NULL,
|
||||
`c115` varchar(30) DEFAULT NULL,
|
||||
`c116` varchar(30) DEFAULT NULL,
|
||||
`c117` varchar(30) DEFAULT NULL,
|
||||
`c118` varchar(30) DEFAULT NULL,
|
||||
`c119` varchar(30) DEFAULT NULL,
|
||||
`c120` varchar(30) DEFAULT NULL,
|
||||
`c121` varchar(30) DEFAULT NULL,
|
||||
`c122` varchar(30) DEFAULT NULL,
|
||||
`c123` varchar(30) DEFAULT NULL,
|
||||
`c124` varchar(30) DEFAULT NULL,
|
||||
`c125` varchar(30) DEFAULT NULL,
|
||||
`c126` varchar(30) DEFAULT NULL,
|
||||
`c127` varchar(30) DEFAULT NULL,
|
||||
`c128` varchar(30) DEFAULT NULL,
|
||||
`c129` varchar(30) DEFAULT NULL,
|
||||
`c130` varchar(30) DEFAULT NULL,
|
||||
`c131` varchar(30) DEFAULT NULL,
|
||||
`c132` varchar(30) DEFAULT NULL,
|
||||
`c133` varchar(30) DEFAULT NULL,
|
||||
`c134` varchar(30) DEFAULT NULL,
|
||||
`c135` varchar(30) DEFAULT NULL,
|
||||
`c136` varchar(30) DEFAULT NULL,
|
||||
`c137` varchar(30) DEFAULT NULL,
|
||||
`c138` varchar(30) DEFAULT NULL,
|
||||
`c139` varchar(30) DEFAULT NULL,
|
||||
`c140` varchar(30) DEFAULT NULL,
|
||||
`c141` varchar(30) DEFAULT NULL,
|
||||
`c142` varchar(30) DEFAULT NULL,
|
||||
`c143` varchar(30) DEFAULT NULL,
|
||||
`c144` varchar(30) DEFAULT NULL,
|
||||
`c145` varchar(30) DEFAULT NULL,
|
||||
`c146` varchar(30) DEFAULT NULL,
|
||||
PRIMARY KEY (`c1`)
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
LOCK TABLES `t1` WRITE;
|
||||
|
||||
INSERT INTO `t1` VALUES ('1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1');
|
||||
|
||||
DROP TABLE `t1`;
|
||||
|
||||
FLUSH LOGS;
|
||||
|
||||
-- echo === Using mysqlbinlog to detect failure. Before the patch mysqlbinlog would find a corrupted event, thence would fail.
|
||||
|
||||
-- let $MYSQLD_DATADIR= `SELECT @@datadir`;
|
||||
-- exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mysqlbinlog_bug42749.binlog
|
||||
-- remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog_bug42749.binlog
|
@ -77,7 +77,8 @@
|
||||
# BUG#42640: mysqld crashes when unsafe statements are executed (STRICT_TRANS_TABLES mode)
|
||||
# BUG#45825: INSERT DELAYED is not unsafe: logged in statement format
|
||||
# BUG#45785: LIMIT in SP does not cause RBL if binlog_format=MIXED
|
||||
#
|
||||
# BUG#47995: Mark user functions as unsafe
|
||||
# BUG#49222: Mare RAND() unsafe
|
||||
#
|
||||
# ==== Related test cases ====
|
||||
#
|
||||
@ -646,6 +647,7 @@ DROP TABLE t1,t2,t3;
|
||||
|
||||
#
|
||||
# BUG#47995: Mark user functions as unsafe
|
||||
# BUG#49222: Mare RAND() unsafe
|
||||
#
|
||||
# Test that the system functions that are supposed to be marked unsafe
|
||||
# generate a warning. Each INSERT statement below should generate a
|
||||
@ -656,27 +658,28 @@ SET SESSION binlog_format = STATEMENT;
|
||||
CREATE TABLE t1 (a VARCHAR(1000));
|
||||
INSERT INTO t1 VALUES (CURRENT_USER()); #marked unsafe before BUG#47995
|
||||
INSERT INTO t1 VALUES (FOUND_ROWS()); #marked unsafe before BUG#47995
|
||||
INSERT INTO t1 VALUES (GET_LOCK('tmp', 1));
|
||||
INSERT INTO t1 VALUES (IS_FREE_LOCK('tmp'));
|
||||
INSERT INTO t1 VALUES (IS_USED_LOCK('tmp'));
|
||||
INSERT INTO t1 VALUES (LOAD_FILE('../../std_data/words2.dat')); #marked unsafe before BUG#47995
|
||||
INSERT INTO t1 VALUES (GET_LOCK('tmp', 1)); #marked unsafe in BUG#47995
|
||||
INSERT INTO t1 VALUES (IS_FREE_LOCK('tmp')); #marked unsafe in BUG#47995
|
||||
INSERT INTO t1 VALUES (IS_USED_LOCK('tmp')); #marked unsafe in BUG#47995
|
||||
INSERT INTO t1 VALUES (LOAD_FILE('../../std_data/words2.dat')); #marked unsafe in BUG#39701
|
||||
INSERT INTO t1 VALUES (MASTER_POS_WAIT('dummy arg', 4711, 1));
|
||||
INSERT INTO t1 VALUES (RELEASE_LOCK('tmp'));
|
||||
INSERT INTO t1 VALUES (RELEASE_LOCK('tmp')); #marked unsafe in BUG#47995
|
||||
INSERT INTO t1 VALUES (ROW_COUNT()); #marked unsafe before BUG#47995
|
||||
INSERT INTO t1 VALUES (SESSION_USER()); #marked unsafe before BUG#47995
|
||||
INSERT INTO t1 VALUES (SLEEP(1));
|
||||
INSERT INTO t1 VALUES (SYSDATE());
|
||||
INSERT INTO t1 VALUES (SLEEP(1)); #marked unsafe in BUG#47995
|
||||
INSERT INTO t1 VALUES (SYSDATE()); #marked unsafe in BUG#47995
|
||||
INSERT INTO t1 VALUES (SYSTEM_USER()); #marked unsafe before BUG#47995
|
||||
INSERT INTO t1 VALUES (USER()); #marked unsafe before BUG#47995
|
||||
INSERT INTO t1 VALUES (UUID()); #marked unsafe before BUG#47995
|
||||
INSERT INTO t1 VALUES (UUID_SHORT()); #marked unsafe before BUG#47995
|
||||
INSERT INTO t1 VALUES (VERSION());
|
||||
INSERT INTO t1 VALUES (VERSION()); #marked unsafe in BUG#47995
|
||||
INSERT INTO t1 VALUES (RAND()); #marked unsafe in BUG#49222
|
||||
DELETE FROM t1;
|
||||
|
||||
# Since we replicate the TIMESTAMP variable, functions affected by the
|
||||
# TIMESTAMP variable are safe to replicate. So we check that the
|
||||
# following following functions depend on the TIMESTAMP variable and
|
||||
# don't generate a warning.
|
||||
# following following functions that depend on the TIMESTAMP variable
|
||||
# are not unsafe and don't generate a warning.
|
||||
|
||||
SET TIMESTAMP=1000000;
|
||||
INSERT INTO t1 VALUES
|
||||
|
Reference in New Issue
Block a user