summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorunknown <joerg@trift2.>2007-06-04 11:24:49 +0200
committerunknown <joerg@trift2.>2007-06-04 11:24:49 +0200
commit41798c07a51424fdd58d1a195e2bee224e24a6d2 (patch)
tree0bb2b25762de3500390b04abe2f502cf291d6398 /client
parent4b679a86492b0dbb95066bfb02327833f3048f78 (diff)
parentf42bcd7774b09cd05fcb4a9e29496de5b8ebb33a (diff)
downloadmariadb-git-41798c07a51424fdd58d1a195e2bee224e24a6d2.tar.gz
Merge trift2.:/MySQL/M51/mysql-5.1
into trift2.:/MySQL/M51/push-5.1 include/config-win.h: Auto merged mysql-test/mysql-test-run.pl: Auto merged mysql-test/t/disabled.def: Auto merged mysql-test/t/mysqltest.test: Auto merged mysql-test/t/ps.test: Auto merged sql/sql_parse.cc: Auto merged
Diffstat (limited to 'client')
-rw-r--r--client/mysqlbinlog.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc
index 7df13da6cd8..edade347783 100644
--- a/client/mysqlbinlog.cc
+++ b/client/mysqlbinlog.cc
@@ -635,6 +635,7 @@ Create_file event for file_id: %u\n",exv->file_id);
print_event_info->common_header_len=
glob_description_event->common_header_len;
ev->print(result_file, print_event_info);
+ ev->temp_buf= 0; // as the event ref is zeroed
/*
We don't want this event to be deleted now, so let's hide it (I
(Guilhem) should later see if this triggers a non-serious Valgrind
@@ -682,8 +683,16 @@ Begin_load_query event for file_id: %u\n", exlq->file_id);
end:
rec_count++;
+ /*
+ Destroy the log_event object. If reading from a remote host,
+ set the temp_buf to NULL so that memory isn't freed twice.
+ */
if (ev)
+ {
+ if (remote_opt)
+ ev->temp_buf= 0;
delete ev;
+ }
DBUG_RETURN(0);
}
@@ -1172,6 +1181,12 @@ could be out of memory");
error= 1;
goto err;
}
+ /*
+ If reading from a remote host, ensure the temp_buf for the
+ Log_event class is pointing to the incoming stream.
+ */
+ if (remote_opt)
+ ev->register_temp_buf((char*) net->read_pos + 1);
Log_event_type type= ev->get_type_code();
if (glob_description_event->binlog_version >= 3 ||