summaryrefslogtreecommitdiff
path: root/sql/slave.cc
diff options
context:
space:
mode:
authorunknown <lars@mysql.com/black.(none)>2006-11-13 17:54:01 +0100
committerunknown <lars@mysql.com/black.(none)>2006-11-13 17:54:01 +0100
commit1613ad2c9836f83d366ca9d6d3aaff741262842c (patch)
treeeb8d5b16379b7f3f8441562d0056a1f68808395e /sql/slave.cc
parent181c9b4dd4c23c5ef4d8c2562c055e35b6267bfe (diff)
parent8fd48ccec01350f65c280cd754aac34d89609fab (diff)
downloadmariadb-git-1613ad2c9836f83d366ca9d6d3aaff741262842c.tar.gz
Merge mysql.com:/home/bk/MERGE/mysql-4.1-merge
into mysql.com:/home/bk/MERGE/mysql-5.0-merge BitKeeper/triggers/post-commit: Auto merged mysql-test/t/func_gconcat.test: Auto merged sql/item_sum.cc: Auto merged sql/sql_repl.cc: Auto merged sql/log_event.h: Manual merge sql/slave.cc: Manual merge
Diffstat (limited to 'sql/slave.cc')
-rw-r--r--sql/slave.cc21
1 files changed, 18 insertions, 3 deletions
diff --git a/sql/slave.cc b/sql/slave.cc
index 25ea918f02f..d093eefc2ee 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -2895,6 +2895,13 @@ static int init_slave_thread(THD* thd, SLAVE_THD_TYPE thd_type)
SYSTEM_THREAD_SLAVE_SQL : SYSTEM_THREAD_SLAVE_IO;
thd->security_ctx->skip_grants();
my_net_init(&thd->net, 0);
+/*
+ Adding MAX_LOG_EVENT_HEADER_LEN to the max_allowed_packet on all
+ slave threads, since a replication event can become this much larger
+ than the corresponding packet (query) sent from client to master.
+*/
+ thd->variables.max_allowed_packet= global_system_variables.max_allowed_packet
+ + MAX_LOG_EVENT_HEADER; /* note, incr over the global not session var */
thd->net.read_timeout = slave_net_timeout;
thd->slave_thread = 1;
set_slave_thread_options(thd);
@@ -3483,11 +3490,19 @@ slave_begin:
thd->proc_info = "Connecting to master";
// we can get killed during safe_connect
if (!safe_connect(thd, mysql, mi))
+ {
sql_print_information("Slave I/O thread: connected to master '%s@%s:%d',\
replication started in log '%s' at position %s", mi->user,
- mi->host, mi->port,
- IO_RPL_LOG_NAME,
- llstr(mi->master_log_pos,llbuff));
+ mi->host, mi->port,
+ IO_RPL_LOG_NAME,
+ llstr(mi->master_log_pos,llbuff));
+ /*
+ Adding MAX_LOG_EVENT_HEADER_LEN to the max_packet_size on the I/O
+ thread, since a replication event can become this much larger than
+ the corresponding packet (query) sent from client to master.
+ */
+ mysql->net.max_packet_size= thd->net.max_packet_size+= MAX_LOG_EVENT_HEADER;
+ }
else
{
sql_print_information("Slave I/O thread killed while connecting to master");