1
0
mirror of https://github.com/MariaDB/server.git synced 2025-04-28 06:45:23 +03:00
mariadb/mysql-test/suite/binlog/include/check_binlog_size.inc
sachin ada54101a7 MDEV-9266 Creating index on temporaray table breaks replication
Problem:- Create/drop index was logged into binlog.

Goal:- Operation on temporary table should not be binlog when binlog format
is row.

Solution:-
We should add CF_FORCE_ORIGINAL_BINLOG_FORMAT when there is ddl on temp
table.
For optimize, analyze, repair we wont change anything ,Then will
be logged in binlog , But they also dont throw any error if operation fails
Since slave wont be having any temp table , but these operation on tmp
table will be processed without breaking replication.

For rename we need a different logic MDEV-16728 will solve it.
2018-07-18 17:13:24 +05:30

32 lines
694 B
PHP

# This file runs the query and checks
# whether the size of binlog is increased or not
# If size is changed it issue die command
# Parameters
# $sql_query = query to run
#Only last row of show binlog events matter
--let $tmp= 0
--let $counter= 1
while ($tmp != "No such row")
{
--let $initial_binlog_size= $tmp
--let $tmp= query_get_value(show binary logs, File_size, $counter)
--inc $counter
}
--eval $sql_query
--let $tmp= 0
--let $counter= 1
while ($tmp != "No such row")
{
--let $current_binlog_size= $tmp
--let $tmp= query_get_value(show binary logs, File_size, $counter)
--inc $counter
}
if ($initial_binlog_size != $current_binlog_size)
{
die "Binlog size changed";
}