List:Commits« Previous MessageNext Message »
From:V Narayanan Date:July 24 2009 8:29am
Subject:bzr push into mysql-5.1-bugteam branch (v.narayanan:3036 to 3037)
View as plain text  
 3037 V Narayanan	2009-07-24 [merge]
      merging with mysql-5.1-bugteam

    modified:
      mysys/array.c
 3036 Alexander Barkov	2009-07-24
      Backporting "WL#3332 Korean Enhancements" and
      "WL#4584 New euckr characters" from 5.4.
      (as agreed on ServerPT meeting on July 8).

    modified:
      mysql-test/r/ctype_euckr.result
      mysql-test/t/ctype_euckr.test
      strings/ctype-euc_kr.c
=== modified file 'mysys/array.c'
--- a/mysys/array.c	2009-02-13 16:41:47 +0000
+++ b/mysys/array.c	2009-07-17 08:55:09 +0000
@@ -32,11 +32,11 @@
   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.
     Static buffers must begin immediately after the array structure.
 
   RETURN VALUE
-    TRUE	my_malloc_ci() failed
     FALSE	Ok
 */
 
@@ -63,12 +63,12 @@ my_bool init_dynamic_array2(DYNAMIC_ARRA
   array->size_of_element=element_size;
   if ((array->buffer= init_buffer))
     DBUG_RETURN(FALSE);
-  if (!(array->buffer=(uchar*) 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-20090724072627-qusknk8grddhrlie.bundle
Thread
bzr push into mysql-5.1-bugteam branch (v.narayanan:3036 to 3037)V Narayanan24 Jul