[Commits] Rev 3555: Corrected the pactch for mdev-449 to fix valgrind failures. in file:///home/igor/maria/maria-5.3-mdev449/

Igor Babaev igor at askmonty.org
Wed Aug 15 00:25:57 EEST 2012


At file:///home/igor/maria/maria-5.3-mdev449/

------------------------------------------------------------
revno: 3555
revision-id: igor at askmonty.org-20120814212556-jr7fdqpm89ooyvdz
parent: igor at askmonty.org-20120814041314-mvxfv100vj4rttsj
committer: Igor Babaev <igor at askmonty.org>
branch nick: maria-5.3-mdev449
timestamp: Tue 2012-08-14 14:25:56 -0700
message:
  Corrected the pactch for mdev-449 to fix valgrind failures.
-------------- next part --------------
=== modified file 'sql/filesort.cc'
--- a/sql/filesort.cc	2012-08-14 04:13:14 +0000
+++ b/sql/filesort.cc	2012-08-14 21:25:56 +0000
@@ -285,7 +285,8 @@
       Use also the space previously used by string pointers in sort_buffer
       for temporary key storage.
     */
-    param.keys= sort_buff_sz / param.rec_length;
+    param.keys=((param.keys*(param.rec_length+sizeof(char*))) /
+		param.rec_length-1);
     maxbuffer--;				// Offset from 0
     if (merge_many_buff(&param,(uchar*) sort_keys,buffpek,&maxbuffer,
 			&tempfile))
@@ -1260,8 +1261,7 @@
   strpos= sort_buffer;
   org_max_rows=max_rows= param->max_rows;
   
-  /* The following will fire if there is not enough space in sort_buffer */
-  DBUG_ASSERT(maxcount!=0);
+  set_if_bigger(maxcount, 1);
   
   if (unique_buff)
   {



More information about the commits mailing list