| 1 |
include/master-slave.inc |
| 2 |
[connection master] |
| 3 |
connection master; |
| 4 |
set @max_binlog_cache_size = @@global.max_binlog_cache_size; |
| 5 |
set @binlog_cache_size = @@global.binlog_cache_size; |
| 6 |
set @@global.max_binlog_cache_size = 4096; |
| 7 |
set @@global. binlog_cache_size = 4096; |
| 8 |
# |
| 9 |
# MDEV-35207 ignored error at binlogging by CREATE-TABLE-SELECT leads to assert |
| 10 |
# |
| 11 |
connect conn_err,localhost,root,,; |
| 12 |
call mtr.add_suppression("Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage"); |
| 13 |
create table t engine=myisam select repeat ('a',4096*3) AS a; |
| 14 |
ERROR HY000: Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage; increase this mariadbd variable and try again |
| 15 |
create table t engine=innodb select repeat ('a',4096*3) AS a; |
| 16 |
ERROR HY000: Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage; increase this mariadbd variable and try again |
| 17 |
create table t (a int unique, b char) select 1 AS a, 'b' as b union select 1 as a, 'c' as b; |
| 18 |
ERROR 23000: Duplicate entry '1' for key 'a' |
| 19 |
select * from t; |
| 20 |
ERROR 42S02: Table 'test.t' doesn't exist |
| 21 |
disconnect conn_err; |
| 22 |
connection master; |
| 23 |
|
| 24 |
# |
| 25 |
# MDEV-35499 errored CREATE-OR-REPLACE-SELECT does not DROP table in binlog |
| 26 |
# |
| 27 |
# |
| 28 |
# Engine = innodb |
| 29 |
# |
| 30 |
set statement binlog_format=statement for create table t (a int) select 1 as a; |
| 31 |
set statement binlog_format=row for create or replace table t (a int primary key, b char) engine=innodb select 1 AS a, 'b' as b union select 1 as a, 'c' as b; |
| 32 |
ERROR 23000: Duplicate entry '1' for key 'PRIMARY' |
| 33 |
select * from t; |
| 34 |
ERROR 42S02: Table 'test.t' doesn't exist |
| 35 |
# |
| 36 |
# Prove an expected lonely `DROP table t' |
| 37 |
include/show_binlog_events.inc |
| 38 |
Log_name Pos Event_type Server_id End_log_pos Info |
| 39 |
master-bin.000001 # Gtid # # BEGIN GTID #-#-# |
| 40 |
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `test`.`t`/* Generated to handle failed CREATE OR REPLACE */ |
| 41 |
master-bin.000001 # Query # # ROLLBACK |
| 42 |
set statement binlog_format=statement for create table t (a int) select 1 as a; |
| 43 |
set statement binlog_format=row for create or replace table t (a text) engine=innodb select repeat ('a',1024) AS a union select repeat ('a',3*4096) AS a union select repeat ('a',3*4096) AS a; |
| 44 |
ERROR HY000: Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage; increase this mariadbd variable and try again |
| 45 |
select * from t; |
| 46 |
ERROR 42S02: Table 'test.t' doesn't exist |
| 47 |
# |
| 48 |
# Prove an expected lonely `DROP table t' |
| 49 |
include/show_binlog_events.inc |
| 50 |
Log_name Pos Event_type Server_id End_log_pos Info |
| 51 |
master-bin.000001 # Gtid # # BEGIN GTID #-#-# |
| 52 |
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `test`.`t`/* Generated to handle failed CREATE OR REPLACE */ |
| 53 |
master-bin.000001 # Query # # ROLLBACK |
| 54 |
set statement binlog_format=statement for create table t (a int) select 1 as a; |
| 55 |
set statement binlog_format=row for create or replace table t (a text) engine=innodb select repeat ('a',4096*3) AS a;; |
| 56 |
ERROR HY000: Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage; increase this mariadbd variable and try again |
| 57 |
select * from t; |
| 58 |
ERROR 42S02: Table 'test.t' doesn't exist |
| 59 |
# |
| 60 |
# Prove an expected lonely `DROP table t' |
| 61 |
include/show_binlog_events.inc |
| 62 |
Log_name Pos Event_type Server_id End_log_pos Info |
| 63 |
master-bin.000001 # Gtid # # BEGIN GTID #-#-# |
| 64 |
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `test`.`t`/* Generated to handle failed CREATE OR REPLACE */ |
| 65 |
master-bin.000001 # Query # # ROLLBACK |
| 66 |
# |
| 67 |
# Engine = myisam |
| 68 |
# |
| 69 |
set statement binlog_format=statement for create table t (a int) select 1 as a; |
| 70 |
set statement binlog_format=row for create or replace table t (a int primary key, b char) engine=myisam select 1 AS a, 'b' as b union select 1 as a, 'c' as b; |
| 71 |
ERROR 23000: Duplicate entry '1' for key 'PRIMARY' |
| 72 |
select * from t; |
| 73 |
ERROR 42S02: Table 'test.t' doesn't exist |
| 74 |
# |
| 75 |
# Prove an expected lonely `DROP table t' |
| 76 |
include/show_binlog_events.inc |
| 77 |
Log_name Pos Event_type Server_id End_log_pos Info |
| 78 |
master-bin.000001 # Gtid # # BEGIN GTID #-#-# |
| 79 |
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `test`.`t`/* Generated to handle failed CREATE OR REPLACE */ |
| 80 |
master-bin.000001 # Query # # ROLLBACK |
| 81 |
set statement binlog_format=statement for create table t (a int) select 1 as a; |
| 82 |
set statement binlog_format=row for create or replace table t (a text) engine=myisam select repeat ('a',1024) AS a union select repeat ('a',3*4096) AS a union select repeat ('a',3*4096) AS a; |
| 83 |
ERROR HY000: Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage; increase this mariadbd variable and try again |
| 84 |
select * from t; |
| 85 |
ERROR 42S02: Table 'test.t' doesn't exist |
| 86 |
# |
| 87 |
# Prove an expected lonely `DROP table t' |
| 88 |
include/show_binlog_events.inc |
| 89 |
Log_name Pos Event_type Server_id End_log_pos Info |
| 90 |
master-bin.000001 # Gtid # # BEGIN GTID #-#-# |
| 91 |
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `test`.`t`/* Generated to handle failed CREATE OR REPLACE */ |
| 92 |
master-bin.000001 # Query # # ROLLBACK |
| 93 |
set statement binlog_format=statement for create table t (a int) select 1 as a; |
| 94 |
set statement binlog_format=row for create or replace table t (a text) engine=myisam select repeat ('a',4096*3) AS a;; |
| 95 |
ERROR HY000: Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage; increase this mariadbd variable and try again |
| 96 |
select * from t; |
| 97 |
ERROR 42S02: Table 'test.t' doesn't exist |
| 98 |
# |
| 99 |
# Prove an expected lonely `DROP table t' |
| 100 |
include/show_binlog_events.inc |
| 101 |
Log_name Pos Event_type Server_id End_log_pos Info |
| 102 |
master-bin.000001 # Gtid # # BEGIN GTID #-#-# |
| 103 |
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `test`.`t`/* Generated to handle failed CREATE OR REPLACE */ |
| 104 |
master-bin.000001 # Query # # ROLLBACK |
| 105 |
create table ti_pk (a int primary key) engine=innodb; |
| 106 |
create table ta (a int) engine=aria; |
| 107 |
create function f_ia(arg int) |
| 108 |
returns integer |
| 109 |
begin |
| 110 |
insert into ti_pk set a=1; |
| 111 |
insert into ta set a=1; |
| 112 |
insert into ti_pk set a=arg; |
| 113 |
return 1; |
| 114 |
end | |
| 115 |
set statement binlog_format = ROW for create table t_y (a int) engine=aria select f_ia(1 /* err */) as a; |
| 116 |
ERROR 23000: Duplicate entry '1' for key 'PRIMARY' |
| 117 |
select * from t_y; |
| 118 |
ERROR 42S02: Table 'test.t_y' doesn't exist |
| 119 |
# correct execution: `ta` is modified and its new record is binlogged |
| 120 |
include/show_binlog_events.inc |
| 121 |
Log_name Pos Event_type Server_id End_log_pos Info |
| 122 |
master-bin.000001 # Gtid # # BEGIN GTID #-#-# |
| 123 |
master-bin.000001 # Annotate_rows # # insert into ti_pk set a=1 |
| 124 |
master-bin.000001 # Table_map # # table_id: # (test.ta) |
| 125 |
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F |
| 126 |
master-bin.000001 # Query # # COMMIT |
| 127 |
select * from ta; |
| 128 |
a |
| 129 |
1 |
| 130 |
select * from ti_pk; |
| 131 |
a |
| 132 |
connection slave; |
| 133 |
include/diff_tables.inc [master:ta,slave:ta] |
| 134 |
connection master; |
| 135 |
delete from ta; |
| 136 |
connection slave; |
| 137 |
connection master; |
| 138 |
set statement binlog_format = STATEMENT for create table t_y (a int) engine=aria select f_ia(1 /* err */) as a; |
| 139 |
ERROR 23000: Duplicate entry '1' for key 'PRIMARY' |
| 140 |
select * from t_y; |
| 141 |
ERROR 42S02: Table 'test.t_y' doesn't exist |
| 142 |
# ***TODO: fix MDEV-36027***. As of now `ta` is modified but that's not binlogged |
| 143 |
include/show_binlog_events.inc |
| 144 |
select *,'on_master' from ta; |
| 145 |
a on_master |
| 146 |
1 on_master |
| 147 |
select * from ti_pk; |
| 148 |
a |
| 149 |
connection slave; |
| 150 |
select *,'on_slave' from ta; |
| 151 |
a on_slave |
| 152 |
connection master; |
| 153 |
drop function f_ia; |
| 154 |
drop table ti_pk, ta; |
| 155 |
SET @@global.max_binlog_cache_size = @max_binlog_cache_size; |
| 156 |
SET @@global. binlog_cache_size = @binlog_cache_size; |
| 157 |
connection slave; |
| 158 |
End of the tests |
| 159 |
include/rpl_end.inc |