|
|||||||||||
|
bk commit into 5.2 tree (cbell:1.2535)
From: <cbell(at)mysql.com>
Date: Sat Jun 30 2007 - 15:04:34 EDT
ChangeSet@1.2535, 2007-06-30 15:04:02-04:00, cbell@mysql_cab_desk. +2 -0 WL#3570 : Default backup This patch adds an array of ptrs to be used to allocate the memory while the data is being sent from the kernel and then free them after the record is written via the handler call. sql/backup/be_default.cc@1.6, 2007-06-30 15:03:51-04:00, cbell@mysql_cab_desk. +18 -3 WL#3570 : Default backup This patch corrects an issue discovered in valgrind tests. The memory for records whose blob fits into the buffer data field from the kernel was not being freed. The change adds an array of ptrs to be used to allocate the memory while the data is being sent from the kernel and then free them after the record is written via the handler call. sql/backup/be_default.h@1.5, 2007-06-30 15:03:51-04:00, cbell@mysql_cab_desk. +3 -1 WL#3570 : Default backup This patch corrects an issue discovered in valgrind tests. The memory for records whose blob fits into the buffer data field from the kernel was not being freed. The change adds an array of ptrs to be used to allocate the memory while the data is being sent from the kernel and then free them after the record is written via the handler call. # This is a BitKeeper patch. What follows are the unified diffs for the
/**
if (write_row)
{
last_write_res = hdl->write_row(cur_table->record[0]);
+ /*
+ Free the blob pointers used.
+ */
+ for (int i=0; i < blob_ptr_index; i++)
+ if (blob_ptrs[i])
+ {
+ my_free(blob_ptrs[i], MYF(0));
+ blob_ptrs[i]= 0;
+ }
+ blob_ptr_index= 0;
if (last_write_res == 0)
mode= WRITE_RCD;
else
@@ -795,9 +808,11 @@
*/
case BLOB_ONCE:
{
- ptr= (byte *)my_malloc(size, MYF(MY_WME));
- memcpy(ptr, (byte *)buf.data + META_SIZE, size);
- ((Field_blob*) cur_table->field[*cur_blob])->set_ptr(size, (uchar *)ptr);
+ blob_ptrs[blob_ptr_index]= (byte *)my_malloc(size, MYF(MY_WME));
+ memcpy(blob_ptrs[blob_ptr_index], (byte *)buf.data + META_SIZE, size);
+ ((Field_blob*) cur_table->field[*cur_blob])->set_ptr(size,
+ (uchar *)blob_ptrs[blob_ptr_index]);
+ blob_ptr_index++;
mode= CHECK_BLOBS;
DBUG_RETURN(PROCESSING);
}
--- 1.4/sql/backup/be_default.h 2007-06-30 15:04:09 -04:00
+++ 1.5/sql/backup/be_default.h 2007-06-30 15:04:09 -04:00
@@ -180,7 +180,7 @@
WRITE_BLOB_BUFFER ///< Buffer blobs mode
} RESTORE_MODE;
-- MySQL Code Commits Mailing List For list archives: http://lists.mysql.com/commits To unsubscribe: http://lists.mysql.com/commits?unsub=lists@pantek.comReceived on Sat Jun 30 15:04:50 2007 This archive was generated by hypermail 2.1.8 : Sat Jun 30 2007 - 15:10:04 EDT |
||||||||||
|
|||||||||||