List:Commits« Previous MessageNext Message »
From:Magne Mahre Date:October 6 2011 12:16pm
Subject:bzr push into mysql-5.5 branch (magne.mahre:3571 to 3572) Bug#12912112
View as plain text  
 3572 Magne Mahre	2011-10-06
      Bug#12912112 MYSQL_CLIENT_TEST FAILS ON TEST_TRUNCATION 
             
      Sun Studio 12 has an error when calculating the compile-time 
      length of a constant character string.  The error is only 
      present when building an optimized 32-bits version, using 
      the -xbuiltin=(%all) compiler flag. 
             
      During compilation, the compiler recognizes the use of 
      the strlen() function used on a constant string. It 
      optimizes the strlen and replaces it with the actual 
      length of the string.   This optimization seems to 
      calculate the length wrongly in this particular case. 
             
      Replacing the "const char *" with a "const char []" 
      solves the problem. 

    modified:
      tests/mysql_client_test.c
 3571 Bjorn Munch	2011-10-05 [merge]
      null upmerge

=== modified file 'tests/mysql_client_test.c'
--- a/tests/mysql_client_test.c	2011-08-03 13:53:44 +0000
+++ b/tests/mysql_client_test.c	2011-10-06 12:13:23 +0000
@@ -13445,7 +13445,10 @@ static void test_truncation()
              ")";
   rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
   myquery(rc);
-  stmt_text= "insert into t1 VALUES ("
+
+  {
+    const char insert_text[]= 
+             "insert into t1 VALUES ("
              "-10, "                            /* i8 */
              "200, "                            /* ui8 */
              "32000, "                          /* i16 */
@@ -13461,8 +13464,9 @@ static void test_truncation()
              "'12345.67 	      ', "      /* tx_1 */
              "'12345.67abc'"                    /* ch_2 */
              ")";
-  rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
-  myquery(rc);
+    rc= mysql_real_query(mysql, insert_text, strlen(insert_text));
+    myquery(rc);
+  }
 
   stmt_text= "select i8 c1, i8 c2, ui8 c3, i16_1 c4, ui16 c5, "
              "       i16 c6, ui16 c7, i32 c8, i32_1 c9, i32_1 c10, "

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-5.5 branch (magne.mahre:3571 to 3572) Bug#12912112Magne Mahre7 Oct