From 72b7e5597b11114cafb0e8ae3c14252a357c9a2c Mon Sep 17 00:00:00 2001 From: "gni/root@dev3-127.(none)" <> Date: Sun, 8 Oct 2006 11:35:03 +0800 Subject: [PATCH 1/4] BUG #21858 Make sure retry when EINTR returns, which decreases memory leak chance. --- ndb/src/common/util/File.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/ndb/src/common/util/File.cpp b/ndb/src/common/util/File.cpp index 056b7ff199b..33d6ca1d535 100644 --- a/ndb/src/common/util/File.cpp +++ b/ndb/src/common/util/File.cpp @@ -123,13 +123,25 @@ bool File_class::close() { bool rc = true; + int retval = 0; + if (m_file != NULL) { ::fflush(m_file); - rc = (::fclose(m_file) == 0 ? true : false); - m_file = NULL; // Try again? + retval = ::fclose(m_file); + while ( (retval != 0) && (errno == EINTR) ){ + retval = ::fclose(m_file); + } + if( retval == 0){ + rc = true; + } + else { + rc = false; + ndbout_c("ERROR: Close file error in File.cpp for %s",strerror(errno)); + } } - + m_file = NULL; + return rc; } From 639683919dc7a313a5d780a4ed283a4d3fa0361a Mon Sep 17 00:00:00 2001 From: "hartmut@mysql.com/linux.site" <> Date: Mon, 13 Nov 2006 17:04:40 +0100 Subject: [PATCH 2/4] Fix for Bug #23887 (Introduced by Bugfix #22295) --- ndb/tools/ndb_config.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ndb/tools/ndb_config.cpp b/ndb/tools/ndb_config.cpp index 8b862391c8e..f4ad104ecb3 100644 --- a/ndb/tools/ndb_config.cpp +++ b/ndb/tools/ndb_config.cpp @@ -37,7 +37,6 @@ static int g_verbose = 0; static int try_reconnect = 3; static int g_nodes, g_connections, g_section; -static const char * g_connectstring = 0; static const char * g_query = 0; static int g_nodeid = 0; @@ -484,7 +483,7 @@ fetch_configuration() ndb_mgm_set_error_stream(mgm, stderr); - if (ndb_mgm_set_connectstring(mgm, g_connectstring)) + if (ndb_mgm_set_connectstring(mgm, opt_connect_str)) { fprintf(stderr, "* %5d: %s\n", ndb_mgm_get_latest_error(mgm), From 6d71f74743844a36b9431fd026fc2790860110dc Mon Sep 17 00:00:00 2001 From: "msvensson@neptunus.(none)" <> Date: Tue, 5 Dec 2006 18:46:08 +0100 Subject: [PATCH 3/4] Cset exclude: msvensson@neptunus.(none)|ChangeSet|20061204181655|04883 --- client/mysqltest.c | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/client/mysqltest.c b/client/mysqltest.c index 8a51e0300b7..e1f69097b16 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -724,20 +724,6 @@ void close_connections() } -void close_statements() -{ - struct st_connection *con; - DBUG_ENTER("close_statements"); - for (con= connections; con < next_con; con++) - { - if (con->stmt) - mysql_stmt_close(con->stmt); - con->stmt= 0; - } - DBUG_VOID_RETURN; -} - - void close_files() { DBUG_ENTER("close_files"); @@ -2914,10 +2900,6 @@ void do_close_connection(struct st_command *command) } } #endif - if (next_con->stmt) - mysql_stmt_close(next_con->stmt); - next_con->stmt= 0; - mysql_close(&con->mysql); if (con->util_mysql) mysql_close(con->util_mysql); @@ -5905,7 +5887,6 @@ int main(int argc, char **argv) break; case Q_DISABLE_PS_PROTOCOL: ps_protocol_enabled= 0; - close_statements(); break; case Q_ENABLE_PS_PROTOCOL: ps_protocol_enabled= ps_protocol; From be212d34863ffdd0ab5dba1f633f69a9df0510ef Mon Sep 17 00:00:00 2001 From: "msvensson@neptunus.(none)" <> Date: Tue, 5 Dec 2006 19:13:31 +0100 Subject: [PATCH 4/4] Remove hack that removes vardir --- mysql-test/mysql-test-run.pl | 3 --- 1 file changed, 3 deletions(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 21824cc69ee..5002f778da5 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -802,9 +802,6 @@ sub command_line_setup () { { # Only platforms that have native symlinks can use the vardir trick $opt_mem= $opt_vardir; - # Delete the default directory in case it exists since we're going to create - # a new one later anyway, and the mkpath below throws a fatal error otherwise - eval { rmtree($default_vardir, 1, 1); }; mtr_report("Using 4.1 vardir trick"); }