From: Date: May 3 2007 12:36pm Subject: bk commit into 5.1 tree (knielsen:1.2441) List-Archive: http://lists.mysql.com/commits/25998 Message-Id: Below is the list of changes that have just been committed into a local 5.1 repository of knielsen. When knielsen 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-03 12:35:58+02:00, knielsen@ymer.(none) +1 -0 WL#3733: NdbRecord optimisation for mysqld. After-merge fixes. sql/ha_ndbcluster.cc@stripped, 2007-05-03 12:35:55+02:00, knielsen@ymer.(none) +13 -26 After-merge fixes. # 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: knielsen # Host: ymer.(none) # Root: /usr/local/mysql/mysql-5.1-wl2223 --- 1.408/sql/ha_ndbcluster.cc 2007-05-03 12:36:04 +02:00 +++ 1.409/sql/ha_ndbcluster.cc 2007-05-03 12:36:04 +02:00 @@ -1216,6 +1216,8 @@ int ha_ndbcluster::get_metadata(const ch goto err; } + calc_batch_buffer_size(); + if ((error= add_table_ndb_record(dict)) != 0) goto err; if ((error= open_indexes(ndb, table, FALSE)) == 0) @@ -1224,8 +1226,6 @@ int ha_ndbcluster::get_metadata(const ch DBUG_RETURN(0); } - calc_batch_buffer_size(); - err: ndbtab_g.invalidate(); m_table= NULL; @@ -1312,7 +1312,7 @@ static void ndb_init_index(NDB_INDEX_DAT data.ndb_unique_record_row= NULL; } -static void ndb_clear_index(NDB_INDEX_DATA &data) +static void ndb_clear_index(NDBDICT *dict, NDB_INDEX_DATA &data) { if (data.unique_index_attrid_map) { @@ -1322,6 +1322,14 @@ static void ndb_clear_index(NDB_INDEX_DA { delete data.index_stat; } + if (data.ndb_unique_record_key) + dict->releaseRecord(data.ndb_unique_record_key); + if (data.ndb_unique_record_row) + dict->releaseRecord(data.ndb_unique_record_row); + if (data.ndb_record_key) + dict->releaseRecord(data.ndb_record_key); + if (data.ndb_record_row) + dict->releaseRecord(data.ndb_record_row); ndb_init_index(data); } @@ -1853,7 +1861,7 @@ int ha_ndbcluster::drop_indexes(Ndb *ndb } if (error) DBUG_RETURN(error); - ndb_clear_index(m_index[i]); + ndb_clear_index(dict, m_index[i]); continue; } } @@ -1947,27 +1955,6 @@ void ha_ndbcluster::release_metadata(THD // Release index list for (i= 0; i < MAX_KEY; i++) { - if (m_index[i].ndb_unique_record_key) - { - dict->releaseRecord(m_index[i].ndb_unique_record_key); - m_index[i].ndb_unique_record_key= NULL; - } - if (m_index[i].ndb_unique_record_row) - { - dict->releaseRecord(m_index[i].ndb_unique_record_row); - m_index[i].ndb_unique_record_row= NULL; - } - if (m_index[i].ndb_record_key) - { - dict->releaseRecord(m_index[i].ndb_record_key); - m_index[i].ndb_record_key= NULL; - } - if (m_index[i].ndb_record_row) - { - dict->releaseRecord(m_index[i].ndb_record_row); - m_index[i].ndb_record_row= NULL; - } - if (m_index[i].unique_index) { DBUG_ASSERT(m_table != NULL); @@ -1978,7 +1965,7 @@ void ha_ndbcluster::release_metadata(THD DBUG_ASSERT(m_table != NULL); dict->removeIndexGlobal(*m_index[i].index, invalidate_indexes); } - ndb_clear_index(m_index[i]); + ndb_clear_index(dict, m_index[i]); } m_table= NULL;