List:Commits« Previous MessageNext Message »
From:He Zhenxing Date:December 2 2010 7:38am
Subject:bzr push into mysql-trunk-bugfixing branch (zhenxing.he:3404 to 3405)
Bug#56650
View as plain text  
 3405 He Zhenxing	2010-12-02
      BUG#56650 Valgrind warnings for memory leak in semisync plugin (MYSQL object not freed)
      
      The problem was that the query result was not freed properly when
      querying master semi-sync status on slave, fixed the problem by adding
      code to free the query result.

    modified:
      plugin/semisync/semisync_slave_plugin.cc
 3404 Tor Didriksen	2010-12-02 [merge]
      merge from 5.5-bugteam

    modified:
      sql/sql_plugin.cc
=== modified file 'plugin/semisync/semisync_slave_plugin.cc'
--- a/plugin/semisync/semisync_slave_plugin.cc	2010-05-31 15:29:54 +0000
+++ b/plugin/semisync/semisync_slave_plugin.cc	2010-12-02 07:38:12 +0000
@@ -53,7 +53,6 @@ int repl_semi_slave_request_dump(Binlog_
   if (mysql_real_query(mysql, query, strlen(query)) ||
       !(res= mysql_store_result(mysql)))
   {
-    mysql_free_result(mysql_store_result(mysql));
     sql_print_error("Execution failed on master: %s", query);
     return 1;
   }
@@ -65,8 +64,10 @@ int repl_semi_slave_request_dump(Binlog_
     sql_print_warning("Master server does not support semi-sync, "
                       "fallback to asynchronous replication");
     rpl_semi_sync_slave_status= 0;
+    mysql_free_result(res);
     return 0;
   }
+  mysql_free_result(res);
 
   /*
     Tell master dump thread that we want to do semi-sync
@@ -76,7 +77,6 @@ int repl_semi_slave_request_dump(Binlog_
   if (mysql_real_query(mysql, query, strlen(query)))
   {
     sql_print_error("Set 'rpl_semi_sync_slave=1' on master failed");
-    mysql_free_result(mysql_store_result(mysql));
     return 1;
   }
   mysql_free_result(mysql_store_result(mysql));


Attachment: [text/bzr-bundle] bzr/zhenxing.he@sun.com-20101202073812-iel8lvhmulyagtsv.bundle
Thread
bzr push into mysql-trunk-bugfixing branch (zhenxing.he:3404 to 3405)Bug#56650He Zhenxing2 Dec