List:Commits« Previous MessageNext Message »
From:V Narayanan Date:July 9 2009 10:26am
Subject:bzr commit into mysql-5.0-bugteam branch (v.narayanan:2800) Bug#43572
View as plain text  
#At file:///home/narayanan/Work/mysql_checkouts/shared_repository_directory/mysql-5.0-bugteam-43572-2/ based on revid:joro@stripped

 2800 V Narayanan	2009-07-09
      Bug#43572 Handle failures from hash_init
      
      This patch is a follow up to http://lists.mysql.com/commits/76678.
      When an allocation failure occurs for the buffer in the dynamic
      array, an error condition was being set. The dynamic array is
      usable even if the memory allocation fails. Since in most cases
      the thread can continue to work without any problems the error
      condition should not be set here.
      
      This patch adds logic to remove the error condition from being set
      when the memory allocation for the buffer in dynamic array fails.
     @ mysys/array.c
        Bug#43572 Handle failures from hash_init
        
        Remove the MY_WME flag from the call to malloc in order to
        prevent the error status from being set.

    modified:
      mysys/array.c
=== modified file 'mysys/array.c'
--- a/mysys/array.c	2007-03-20 14:34:25 +0000
+++ b/mysys/array.c	2009-07-09 10:26:15 +0000
@@ -56,7 +56,11 @@ my_bool init_dynamic_array(DYNAMIC_ARRAY
   array->max_element=init_alloc;
   array->alloc_increment=alloc_increment;
   array->size_of_element=element_size;
-  if (!(array->buffer=(char*) my_malloc_ci(element_size*init_alloc,MYF(MY_WME))))
+  /* 
+    Since the dynamic array is usable even if allocation fails here malloc
+    should not throw an error
+  */
+  if (!(array->buffer= (char*) my_malloc_ci(element_size*init_alloc, MYF(0))))
   {
     array->max_element=0;
     DBUG_RETURN(TRUE);


Attachment: [text/bzr-bundle] bzr/v.narayanan@sun.com-20090709102615-mfplmn7qjwp6riip.bundle
Thread
bzr commit into mysql-5.0-bugteam branch (v.narayanan:2800) Bug#43572V Narayanan9 Jul
  • Re: bzr commit into mysql-5.0-bugteam branch (v.narayanan:2800)Bug#43572Ingo Strüwing10 Jul
    • Re: bzr commit into mysql-5.0-bugteam branch (v.narayanan:2800)Bug#43572V Narayanan12 Jul
    • Re: bzr commit into mysql-5.0-bugteam branch (v.narayanan:2800)Bug#43572Sergey Vojtovich14 Jul