replication fixes

parent 28d23e87
......@@ -41585,6 +41585,9 @@ not yet 100 % confident in this code.
@appendixsubsec Changes in release 3.23.34
@itemize @bullet
@item
Limit query length for replication by max_allowed_packet, not the arbitrary
limit of 4 MB
@item
Allow space around @code{=} in argument to @code{--set-variable}.
@item
Fixed problem in automatic repair that could let some threads in state
......@@ -41606,7 +41609,7 @@ Fixed that @code{mysqlbinlog} writes the timestamp value for each query.
This ensures that on gets same values for date functions like @code{NOW()}
when using @code{mysqlbinlog} to pipe the queries to another server.
@item
Allow one to use @code{--skip-gemeni}, @code{--skip-bdb} and
Allow one to use @code{--skip-gemini}, @code{--skip-bdb} and
@code{--skip-innobase} to @code{mysqld} even if these databases are not
compiled in @code{mysqld}.
@item
......@@ -21,5 +21,9 @@ Log_name
master-bin.003
master-bin.004
master-bin.005
File Position Binlog_do_db Binlog_ignore_db
master-bin.005 1504
Master_Host Master_User Master_Port Connect_retry Log_File Pos Slave_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter
127.0.0.1 root 9306 60 master-bin.005 1504 Yes 0 0
count(*)
100
......@@ -78,11 +78,13 @@ while ($1)
dec $1;
}
show master logs;
show master status;
save_master_pos;
connection slave;
slave stop;
slave start;
sync_with_master;
show slave status;
select count(*) from t3 where n = 4;
#clean up
connection master;
......
......@@ -85,10 +85,11 @@ int Log_event::read_log_event(IO_CACHE* file, String* packet,
return file->error > 0 ? LOG_READ_TRUNC: LOG_READ_IO;
}
data_len = uint4korr(buf + EVENT_LEN_OFFSET);
if (data_len < LOG_EVENT_HEADER_LEN || data_len > MAX_EVENT_LEN)
if (data_len < LOG_EVENT_HEADER_LEN || data_len > max_allowed_packet)
{
if (log_lock) pthread_mutex_unlock(log_lock);
return LOG_READ_BOGUS;
return (data_len < LOG_EVENT_HEADER_LEN) ? LOG_READ_BOGUS :
LOG_READ_TOO_LARGE;
}
packet->append(buf, sizeof(buf));
data_len -= LOG_EVENT_HEADER_LEN;
......
......@@ -31,6 +31,7 @@
#define LOG_READ_IO -3
#define LOG_READ_MEM -5
#define LOG_READ_TRUNC -6
#define LOG_READ_TOO_LARGE -7
#define LOG_EVENT_OFFSET 4
#define BINLOG_VERSION 1
......@@ -42,7 +43,6 @@
+ sizeof(uint32) + 2 + sizeof(uint32))
#define EVENT_LEN_OFFSET 9
#define EVENT_TYPE_OFFSET 4
#define MAX_EVENT_LEN 4*1024*1024
#define QUERY_EVENT_OVERHEAD (LOG_EVENT_HEADER_LEN+QUERY_HEADER_LEN)
#define ROTATE_EVENT_OVERHEAD LOG_EVENT_HEADER_LEN
#define LOAD_EVENT_OVERHEAD (LOG_EVENT_HEADER_LEN+LOAD_HEADER_LEN+sizeof(sql_ex_info))
......
......@@ -352,6 +352,10 @@ sweepstakes if you report the bug";
case LOG_READ_BOGUS:
errmsg = "bogus data in log event";
break;
case LOG_READ_TOO_LARGE:
errmsg = "log event entry exceeded max_allowed_packet -\
increase max_allowed_packet on master";
break;
case LOG_READ_IO:
errmsg = "I/O error reading log event";
break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment