summaryrefslogtreecommitdiff
path: root/sql/log_event.cc
diff options
context:
space:
mode:
authorsasha@mysql.sashanet.com <>2000-11-16 22:59:50 -0700
committersasha@mysql.sashanet.com <>2000-11-16 22:59:50 -0700
commitd52812635920a23fb2c6ce4e784eb1d687fe48a7 (patch)
treed8068f5b0d790b22d0da98d40533c9240c853251 /sql/log_event.cc
parent02ee7434255bbb6ce9da36c94668df9e4771c69d (diff)
downloadmariadb-git-d52812635920a23fb2c6ce4e784eb1d687fe48a7.tar.gz
fixed bugs in IO_CACHE and Load_event constructor. The code now passes
replication test suite
Diffstat (limited to 'sql/log_event.cc')
-rw-r--r--sql/log_event.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/sql/log_event.cc b/sql/log_event.cc
index e895914aa4d..be053e2f260 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -256,7 +256,7 @@ void Log_event::print_header(FILE* file)
{
fputc('#', file);
print_timestamp(file);
- fprintf(file, " server id %ld ", server_id);
+ fprintf(file, " server id %d ", server_id);
}
void Log_event::print_timestamp(FILE* file, time_t* ts)
@@ -418,7 +418,7 @@ Query_log_event::Query_log_event(IO_CACHE* file, time_t when_arg,
Query_log_event::Query_log_event(const char* buf, int event_len):
Log_event(buf),data_buf(0), query(NULL), db(NULL)
{
- if (event_len < QUERY_EVENT_OVERHEAD)
+ if ((uint)event_len < QUERY_EVENT_OVERHEAD)
return;
ulong data_len;
buf += EVENT_LEN_OFFSET;
@@ -577,10 +577,10 @@ Load_log_event::Load_log_event(const char* buf, int event_len):
{
ulong data_len;
- if(event_len < (LOAD_EVENT_OVERHEAD + LOG_EVENT_HEADER_LEN))
+ if((uint)event_len < (LOAD_EVENT_OVERHEAD + LOG_EVENT_HEADER_LEN))
return;
-
buf += EVENT_LEN_OFFSET;
+ memcpy(&sql_ex, buf + LOAD_HEADER_LEN + 4, sizeof(sql_ex));
data_len = event_len;
if(!(data_buf = (char*)my_malloc(data_len + 1, MYF(MY_WME))))
@@ -671,7 +671,7 @@ void Load_log_event::print(FILE* file, bool short_form)
}
if((int)skip_lines > 0)
- fprintf(file, " IGNORE %ld LINES ", skip_lines);
+ fprintf(file, " IGNORE %d LINES ", skip_lines);
if (num_fields)
{