=== modified file 'sql/ha_ndbcluster.cc' --- sql/ha_ndbcluster.cc 2008-08-12 15:54:32 +0000 +++ sql/ha_ndbcluster.cc 2008-09-05 08:45:00 +0000 @@ -4623,7 +4623,7 @@ int ha_ndbcluster::external_lock(THD *th { DBUG_PRINT("info", ("Add share to list of changed tables")); /* NOTE push_back allocates memory using transactions mem_root! */ - thd_ndb->changed_tables.push_back(m_share, + thd_ndb->changed_tables.push_back(get_share(m_share), &thd->transaction.mem_root); } @@ -4818,6 +4818,7 @@ static int ndbcluster_commit(handlerton share->commit_count= 0; share->commit_count_lock++; pthread_mutex_unlock(&share->mutex); + free_share(&share); } thd_ndb->changed_tables.empty(); @@ -4860,6 +4861,12 @@ static int ndbcluster_rollback(handlerto thd_ndb->trans= NULL; /* Clear list of tables changed by transaction */ + NDB_SHARE* share; + List_iterator_fast it(thd_ndb->changed_tables); + while ((share= it++)) + { + free_share(&share); + } thd_ndb->changed_tables.empty(); DBUG_RETURN(res);