List:Commits« Previous MessageNext Message »
From:Tor Didriksen Date:October 30 2012 2:45pm
Subject:bzr push into mysql-5.6 branch (tor.didriksen:4510 to 4511)
View as plain text  
 4511 Tor Didriksen	2012-10-30
      Unit test cleanups: Fix warnings reported by AddressSanitizer
     @ unittest/gunit/decimal-t.cc
        Buffer overrun in one of the tests.
     @ unittest/gunit/field-t.cc
        We were reading uninitialized part of stack.
     @ unittest/gunit/filesort_compare-t.cc
        Possible buffer overrun.
        Disable some experimental tests.
     @ unittest/gunit/segfault-t.cc
        Running clang with -O1 yields SIGILL rather than SIGSEGV.
     @ unittest/gunit/stdcxx-t.cc
        Older versions of gcc do not have std::tr1::unordered_map

    modified:
      unittest/gunit/decimal-t.cc
      unittest/gunit/field-t.cc
      unittest/gunit/filesort_compare-t.cc
      unittest/gunit/segfault-t.cc
      unittest/gunit/stdcxx-t.cc
 4510 Anirudh Mangipudi	2012-10-30 [merge]
      BUG#11754894: MYISAMCHK ERROR HAS INCORRECT REFERENCE 
                    TO 'MYISAM_SORT_BUFFER_SIZE'
      Null Merge from 5.5 to 5.6

=== modified file 'unittest/gunit/decimal-t.cc'
--- a/unittest/gunit/decimal-t.cc	2012-05-07 12:05:48 +0000
+++ b/unittest/gunit/decimal-t.cc	2012-10-30 14:40:02 +0000
@@ -39,7 +39,7 @@ typedef decimal_digit_t dec1;
 
 int full= 0;
 decimal_t a, b, c;
-decimal_digit_t buf1[25], buf2[25], buf3[25];
+decimal_digit_t buf1[50], buf2[50], buf3[50];
 
 void dump_decimal(decimal_t *d)
 {

=== modified file 'unittest/gunit/field-t.cc'
--- a/unittest/gunit/field-t.cc	2012-05-30 09:18:58 +0000
+++ b/unittest/gunit/field-t.cc	2012-10-30 14:40:02 +0000
@@ -625,8 +625,8 @@ TEST_F(FieldTest, MakeSortKey)
     SCOPED_TRACE("Field_varstring");
     Mock_charset mock_charset;
     Fake_TABLE_SHARE fake_share(0);
-    uchar ptr= 0;
-    Field_varstring fvs(&ptr, 0, 0, NULL, '\0', Field::NONE, "", &fake_share,
+    uchar ptr[8]= {0, 0, 0, 0, 0, 0, 0, 0};
+    Field_varstring fvs(ptr, 0, 0, NULL, '\0', Field::NONE, "", &fake_share,
                         &mock_charset);
     uchar to;
     fvs.make_sort_key(&to, 666);

=== modified file 'unittest/gunit/filesort_compare-t.cc'
--- a/unittest/gunit/filesort_compare-t.cc	2012-02-07 11:56:30 +0000
+++ b/unittest/gunit/filesort_compare-t.cc	2012-10-30 14:40:02 +0000
@@ -242,7 +242,7 @@ public:
   bool operator()(const uchar *s1, const uchar *s2)
   {
     size_t len= m_size;
-    while(len)
+    while(len > 0)
     {
       COMPARE(0);
       COMPARE(1);
@@ -252,7 +252,7 @@ public:
       s1 += 4;
       s2 += 4;
     }
-    return s1[0] < s2[0];
+    return false;
   }
   size_t m_size;
 };
@@ -425,7 +425,7 @@ TEST_F(FileSortCompareTest, StdStableSor
   }
 }
 
-TEST_F(FileSortCompareTest, StdSortIntCompare)
+TEST_F(FileSortCompareTest, DISABLED_StdSortIntCompare)
 {
   for (int ix= 0; ix < num_iterations; ++ix)
   {
@@ -434,7 +434,7 @@ TEST_F(FileSortCompareTest, StdSortIntCo
   }
 }
 
-TEST_F(FileSortCompareTest, StdStableSortIntCompare)
+TEST_F(FileSortCompareTest, DISABLED_StdStableSortIntCompare)
 {
   for (int ix= 0; ix < num_iterations; ++ix)
   {
@@ -443,7 +443,7 @@ TEST_F(FileSortCompareTest, StdStableSor
   }
 }
 
-TEST_F(FileSortCompareTest, StdSortIntIntIntInt)
+TEST_F(FileSortCompareTest, DISABLED_StdSortIntIntIntInt)
 {
   for (int ix= 0; ix < num_iterations; ++ix)
   {
@@ -453,7 +453,7 @@ TEST_F(FileSortCompareTest, StdSortIntIn
   }
 }
 
-TEST_F(FileSortCompareTest, StdStableSortIntIntIntInt)
+TEST_F(FileSortCompareTest, DISABLED_StdStableSortIntIntIntInt)
 {
   for (int ix= 0; ix < num_iterations; ++ix)
   {

=== modified file 'unittest/gunit/segfault-t.cc'
--- a/unittest/gunit/segfault-t.cc	2012-10-17 15:11:15 +0000
+++ b/unittest/gunit/segfault-t.cc	2012-10-30 14:40:02 +0000
@@ -57,8 +57,11 @@ TEST_F(FatalSignalDeathTest, Segfault)
 #if defined(__WIN__)
   EXPECT_DEATH_IF_SUPPORTED(*pint= 42, ".* UTC - mysqld got exception.*");
 #else
-  // On most platforms we get SIGSEGV == 11, but SIGBUS == 10 is also possible.
-  EXPECT_DEATH_IF_SUPPORTED(*pint= 42, ".* UTC - mysqld got signal 1.*");
+  /*
+   On most platforms we get SIGSEGV == 11, but SIGBUS == 10 is also possible.
+   And on Mac OsX we can get SIGILL == 4 (but only in optmized mode).
+  */
+  EXPECT_DEATH_IF_SUPPORTED(*pint= 42, ".* UTC - mysqld got signal .*");
 #endif
 }
 

=== modified file 'unittest/gunit/stdcxx-t.cc'
--- a/unittest/gunit/stdcxx-t.cc	2012-04-27 08:41:49 +0000
+++ b/unittest/gunit/stdcxx-t.cc	2012-10-30 14:40:02 +0000
@@ -17,7 +17,7 @@
 #include "my_config.h"
 #include <gtest/gtest.h>
 
-#if defined(__GNUC__)
+#if defined(__GNUC__) && __GNUC__ > 3
 #include <tr1/unordered_map>
 #elif defined(__WIN__)
 #include <hash_map>
@@ -31,7 +31,7 @@
 template<typename K, typename T>
 struct MyHashMap
 {
-#if defined(__GNUC__)
+#if defined(__GNUC__) && __GNUC__ > 3
   typedef std::tr1::unordered_map<K, T> Type;
 #elif defined(__WIN__)
   typedef stdext::hash_map<K, T> Type;

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-5.6 branch (tor.didriksen:4510 to 4511) Tor Didriksen16 Nov