summaryrefslogtreecommitdiff
path: root/sql/sys_vars.cc
diff options
context:
space:
mode:
authorvinchen <vinchen13@gmail.com>2016-10-08 12:07:26 +0800
committerKristian Nielsen <knielsen@knielsen-hq.org>2016-10-19 20:20:35 +0200
commit640051e06aa585b056671738a6614cd314074ac6 (patch)
tree540b46e17247011c429d184413ff4f957af64e42 /sql/sys_vars.cc
parent27025221fe2ea17aa737ad2ad31011407c00dcc9 (diff)
downloadmariadb-git-640051e06aa585b056671738a6614cd314074ac6.tar.gz
Binlog compressed
Add some event types for the compressed event, there are: QUERY_COMPRESSED_EVENT, WRITE_ROWS_COMPRESSED_EVENT_V1, UPDATE_ROWS_COMPRESSED_EVENT_V1, DELETE_POWS_COMPRESSED_EVENT_V1, WRITE_ROWS_COMPRESSED_EVENT, UPDATE_ROWS_COMPRESSED_EVENT, DELETE_POWS_COMPRESSED_EVENT. These events inheritance the uncompressed editor events. One of their constructor functions and write function have been overridden for uncompressing and compressing. Anything but this is totally the same. On slave, The IO thread will uncompress and convert them When it receiving the events from the master. So the SQL and worker threads can be stay unchanged. Now we use zlib as compress algorithm. It maybe support other algorithm in the future.
Diffstat (limited to 'sql/sys_vars.cc')
-rw-r--r--sql/sys_vars.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc
index 3e6a06c3ab0..ab4429005ab 100644
--- a/sql/sys_vars.cc
+++ b/sql/sys_vars.cc
@@ -1157,6 +1157,18 @@ static Sys_var_mybool Sys_log_bin(
"log_bin", "Whether the binary log is enabled",
READ_ONLY GLOBAL_VAR(opt_bin_log), NO_CMD_LINE, DEFAULT(FALSE));
+static Sys_var_mybool Sys_log_bin_compress(
+ "log_bin_compress", "Whether the binary log can be compressed",
+ GLOBAL_VAR(opt_bin_log_compress), CMD_LINE(OPT_ARG), DEFAULT(FALSE));
+
+/* the min length is 10, means that Begin/Commit/Rollback would never be compressed! */
+static Sys_var_uint Sys_log_bin_compress_min_len(
+ "log_bin_compress_min_len",
+ "Minimum length of sql statement(in statement mode) or record(in row mode)"
+ "that can be compressed.",
+ GLOBAL_VAR(opt_bin_log_compress_min_len),
+ CMD_LINE(OPT_ARG), VALID_RANGE(10, 1024), DEFAULT(256), BLOCK_SIZE(1));
+
static Sys_var_mybool Sys_trust_function_creators(
"log_bin_trust_function_creators",
"If set to FALSE (the default), then when --log-bin is used, creation "