126
126
static inline bool io_slave_killed(THD* thd,Master_info* mi);
127
127
static inline bool sql_slave_killed(THD* thd,Relay_log_info* rli);
128
128
static int32_t init_slave_thread(THD* thd, SLAVE_THD_TYPE thd_type);
129
static int32_t safe_connect(THD* thd, MYSQL* mysql, Master_info* mi);
130
static int32_t safe_reconnect(THD* thd, MYSQL* mysql, Master_info* mi,
129
static int32_t safe_connect(THD* thd, DRIZZLE *drizzle, Master_info* mi);
130
static int32_t safe_reconnect(THD* thd, DRIZZLE *drizzle, Master_info* mi,
131
131
bool suppress_warnings);
132
static int32_t connect_to_master(THD* thd, MYSQL* mysql, Master_info* mi,
132
static int32_t connect_to_master(THD* thd, DRIZZLE *drizzle, Master_info* mi,
133
133
bool reconnect, bool suppress_warnings);
134
134
static int32_t safe_sleep(THD* thd, int32_t sec, CHECK_KILLED_FUNC thread_killed,
135
135
void* thread_killed_arg);
136
static int32_t get_master_version_and_clock(MYSQL* mysql, Master_info* mi);
136
static int32_t get_master_version_and_clock(DRIZZLE *drizzle, Master_info* mi);
137
137
static Log_event* next_event(Relay_log_info* rli);
138
138
static int32_t queue_event(Master_info* mi,const char* buf,uint32_t event_len);
139
139
static int32_t terminate_slave_thread(THD *thd,
757
static int32_t get_master_version_and_clock(MYSQL* mysql, Master_info* mi)
757
static int32_t get_master_version_and_clock(DRIZZLE *drizzle, Master_info* mi)
759
759
char error_buf[512];
760
760
String err_msg(error_buf, sizeof(error_buf), &my_charset_bin);
761
761
char err_buff[MAX_SLAVE_ERRMSG];
762
762
const char* errmsg= 0;
763
763
int32_t err_code= 0;
764
MYSQL_RES *master_res= 0;
765
MYSQL_ROW master_row;
764
DRIZZLE_RES *master_res= 0;
765
DRIZZLE_ROW master_row;
767
767
err_msg.length(0);
772
772
delete mi->rli.relay_log.description_event_for_queue;
773
773
mi->rli.relay_log.description_event_for_queue= 0;
775
if (!my_isdigit(&my_charset_bin,*mysql->server_version))
775
if (!my_isdigit(&my_charset_bin,*drizzle->server_version))
777
errmsg = "Master reported unrecognized MySQL version";
777
errmsg = "Master reported unrecognized DRIZZLE version";
778
778
err_code= ER_SLAVE_FATAL_ERROR;
779
779
sprintf(err_buff, ER(err_code), errmsg);
780
780
err_msg.append(err_buff);
785
Note the following switch will bug when we have MySQL branch 30 ;)
785
Note the following switch will bug when we have DRIZZLE branch 30 ;)
787
switch (*mysql->server_version)
787
switch (*drizzle->server_version)
792
errmsg = "Master reported unrecognized MySQL version";
792
errmsg = "Master reported unrecognized DRIZZLE version";
793
793
err_code= ER_SLAVE_FATAL_ERROR;
794
794
sprintf(err_buff, ER(err_code), errmsg);
795
795
err_msg.append(err_buff);
798
798
mi->rli.relay_log.description_event_for_queue= new
799
Format_description_log_event(1, mysql->server_version);
799
Format_description_log_event(1, drizzle->server_version);
802
802
mi->rli.relay_log.description_event_for_queue= new
803
Format_description_log_event(3, mysql->server_version);
803
Format_description_log_event(3, drizzle->server_version);
807
Master is MySQL >=5.0. Give a default Format_desc event, so that we can
807
Master is DRIZZLE >=5.0. Give a default Format_desc event, so that we can
808
808
take the early steps (like tests for "is this a 3.23 master") which we
809
809
have to take before we receive the real master's Format_desc which will
810
810
override this one. Note that the Format_desc we create below is garbage
812
812
master is 3.23, 4.0, etc.
814
814
mi->rli.relay_log.description_event_for_queue= new
815
Format_description_log_event(4, mysql->server_version);
815
Format_description_log_event(4, drizzle->server_version);
842
842
unavailable (very old master not supporting UNIX_TIMESTAMP()?).
845
if (!mysql_real_query(mysql, STRING_WITH_LEN("SELECT UNIX_TIMESTAMP()")) &&
846
(master_res= mysql_store_result(mysql)) &&
847
(master_row= mysql_fetch_row(master_res)))
845
if (!drizzle_real_query(drizzle, STRING_WITH_LEN("SELECT UNIX_TIMESTAMP()")) &&
846
(master_res= drizzle_store_result(drizzle)) &&
847
(master_row= drizzle_fetch_row(master_res)))
849
849
mi->clock_diff_with_master=
850
850
(long) (time((time_t*) 0) - strtoul(master_row[0], 0, 10));
855
855
sql_print_warning("\"SELECT UNIX_TIMESTAMP()\" failed on master, "
856
856
"do not trust column Seconds_Behind_Master of SHOW "
857
857
"SLAVE STATUS. Error: %s (%d)",
858
mysql_error(mysql), mysql_errno(mysql));
858
drizzle_error(drizzle), drizzle_errno(drizzle));
861
mysql_free_result(master_res);
861
drizzle_free_result(master_res);
864
864
Check that the master's server id and ours are different. Because if they
870
870
Note: we could have put a @@SERVER_ID in the previous SELECT
871
871
UNIX_TIMESTAMP() instead, but this would not have worked on 3.23 masters.
873
if (!mysql_real_query(mysql,
873
if (!drizzle_real_query(drizzle,
874
874
STRING_WITH_LEN("SHOW VARIABLES LIKE 'SERVER_ID'")) &&
875
(master_res= mysql_store_result(mysql)))
875
(master_res= drizzle_store_result(drizzle)))
877
if ((master_row= mysql_fetch_row(master_res)) &&
877
if ((master_row= drizzle_fetch_row(master_res)) &&
878
878
(::server_id == strtoul(master_row[1], 0, 10)) &&
879
879
!mi->rli.replicate_same_server_id)
882
882
"The slave I/O thread stops because master and slave have equal"
883
" MySQL server ids; these ids must be different for replication to work (or"
883
" DRIZZLE server ids; these ids must be different for replication to work (or"
884
884
" the --replicate-same-server-id option must be used on slave but this does"
885
885
" not always make sense; please check the manual before using it).";
886
886
err_code= ER_SLAVE_FATAL_ERROR;
887
887
sprintf(err_buff, ER(err_code), errmsg);
888
888
err_msg.append(err_buff);
890
mysql_free_result(master_res);
890
drizzle_free_result(master_res);
912
912
/* redundant with rest of code but safer against later additions */
913
if (*mysql->server_version == '3')
913
if (*drizzle->server_version == '3')
916
if ((*mysql->server_version == '4') &&
917
!mysql_real_query(mysql,
916
if ((*drizzle->server_version == '4') &&
917
!drizzle_real_query(drizzle,
918
918
STRING_WITH_LEN("SELECT @@GLOBAL.COLLATION_SERVER")) &&
919
(master_res= mysql_store_result(mysql)))
919
(master_res= drizzle_store_result(drizzle)))
921
if ((master_row= mysql_fetch_row(master_res)) &&
921
if ((master_row= drizzle_fetch_row(master_res)) &&
922
922
strcmp(master_row[0], global_system_variables.collation_server->name))
929
929
sprintf(err_buff, ER(err_code), errmsg);
930
930
err_msg.append(err_buff);
932
mysql_free_result(master_res);
932
drizzle_free_result(master_res);
949
949
This check is only necessary for 4.x masters (and < 5.0.4 masters but
950
950
those were alpha).
952
if ((*mysql->server_version == '4') &&
953
!mysql_real_query(mysql, STRING_WITH_LEN("SELECT @@GLOBAL.TIME_ZONE")) &&
954
(master_res= mysql_store_result(mysql)))
952
if ((*drizzle->server_version == '4') &&
953
!drizzle_real_query(drizzle, STRING_WITH_LEN("SELECT @@GLOBAL.TIME_ZONE")) &&
954
(master_res= drizzle_store_result(drizzle)))
956
if ((master_row= mysql_fetch_row(master_res)) &&
956
if ((master_row= drizzle_fetch_row(master_res)) &&
957
957
strcmp(master_row[0],
958
958
global_system_variables.time_zone->get_name()->ptr()))
965
965
sprintf(err_buff, ER(err_code), errmsg);
966
966
err_msg.append(err_buff);
968
mysql_free_result(master_res);
968
drizzle_free_result(master_res);
982
982
llstr((uint64_t) (mi->heartbeat_period*1000000000UL), llbuf);
983
983
sprintf(query, query_format, llbuf);
985
if (mysql_real_query(mysql, query, strlen(query))
985
if (drizzle_real_query(drizzle, query, strlen(query))
986
986
&& !check_io_slave_killed(mi->io_thd, mi, NULL))
988
988
err_msg.append("The slave I/O thread stops because querying master with '");
989
989
err_msg.append(query);
990
990
err_msg.append("' failed;");
991
991
err_msg.append(" error: ");
992
err_code= mysql_errno(mysql);
992
err_code= drizzle_errno(drizzle);
993
993
err_msg.qs_append(err_code);
994
994
err_msg.append(" '");
995
err_msg.append(mysql_error(mysql));
995
err_msg.append(drizzle_error(drizzle));
996
996
err_msg.append("'");
997
mysql_free_result(mysql_store_result(mysql));
997
drizzle_free_result(drizzle_store_result(drizzle));
1000
mysql_free_result(mysql_store_result(mysql));
1000
drizzle_free_result(drizzle_store_result(drizzle));
1092
int32_t register_slave_on_master(MYSQL* mysql, Master_info *mi,
1092
int32_t register_slave_on_master(DRIZZLE *drizzle, Master_info *mi,
1093
1093
bool *suppress_warnings)
1095
1095
uchar buf[1024], *pos= buf;
1117
1117
/* The master will fill in master_id */
1118
1118
int4store(pos, 0); pos+= 4;
1120
if (simple_command(mysql, COM_REGISTER_SLAVE, buf, (size_t) (pos- buf), 0))
1120
if (simple_command(drizzle, COM_REGISTER_SLAVE, buf, (size_t) (pos- buf), 0))
1122
if (mysql_errno(mysql) == ER_NET_READ_INTERRUPTED)
1122
if (drizzle_errno(drizzle) == ER_NET_READ_INTERRUPTED)
1124
1124
*suppress_warnings= true; // Suppress reconnect warning
1126
1126
else if (!check_io_slave_killed(mi->io_thd, mi, NULL))
1129
snprintf(buf, sizeof(buf), "%s (Errno: %d)", mysql_error(mysql),
1130
mysql_errno(mysql));
1129
snprintf(buf, sizeof(buf), "%s (Errno: %d)", drizzle_error(drizzle),
1130
drizzle_errno(drizzle));
1131
1131
mi->report(ERROR_LEVEL, ER_SLAVE_MASTER_COM_FAILURE,
1132
1132
ER(ER_SLAVE_MASTER_COM_FAILURE), "COM_REGISTER_SLAVE", buf);
1448
static int32_t request_dump(MYSQL* mysql, Master_info* mi,
1448
static int32_t request_dump(DRIZZLE *drizzle, Master_info* mi,
1449
1449
bool *suppress_warnings)
1451
1451
uchar buf[FN_REFLEN + 10];
1461
1461
int4store(buf + 6, server_id);
1462
1462
len = (uint32_t) strlen(logname);
1463
1463
memcpy(buf + 10, logname,len);
1464
if (simple_command(mysql, COM_BINLOG_DUMP, buf, len + 10, 1))
1464
if (simple_command(drizzle, COM_BINLOG_DUMP, buf, len + 10, 1))
1467
1467
Something went wrong, so we will just reconnect and retry later
1468
1468
in the future, we should do a better error analysis, but for
1469
1469
now we just fill up the error log :-)
1471
if (mysql_errno(mysql) == ER_NET_READ_INTERRUPTED)
1471
if (drizzle_errno(drizzle) == ER_NET_READ_INTERRUPTED)
1472
1472
*suppress_warnings= true; // Suppress reconnect warning
1474
1474
sql_print_error("Error on COM_BINLOG_DUMP: %d %s, will retry in %d secs",
1475
mysql_errno(mysql), mysql_error(mysql),
1475
drizzle_errno(drizzle), drizzle_error(drizzle),
1476
1476
mi->connect_retry);
1511
1511
if (disconnect_slave_event_count && !(mi->events_till_disconnect--))
1512
1512
return(packet_error);
1514
len = cli_safe_read(mysql);
1514
len = cli_safe_read(drizzle);
1515
1515
if (len == packet_error || (int32_t) len < 1)
1517
if (mysql_errno(mysql) == ER_NET_READ_INTERRUPTED)
1517
if (drizzle_errno(drizzle) == ER_NET_READ_INTERRUPTED)
1520
1520
We are trying a normal reconnect after a read timeout;
1527
1527
sql_print_error("Error reading packet from server: %s ( server_errno=%d)",
1528
mysql_error(mysql), mysql_errno(mysql));
1528
drizzle_error(drizzle), drizzle_errno(drizzle));
1529
1529
return(packet_error);
1532
1532
/* Check if eof packet */
1533
if (len < 8 && mysql->net.read_pos[0] == 254)
1533
if (len < 8 && drizzle->net.read_pos[0] == 254)
1535
1535
sql_print_information("Slave: received end packet from server, apparent "
1536
1536
"master shutdown: %s",
1537
mysql_error(mysql));
1537
drizzle_error(drizzle));
1538
1538
return(packet_error);
1862
1862
binary log is corrupted (you can check this by running 'mysqlbinlog' on the \
1863
1863
binary log), the slave's relay log is corrupted (you can check this by running \
1864
1864
'mysqlbinlog' on the relay log), a network problem, or a bug in the master's \
1865
or slave's MySQL code. If you want to check the master's binary log or slave's \
1865
or slave's DRIZZLE code. If you want to check the master's binary log or slave's \
1866
1866
relay log, you will be able to know their names by issuing 'SHOW SLAVE STATUS' \
1867
1867
on this slave.\
1884
1884
no messages are added to the log.
1886
1886
@param[in] thd Thread context.
1887
@param[in] mysql MySQL connection.
1887
@param[in] DRIZZLE DRIZZLE connection.
1888
1888
@param[in] mi Master connection information.
1889
1889
@param[in,out] retry_count Number of attempts to reconnect.
1890
1890
@param[in] suppress_warnings TRUE when a normal net read timeout
1896
1896
@retval 1 There was an error.
1899
static int32_t try_to_reconnect(THD *thd, MYSQL *mysql, Master_info *mi,
1899
static int32_t try_to_reconnect(THD *thd, DRIZZLE *drizzle, Master_info *mi,
1900
1900
uint32_t *retry_count, bool suppress_warnings,
1901
1901
const char *messages[SLAVE_RECON_MSG_MAX])
1936
1936
sql_print_information(buf);
1939
if (safe_reconnect(thd, mysql, mi, 1) || io_slave_killed(thd, mi))
1939
if (safe_reconnect(thd, drizzle, mi, 1) || io_slave_killed(thd, mi))
1941
1941
if (global_system_variables.log_warnings)
1942
1942
sql_print_information(messages[SLAVE_RECON_MSG_KILLED_AFTER]);
1991
1991
pthread_mutex_unlock(&mi->run_lock);
1992
1992
pthread_cond_broadcast(&mi->start_cond);
1994
if (!(mi->mysql = mysql = drizzle_create(NULL)))
1994
if (!(mi->drizzle= drizzle = drizzle_create(NULL)))
1996
1996
mi->report(ERROR_LEVEL, ER_SLAVE_FATAL_ERROR,
1997
1997
ER(ER_SLAVE_FATAL_ERROR), "error in drizzle_create()");
2001
2001
thd_proc_info(thd, "Connecting to master");
2002
2002
// we can get killed during safe_connect
2003
if (!safe_connect(thd, mysql, mi))
2003
if (!safe_connect(thd, drizzle, mi))
2005
2005
sql_print_information("Slave I/O thread: connected to master '%s@%s:%d',"
2006
2006
"replication started in log '%s' at position %s",
2012
2012
thread, since a replication event can become this much larger than
2013
2013
the corresponding packet (query) sent from client to master.
2015
mysql->net.max_packet_size= thd->net.max_packet_size+= MAX_LOG_EVENT_HEADER;
2015
drizzle->net.max_packet_size= thd->net.max_packet_size+= MAX_LOG_EVENT_HEADER;
2025
2025
// TODO: the assignment below should be under mutex (5.0)
2026
2026
mi->slave_running= MYSQL_SLAVE_RUN_CONNECT;
2027
thd->slave_net = &mysql->net;
2027
thd->slave_net = &drizzle->net;
2028
2028
thd_proc_info(thd, "Checking master version");
2029
if (get_master_version_and_clock(mysql, mi))
2029
if (get_master_version_and_clock(drizzle, mi))
2032
2032
if (mi->rli.relay_log.description_event_for_queue->binlog_version > 1)
2035
2035
Register ourselves with the master.
2037
2037
thd_proc_info(thd, "Registering slave on master");
2038
if (register_slave_on_master(mysql, mi, &suppress_warnings))
2038
if (register_slave_on_master(drizzle, mi, &suppress_warnings))
2040
2040
if (!check_io_slave_killed(thd, mi, "Slave I/O thread killed "
2041
2041
"while registering slave on master"))
2043
2043
sql_print_error("Slave I/O thread couldn't register on master");
2044
if (try_to_reconnect(thd, mysql, mi, &retry_count, suppress_warnings,
2044
if (try_to_reconnect(thd, drizzle, mi, &retry_count, suppress_warnings,
2045
2045
reconnect_messages[SLAVE_RECON_ACT_REG]))
2054
2054
retry_count_reg++;
2055
2055
sql_print_information("Forcing to reconnect slave I/O thread");
2056
if (try_to_reconnect(thd, mysql, mi, &retry_count, suppress_warnings,
2056
if (try_to_reconnect(thd, drizzle, mi, &retry_count, suppress_warnings,
2057
2057
reconnect_messages[SLAVE_RECON_ACT_REG]))
2059
2059
goto connected;
2063
2063
while (!io_slave_killed(thd,mi))
2065
2065
thd_proc_info(thd, "Requesting binlog dump");
2066
if (request_dump(mysql, mi, &suppress_warnings))
2066
if (request_dump(drizzle, mi, &suppress_warnings))
2068
2068
sql_print_error("Failed on request_dump()");
2069
2069
if (check_io_slave_killed(thd, mi, "Slave I/O thread killed while \
2070
2070
requesting master dump") ||
2071
try_to_reconnect(thd, mysql, mi, &retry_count, suppress_warnings,
2071
try_to_reconnect(thd, drizzle, mi, &retry_count, suppress_warnings,
2072
2072
reconnect_messages[SLAVE_RECON_ACT_DUMP]))
2074
2074
goto connected;
2078
2078
retry_count_dump++;
2079
2079
sql_print_information("Forcing to reconnect slave I/O thread");
2080
if (try_to_reconnect(thd, mysql, mi, &retry_count, suppress_warnings,
2080
if (try_to_reconnect(thd, drizzle, mi, &retry_count, suppress_warnings,
2081
2081
reconnect_messages[SLAVE_RECON_ACT_DUMP]))
2083
2083
goto connected;
2093
2093
we're in fact receiving nothing.
2095
2095
thd_proc_info(thd, "Waiting for master to send event");
2096
event_len= read_event(mysql, mi, &suppress_warnings);
2096
event_len= read_event(drizzle, mi, &suppress_warnings);
2097
2097
if (check_io_slave_killed(thd, mi, "Slave I/O thread killed while \
2098
2098
reading event"))
2102
2102
retry_count_event++;
2103
2103
sql_print_information("Forcing to reconnect slave I/O thread");
2104
if (try_to_reconnect(thd, mysql, mi, &retry_count, suppress_warnings,
2104
if (try_to_reconnect(thd, drizzle, mi, &retry_count, suppress_warnings,
2105
2105
reconnect_messages[SLAVE_RECON_ACT_EVENT]))
2107
2107
goto connected;
2110
2110
if (event_len == packet_error)
2112
uint32_t mysql_error_number= mysql_errno(mysql);
2113
switch (mysql_error_number) {
2112
uint32_t drizzle_error_number= drizzle_errno(drizzle);
2113
switch (drizzle_error_number) {
2114
2114
case CR_NET_PACKET_TOO_LARGE:
2115
2115
sql_print_error("\
2116
2116
Log entry on master is longer than max_allowed_packet (%ld) on \
2119
2119
thd->variables.max_allowed_packet);
2121
2121
case ER_MASTER_FATAL_ERROR_READING_BINLOG:
2122
sql_print_error(ER(mysql_error_number), mysql_error_number,
2123
mysql_error(mysql));
2122
sql_print_error(ER(drizzle_error_number), drizzle_error_number,
2123
drizzle_error(drizzle));
2125
2125
case EE_OUTOFMEMORY:
2126
2126
case ER_OUTOFMEMORY:
2128
2128
Stopping slave I/O thread due to out-of-memory error from master");
2131
if (try_to_reconnect(thd, mysql, mi, &retry_count, suppress_warnings,
2131
if (try_to_reconnect(thd, drizzle, mi, &retry_count, suppress_warnings,
2132
2132
reconnect_messages[SLAVE_RECON_ACT_EVENT]))
2134
2134
goto connected;
2137
2137
retry_count=0; // ok event, reset retry counter
2138
2138
thd_proc_info(thd, "Queueing master event to the relay log");
2139
if (queue_event(mi,(const char*)mysql->net.read_pos + 1, event_len))
2139
if (queue_event(mi,(const char*)drizzle->net.read_pos + 1, event_len))
2650
2650
if (mi->rli.relay_log.description_event_for_queue->binlog_version >= 4)
2652
2652
delete mi->rli.relay_log.description_event_for_queue;
2653
/* start from format 3 (MySQL 4.0) again */
2653
/* start from format 3 (DRIZZLE 4.0) again */
2654
2654
mi->rli.relay_log.description_event_for_queue= new
2655
2655
Format_description_log_event(3);
3117
static int32_t safe_connect(THD* thd, MYSQL* mysql, Master_info* mi)
3117
static int32_t safe_connect(THD* thd, DRIZZLE *drizzle, Master_info* mi)
3119
return(connect_to_master(thd, mysql, mi, 0, 0));
3119
return(connect_to_master(thd, drizzle, mi, 0, 0));
3129
3129
master_retry_count times
3132
static int32_t connect_to_master(THD* thd, MYSQL* mysql, Master_info* mi,
3132
static int32_t connect_to_master(THD* thd, DRIZZLE *drizzle, Master_info* mi,
3133
3133
bool reconnect, bool suppress_warnings)
3135
3135
int32_t slave_was_killed;
3142
3142
if (opt_slave_compressed_protocol)
3143
3143
client_flag=CLIENT_COMPRESS; /* We will use compression */
3145
mysql_options(mysql, MYSQL_OPT_CONNECT_TIMEOUT, (char *) &slave_net_timeout);
3146
mysql_options(mysql, MYSQL_OPT_READ_TIMEOUT, (char *) &slave_net_timeout);
3145
drizzle_options(drizzle, DRIZZLE_OPT_CONNECT_TIMEOUT, (char *) &slave_net_timeout);
3146
drizzle_options(drizzle, DRIZZLE_OPT_READ_TIMEOUT, (char *) &slave_net_timeout);
3148
mysql_options(mysql, MYSQL_SET_CHARSET_NAME, default_charset_info->csname);
3148
drizzle_options(drizzle, DRIZZLE_SET_CHARSET_NAME, default_charset_info->csname);
3149
3149
/* This one is not strictly needed but we have it here for completeness */
3150
mysql_options(mysql, MYSQL_SET_CHARSET_DIR, (char *) charsets_dir);
3150
drizzle_options(drizzle, DRIZZLE_SET_CHARSET_DIR, (char *) charsets_dir);
3152
3152
while (!(slave_was_killed = io_slave_killed(thd,mi)) &&
3153
(reconnect ? mysql_reconnect(mysql) != 0 :
3154
mysql_real_connect(mysql, mi->host, mi->user, mi->password, 0,
3153
(reconnect ? drizzle_reconnect(drizzle) != 0 :
3154
drizzle_connect(drizzle, mi->host, mi->user, mi->password, 0,
3155
3155
mi->port, 0, client_flag) == 0))
3157
3157
/* Don't repeat last error */
3158
if ((int32_t)mysql_errno(mysql) != last_errno)
3158
if ((int32_t)drizzle_errno(drizzle) != last_errno)
3160
last_errno=mysql_errno(mysql);
3160
last_errno=drizzle_errno(drizzle);
3161
3161
suppress_warnings= 0;
3162
3162
mi->report(ERROR_LEVEL, last_errno,
3163
3163
"error %s to master '%s@%s:%d'"
3201
3201
mi->user, mi->host, mi->port);
3203
3203
#ifdef SIGNAL_WITH_VIO_CLOSE
3204
thd->set_active_vio(mysql->net.vio);
3204
thd->set_active_vio(drizzle->net.vio);
3207
mysql->reconnect= 1;
3207
drizzle->reconnect= 1;
3208
3208
return(slave_was_killed);
3217
3217
master_retry_count times
3220
static int32_t safe_reconnect(THD* thd, MYSQL* mysql, Master_info* mi,
3220
static int32_t safe_reconnect(THD* thd, DRIZZLE *drizzle, Master_info* mi,
3221
3221
bool suppress_warnings)
3223
return(connect_to_master(thd, mysql, mi, 1, suppress_warnings));
3223
return(connect_to_master(thd, drizzle, mi, 1, suppress_warnings));