From: Alexander Barkov Date: July 6 2012 7:00am Subject: bzr push into mysql-5.6 branch (alexander.barkov:3987 to 3988) Bug#13938850 List-Archive: http://lists.mysql.com/commits/144391 X-Bug: 13938850 Message-Id: <201207060707.q6677t7Z022398@acsmt356.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 3988 Alexander Barkov 2012-07-06 Clean-up for Bug#13938850. Removing String::reserve_and_set_length() introduced in the patch for Bug#13938850. Switching to use String::append(). modified: sql/gcalc_tools.cc sql/sql_string.h 3987 Jimmy Yang 2012-07-06 Fix Bug #14168957 - THE TEST INNODB_BUG13867871 DOES NOT CLEAN UP PROPERLY rb://1126 approved by Sunny Bains 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).