diff options
author | unknown <patg@patrick.local> | 2005-04-01 12:32:17 -0800 |
---|---|---|
committer | unknown <patg@patrick.local> | 2005-04-01 12:32:17 -0800 |
commit | c0333ecee42a4de499b3377cfa21d7b5af1ddd2b (patch) | |
tree | 389228d07d324be3e962fefab032b134daa8021a /ndb | |
parent | 844acf9a66bb85ea0604f385efdaf2c655fd957a (diff) | |
parent | bd2da82b2131241ce960bb02075aba2689ed1a3a (diff) | |
download | mariadb-git-c0333ecee42a4de499b3377cfa21d7b5af1ddd2b.tar.gz |
5.0 to 5.1 merge
mysql-test/r/grant.result:
Auto merged
scripts/mysql_create_system_tables.sh:
Auto merged
scripts/mysql_fix_privilege_tables.sql:
Auto merged
sql/Makefile.am:
Auto merged
sql/log.cc:
Auto merged
sql/log_event.cc:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/mysqld.cc:
Auto merged
sql/slave.cc:
Auto merged
sql/slave.h:
Auto merged
sql/sql_acl.cc:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_parse.cc:
Auto merged
configure.in:
merge of 5.0 to 5.1, version info and NDB_VERSION_() conflicts
libmysqld/Makefile.am:
merge of Makefile sql_sources list
sql/sql_acl.h:
merge, no need to hand resolve
BitKeeper/etc/logging_ok:
Logging to logging@openlogging.org accepted
Diffstat (limited to 'ndb')
-rw-r--r-- | ndb/include/util/Vector.hpp | 8 | ||||
-rw-r--r-- | ndb/src/kernel/blocks/dbdict/Dbdict.cpp | 4 | ||||
-rw-r--r-- | ndb/src/kernel/blocks/dbdict/printSchemaFile.cpp (renamed from ndb/src/kernel/blocks/dbdict/printSchemafile/printSchemafile.cpp) | 15 | ||||
-rw-r--r-- | ndb/src/kernel/blocks/dbdict/printSchemafile/Makefile | 12 | ||||
-rw-r--r-- | ndb/src/kernel/vm/VMSignal.cpp | 4 | ||||
-rw-r--r-- | ndb/src/mgmapi/mgmapi.cpp | 12 | ||||
-rw-r--r-- | ndb/src/ndbapi/DictCache.cpp | 7 |
7 files changed, 41 insertions, 21 deletions
diff --git a/ndb/include/util/Vector.hpp b/ndb/include/util/Vector.hpp index f60817dab67..480dddf8243 100644 --- a/ndb/include/util/Vector.hpp +++ b/ndb/include/util/Vector.hpp @@ -61,6 +61,10 @@ Vector<T>::Vector(int i){ template<class T> Vector<T>::~Vector(){ delete[] m_items; + // safety for placement new usage + m_items = 0; + m_size = 0; + m_arraySize = 0; } template<class T> @@ -174,6 +178,10 @@ MutexVector<T>::MutexVector(int i){ template<class T> MutexVector<T>::~MutexVector(){ delete[] m_items; + // safety for placement new usage + m_items = 0; + m_size = 0; + m_arraySize = 0; } template<class T> diff --git a/ndb/src/kernel/blocks/dbdict/Dbdict.cpp b/ndb/src/kernel/blocks/dbdict/Dbdict.cpp index 78209c3affa..4bc5b127a8f 100644 --- a/ndb/src/kernel/blocks/dbdict/Dbdict.cpp +++ b/ndb/src/kernel/blocks/dbdict/Dbdict.cpp @@ -2470,7 +2470,9 @@ Dbdict::restartCreateTab_writeTableConf(Signal* signal, callback.m_callbackFunction = safe_cast(&Dbdict::restartCreateTab_dihComplete); - SegmentedSectionPtr fragDataPtr; fragDataPtr.setNull(); + SegmentedSectionPtr fragDataPtr; + fragDataPtr.sz = 0; + fragDataPtr.setNull(); createTab_dih(signal, createTabPtr, fragDataPtr, &callback); } diff --git a/ndb/src/kernel/blocks/dbdict/printSchemafile/printSchemafile.cpp b/ndb/src/kernel/blocks/dbdict/printSchemaFile.cpp index bf721a0b30a..0ba52878b7c 100644 --- a/ndb/src/kernel/blocks/dbdict/printSchemafile/printSchemafile.cpp +++ b/ndb/src/kernel/blocks/dbdict/printSchemaFile.cpp @@ -1,3 +1,11 @@ +#if 0 +make -f Makefile -f - printSchemaFile <<'_eof_' +printSchemaFile: printSchemaFile.cpp + $(CXXCOMPILE) -o $@ $@.cpp -L../../../common/util/.libs -lgeneral +_eof_ +exit $? +#endif + /* Copyright (C) 2003 MySQL AB This program is free software; you can redistribute it and/or modify @@ -92,6 +100,13 @@ NDB_COMMAND(printSchemafile, } print(filename, (SchemaFile *)&buf[0]); + + Uint32 chk = 0, i; + for (i = 0; i < bytes/4; i++) + chk ^= buf[i]; + if (chk != 0) + ndbout << "Invalid checksum!" << endl; + delete [] buf; return 0; } diff --git a/ndb/src/kernel/blocks/dbdict/printSchemafile/Makefile b/ndb/src/kernel/blocks/dbdict/printSchemafile/Makefile deleted file mode 100644 index 1b097e2ce37..00000000000 --- a/ndb/src/kernel/blocks/dbdict/printSchemafile/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -include .defs.mk - -TYPE := ndbapi - -BIN_TARGET := printSchemafile -BIN_TARGET_ARCHIVES := portlib general - -CCFLAGS_LOC += -I.. - -SOURCES := printSchemafile.cpp - -include $(NDB_TOP)/Epilogue.mk diff --git a/ndb/src/kernel/vm/VMSignal.cpp b/ndb/src/kernel/vm/VMSignal.cpp index bffca6f6541..e4eafb47ff7 100644 --- a/ndb/src/kernel/vm/VMSignal.cpp +++ b/ndb/src/kernel/vm/VMSignal.cpp @@ -18,8 +18,8 @@ #include <string.h> Signal::Signal(){ - memset(&header, sizeof(header), 0); - memset(theData, sizeof(theData), 0); + memset(&header, 0, sizeof(header)); + memset(theData, 0, sizeof(theData)); } void diff --git a/ndb/src/mgmapi/mgmapi.cpp b/ndb/src/mgmapi/mgmapi.cpp index 67ee307bb68..fe7909ba5a1 100644 --- a/ndb/src/mgmapi/mgmapi.cpp +++ b/ndb/src/mgmapi/mgmapi.cpp @@ -144,6 +144,7 @@ extern "C" NdbMgmHandle ndb_mgm_create_handle() { + DBUG_ENTER("ndb_mgm_create_handle"); NdbMgmHandle h = (NdbMgmHandle)my_malloc(sizeof(ndb_mgm_handle),MYF(MY_WME)); h->connected = 0; @@ -163,7 +164,8 @@ ndb_mgm_create_handle() h->logfile = 0; #endif - return h; + DBUG_PRINT("info", ("handle=0x%x", (UintPtr)h)); + DBUG_RETURN(h); } extern "C" @@ -171,10 +173,13 @@ int ndb_mgm_set_connectstring(NdbMgmHandle handle, const char * mgmsrv) { DBUG_ENTER("ndb_mgm_set_connectstring"); + DBUG_PRINT("info", ("handle=0x%x", (UintPtr)handle)); + handle->cfg.~LocalConfig(); new (&(handle->cfg)) LocalConfig; if (!handle->cfg.init(mgmsrv, 0) || handle->cfg.ids.size() == 0) { + handle->cfg.~LocalConfig(); new (&(handle->cfg)) LocalConfig; handle->cfg.init(0, 0); /* reset the LocalConfig */ SET_ERROR(handle, NDB_MGM_ILLEGAL_CONNECT_STRING, ""); @@ -191,8 +196,10 @@ extern "C" void ndb_mgm_destroy_handle(NdbMgmHandle * handle) { + DBUG_ENTER("ndb_mgm_destroy_handle"); if(!handle) - return; + DBUG_VOID_RETURN; + DBUG_PRINT("info", ("handle=0x%x", (UintPtr)(* handle))); /** * important! only disconnect if connected * other code relies on this @@ -209,6 +216,7 @@ ndb_mgm_destroy_handle(NdbMgmHandle * handle) (*handle)->cfg.~LocalConfig(); my_free((char*)* handle,MYF(MY_ALLOW_ZERO_PTR)); * handle = 0; + DBUG_VOID_RETURN; } /***************************************************************************** diff --git a/ndb/src/ndbapi/DictCache.cpp b/ndb/src/ndbapi/DictCache.cpp index afdb37aa53f..da9d5b70d47 100644 --- a/ndb/src/ndbapi/DictCache.cpp +++ b/ndb/src/ndbapi/DictCache.cpp @@ -24,12 +24,11 @@ Ndb_local_table_info * Ndb_local_table_info::create(NdbTableImpl *table_impl, Uint32 sz) { - if (sz % 8 != 0) // round to Uint64 - sz += 8 - sz % 8; - void *data= malloc(sizeof(NdbTableImpl)+sz-8); + Uint32 tot_size= sizeof(NdbTableImpl *) + ((sz+7) & ~7); // round to Uint64 + void *data= malloc(tot_size); if (data == 0) return 0; - memset(data,0,sizeof(NdbTableImpl)+sz-8); + memset(data, 0, tot_size); new (data) Ndb_local_table_info(table_impl); return (Ndb_local_table_info *) data; } |