Skip to content

Commit

Permalink
Preserve the CLIENT_REMEMBER_OPTIONS flag for compressed connections
Browse files Browse the repository at this point in the history
Summary:
I heard someone recently state that we turn on compression for the
slaves' connections to their masters. This reminded me that there is
a bug in the bit math for turning on this setting which caused problems
in my past job. Fix it here too.

Specifically, keep the CLIENT_REMEMBER_OPTIONS bit set in the flags for
the IO thread's connection so that on failure connecting to the master
mysql_real_connect does not call mysql_close_free_options and stomp the
connection timeout setting.

Test Plan: mtr

Reviewers: steaphan

Reviewed By: steaphan
  • Loading branch information
jtolmer authored and steaphangreene committed May 29, 2013
1 parent f9b082f commit a14eb57
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sql/slave.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4222,7 +4222,7 @@ static int connect_to_master(THD* thd, MYSQL* mysql, Master_info* mi,
#endif
ulong client_flag= CLIENT_REMEMBER_OPTIONS;
if (opt_slave_compressed_protocol)
client_flag=CLIENT_COMPRESS; /* We will use compression */
client_flag |= CLIENT_COMPRESS; /* We will use compression */

mysql_options(mysql, MYSQL_OPT_CONNECT_TIMEOUT, (char *) &slave_net_timeout);
mysql_options(mysql, MYSQL_OPT_READ_TIMEOUT, (char *) &slave_net_timeout);
Expand Down

0 comments on commit a14eb57

Please sign in to comment.