diff options
author | Vicențiu Ciorbaru <vicentiu@mariadb.org> | 2015-03-21 20:43:24 +0200 |
---|---|---|
committer | Vicențiu Ciorbaru <vicentiu@mariadb.org> | 2015-06-22 09:57:41 +0300 |
commit | 481fc5a982fcbd14f53476799ac7268bdb514c69 (patch) | |
tree | 2e76d962b27fb483ec31672af969491569f29f9a | |
parent | 0357791e3c291c47fe128954dac45c271f721b2a (diff) | |
download | mariadb-git-481fc5a982fcbd14f53476799ac7268bdb514c69.tar.gz |
[MDEV-6877] Added binlog_row_image system variable
The system variable is present but it does not do anything yet.
-rw-r--r-- | sql/sql_class.h | 11 | ||||
-rw-r--r-- | sql/sys_vars.cc | 16 |
2 files changed, 27 insertions, 0 deletions
diff --git a/sql/sql_class.h b/sql/sql_class.h index 176d739f38f..fbc9c0e8d78 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -96,6 +96,16 @@ enum enum_mark_columns { MARK_COLUMNS_NONE, MARK_COLUMNS_READ, MARK_COLUMNS_WRITE}; enum enum_filetype { FILETYPE_CSV, FILETYPE_XML }; +enum enum_binlog_row_image { + /** PKE in the before image and changed columns in the after image */ + BINLOG_ROW_IMAGE_MINIMAL= 0, + /** Whenever possible, before and after image contain all columns except blobs. */ + BINLOG_ROW_IMAGE_NOBLOB= 1, + /** All columns in both before and after image. */ + BINLOG_ROW_IMAGE_FULL= 2 +}; + + /* Bits for different SQL modes modes (including ANSI mode) */ #define MODE_REAL_AS_FLOAT (1ULL << 0) #define MODE_PIPES_AS_CONCAT (1ULL << 1) @@ -589,6 +599,7 @@ typedef struct system_variables /* Flags for slow log filtering */ ulong log_slow_rate_limit; ulong binlog_format; ///< binlog format for this thd (see enum_binlog_format) + ulong binlog_row_image; ulong progress_report_time; ulong completion_type; ulong query_cache_type; diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc index 971040a670e..b55076d212a 100644 --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc @@ -5200,6 +5200,22 @@ static Sys_var_mybool Sys_encrypt_tmp_files( READ_ONLY GLOBAL_VAR(encrypt_tmp_files), CMD_LINE(OPT_ARG), DEFAULT(TRUE)); +static const char *binlog_row_image_names[]= {"MINIMAL", "NOBLOB", "FULL", NullS}; +static Sys_var_enum Sys_binlog_row_image( + "binlog_row_image", + "Controls whether rows should be logged in 'FULL', 'NOBLOB' or " + "'MINIMAL' formats. 'FULL', means that all columns in the before " + "and after image are logged. 'NOBLOB', means that mysqld avoids logging " + "blob columns whenever possible (eg, blob column was not changed or " + "is not part of primary key). 'MINIMAL', means that a PK equivalent (PK " + "columns or full row if there is no PK in the table) is logged in the " + "before image, and only changed columns are logged in the after image. " + "(Default: FULL).", + SESSION_VAR(binlog_row_image), CMD_LINE(REQUIRED_ARG), + binlog_row_image_names, DEFAULT(BINLOG_ROW_IMAGE_FULL), + 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; |