List:Commits« Previous MessageNext Message »
From:Tor Didriksen Date:May 27 2011 9:17am
Subject:bzr push into mysql-trunk branch (tor.didriksen:3315 to 3316)
View as plain text  
 3316 Tor Didriksen	2011-05-27
      s/ASSERT_EQ(false, /ASSERT_FALSE(/g
      
      because it is "the right thing"
      and because it does not compile with gcc 4.5.1
      
      unittest/gunit/opt_trace-t.cc:338:156: 
      error: converting false to pointer type for argument 1 of 
      char testing::internal::IsNullLiteralHelper(testing::internal::Secret*)

    modified:
      unittest/gunit/opt_trace-t.cc
 3315 Guilhem Bichot	2011-05-26
      fix for BUG#12595210 - JSON SYNTAX ERROR ASSERT ON WHERE FIELD NOT IN SUBQUERY
     @ mysql-test/suite/optimizer_trace/t/optimizer_trace_bugs.test
        test for bug; used to crash. BUG 12595688 was filed along the way.
     @ sql/item_subselect.cc
        when doing IN->EXISTS transformation of IN(select),
        if "select" contains some constant WHERE/HAVING clause we may evaluate it;
        this may evaluate a subquery (if the WHERE/HAVING has a subquery). This caused
        a syntax error like this:
                        {
                          "transformation": {
                            "select#": 2,
                            "from": "IN (SELECT)",
                            "to": "EXISTS (CORRELATED SELECT)",
                            "chosen": true** invalid JSON (missing key) ** ,
                            "?": {
                              "subselect_execution": {
                                "select#": 3,
        Where:
        "subselect_execution" and its outer unnamed object come from join->conds->fix_fields()
        called in Item_in_subselect::row_value_in_to_exists_transformer()
        (transforming select#2 with IN->EXISTS, evaluating its WHERE clause along the way,
        which means evaluating the constant select#3).
        The fix is to open a named object when about to evaluate the constant WHERE,
        so that subquery execution fits into it.
        Same for HAVING.
        Same for transformations of returning-single-column subqueries.

    modified:
      mysql-test/suite/optimizer_trace/r/optimizer_trace2_no_prot.result
      mysql-test/suite/optimizer_trace/r/optimizer_trace_bugs.result
      mysql-test/suite/optimizer_trace/r/optimizer_trace_no_prot.result
      mysql-test/suite/optimizer_trace/r/optimizer_trace_ps_prot.result
      mysql-test/suite/optimizer_trace/r/optimizer_trace_range_no_prot.result
      mysql-test/suite/optimizer_trace/t/optimizer_trace_bugs.test
      sql/item_subselect.cc
=== modified file 'unittest/gunit/opt_trace-t.cc'
--- a/unittest/gunit/opt_trace-t.cc	2011-05-06 12:02:15 +0000
+++ b/unittest/gunit/opt_trace-t.cc	2011-05-27 09:16:43 +0000
@@ -335,8 +335,8 @@ TEST_F(TraceContentTest, BuggyObject)
 /** Test reaction to malformed JSON (array with value with key) */
 TEST_F(TraceContentTest, BuggyArray)
 {
-  ASSERT_EQ(false, trace.start(true, false, true, false, -1, 1, ULONG_MAX,
-                               all_features));
+  ASSERT_FALSE(trace.start(true, false, true, false, -1, 1, ULONG_MAX,
+                           all_features));
   {
     Opt_trace_object oto(&trace);
     {
@@ -611,8 +611,8 @@ TEST_F(TraceContentTest, Offset)
 /** Test truncation by max_mem_size */
 TEST_F(TraceContentTest, MaxMemSize)
 {
-  ASSERT_EQ(false, trace.start(true, false, false, false, -1,
-                               1, 1000 /* max_mem_size */, all_features));
+  ASSERT_FALSE(trace.start(true, false, false, false, -1,
+                           1, 1000 /* max_mem_size */, all_features));
   /* make a "long" trace */
   {
     Opt_trace_object oto(&trace);
@@ -651,8 +651,8 @@ TEST_F(TraceContentTest, MaxMemSize)
 /** Test how truncation by max_mem_size affects next traces */
 TEST_F(TraceContentTest, MaxMemSize2)
 {
-  ASSERT_EQ(false, trace.start(true, false, false, false, -2,
-                               2, 21 /* max_mem_size */, all_features));
+  ASSERT_FALSE(trace.start(true, false, false, false, -2,
+                           2, 21 /* max_mem_size */, all_features));
   /* make a "long" trace */
   {
     Opt_trace_object oto(&trace);
@@ -660,8 +660,8 @@ TEST_F(TraceContentTest, MaxMemSize2)
   }
   trace.end();
   /* A second similar trace */
-  ASSERT_EQ(false, trace.start(true, false, false, false, -2,
-                               2, 21, all_features));
+  ASSERT_FALSE(trace.start(true, false, false, false, -2,
+                           2, 21, all_features));
   {
     Opt_trace_object oto(&trace);
     oto.add_alnum("some key2", "make it long");
@@ -687,8 +687,8 @@ TEST_F(TraceContentTest, MaxMemSize2)
     3rd trace; the first one should automatically be purged, thus the 3rd
     should have a bit of room.
   */
-  ASSERT_EQ(false, trace.start(true, false, false, false, -2,
-                               2, 21, all_features));
+  ASSERT_FALSE(trace.start(true, false, false, false, -2,
+                           2, 21, all_features));
   {
     Opt_trace_object oto(&trace);
     oto.add_alnum("some key3", "make it long");
@@ -749,8 +749,8 @@ void open_object(uint count, Opt_trace_c
 /// Test reaction to out-of-memory condition in trace buffer
 TEST_F(TraceContentTest, OOMinBuffer)
 {
-  ASSERT_EQ(false, trace.start(true, false, false, false, -1, 1, ULONG_MAX,
-                               all_features));
+  ASSERT_FALSE(trace.start(true, false, false, false, -1, 1, ULONG_MAX,
+                           all_features));
   {
     Opt_trace_object oto(&trace);
     {
@@ -777,8 +777,8 @@ TEST_F(TraceContentTest, OOMinBuffer)
 /// Test reaction to out-of-memory condition in book-keeping data structures
 TEST_F(TraceContentTest, OOMinBookKeeping)
 {
-  ASSERT_EQ(false, trace.start(true, false, false, false, -1, 1, ULONG_MAX,
-                               all_features));
+  ASSERT_FALSE(trace.start(true, false, false, false, -1, 1, ULONG_MAX,
+                           all_features));
   {
     Opt_trace_object oto(&trace);
     open_object(100, &trace, true);
@@ -841,8 +841,8 @@ TEST_F(TraceContentTest, OOMinPurge)
 /** Test filtering by feature */
 TEST_F(TraceContentTest, FilteringByFeature)
 {
-  ASSERT_EQ(false, trace.start(true, false, false, false, -1, 1, ULONG_MAX,
-                               Opt_trace_context::MISC));
+  ASSERT_FALSE(trace.start(true, false, false, false, -1, 1, ULONG_MAX,
+                           Opt_trace_context::MISC));
   {
     Opt_trace_object oto(&trace);
     {
@@ -904,8 +904,8 @@ TEST_F(TraceContentTest, FilteringByFeat
 /** Test escaping of characters */
 TEST_F(TraceContentTest, Escaping)
 {
-  ASSERT_EQ(false, trace.start(true, false, true, false, -1, 1, ULONG_MAX,
-                               all_features));
+  ASSERT_FALSE(trace.start(true, false, true, false, -1, 1, ULONG_MAX,
+                           all_features));
   // All ASCII 0-127 chars are valid UTF8 encodings
   char all_chars[130];
   for (uint c= 0; c < sizeof(all_chars) - 2 ; c++)
@@ -948,8 +948,8 @@ TEST_F(TraceContentTest, Escaping)
 /** Test how the system handles non-UTF8 characters, a violation of its API */
 TEST_F(TraceContentTest, NonUtf8)
 {
-  ASSERT_EQ(false, trace.start(true, false, true, false, -1, 1, ULONG_MAX,
-                               all_features));
+  ASSERT_FALSE(trace.start(true, false, true, false, -1, 1, ULONG_MAX,
+                           all_features));
   /*
     A string which starts with invalid utf8 (the four first bytes are éèÄà in
     latin1).
@@ -1002,8 +1002,8 @@ TEST_F(TraceContentTest, NonUtf8)
 */
 TEST_F(TraceContentTest, Indent)
 {
-  ASSERT_EQ(false, trace.start(true, false, false, false, -1, 1, ULONG_MAX,
-                               all_features));
+  ASSERT_FALSE(trace.start(true, false, false, false, -1, 1, ULONG_MAX,
+                           all_features));
   {
     Opt_trace_object oto(&trace);
     open_object(100, &trace, false);

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk branch (tor.didriksen:3315 to 3316) Tor Didriksen27 May