Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

bk commit into 5.2 tree (cbell:1.2535)

From: <cbell(at)mysql.com>
Date: Sat Jun 30 2007 - 15:04:34 EDT


Below is the list of changes that have just been committed into a local 5.2 repository of cbell. When cbell does a push these changes will be propagated to the main repository and, within 24 hours after the push, to the public repository.
For information on how to access the public repository see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

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.     

Do you need help?X

    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
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: cbell
# Host: mysql_cab_desk.
# Root: C:/source/c++/mysql-5.2-backup-merge-test

  • 1.5/sql/backup/be_default.cc 2007-06-30 15:04:09 -04:00 +++ 1.6/sql/backup/be_default.cc 2007-06-30 15:04:09 -04:00 @@ -492,6 +492,9 @@ */ tables_in_backup= build_table_list(tables, TL_WRITE); all_tables= tables_in_backup; + for (int i=0; i < MAX_FIELDS; i++) + blob_ptrs[i]= 0; + blob_ptr_index= 0; }

 /**
@@ -771,6 +774,16 @@

     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;
 
  • result_t truncate_table(TABLE *tbl); + result_t truncate_table(TABLE *tbl); int next_table(); RESTORE_MODE mode; ///< Indicates which mode the code is in uint tbl_num; ///< The index of the current table. @@ -192,6 +192,8 @@ Buffer_iterator rec_buffer; ///< Buffer iterator for windowing records Buffer_iterator blob_buffer; ///< Buffer iterator for windowing BLOB fields TABLE_LIST *tables_in_backup; ///< List of tables used in backup. + byte *blob_ptrs[MAX_FIELDS]; ///< List of blob pointers used + int blob_ptr_index; ///< Position in blob pointer list }; } // default_backup namespace
-- 
MySQL Code Commits Mailing List
For list archives: 
http://lists.mysql.com/commits
To unsubscribe:    
http://lists.mysql.com/commits?unsub=lists@pantek.com
Received 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


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library