List:Commits« Previous MessageNext Message »
From:Alexander Barkov Date:July 6 2012 7:04am
Subject:bzr push into mysql-trunk branch (alexander.barkov:3995 to 3996)
View as plain text  
 3996 Alexander Barkov	2012-07-06 [merge]
      Merging from mysql-5.6

    modified:
      sql/gcalc_tools.cc
      sql/sql_string.h
 3995 Jimmy Yang	2012-07-06 [merge]
      Merge from mysql-5.6 to mysql-trunk

    modified:
      mysql-test/suite/innodb/r/innodb_bug13867871.result
      mysql-test/suite/innodb/t/innodb_bug13867871.test
=== modified file 'sql/gcalc_tools.cc'
--- a/sql/gcalc_tools.cc	2012-07-06 06:40:40 +0000
+++ b/sql/gcalc_tools.cc	2012-07-06 06:59:29 +0000
@@ -1281,23 +1281,19 @@ int Gcalc_result_receiver::reorder_chunk
 
   String tmp;
   uint32 reserve_length= buffer.length();
-  if (tmp.reserve_and_set_length(reserve_length, MY_ALIGN(reserve_length, 512)))
+  if (tmp.reserve(reserve_length, MY_ALIGN(reserve_length, 512)))
     DBUG_RETURN(1);
 
-  char *sorted= (char *) tmp.ptr();
-  const char *unsorted= buffer.ptr();
-
   // Put shape data in the required order
   for (chunk_info *chunk= chunks, *end= chunks + nchunks; chunk < end; chunk++)
   {
 #ifndef DBUG_OFF
     chunk->dbug_print();
 #endif
-    memmove(sorted, unsorted + chunk->position, (size_t) chunk->length);
-    sorted+= chunk->length;
+    tmp.append(buffer.ptr() + chunk->position, (size_t) chunk->length);
   }
   // Make sure all chunks were put
-  DBUG_ASSERT(sorted - tmp.ptr() == (size_t) buffer.length());
+  DBUG_ASSERT(tmp.length() == buffer.length());
   // Get all data from tmp and unlink tmp from its buffer.
   buffer.takeover(tmp);
   DBUG_RETURN(0);

=== modified file 'sql/sql_string.h'
--- a/sql/sql_string.h	2012-07-05 08:42:00 +0000
+++ b/sql/sql_string.h	2012-07-06 06:59:29 +0000
@@ -445,25 +445,6 @@ public:
     return realloc(str_length + space_needed);
   }
   int reserve(uint32 space_needed, uint32 grow_by);
-  /**
-    Reserve additional space_needed bytes and increment length by space_needed.
-    The space added to the buffer remains uninitialized, so the caller
-    is further responsible to pupulate the allocated space with data.
-
-    @param space_needes - size of the additional space needed.
-    @param grow_by      - minimum block size to allocate.
-    @return             - operation result
-    @retval             - 0 on success
-    @retval             - 1 on error
-  */
-  bool reserve_and_set_length(uint32 space_needed, uint32 grow_by)
-  {
-    if (reserve(space_needed, grow_by))
-      return true;
-    str_length+= space_needed;
-    return false;
-  }
-
   /*
     The following append operations do NOT check alloced memory
     q_*** methods writes values of parameters itself

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk branch (alexander.barkov:3995 to 3996) Alexander Barkov6 Jul