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

 2787 V Narayanan	2009-07-17 [merge]
      merging with mysql-5.0-bugteam

    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-12 05:48:53 +0000
@@ -31,10 +31,10 @@
   DESCRIPTION
     init_dynamic_array() initiates array and allocate space for 
     init_alloc eilements. 
-    Array is usable even if space allocation failed.
+    Array is usable even if space allocation failed, hence, the
+    function never returns TRUE.
 
   RETURN VALUE
-    TRUE	my_malloc_ci() failed
     FALSE	Ok
 */
 
@@ -56,11 +56,12 @@ 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);
-  }
   DBUG_RETURN(FALSE);
 } 
 


Attachment: [text/bzr-bundle] bzr/v.narayanan@sun.com-20090717074022-t72g5ho2xm9fij2u.bundle
Thread
bzr commit into mysql-5.0-bugteam branch (v.narayanan:2787)V Narayanan17 Jul