| 1 |
# ==== Purpose ==== |
| 2 |
# |
| 3 |
# Assert that the binary log contains a specific sequence of partition ids |
| 4 |
# for UPDATE Events (having both a partition id for the |
| 5 |
# before-image($source_partition_id), and one for the after-image(target_partition_id)). |
| 6 |
# |
| 7 |
# ==== Usage ==== |
| 8 |
# |
| 9 |
# --let $binlog_fullpath= TEXT |
| 10 |
# --let $binlog_position= NUMBER |
| 11 |
# --let $partition_id= NUMBER |
| 12 |
# --source include/rpl_partition_info.inc |
| 13 |
# |
| 14 |
# Parameters: |
| 15 |
# |
| 16 |
# $binlog_fullpath |
| 17 |
# The full path of binary log to look in. |
| 18 |
# (settable using include/save_binlog_position.inc) |
| 19 |
# $binlog_position |
| 20 |
# The log position to start reading from |
| 21 |
# (settable using include/save_binlog_position.inc) |
| 22 |
# $partition_id |
| 23 |
# This is a semicolon-separated list of pairs of partition_id. |
| 24 |
# Each pair consists of 'source_partition_id' as an integer |
| 25 |
# followed by space followed by 'target_partition_id' as an integar. |
| 26 |
# Note that this is whitespace-sensitive so there should |
| 27 |
# not be any other space characters than those separating |
| 28 |
# source_partition_id from target_partition_id. |
| 29 |
# ==== References ==== |
| 30 |
# |
| 31 |
# Bug#28977199:UPDATE EVENT LOGS ONLY THE TARGET PARTITION WHEN MODIFYING MULTIPLE PARTITION |
| 32 |
# WL#12168:Add Partition Information into the Binary Log |
| 33 |
|
| 34 |
|
| 35 |
if ($partition_id == '') |
| 36 |
{ |
| 37 |
--die !!!ERROR IN TEST: you must set $target_partition_id |
| 38 |
} |
| 39 |
|
| 40 |
--let $include_filename= rpl_partition_info_update.inc |
| 41 |
--source include/begin_include_file.inc |
| 42 |
|
| 43 |
--exec $MYSQL_BINLOG --start-position=$binlog_position -vv $binlog_fullpath > $MYSQLTEST_VARDIR/tmp/mysqlbinlog_partition.binlog |
| 44 |
--let $assert_file = $MYSQLTEST_VARDIR/tmp/mysqlbinlog_partition.binlog |
| 45 |
|
| 46 |
--let $assert_select= source_partition:.*target_partition:.* |
| 47 |
--let $assert_match= `SELECT CONCAT('source_partition: ', REPLACE(REPLACE('$partition_id', ' ', '.*target_partition: '),';', '.*\n[^\n]*source_partition: '))` |
| 48 |
--let $assert_text= assert_partition_info: $partition_id |
| 49 |
--source include/assert_grep.inc |
| 50 |
|
| 51 |
--let $partition_id= |
| 52 |
--remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog_partition.binlog |
| 53 |
--let $include_filename= rpl_partition_info_update.inc |
| 54 |
--source include/end_include_file.inc |
| 55 |
|
| 56 |
|