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
=== modified file 'Percona-Server/client/mysqlbinlog.cc'
--- Percona-Server/client/mysqlbinlog.cc 2013-10-23 08:48:28 +0000
+++ Percona-Server/client/mysqlbinlog.cc 2013-11-04 09:10:20 +0000
@@ -67,6 +67,7 @@
6767
6868
69#define CLIENT_CAPABILITIES (CLIENT_LONG_PASSWORD | CLIENT_LONG_FLAG | CLIENT_LOCAL_FILES)69#define CLIENT_CAPABILITIES (CLIENT_LONG_PASSWORD | CLIENT_LONG_FLAG | CLIENT_LOCAL_FILES)
70#include <sslopt-vars.h>
7071
71char server_version[SERVER_VERSION_LENGTH];72char server_version[SERVER_VERSION_LENGTH];
72ulong server_id = 0;73ulong server_id = 0;
@@ -379,7 +380,7 @@
379 Create_file_log_event *ce);380 Create_file_log_event *ce);
380};381};
381382
382383static my_bool opt_compress=0;
383/**384/**
384 Creates and opens a new temporary file in the directory specified by previous call to init_by_dir_name() or init_by_cur_dir().385 Creates and opens a new temporary file in the directory specified by previous call to init_by_dir_name() or init_by_cur_dir().
385386
@@ -1395,6 +1396,9 @@
1395 {"character-sets-dir", OPT_CHARSETS_DIR,1396 {"character-sets-dir", OPT_CHARSETS_DIR,
1396 "Directory for character set files.", &charsets_dir,1397 "Directory for character set files.", &charsets_dir,
1397 &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},1398 &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
1399 {"compress", 'C', "Use compression in server/client protocol.",
1400 &opt_compress, &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
1401 0, 0, 0},
1398 {"database", 'd', "List entries for just this database (local log only).",1402 {"database", 'd', "List entries for just this database (local log only).",
1399 &database, &database, 0, GET_STR_ALLOC, REQUIRED_ARG,1403 &database, &database, 0, GET_STR_ALLOC, REQUIRED_ARG,
1400 0, 0, 0, 0, 0, 0},1404 0, 0, 0, 0, 0, 0},
@@ -1499,6 +1503,7 @@
1499 {"socket", 'S', "The socket file to use for connection.",1503 {"socket", 'S', "The socket file to use for connection.",
1500 &sock, &sock, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0,1504 &sock, &sock, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0,
1501 0, 0},1505 0, 0},
1506#include <sslopt-longopts.h>
1502 {"start-datetime", OPT_START_DATETIME,1507 {"start-datetime", OPT_START_DATETIME,
1503 "Start reading the binlog at first event having a datetime equal or "1508 "Start reading the binlog at first event having a datetime equal or "
1504 "posterior to the argument; the argument must be a date and time "1509 "posterior to the argument; the argument must be a date and time "
@@ -1727,6 +1732,7 @@
1727 DBUG_PUSH(argument ? argument : default_dbug_option);1732 DBUG_PUSH(argument ? argument : default_dbug_option);
1728 break;1733 break;
1729#endif1734#endif
1735#include <sslopt-case.h>
1730 case 'd':1736 case 'd':
1731 one_database = 1;1737 one_database = 1;
1732 break;1738 break;
@@ -1828,7 +1834,19 @@
18281834
1829 if (opt_default_auth && *opt_default_auth)1835 if (opt_default_auth && *opt_default_auth)
1830 mysql_options(mysql, MYSQL_DEFAULT_AUTH, opt_default_auth);1836 mysql_options(mysql, MYSQL_DEFAULT_AUTH, opt_default_auth);
18311837 if (opt_compress)
1838 mysql_options(mysql,MYSQL_OPT_COMPRESS,NullS);
1839#ifdef HAVE_OPENSSL
1840 if (opt_use_ssl)
1841 {
1842 mysql_ssl_set(mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
1843 opt_ssl_capath, opt_ssl_cipher);
1844 mysql_options(mysql, MYSQL_OPT_SSL_CRL, opt_ssl_crl);
1845 mysql_options(mysql, MYSQL_OPT_SSL_CRLPATH, opt_ssl_crlpath);
1846 }
1847 mysql_options(mysql,MYSQL_OPT_SSL_VERIFY_SERVER_CERT,
1848 (char*)&opt_ssl_verify_server_cert);
1849#endif
1832 if (opt_protocol)1850 if (opt_protocol)
1833 mysql_options(mysql, MYSQL_OPT_PROTOCOL, (char*) &opt_protocol);1851 mysql_options(mysql, MYSQL_OPT_PROTOCOL, (char*) &opt_protocol);
1834 if (opt_bind_addr)1852 if (opt_bind_addr)
18351853
=== added file 'Percona-Server/mysql-test/r/percona_mysqlbinlog_ssl_compress.result'
--- Percona-Server/mysql-test/r/percona_mysqlbinlog_ssl_compress.result 1970-01-01 00:00:00 +0000
+++ Percona-Server/mysql-test/r/percona_mysqlbinlog_ssl_compress.result 2013-11-04 09:10:20 +0000
@@ -0,0 +1,21 @@
1reset master;
2set timestamp=1000000000;
3drop table if exists t1;
4create table t1 (word varchar(20));
5insert into t1 values ("abirvalg");
6flush logs;
7
8--- --start-position --
9DELIMITER /*!*/;
10/*!\C latin1 *//*!*/;
11BEGIN
12/*!*/;
13use `test`/*!*/;
14insert into t1 values ("abirvalg")
15/*!*/;
16COMMIT
17/*!*/;
18DELIMITER ;
19# End of log file
20ROLLBACK /* added by mysqlbinlog */;
21drop table t1;
022
=== added file 'Percona-Server/mysql-test/t/percona_mysqlbinlog_ssl_compress.test'
--- Percona-Server/mysql-test/t/percona_mysqlbinlog_ssl_compress.test 1970-01-01 00:00:00 +0000
+++ Percona-Server/mysql-test/t/percona_mysqlbinlog_ssl_compress.test 2013-11-04 09:10:20 +0000
@@ -0,0 +1,35 @@
1# Check for mysqlbinlog ssl and compression options
2-- source include/have_compress.inc
3-- source include/have_ssl_communication.inc
4-- source include/have_binlog_format_statement.inc
5-- source include/have_log_bin.inc
6
7--disable_query_log
8CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
9--enable_query_log
10
11# Deletes all the binary logs
12reset master;
13
14# we need this for getting fixed timestamps inside of this test
15set timestamp=1000000000;
16
17--disable_warnings
18drop table if exists t1;
19--enable_warnings
20
21create table t1 (word varchar(20));
22
23--let $binlog_start_pos=query_get_value(SHOW MASTER STATUS, Position, 1)
24# simple test for simple statement and various events
25insert into t1 values ("abirvalg");
26flush logs;
27
28# Strangely but this works
29--disable_query_log
30select "--- --start-position --" as "";
31--enable_query_log
32--replace_regex /.*SET .*$//[i]
33--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
34
35drop table t1;

Subscribers

People subscribed via source and target branches