From 2a6a3ad279494f631b71ba1cb30ed0b659ce4707 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 5 May 2006 15:34:46 +0200 Subject: [PATCH] do not install ndb slave if no slaves fixed memleak in ndbcluster_end mysql-test/mysql-test-run.pl: do not install ndb slave if no slaves sql/ha_ndbcluster.cc: fixed memleak in ndbcluster_end --- mysql-test/mysql-test-run.pl | 2 +- sql/ha_ndbcluster.cc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 30ac61c80e8..fa3b5ad3081 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -1857,7 +1857,7 @@ sub mysql_install_db () { } } - if ( ndbcluster_install_slave() ) + if ( $use_slaves and ndbcluster_install_slave() ) { if ( $opt_force) { diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 3544ccef42b..29e531936b7 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -6217,10 +6217,10 @@ static int ndbcluster_end(ha_panic_function type) #ifdef HAVE_NDB_BINLOG { pthread_mutex_lock(&ndbcluster_mutex); - for (uint i= 0; i < ndbcluster_open_tables.records; i++) + while (ndbcluster_open_tables.records) { NDB_SHARE *share= - (NDB_SHARE*) hash_element(&ndbcluster_open_tables, i); + (NDB_SHARE*) hash_element(&ndbcluster_open_tables, 0); #ifndef DBUG_OFF fprintf(stderr, "NDB: table share %s with use_count %d not freed\n", share->key, share->use_count);