List:Commits« Previous MessageNext Message »
From:Jim Winstead Date:June 28 2006 7:11pm
Subject:bk commit into 5.0 tree (jimw:1.2201)
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of jimw. When jimw 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
  1.2201 06/06/28 12:11:52 jimw@stripped +1 -0
  Optimize stack usage of ha_federated::update_row().

  sql/ha_federated.cc
    1.62 06/06/28 12:11:48 jimw@stripped +13 -20
    We only need one string buffer for fields in ::update_row()

# 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:	jimw
# Host:	rama.(none)
# Root:	/home/jimw/my/mysql-5.0-16494

--- 1.61/sql/ha_federated.cc	2006-06-26 16:59:49 -07:00
+++ 1.62/sql/ha_federated.cc	2006-06-28 12:11:48 -07:00
@@ -1817,19 +1817,13 @@ int ha_federated::update_row(const byte 
   /* 
     buffers for following strings
   */
-  char old_field_value_buffer[STRING_BUFFER_USUAL_SIZE];
-  char new_field_value_buffer[STRING_BUFFER_USUAL_SIZE];
+  char field_value_buffer[STRING_BUFFER_USUAL_SIZE];
   char update_buffer[FEDERATED_QUERY_BUFFER_SIZE];
   char where_buffer[FEDERATED_QUERY_BUFFER_SIZE];
 
-  /* stores the value to be replaced of the field were are updating */
-  String old_field_value(old_field_value_buffer,
-                         sizeof(old_field_value_buffer),
-                         &my_charset_bin);
-  /* stores the new value of the field */
-  String new_field_value(new_field_value_buffer,
-                         sizeof(new_field_value_buffer),
-                         &my_charset_bin);
+  /* Work area for field values */
+  String field_value(field_value_buffer, sizeof(field_value_buffer),
+                     &my_charset_bin);
   /* stores the update query */
   String update_string(update_buffer,
                        sizeof(update_buffer),
@@ -1842,8 +1836,7 @@ int ha_federated::update_row(const byte 
   /* 
     set string lengths to 0 to avoid misc chars in string
   */
-  old_field_value.length(0);
-  new_field_value.length(0);
+  field_value.length(0);
   update_string.length(0);
   where_string.length(0);
 
@@ -1874,10 +1867,10 @@ int ha_federated::update_row(const byte 
     else
     {
       /* otherwise = */
-      (*field)->val_str(&new_field_value);
-      (*field)->quote_data(&new_field_value);
-      update_string.append(new_field_value);
-      new_field_value.length(0);
+      (*field)->val_str(&field_value);
+      (*field)->quote_data(&field_value);
+      update_string.append(field_value);
+      field_value.length(0);
     }
 
     if (field_in_record_is_null(table, *field, (char*) old_data))
@@ -1885,11 +1878,11 @@ int ha_federated::update_row(const byte 
     else
     {
       where_string.append(FEDERATED_EQ);
-      (*field)->val_str(&old_field_value,
+      (*field)->val_str(&field_value,
                         (char*) (old_data + (*field)->offset()));
-      (*field)->quote_data(&old_field_value);
-      where_string.append(old_field_value);
-      old_field_value.length(0);
+      (*field)->quote_data(&field_value);
+      where_string.append(field_value);
+      field_value.length(0);
     }
 
     /*
Thread
bk commit into 5.0 tree (jimw:1.2201)Jim Winstead28 Jun