diff options
author | Sachin <sachin.setiya@mariadb.com> | 2019-09-01 13:25:16 +0530 |
---|---|---|
committer | Sachin <sachin.setiya@mariadb.com> | 2019-09-11 15:09:35 +0530 |
commit | 967c14c04e9e14062bd2b8288e054514af3cd322 (patch) | |
tree | 5892bd31febe816c9ec6c6526802fd5db6bd80d5 /mysql-test/suite/binlog/include | |
parent | 0636645e7e13d07a0262571f72bde11e5680a420 (diff) | |
download | mariadb-git-967c14c04e9e14062bd2b8288e054514af3cd322.tar.gz |
MDEV-20477 Merge binlog extended metadata support from the upstream
Cherry-pick the commits the mysql and some changes.
WL#4618 RBR: extended table metadata in the binary log
This patch extends Table Map Event. It appends some new fields for
more metadata. The new metadata includes:
- Signedness of Numberic Columns
- Character Set of Character Columns and Binary Columns
- Column Name
- String Value of SET Columns
- String Value of ENUM Columns
- Primary Key
- Character Set of SET Columns and ENUM Columns
- Geometry Type
Some of them are optional, the patch introduces a GLOBAL system
variable to control it. It is binlog_row_metadata.
- Scope: GLOBAL
- Dynamic: Yes
- Type: ENUM
- Values: {NO_LOG, MINIMAL, FULL}
- Default: NO_LOG
Only Signedness, character set and geometry type are logged if it is MINIMAL.
Otherwise all of them are logged.
Also add a binlog_type_info() to field, So that we can have extract
relevant binlog info from field.
Diffstat (limited to 'mysql-test/suite/binlog/include')
-rw-r--r-- | mysql-test/suite/binlog/include/print_optional_metadata.inc | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/mysql-test/suite/binlog/include/print_optional_metadata.inc b/mysql-test/suite/binlog/include/print_optional_metadata.inc new file mode 100644 index 00000000000..739903ab190 --- /dev/null +++ b/mysql-test/suite/binlog/include/print_optional_metadata.inc @@ -0,0 +1,34 @@ +# Auxaliary file for printing optional metadata in table_map_log_event +# Usage : +# --let $binlog_file= +# [--let $stop_position] +# [--let $print_primary_key] +# --source extra/binlog_tests/print_optional_metadata.inc + +--let $output_file= $MYSQLTEST_VARDIR/tmp/mysqlbinlog.output + +--let $_stop_position_opt= +if ($stop_position) +{ + --let $_stop_position_opt=--stop-position=$stop_position +} + +--exec $MYSQL_BINLOG -F --print-table-metadata $_stop_position_opt $binlog_file > $output_file + + +--let SEARCH_PATTERN= # (?:Columns\(| {8}).* +--let SEARCH_FILE= $output_file +--let SEARCH_OUTPUT=matches +--let SEARCH_TYPE="_gm_" +--source include/search_pattern_in_file.inc + +if ($print_primary_key) +{ + --let SEARCH_PATTERN= # Primary Key + --source include/search_pattern_in_file.inc +} +--remove_file $output_file +--let $stop_position= +--let $_stop_position_opt= + + |