List:Commits« Previous MessageNext Message »
From:Georgi Kodinov Date:August 19 2009 3:22pm
Subject:bzr commit into mysql-5.1 branch (joro:3073) Bug#45962
View as plain text  
#At file:///home/kgeorge/mysql/work/B45962-5.1-bugteam/ based on revid:joro@stripped

 3073 Georgi Kodinov	2009-07-09
      Bug #45962: memory leak after 'sort aborted' errors
      
      When the function exits with an error it was not
      freeing the local Unique class instance.
      Fixed my making sure all the places where the function
      returns from are freeing the Unique instance 

    modified:
      sql/opt_range.cc
=== modified file 'sql/opt_range.cc'
--- a/sql/opt_range.cc	2009-07-16 12:43:17 +0000
+++ b/sql/opt_range.cc	2009-07-09 12:05:30 +0000
@@ -8065,7 +8065,10 @@ int QUICK_INDEX_MERGE_SELECT::read_keys_
       if (cur_quick->file->inited != handler::NONE) 
         cur_quick->file->ha_index_end();
       if (cur_quick->init() || cur_quick->reset())
+      {
+        delete unique;
         DBUG_RETURN(1);
+      }
     }
 
     if (result)
@@ -8073,13 +8076,17 @@ int QUICK_INDEX_MERGE_SELECT::read_keys_
       if (result != HA_ERR_END_OF_FILE)
       {
         cur_quick->range_end();
+        delete unique;
         DBUG_RETURN(result);
       }
       break;
     }
 
     if (thd->killed)
+    {
+      delete unique;
       DBUG_RETURN(1);
+    }
 
     /* skip row if it will be retrieved by clustered PK scan */
     if (pk_quick_select && pk_quick_select->row_in_ranges())
@@ -8088,8 +8095,10 @@ int QUICK_INDEX_MERGE_SELECT::read_keys_
     cur_quick->file->position(cur_quick->record);
     result= unique->unique_add((char*)cur_quick->file->ref);
     if (result)
+    {
+      delete unique;
       DBUG_RETURN(1);
-
+    }
   }
 
   /*


Attachment: [text/bzr-bundle] bzr/joro@sun.com-20090709120530-32st2vp5vvsbswzv.bundle
Thread
bzr commit into mysql-5.1 branch (joro:3073) Bug#45962Georgi Kodinov19 Aug