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 /sql/sys_vars.cc | |
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 'sql/sys_vars.cc')
-rw-r--r-- | sql/sys_vars.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc index ca9988b660e..1ba58bf71c4 100644 --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc @@ -6209,6 +6209,19 @@ static Sys_var_enum Sys_binlog_row_image( SESSION_VAR(binlog_row_image), CMD_LINE(REQUIRED_ARG), binlog_row_image_names, DEFAULT(BINLOG_ROW_IMAGE_FULL)); +static const char *binlog_row_metadata_names[]= {"NO_LOG", "MINIMAL", "FULL", NullS}; +static Sys_var_enum Sys_binlog_row_metadata( + "binlog_row_metadata", + "Controls whether metadata is logged using FULL , MINIMAL format and NO_LOG." + "FULL causes all metadata to be logged; MINIMAL means that only " + "metadata actually required by slave is logged; NO_LOG NO metadata will be logged." + "Default: NO_LOG.", + GLOBAL_VAR(binlog_row_metadata), CMD_LINE(REQUIRED_ARG), + binlog_row_metadata_names, DEFAULT(Table_map_log_event::BINLOG_ROW_METADATA_NO_LOG), + NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(NULL), + ON_UPDATE(NULL)); + + static bool check_pseudo_slave_mode(sys_var *self, THD *thd, set_var *var) { longlong previous_val= thd->variables.pseudo_slave_mode; |