Merge lp:~vlad-lesin/percona-server/5.6-mysqlbinlog-issue35303 into lp:percona-server/5.6

Proposed by Vlad Lesin
Status: Merged
Approved by: Laurynas Biveinis
Approved revision: no longer in the source branch.
Merged at revision: 509
Proposed branch: lp:~vlad-lesin/percona-server/5.6-mysqlbinlog-issue35303
Merge into: lp:percona-server/5.6
Diff against target: 133 lines (+76/-2)
3 files modified
Percona-Server/client/mysqlbinlog.cc (+20/-2)
Percona-Server/mysql-test/r/percona_mysqlbinlog_ssl_compress.result (+21/-0)
Percona-Server/mysql-test/t/percona_mysqlbinlog_ssl_compress.test (+35/-0)
To merge this branch: bzr merge lp:~vlad-lesin/percona-server/5.6-mysqlbinlog-issue35303
Reviewer Review Type Date Requested Status
Laurynas Biveinis (community) Approve
George Ormond Lorch III (community) g2 Approve
Review via email: mp+193740@code.launchpad.net

Description of the change

Bug #1197524 fixes and
https://blueprints.launchpad.net/percona-server/+spec/mysqlbinlog-compress
blueprint implementation.

SSL and compression connection options are implemented for mysqlbinlog.

http://jenkins.percona.com/view/PS%205.6/job/percona-server-5.6-param/399

Merged from lp:~vlad-lesin/percona-server/5.5-mysqlbinlog-issue35303. The difference between 5.5 and 5.6 versions is in the following two lines:
+ mysql_options(mysql, MYSQL_OPT_SSL_CRL, opt_ssl_crl);
+ mysql_options(mysql, MYSQL_OPT_SSL_CRLPATH, opt_ssl_crlpath);
5.5 does not support these options while 5.6 does.

To post a comment you must log in.
Revision history for this message
George Ormond Lorch III (gl-az) :
review: Approve (g2)
Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :

Vlad -

This is OK but we have a Launchpad limitation that a blueprint can be targeted only to single series. https://blueprints.launchpad.net/percona-server/+spec/mysqlbinlog-compress is targeted to 5.5 and thus will be invisible in 5.6 milestone view etc. Please create a new blueprint for 5.6.

review: Needs Information
Revision history for this message
Vlad Lesin (vlad-lesin) wrote :

> This is OK but we have a Launchpad limitation that a blueprint can be targeted
> only to single series. https://blueprints.launchpad.net/percona-server/+spec
> /mysqlbinlog-compress is targeted to 5.5 and thus will be invisible in 5.6
> milestone view etc. Please create a new blueprint for 5.6.
Done. See https://blueprints.launchpad.net/percona-server/+spec/mysqlbinlog-compress-5.6 .

Revision history for this message
Laurynas Biveinis (laurynas-biveinis) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Percona-Server/client/mysqlbinlog.cc'
2--- Percona-Server/client/mysqlbinlog.cc 2013-10-23 08:48:28 +0000
3+++ Percona-Server/client/mysqlbinlog.cc 2013-11-04 09:10:20 +0000
4@@ -67,6 +67,7 @@
5
6
7 #define CLIENT_CAPABILITIES (CLIENT_LONG_PASSWORD | CLIENT_LONG_FLAG | CLIENT_LOCAL_FILES)
8+#include <sslopt-vars.h>
9
10 char server_version[SERVER_VERSION_LENGTH];
11 ulong server_id = 0;
12@@ -379,7 +380,7 @@
13 Create_file_log_event *ce);
14 };
15
16-
17+static my_bool opt_compress=0;
18 /**
19 Creates and opens a new temporary file in the directory specified by previous call to init_by_dir_name() or init_by_cur_dir().
20
21@@ -1395,6 +1396,9 @@
22 {"character-sets-dir", OPT_CHARSETS_DIR,
23 "Directory for character set files.", &charsets_dir,
24 &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
25+ {"compress", 'C', "Use compression in server/client protocol.",
26+ &opt_compress, &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
27+ 0, 0, 0},
28 {"database", 'd', "List entries for just this database (local log only).",
29 &database, &database, 0, GET_STR_ALLOC, REQUIRED_ARG,
30 0, 0, 0, 0, 0, 0},
31@@ -1499,6 +1503,7 @@
32 {"socket", 'S', "The socket file to use for connection.",
33 &sock, &sock, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0,
34 0, 0},
35+#include <sslopt-longopts.h>
36 {"start-datetime", OPT_START_DATETIME,
37 "Start reading the binlog at first event having a datetime equal or "
38 "posterior to the argument; the argument must be a date and time "
39@@ -1727,6 +1732,7 @@
40 DBUG_PUSH(argument ? argument : default_dbug_option);
41 break;
42 #endif
43+#include <sslopt-case.h>
44 case 'd':
45 one_database = 1;
46 break;
47@@ -1828,7 +1834,19 @@
48
49 if (opt_default_auth && *opt_default_auth)
50 mysql_options(mysql, MYSQL_DEFAULT_AUTH, opt_default_auth);
51-
52+ if (opt_compress)
53+ mysql_options(mysql,MYSQL_OPT_COMPRESS,NullS);
54+#ifdef HAVE_OPENSSL
55+ if (opt_use_ssl)
56+ {
57+ mysql_ssl_set(mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
58+ opt_ssl_capath, opt_ssl_cipher);
59+ mysql_options(mysql, MYSQL_OPT_SSL_CRL, opt_ssl_crl);
60+ mysql_options(mysql, MYSQL_OPT_SSL_CRLPATH, opt_ssl_crlpath);
61+ }
62+ mysql_options(mysql,MYSQL_OPT_SSL_VERIFY_SERVER_CERT,
63+ (char*)&opt_ssl_verify_server_cert);
64+#endif
65 if (opt_protocol)
66 mysql_options(mysql, MYSQL_OPT_PROTOCOL, (char*) &opt_protocol);
67 if (opt_bind_addr)
68
69=== added file 'Percona-Server/mysql-test/r/percona_mysqlbinlog_ssl_compress.result'
70--- Percona-Server/mysql-test/r/percona_mysqlbinlog_ssl_compress.result 1970-01-01 00:00:00 +0000
71+++ Percona-Server/mysql-test/r/percona_mysqlbinlog_ssl_compress.result 2013-11-04 09:10:20 +0000
72@@ -0,0 +1,21 @@
73+reset master;
74+set timestamp=1000000000;
75+drop table if exists t1;
76+create table t1 (word varchar(20));
77+insert into t1 values ("abirvalg");
78+flush logs;
79+
80+--- --start-position --
81+DELIMITER /*!*/;
82+/*!\C latin1 *//*!*/;
83+BEGIN
84+/*!*/;
85+use `test`/*!*/;
86+insert into t1 values ("abirvalg")
87+/*!*/;
88+COMMIT
89+/*!*/;
90+DELIMITER ;
91+# End of log file
92+ROLLBACK /* added by mysqlbinlog */;
93+drop table t1;
94
95=== added file 'Percona-Server/mysql-test/t/percona_mysqlbinlog_ssl_compress.test'
96--- Percona-Server/mysql-test/t/percona_mysqlbinlog_ssl_compress.test 1970-01-01 00:00:00 +0000
97+++ Percona-Server/mysql-test/t/percona_mysqlbinlog_ssl_compress.test 2013-11-04 09:10:20 +0000
98@@ -0,0 +1,35 @@
99+# Check for mysqlbinlog ssl and compression options
100+-- source include/have_compress.inc
101+-- source include/have_ssl_communication.inc
102+-- source include/have_binlog_format_statement.inc
103+-- source include/have_log_bin.inc
104+
105+--disable_query_log
106+CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
107+--enable_query_log
108+
109+# Deletes all the binary logs
110+reset master;
111+
112+# we need this for getting fixed timestamps inside of this test
113+set timestamp=1000000000;
114+
115+--disable_warnings
116+drop table if exists t1;
117+--enable_warnings
118+
119+create table t1 (word varchar(20));
120+
121+--let $binlog_start_pos=query_get_value(SHOW MASTER STATUS, Position, 1)
122+# simple test for simple statement and various events
123+insert into t1 values ("abirvalg");
124+flush logs;
125+
126+# Strangely but this works
127+--disable_query_log
128+select "--- --start-position --" as "";
129+--enable_query_log
130+--replace_regex /.*SET .*$//[i]
131+--exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --read-from-remote-server --start-position=$binlog_start_pos --user=root --host=127.0.0.1 --port=$MASTER_MYPORT --ssl-key=$MYSQL_TEST_DIR/std_data/client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem --compress master-bin.000001
132+
133+drop table t1;

Subscribers

People subscribed via source and target branches