Commit b9a9ee20 authored by unknown's avatar unknown

stilled some valgrind memleak warnings

parent 665d9580
...@@ -79,18 +79,26 @@ is_ndb_blob_table(const NdbTableImpl* t) ...@@ -79,18 +79,26 @@ is_ndb_blob_table(const NdbTableImpl* t)
NdbColumnImpl::NdbColumnImpl() NdbColumnImpl::NdbColumnImpl()
: NdbDictionary::Column(* this), m_attrId(-1), m_facade(this) : NdbDictionary::Column(* this), m_attrId(-1), m_facade(this)
{ {
DBUG_ENTER("NdbColumnImpl::NdbColumnImpl");
DBUG_PRINT("info", ("this: %x", this));
init(); init();
DBUG_VOID_RETURN;
} }
NdbColumnImpl::NdbColumnImpl(NdbDictionary::Column & f) NdbColumnImpl::NdbColumnImpl(NdbDictionary::Column & f)
: NdbDictionary::Column(* this), m_attrId(-1), m_facade(&f) : NdbDictionary::Column(* this), m_attrId(-1), m_facade(&f)
{ {
DBUG_ENTER("NdbColumnImpl::NdbColumnImpl");
DBUG_PRINT("info", ("this: %x", this));
init(); init();
DBUG_VOID_RETURN;
} }
NdbColumnImpl& NdbColumnImpl&
NdbColumnImpl::operator=(const NdbColumnImpl& col) NdbColumnImpl::operator=(const NdbColumnImpl& col)
{ {
DBUG_ENTER("NdbColumnImpl::operator=");
DBUG_PRINT("info", ("this: %x &col: %x", this, &col));
m_attrId = col.m_attrId; m_attrId = col.m_attrId;
m_name = col.m_name; m_name = col.m_name;
m_type = col.m_type; m_type = col.m_type;
...@@ -112,13 +120,14 @@ NdbColumnImpl::operator=(const NdbColumnImpl& col) ...@@ -112,13 +120,14 @@ NdbColumnImpl::operator=(const NdbColumnImpl& col)
if (col.m_blobTable == NULL) if (col.m_blobTable == NULL)
m_blobTable = NULL; m_blobTable = NULL;
else { else {
m_blobTable = new NdbTableImpl(); if (m_blobTable == NULL)
m_blobTable = new NdbTableImpl();
m_blobTable->assign(*col.m_blobTable); m_blobTable->assign(*col.m_blobTable);
} }
m_column_no = col.m_column_no; m_column_no = col.m_column_no;
// Do not copy m_facade !! // Do not copy m_facade !!
return *this; DBUG_RETURN(*this);
} }
void void
...@@ -261,15 +270,19 @@ NdbColumnImpl::init(Type t) ...@@ -261,15 +270,19 @@ NdbColumnImpl::init(Type t)
NdbColumnImpl::~NdbColumnImpl() NdbColumnImpl::~NdbColumnImpl()
{ {
DBUG_ENTER("NdbColumnImpl::~NdbColumnImpl");
DBUG_PRINT("info", ("this: %x", this));
if (m_blobTable != NULL) if (m_blobTable != NULL)
delete m_blobTable; delete m_blobTable;
m_blobTable = NULL; m_blobTable = NULL;
DBUG_VOID_RETURN;
} }
bool bool
NdbColumnImpl::equal(const NdbColumnImpl& col) const NdbColumnImpl::equal(const NdbColumnImpl& col) const
{ {
DBUG_ENTER("NdbColumnImpl::equal"); DBUG_ENTER("NdbColumnImpl::equal");
DBUG_PRINT("info", ("this: %x &col: %x", this, &col));
if(strcmp(m_name.c_str(), col.m_name.c_str()) != 0){ if(strcmp(m_name.c_str(), col.m_name.c_str()) != 0){
DBUG_RETURN(false); DBUG_RETURN(false);
} }
...@@ -377,24 +390,33 @@ NdbTableImpl::NdbTableImpl() ...@@ -377,24 +390,33 @@ NdbTableImpl::NdbTableImpl()
: NdbDictionary::Table(* this), : NdbDictionary::Table(* this),
NdbDictObjectImpl(NdbDictionary::Object::UserTable), m_facade(this) NdbDictObjectImpl(NdbDictionary::Object::UserTable), m_facade(this)
{ {
DBUG_ENTER("NdbTableImpl::NdbTableImpl");
DBUG_PRINT("info", ("this: %x", this));
init(); init();
DBUG_VOID_RETURN;
} }
NdbTableImpl::NdbTableImpl(NdbDictionary::Table & f) NdbTableImpl::NdbTableImpl(NdbDictionary::Table & f)
: NdbDictionary::Table(* this), : NdbDictionary::Table(* this),
NdbDictObjectImpl(NdbDictionary::Object::UserTable), m_facade(&f) NdbDictObjectImpl(NdbDictionary::Object::UserTable), m_facade(&f)
{ {
DBUG_ENTER("NdbTableImpl::NdbTableImpl");
DBUG_PRINT("info", ("this: %x", this));
init(); init();
DBUG_VOID_RETURN;
} }
NdbTableImpl::~NdbTableImpl() NdbTableImpl::~NdbTableImpl()
{ {
DBUG_ENTER("NdbTableImpl::~NdbTableImpl");
DBUG_PRINT("info", ("this: %x", this));
if (m_index != 0) { if (m_index != 0) {
delete m_index; delete m_index;
m_index = 0; m_index = 0;
} }
for (unsigned i = 0; i < m_columns.size(); i++) for (unsigned i = 0; i < m_columns.size(); i++)
delete m_columns[i]; delete m_columns[i];
DBUG_VOID_RETURN;
} }
void void
...@@ -636,6 +658,8 @@ NdbTableImpl::equal(const NdbTableImpl& obj) const ...@@ -636,6 +658,8 @@ NdbTableImpl::equal(const NdbTableImpl& obj) const
void void
NdbTableImpl::assign(const NdbTableImpl& org) NdbTableImpl::assign(const NdbTableImpl& org)
{ {
DBUG_ENTER("NdbColumnImpl::assign");
DBUG_PRINT("info", ("this: %x &org: %x", this, &org));
/* m_changeMask intentionally not copied */ /* m_changeMask intentionally not copied */
m_primaryTableId = org.m_primaryTableId; m_primaryTableId = org.m_primaryTableId;
m_internalName.assign(org.m_internalName); m_internalName.assign(org.m_internalName);
...@@ -662,7 +686,14 @@ NdbTableImpl::assign(const NdbTableImpl& org) ...@@ -662,7 +686,14 @@ NdbTableImpl::assign(const NdbTableImpl& org)
m_columnHashMask, m_columnHash, m_hashValueMask, m_hashpointerValue m_columnHashMask, m_columnHash, m_hashValueMask, m_hashpointerValue
is state calculated by computeAggregates and buildColumnHash is state calculated by computeAggregates and buildColumnHash
*/ */
for(unsigned i = 0; i<org.m_columns.size(); i++){ unsigned i;
for(i = 0; i < m_columns.size(); i++)
{
delete m_columns[i];
}
m_columns.clear();
for(i = 0; i < org.m_columns.size(); i++)
{
NdbColumnImpl * col = new NdbColumnImpl(); NdbColumnImpl * col = new NdbColumnImpl();
const NdbColumnImpl * iorg = org.m_columns[i]; const NdbColumnImpl * iorg = org.m_columns[i];
(* col) = (* iorg); (* col) = (* iorg);
...@@ -702,6 +733,7 @@ NdbTableImpl::assign(const NdbTableImpl& org) ...@@ -702,6 +733,7 @@ NdbTableImpl::assign(const NdbTableImpl& org)
m_tablespace_name = org.m_tablespace_name; m_tablespace_name = org.m_tablespace_name;
m_tablespace_id= org.m_tablespace_id; m_tablespace_id= org.m_tablespace_id;
m_tablespace_version = org.m_tablespace_version; m_tablespace_version = org.m_tablespace_version;
DBUG_VOID_RETURN;
} }
void NdbTableImpl::setName(const char * name) void NdbTableImpl::setName(const char * name)
...@@ -1085,14 +1117,20 @@ NdbEventImpl::NdbEventImpl() : ...@@ -1085,14 +1117,20 @@ NdbEventImpl::NdbEventImpl() :
NdbDictionary::Event(* this), NdbDictionary::Event(* this),
NdbDictObjectImpl(NdbDictionary::Object::TypeUndefined), m_facade(this) NdbDictObjectImpl(NdbDictionary::Object::TypeUndefined), m_facade(this)
{ {
DBUG_ENTER("NdbEventImpl::NdbEventImpl");
DBUG_PRINT("info", ("this: %x", this));
init(); init();
DBUG_VOID_RETURN;
} }
NdbEventImpl::NdbEventImpl(NdbDictionary::Event & f) : NdbEventImpl::NdbEventImpl(NdbDictionary::Event & f) :
NdbDictionary::Event(* this), NdbDictionary::Event(* this),
NdbDictObjectImpl(NdbDictionary::Object::TypeUndefined), m_facade(&f) NdbDictObjectImpl(NdbDictionary::Object::TypeUndefined), m_facade(&f)
{ {
DBUG_ENTER("NdbEventImpl::NdbEventImpl");
DBUG_PRINT("info", ("this: %x", this));
init(); init();
DBUG_VOID_RETURN;
} }
void NdbEventImpl::init() void NdbEventImpl::init()
...@@ -1108,10 +1146,13 @@ void NdbEventImpl::init() ...@@ -1108,10 +1146,13 @@ void NdbEventImpl::init()
NdbEventImpl::~NdbEventImpl() NdbEventImpl::~NdbEventImpl()
{ {
DBUG_ENTER("NdbEventImpl::~NdbEventImpl");
DBUG_PRINT("info", ("this: %x", this));
for (unsigned i = 0; i < m_columns.size(); i++) for (unsigned i = 0; i < m_columns.size(); i++)
delete m_columns[i]; delete m_columns[i];
if (m_tableImpl) if (m_tableImpl)
delete m_tableImpl; delete m_tableImpl;
DBUG_VOID_RETURN;
} }
void NdbEventImpl::setName(const char * name) void NdbEventImpl::setName(const char * name)
...@@ -1134,11 +1175,14 @@ NdbEventImpl::setTable(const NdbDictionary::Table& table) ...@@ -1134,11 +1175,14 @@ NdbEventImpl::setTable(const NdbDictionary::Table& table)
void void
NdbEventImpl::setTable(NdbTableImpl *tableImpl) NdbEventImpl::setTable(NdbTableImpl *tableImpl)
{ {
DBUG_ENTER("NdbEventImpl::setTable");
DBUG_PRINT("info", ("this: %x tableImpl: %x", this, tableImpl));
DBUG_ASSERT(tableImpl->m_status != NdbDictionary::Object::Invalid); DBUG_ASSERT(tableImpl->m_status != NdbDictionary::Object::Invalid);
if (!m_tableImpl) if (!m_tableImpl)
m_tableImpl = new NdbTableImpl(); m_tableImpl = new NdbTableImpl();
// Copy table, since event might be accessed from different threads // Copy table, since event might be accessed from different threads
m_tableImpl->assign(*tableImpl); m_tableImpl->assign(*tableImpl);
DBUG_VOID_RETURN;
} }
const NdbDictionary::Table * const NdbDictionary::Table *
...@@ -3944,6 +3988,7 @@ NdbDictionaryImpl::dropBlobEvents(const NdbEventImpl& evnt) ...@@ -3944,6 +3988,7 @@ NdbDictionaryImpl::dropBlobEvents(const NdbEventImpl& evnt)
if (blob_evnt == NULL) if (blob_evnt == NULL)
continue; continue;
(void)dropEvent(*blob_evnt); (void)dropEvent(*blob_evnt);
delete blob_evnt;
} }
} else { } else {
// loop over MAX_ATTRIBUTES_IN_TABLE ... // loop over MAX_ATTRIBUTES_IN_TABLE ...
......
...@@ -189,6 +189,17 @@ NdbEventOperationImpl::~NdbEventOperationImpl() ...@@ -189,6 +189,17 @@ NdbEventOperationImpl::~NdbEventOperationImpl()
// m_bufferHandle->dropSubscribeEvent(m_bufferId); // m_bufferHandle->dropSubscribeEvent(m_bufferId);
; // ToDo? We should send stop signal here ; // ToDo? We should send stop signal here
if (theMainOp == NULL)
{
NdbEventOperationImpl* tBlobOp = theBlobOpList;
while (tBlobOp != NULL)
{
NdbEventOperationImpl *op = tBlobOp;
tBlobOp = tBlobOp->m_next;
delete op;
}
}
m_ndb->theImpl->theNdbObjectIdMap.unmap(m_oid, this); m_ndb->theImpl->theNdbObjectIdMap.unmap(m_oid, this);
DBUG_PRINT("exit",("this: %p/%p oid: %u main: %p", DBUG_PRINT("exit",("this: %p/%p oid: %u main: %p",
this, m_facade, m_oid, theMainOp)); this, m_facade, m_oid, theMainOp));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment