summaryrefslogtreecommitdiff
path: root/sql/sql_class.h
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/sql_class.h
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/sql_class.h')
-rw-r--r--sql/sql_class.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/sql/sql_class.h b/sql/sql_class.h
index 994a161a646..a63a3379ec1 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -5681,6 +5681,12 @@ void thd_exit_cond(MYSQL_THD thd, const PSI_stage_info *stage,
#define THD_EXIT_COND(P1, P2) \
thd_exit_cond(P1, P2, __func__, __FILE__, __LINE__)
+inline bool binlog_should_compress(ulong len)
+{
+ return opt_bin_log_compress &&
+ len >= opt_bin_log_compress_min_len;
+}
+
#endif /* MYSQL_SERVER */
#endif /* SQL_CLASS_INCLUDED */