From: Date: May 11 2007 8:07am Subject: bk commit into 5.0 tree (tomas:1.2483) BUG#25818 List-Archive: http://lists.mysql.com/commits/26480 X-Bug: 25818 Message-Id: <20070511060749.6D3B33F95E4@whalegate.ndb.mysql.com> Below is the list of changes that have just been committed into a local 5.0 repository of tomas. When tomas does a push these changes will be propagated to the main repository and, within 24 hours after the push, to the public repository. For information on how to access the public repository see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html ChangeSet@stripped, 2007-05-11 08:07:42+02:00, tomas@stripped +1 -0 Bug#25818 No return of NDB share object in failures in open method - make sure resources are release properly on error sql/ha_ndbcluster.cc@stripped, 2007-05-11 08:07:39+02:00, tomas@stripped +18 -9 Bug#25818 No return of NDB share object in failures in open method - make sure resources are release properly on error # This is a BitKeeper patch. What follows are the unified diffs for the # set of deltas contained in the patch. The rest of the patch, the part # that BitKeeper cares about, is below these diffs. # User: tomas # Host: whalegate.ndb.mysql.com # Root: /home/tomas/mysql-5.0-ndb --- 1.311/sql/ha_ndbcluster.cc 2007-05-02 09:57:55 +02:00 +++ 1.312/sql/ha_ndbcluster.cc 2007-05-11 08:07:39 +02:00 @@ -5011,27 +5011,36 @@ set_dbname(name); set_tabname(name); - if (check_ndb_connection()) { - free_share(m_share); m_share= 0; - DBUG_RETURN(HA_ERR_NO_CONNECTION); + if ((res= check_ndb_connection()) || + (res= get_metadata(name))) + { + free_share(m_share); + m_share= 0; + DBUG_RETURN(res); } - - res= get_metadata(name); - if (!res) + while (1) { Ndb *ndb= get_ndb(); if (ndb->setDatabaseName(m_dbname)) { - ERR_RETURN(ndb->getNdbError()); + res= ndb_to_mysql_error(&ndb->getNdbError()); + break; } struct Ndb_statistics stat; res= ndb_get_table_statistics(NULL, false, ndb, m_tabname, &stat); records= stat.row_count; if(!res) res= info(HA_STATUS_CONST); + break; + } + if (res) + { + free_share(m_share); + m_share= 0; + release_metadata(); + DBUG_RETURN(res); } - - DBUG_RETURN(res); + DBUG_RETURN(0); }