diff options
author | Jim Winstead <jimw@mysql.com> | 2009-05-12 14:20:33 -0700 |
---|---|---|
committer | Jim Winstead <jimw@mysql.com> | 2009-05-12 14:20:33 -0700 |
commit | 6cbe3ef3f9b594d4f87ebdfbc7159191f9291ea3 (patch) | |
tree | b1e275cabb602c8d7d5cdf224e291d0d5a694f15 /client | |
parent | 71cbbff7ded14bb23189eec1a4345133970c33ca (diff) | |
parent | 0781a302628077dae05db3542f0885d031a99b36 (diff) | |
download | mariadb-git-6cbe3ef3f9b594d4f87ebdfbc7159191f9291ea3.tar.gz |
Merge from 5.0-bugteam
Diffstat (limited to 'client')
-rw-r--r-- | client/mysqlbinlog.cc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index ed072902730..36b86ae7a96 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -626,6 +626,7 @@ Create_file event for file_id: %u\n",exv->file_id); glob_description_event= (Format_description_log_event*) ev; print_event_info->common_header_len= glob_description_event->common_header_len; ev->print(result_file, print_event_info); + ev->temp_buf= 0; /* 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 @@ -668,8 +669,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); } @@ -1151,6 +1160,11 @@ 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. + */ + ev->register_temp_buf((char *) net->read_pos + 1); Log_event_type type= ev->get_type_code(); if (glob_description_event->binlog_version >= 3 || |