mirror of
https://github.com/MariaDB/server.git
synced 2025-01-22 23:04:20 +01:00
0ffd1be87d
More adaptions to make it work with existing code base.
224 lines
10 KiB
Text
224 lines
10 KiB
Text
stop slave;
|
|
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
|
reset master;
|
|
reset slave;
|
|
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
|
start slave;
|
|
drop database if exists mysqltest1;
|
|
create database mysqltest1;
|
|
use mysqltest1;
|
|
show global variables like "binlog_format%";
|
|
Variable_name Value
|
|
binlog_format ROW
|
|
show session variables like "binlog_format%";
|
|
Variable_name Value
|
|
binlog_format ROW
|
|
select @@global.binlog_format, @@session.binlog_format;
|
|
@@global.binlog_format @@session.binlog_format
|
|
ROW ROW
|
|
CREATE TABLE t1 (a varchar(100));
|
|
prepare stmt1 from 'insert into t1 select concat(UUID(),?)';
|
|
set @string="emergency";
|
|
insert into t1 values("work");
|
|
execute stmt1 using @string;
|
|
deallocate prepare stmt1;
|
|
prepare stmt1 from 'insert into t1 select ?';
|
|
insert into t1 values(concat(UUID(),"work"));
|
|
execute stmt1 using @string;
|
|
deallocate prepare stmt1;
|
|
insert into t1 values(concat("for",UUID()));
|
|
insert into t1 select "yesterday";
|
|
create temporary table tmp(a char(3));
|
|
insert into tmp values("see");
|
|
set binlog_format=statement;
|
|
ERROR HY000: Cannot switch out of the row-based binary log format when the session has open temporary tables
|
|
insert into t1 select * from tmp;
|
|
drop temporary table tmp;
|
|
set binlog_format=statement;
|
|
show global variables like "binlog_format%";
|
|
Variable_name Value
|
|
binlog_format ROW
|
|
show session variables like "binlog_format%";
|
|
Variable_name Value
|
|
binlog_format STATEMENT
|
|
select @@global.binlog_format, @@session.binlog_format;
|
|
@@global.binlog_format @@session.binlog_format
|
|
ROW STATEMENT
|
|
set global binlog_format=statement;
|
|
show global variables like "binlog_format%";
|
|
Variable_name Value
|
|
binlog_format STATEMENT
|
|
show session variables like "binlog_format%";
|
|
Variable_name Value
|
|
binlog_format STATEMENT
|
|
select @@global.binlog_format, @@session.binlog_format;
|
|
@@global.binlog_format @@session.binlog_format
|
|
STATEMENT STATEMENT
|
|
prepare stmt1 from 'insert into t1 select ?';
|
|
set @string="emergency";
|
|
insert into t1 values("work");
|
|
execute stmt1 using @string;
|
|
deallocate prepare stmt1;
|
|
prepare stmt1 from 'insert into t1 select ?';
|
|
insert into t1 values("work");
|
|
execute stmt1 using @string;
|
|
deallocate prepare stmt1;
|
|
insert into t1 values("for");
|
|
insert into t1 select "yesterday";
|
|
set binlog_format=default;
|
|
select @@global.binlog_format, @@session.binlog_format;
|
|
@@global.binlog_format @@session.binlog_format
|
|
STATEMENT STATEMENT
|
|
set global binlog_format=default;
|
|
ERROR 42000: Variable 'binlog_format' doesn't have a default value
|
|
select @@global.binlog_format, @@session.binlog_format;
|
|
@@global.binlog_format @@session.binlog_format
|
|
STATEMENT STATEMENT
|
|
prepare stmt1 from 'insert into t1 select ?';
|
|
set @string="emergency";
|
|
insert into t1 values("work");
|
|
execute stmt1 using @string;
|
|
deallocate prepare stmt1;
|
|
prepare stmt1 from 'insert into t1 select ?';
|
|
insert into t1 values("work");
|
|
execute stmt1 using @string;
|
|
deallocate prepare stmt1;
|
|
insert into t1 values("for");
|
|
insert into t1 select "yesterday";
|
|
set binlog_format=mixed;
|
|
select @@global.binlog_format, @@session.binlog_format;
|
|
@@global.binlog_format @@session.binlog_format
|
|
STATEMENT MIXED
|
|
set global binlog_format=mixed;
|
|
select @@global.binlog_format, @@session.binlog_format;
|
|
@@global.binlog_format @@session.binlog_format
|
|
MIXED MIXED
|
|
prepare stmt1 from 'insert into t1 select concat(UUID(),?)';
|
|
set @string="emergency";
|
|
insert into t1 values("work");
|
|
execute stmt1 using @string;
|
|
deallocate prepare stmt1;
|
|
prepare stmt1 from 'insert into t1 select ?';
|
|
insert into t1 values(concat(UUID(),"work"));
|
|
execute stmt1 using @string;
|
|
deallocate prepare stmt1;
|
|
insert into t1 values(concat("for",UUID()));
|
|
insert into t1 select "yesterday";
|
|
prepare stmt1 from 'insert into t1 select ?';
|
|
insert into t1 values(concat(UUID(),"work"));
|
|
execute stmt1 using @string;
|
|
deallocate prepare stmt1;
|
|
insert into t1 values(concat("for",UUID()));
|
|
insert into t1 select "yesterday";
|
|
create procedure foo()
|
|
begin
|
|
insert into t1 values("work");
|
|
insert into t1 values(concat("for",UUID()));
|
|
insert into t1 select "yesterday";
|
|
end|
|
|
create procedure foo2()
|
|
begin
|
|
insert into t1 values(concat("emergency",UUID()));
|
|
insert into t1 values("work");
|
|
insert into t1 values(concat("for",UUID()));
|
|
set session binlog_format=row; # accepted for stored procs
|
|
insert into t1 values("more work");
|
|
set session binlog_format=mixed;
|
|
end|
|
|
create function foo3() returns bigint unsigned
|
|
begin
|
|
set session binlog_format=row; # rejected for stored funcs
|
|
insert into t1 values("alarm");
|
|
return 100;
|
|
end|
|
|
call foo();
|
|
call foo2();
|
|
select foo3();
|
|
ERROR HY000: Cannot change the binary logging format inside a stored function or trigger
|
|
select * from t1 where a="alarm";
|
|
a
|
|
show binlog events from 102;
|
|
Log_name Pos Event_type Server_id End_log_pos Info
|
|
master-bin.000001 102 Query 1 205 drop database if exists mysqltest1
|
|
master-bin.000001 205 Table_map 1 262 table_id: 15 (mysql.proc)
|
|
master-bin.000001 262 Write_rows 1 291 table_id: 4294967295 flags: STMT_END_F
|
|
master-bin.000001 291 Table_map 1 349 table_id: 16 (mysql.event)
|
|
master-bin.000001 349 Write_rows 1 378 table_id: 4294967295 flags: STMT_END_F
|
|
master-bin.000001 378 Query 1 473 create database mysqltest1
|
|
master-bin.000001 473 Query 1 574 use `mysqltest1`; CREATE TABLE t1 (a varchar(100))
|
|
master-bin.000001 574 Table_map 1 619 table_id: 17 (mysqltest1.t1)
|
|
master-bin.000001 619 Write_rows 1 648 table_id: 4294967295 flags: STMT_END_F
|
|
master-bin.000001 648 Table_map 1 693 table_id: 17 (mysqltest1.t1)
|
|
master-bin.000001 693 Write_rows 1 728 table_id: 17 flags: STMT_END_F
|
|
master-bin.000001 728 Table_map 1 773 table_id: 17 (mysqltest1.t1)
|
|
master-bin.000001 773 Write_rows 1 849 table_id: 17 flags: STMT_END_F
|
|
master-bin.000001 849 Table_map 1 894 table_id: 17 (mysqltest1.t1)
|
|
master-bin.000001 894 Write_rows 1 923 table_id: 4294967295 flags: STMT_END_F
|
|
master-bin.000001 923 Table_map 1 968 table_id: 17 (mysqltest1.t1)
|
|
master-bin.000001 968 Write_rows 1 1039 table_id: 17 flags: STMT_END_F
|
|
master-bin.000001 1039 Table_map 1 1084 table_id: 17 (mysqltest1.t1)
|
|
master-bin.000001 1084 Write_rows 1 1124 table_id: 17 flags: STMT_END_F
|
|
master-bin.000001 1124 Table_map 1 1169 table_id: 17 (mysqltest1.t1)
|
|
master-bin.000001 1169 Write_rows 1 1239 table_id: 17 flags: STMT_END_F
|
|
master-bin.000001 1239 Table_map 1 1284 table_id: 17 (mysqltest1.t1)
|
|
master-bin.000001 1284 Write_rows 1 1324 table_id: 17 flags: STMT_END_F
|
|
master-bin.000001 1324 Table_map 1 1369 table_id: 17 (mysqltest1.t1)
|
|
master-bin.000001 1369 Write_rows 1 1403 table_id: 17 flags: STMT_END_F
|
|
master-bin.000001 1403 Query 1 1501 use `mysqltest1`; insert into t1 values("work")
|
|
master-bin.000001 1501 User var 1 1549 @`string`=_latin1 0x656D657267656E6379 COLLATE latin1_swedish_ci
|
|
master-bin.000001 1549 Query 1 1649 use `mysqltest1`; insert into t1 select @'string'
|
|
master-bin.000001 1649 Query 1 1747 use `mysqltest1`; insert into t1 values("work")
|
|
master-bin.000001 1747 User var 1 1795 @`string`=_latin1 0x656D657267656E6379 COLLATE latin1_swedish_ci
|
|
master-bin.000001 1795 Query 1 1895 use `mysqltest1`; insert into t1 select @'string'
|
|
master-bin.000001 1895 Query 1 1992 use `mysqltest1`; insert into t1 values("for")
|
|
master-bin.000001 1992 Query 1 2094 use `mysqltest1`; insert into t1 select "yesterday"
|
|
master-bin.000001 2094 Query 1 2192 use `mysqltest1`; insert into t1 values("work")
|
|
master-bin.000001 2192 User var 1 2240 @`string`=_latin1 0x656D657267656E6379 COLLATE latin1_swedish_ci
|
|
master-bin.000001 2240 Query 1 2340 use `mysqltest1`; insert into t1 select @'string'
|
|
master-bin.000001 2340 Query 1 2438 use `mysqltest1`; insert into t1 values("work")
|
|
master-bin.000001 2438 User var 1 2486 @`string`=_latin1 0x656D657267656E6379 COLLATE latin1_swedish_ci
|
|
master-bin.000001 2486 Query 1 2586 use `mysqltest1`; insert into t1 select @'string'
|
|
master-bin.000001 2586 Query 1 2683 use `mysqltest1`; insert into t1 values("for")
|
|
master-bin.000001 2683 Query 1 2785 use `mysqltest1`; insert into t1 select "yesterday"
|
|
master-bin.000001 2785 Query 1 2883 use `mysqltest1`; insert into t1 values("work")
|
|
master-bin.000001 2883 Write_rows 1 2959 table_id: 17 flags: STMT_END_F
|
|
master-bin.000001 2959 Write_rows 1 3030 table_id: 17 flags: STMT_END_F
|
|
master-bin.000001 3030 User var 1 3078 @`string`=_latin1 0x656D657267656E6379 COLLATE latin1_swedish_ci
|
|
master-bin.000001 3078 Query 1 3178 use `mysqltest1`; insert into t1 select @'string'
|
|
master-bin.000001 3178 Write_rows 1 3248 table_id: 17 flags: STMT_END_F
|
|
master-bin.000001 3248 Query 1 3350 use `mysqltest1`; insert into t1 select "yesterday"
|
|
master-bin.000001 3350 Write_rows 1 3421 table_id: 17 flags: STMT_END_F
|
|
master-bin.000001 3421 User var 1 3469 @`string`=_latin1 0x656D657267656E6379 COLLATE latin1_swedish_ci
|
|
master-bin.000001 3469 Query 1 3569 use `mysqltest1`; insert into t1 select @'string'
|
|
master-bin.000001 3569 Write_rows 1 3639 table_id: 17 flags: STMT_END_F
|
|
master-bin.000001 3639 Query 1 3741 use `mysqltest1`; insert into t1 select "yesterday"
|
|
master-bin.000001 3741 Query 1 3953 use `mysqltest1`; create procedure foo()
|
|
begin
|
|
insert into t1 values("work");
|
|
insert into t1 values(concat("for",UUID()));
|
|
insert into t1 select "yesterday";
|
|
end
|
|
master-bin.000001 3953 Query 1 4310 use `mysqltest1`; create procedure foo2()
|
|
begin
|
|
insert into t1 values(concat("emergency",UUID()));
|
|
insert into t1 values("work");
|
|
insert into t1 values(concat("for",UUID()));
|
|
set session binlog_format=row; # accepted for stored procs
|
|
insert into t1 values("more work");
|
|
set session binlog_format=mixed;
|
|
end
|
|
master-bin.000001 4310 Query 1 4538 use `mysqltest1`; create function foo3() returns bigint unsigned
|
|
begin
|
|
set session binlog_format=row; # rejected for stored funcs
|
|
insert into t1 values("alarm");
|
|
return 100;
|
|
end
|
|
master-bin.000001 4538 Query 1 4644 use `mysqltest1`; insert into t1 values("work")
|
|
master-bin.000001 4644 Write_rows 1 4714 table_id: 17 flags: STMT_END_F
|
|
master-bin.000001 4714 Query 1 4824 use `mysqltest1`; insert into t1 select "yesterday"
|
|
master-bin.000001 4824 Write_rows 1 4900 table_id: 17 flags: STMT_END_F
|
|
master-bin.000001 4900 Query 1 5006 use `mysqltest1`; insert into t1 values("work")
|
|
master-bin.000001 5006 Write_rows 1 5076 table_id: 17 flags: STMT_END_F
|
|
master-bin.000001 5076 Table_map 1 5121 table_id: 17 (mysqltest1.t1)
|
|
master-bin.000001 5121 Write_rows 1 5161 table_id: 17 flags: STMT_END_F
|
|
drop database mysqltest1;
|