List:Commits« Previous MessageNext Message »
From:Sergey Vojtovich Date:December 1 2006 3:11pm
Subject:bk commit into 4.1 tree (svoj:1.2537) BUG#23196
View as plain text  
Below is the list of changes that have just been committed into a local
4.1 repository of svoj. When svoj 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@stripped, 2006-12-01 19:11:43+04:00, svoj@stripped +3 -0
  BUG#23196 - MySQL server does not exit / shutdown when
              storage engine returns errno 12
  
  If there is not enough memory to store or update blob record
  (while allocating record buffer), myisam marks table as crashed.
  
  With this fix myisam attempts to roll an index back and return
  an error, not marking a table as crashed.
  
  Affects myisam tables with blobs only. No test case for this fix.

  myisam/mi_dynrec.c@stripped, 2006-12-01 19:11:41+04:00, svoj@stripped +2 -2
    If there is not enough memory to store or update blob record
    (while allocating record buffer), return HA_ERR_OUT_OF_MEM
    instead of ENOMEM. In this case storage engine can simply
    roll an index back and return an error, not marking table
    as crashed.

  myisam/mi_update.c@stripped, 2006-12-01 19:11:41+04:00, svoj@stripped +2 -1
    In some cases do not mark a table as crashed if we run out of
    memory. Instead roll an index back and return an error. These
    cases are signalled with my_errno set to HA_ERR_OUT_OF_MEM.

  myisam/mi_write.c@stripped, 2006-12-01 19:11:41+04:00, svoj@stripped +1 -1
    In some cases do not mark a table as crashed if we run out of
    memory. Instead roll an index back and return an error. These
    cases are signalled with my_errno set to HA_ERR_OUT_OF_MEM.

# 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:	svoj
# Host:	april.(none)
# Root:	/home/svoj/devel/mysql/BUG23196/mysql-4.1-engines

--- 1.41/myisam/mi_dynrec.c	2006-12-01 19:11:47 +04:00
+++ 1.42/myisam/mi_dynrec.c	2006-12-01 19:11:47 +04:00
@@ -81,7 +81,7 @@ int _mi_write_blob_record(MI_INFO *info,
 #endif
   if (!(rec_buff=(byte*) my_alloca(reclength)))
   {
-    my_errno=ENOMEM;
+    my_errno= HA_ERR_OUT_OF_MEM; /* purecov: inspected */
     return(-1);
   }
   reclength2= _mi_rec_pack(info,rec_buff+ALIGN_SIZE(MI_MAX_DYN_BLOCK_HEADER),
@@ -115,7 +115,7 @@ int _mi_update_blob_record(MI_INFO *info
 #endif
   if (!(rec_buff=(byte*) my_alloca(reclength)))
   {
-    my_errno=ENOMEM;
+    my_errno= HA_ERR_OUT_OF_MEM; /* purecov: inspected */
     return(-1);
   }
   reclength=_mi_rec_pack(info,rec_buff+ALIGN_SIZE(MI_MAX_DYN_BLOCK_HEADER),

--- 1.17/myisam/mi_update.c	2006-12-01 19:11:47 +04:00
+++ 1.18/myisam/mi_update.c	2006-12-01 19:11:47 +04:00
@@ -193,7 +193,8 @@ err:
   save_errno=my_errno;
   if (changed)
     key_changed|= HA_STATE_CHANGED;
-  if (my_errno == HA_ERR_FOUND_DUPP_KEY || my_errno == HA_ERR_RECORD_FILE_FULL)
+  if (my_errno == HA_ERR_FOUND_DUPP_KEY || my_errno == HA_ERR_OUT_OF_MEM ||
+      my_errno == HA_ERR_RECORD_FILE_FULL)
   {
     info->errkey= (int) i;
     flag=0;

--- 1.50/myisam/mi_write.c	2006-12-01 19:11:47 +04:00
+++ 1.51/myisam/mi_write.c	2006-12-01 19:11:47 +04:00
@@ -164,7 +164,7 @@ int mi_write(MI_INFO *info, byte *record
 err:
   save_errno=my_errno;
   if (my_errno == HA_ERR_FOUND_DUPP_KEY || my_errno == HA_ERR_RECORD_FILE_FULL ||
-      my_errno == HA_ERR_NULL_IN_SPATIAL)
+      my_errno == HA_ERR_NULL_IN_SPATIAL || my_errno == HA_ERR_OUT_OF_MEM)
   {
     if (info->bulk_insert)
     {
Thread
bk commit into 4.1 tree (svoj:1.2537) BUG#23196Sergey Vojtovich1 Dec