diff options
author | unknown <tomas@whalegate.ndb.mysql.com> | 2007-07-13 10:35:03 +0200 |
---|---|---|
committer | unknown <tomas@whalegate.ndb.mysql.com> | 2007-07-13 10:35:03 +0200 |
commit | a666081bccaba5e6ae06dfb2e1c67845207bc03e (patch) | |
tree | 81f238716a9a8ab3275cb8a260e1684b29aa406b /storage | |
parent | b4352246404ba9ba3b89285c0543587b218f74eb (diff) | |
parent | 49bb7e206b2b04f36f461b59ce7e86d692c7b654 (diff) | |
download | mariadb-git-a666081bccaba5e6ae06dfb2e1c67845207bc03e.tar.gz |
Merge tulin@bk-internal.mysql.com:/home/bk/mysql-5.1-new-ndb-merge
into whalegate.ndb.mysql.com:/home/tomas/mysql-5.1-new-ndb-merge
mysql-test/r/rpl_row_tabledefs_2myisam.result:
Auto merged
mysql-test/r/rpl_row_tabledefs_3innodb.result:
Auto merged
storage/ndb/test/run-test/daily-basic-tests.txt:
Auto merged
storage/ndb/tools/restore/restore_main.cpp:
Auto merged
sql/log_event.cc:
manual merge
Diffstat (limited to 'storage')
-rw-r--r-- | storage/ndb/include/ndb_version.h.in | 57 | ||||
-rw-r--r-- | storage/ndb/include/util/version.h | 23 | ||||
-rw-r--r-- | storage/ndb/src/common/util/version.c | 23 | ||||
-rw-r--r-- | storage/ndb/src/kernel/blocks/dbdict/printSchemaFile.cpp | 2 | ||||
-rw-r--r-- | storage/ndb/src/kernel/blocks/diskpage.cpp | 2 | ||||
-rw-r--r-- | storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp | 2 | ||||
-rw-r--r-- | storage/ndb/src/kernel/blocks/restore.cpp | 2 | ||||
-rw-r--r-- | storage/ndb/src/kernel/vm/SimulatedBlock.hpp | 2 | ||||
-rw-r--r-- | storage/ndb/src/mgmsrv/Services.cpp | 2 | ||||
-rw-r--r-- | storage/ndb/src/ndbapi/ClusterMgr.cpp | 2 | ||||
-rw-r--r-- | storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp | 2 | ||||
-rw-r--r-- | storage/ndb/tools/restore/restore_main.cpp | 6 |
12 files changed, 70 insertions, 55 deletions
diff --git a/storage/ndb/include/ndb_version.h.in b/storage/ndb/include/ndb_version.h.in index 9e1edeecd1e..5405ad4d7aa 100644 --- a/storage/ndb/include/ndb_version.h.in +++ b/storage/ndb/include/ndb_version.h.in @@ -16,8 +16,7 @@ #ifndef NDB_VERSION_H #define NDB_VERSION_H -#include <ndb_global.h> -#include <version.h> +#include <ndb_types.h> /* NDB build version */ #define NDB_VERSION_BUILD @NDB_VERSION_BUILD@ @@ -32,19 +31,35 @@ #define NDB_VERSION_STATUS "@NDB_VERSION_STATUS@" -#define MAKE_VERSION(A,B,C) (((A) << 16) | ((B) << 8) | ((C) << 0)) +#define NDB_MAKE_VERSION(A,B,C) (((A) << 16) | ((B) << 8) | ((C) << 0)) -#define NDB_VERSION_D MAKE_VERSION(NDB_VERSION_MAJOR, NDB_VERSION_MINOR, NDB_VERSION_BUILD) +#define NDB_VERSION_D NDB_MAKE_VERSION(NDB_VERSION_MAJOR, NDB_VERSION_MINOR, NDB_VERSION_BUILD) #define NDB_VERSION_STRING_BUF_SZ 100 #ifdef __cplusplus -extern "C" -#else -extern +extern "C" { #endif -char ndb_version_string_buf[NDB_VERSION_STRING_BUF_SZ]; -#define NDB_VERSION_STRING (getVersionString(NDB_VERSION, NDB_VERSION_STATUS, \ - ndb_version_string_buf, \ - sizeof(ndb_version_string_buf))) + +void ndbPrintVersion(); + +Uint32 ndbMakeVersion(Uint32 major, Uint32 minor, Uint32 build); + +Uint32 ndbGetMajor(Uint32 version); + +Uint32 ndbGetMinor(Uint32 version); + +Uint32 ndbGetBuild(Uint32 version); + +const char* ndbGetVersionString(Uint32 version, const char * status, + char *buf, unsigned sz); +const char* ndbGetOwnVersionString(); + +Uint32 ndbGetOwnVersion(); + +#ifdef __cplusplus +} +#endif + +#define NDB_VERSION_STRING ndbGetOwnVersionString() #define NDB_VERSION ndbGetOwnVersion() @@ -59,19 +74,19 @@ char ndb_version_string_buf[NDB_VERSION_STRING_BUF_SZ]; /** * From which version do we support rowid */ -#define NDBD_ROWID_VERSION (MAKE_VERSION(5,1,6)) -#define NDBD_INCL_NODECONF_VERSION_4 MAKE_VERSION(4,1,17) -#define NDBD_INCL_NODECONF_VERSION_5 MAKE_VERSION(5,0,18) -#define NDBD_FRAGID_VERSION (MAKE_VERSION(5,1,6)) -#define NDBD_DICT_LOCK_VERSION_5 MAKE_VERSION(5,0,23) -#define NDBD_DICT_LOCK_VERSION_5_1 MAKE_VERSION(5,1,12) +#define NDBD_ROWID_VERSION (NDB_MAKE_VERSION(5,1,6)) +#define NDBD_INCL_NODECONF_VERSION_4 NDB_MAKE_VERSION(4,1,17) +#define NDBD_INCL_NODECONF_VERSION_5 NDB_MAKE_VERSION(5,0,18) +#define NDBD_FRAGID_VERSION (NDB_MAKE_VERSION(5,1,6)) +#define NDBD_DICT_LOCK_VERSION_5 NDB_MAKE_VERSION(5,0,23) +#define NDBD_DICT_LOCK_VERSION_5_1 NDB_MAKE_VERSION(5,1,12) -#define NDBD_UPDATE_FRAG_DIST_KEY_50 MAKE_VERSION(5,0,26) -#define NDBD_UPDATE_FRAG_DIST_KEY_51 MAKE_VERSION(5,1,12) +#define NDBD_UPDATE_FRAG_DIST_KEY_50 NDB_MAKE_VERSION(5,0,26) +#define NDBD_UPDATE_FRAG_DIST_KEY_51 NDB_MAKE_VERSION(5,1,12) -#define NDBD_QMGR_SINGLEUSER_VERSION_5 MAKE_VERSION(5,0,25) +#define NDBD_QMGR_SINGLEUSER_VERSION_5 NDB_MAKE_VERSION(5,0,25) -#define NDBD_NODE_VERSION_REP MAKE_VERSION(6,1,1) +#define NDBD_NODE_VERSION_REP NDB_MAKE_VERSION(6,1,1) #endif diff --git a/storage/ndb/include/util/version.h b/storage/ndb/include/util/version.h index 42513d00442..9ea18ecd9d9 100644 --- a/storage/ndb/include/util/version.h +++ b/storage/ndb/include/util/version.h @@ -16,25 +16,18 @@ #ifndef VERSION_H #define VERSION_H -#include <ndb_types.h> +#include <ndb_version.h> + +/* some backwards compatible macros */ +#define MAKE_VERSION(A,B,C) NDB_MAKE_VERSION(A,B,C) +#define getMajor(a) ndbGetMajor(a) +#define getMinor(a) ndbGetMinor(a) +#define getBuild(a) ndbGetBuild(a) + #ifdef __cplusplus extern "C" { #endif - Uint32 getMajor(Uint32 version); - - Uint32 getMinor(Uint32 version); - - Uint32 getBuild(Uint32 version); - - Uint32 makeVersion(Uint32 major, Uint32 minor, Uint32 build); - - const char* getVersionString(Uint32 version, const char * status, - char *buf, unsigned sz); - - void ndbPrintVersion(); - Uint32 ndbGetOwnVersion(); - int ndbCompatible_mgmt_ndb(Uint32 ownVersion, Uint32 otherVersion); int ndbCompatible_ndb_mgmt(Uint32 ownVersion, Uint32 otherVersion); int ndbCompatible_mgmt_api(Uint32 ownVersion, Uint32 otherVersion); diff --git a/storage/ndb/src/common/util/version.c b/storage/ndb/src/common/util/version.c index f309a3d4ad5..56a92489131 100644 --- a/storage/ndb/src/common/util/version.c +++ b/storage/ndb/src/common/util/version.c @@ -20,26 +20,33 @@ #include <NdbEnv.h> #include <NdbOut.hpp> -Uint32 getMajor(Uint32 version) { +Uint32 ndbGetMajor(Uint32 version) { return (version >> 16) & 0xFF; } -Uint32 getMinor(Uint32 version) { +Uint32 ndbGetMinor(Uint32 version) { return (version >> 8) & 0xFF; } -Uint32 getBuild(Uint32 version) { +Uint32 ndbGetBuild(Uint32 version) { return (version >> 0) & 0xFF; } -Uint32 makeVersion(Uint32 major, Uint32 minor, Uint32 build) { - return MAKE_VERSION(major, minor, build); +Uint32 ndbMakeVersion(Uint32 major, Uint32 minor, Uint32 build) { + return NDB_MAKE_VERSION(major, minor, build); } -char ndb_version_string_buf[NDB_VERSION_STRING_BUF_SZ]; -const char * getVersionString(Uint32 version, const char * status, - char *buf, unsigned sz) +const char * ndbGetOwnVersionString() +{ + static char ndb_version_string_buf[NDB_VERSION_STRING_BUF_SZ]; + return ndbGetVersionString(NDB_VERSION, NDB_VERSION_STATUS, + ndb_version_string_buf, + sizeof(ndb_version_string_buf)); +} + +const char * ndbGetVersionString(Uint32 version, const char * status, + char *buf, unsigned sz) { if (status && status[0] != 0) basestring_snprintf(buf, sz, diff --git a/storage/ndb/src/kernel/blocks/dbdict/printSchemaFile.cpp b/storage/ndb/src/kernel/blocks/dbdict/printSchemaFile.cpp index 602881095c3..44326e213d0 100644 --- a/storage/ndb/src/kernel/blocks/dbdict/printSchemaFile.cpp +++ b/storage/ndb/src/kernel/blocks/dbdict/printSchemaFile.cpp @@ -15,7 +15,7 @@ #include <ndb_global.h> -#include <ndb_version.h> +#include <util/version.h> #include <NdbMain.h> #include <NdbOut.hpp> diff --git a/storage/ndb/src/kernel/blocks/diskpage.cpp b/storage/ndb/src/kernel/blocks/diskpage.cpp index 3f98e078746..50e9b6e53cb 100644 --- a/storage/ndb/src/kernel/blocks/diskpage.cpp +++ b/storage/ndb/src/kernel/blocks/diskpage.cpp @@ -49,7 +49,7 @@ operator<<(NdbOut& out, const File_formats::Zero_page_header& obj) char buf[256]; out << "page size: " << obj.m_page_size << endl; out << "ndb version: " << obj.m_ndb_version << ", " << - getVersionString(obj.m_ndb_version, 0, buf, sizeof(buf)) << endl; + ndbGetVersionString(obj.m_ndb_version, 0, buf, sizeof(buf)) << endl; out << "ndb node id: " << obj.m_node_id << endl; out << "file type: " << obj.m_file_type << endl; out << "time: " << obj.m_time << ", " diff --git a/storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp b/storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp index 52045fd63cd..1fba4d62e17 100644 --- a/storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp +++ b/storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp @@ -2793,7 +2793,7 @@ void Qmgr::execAPI_REGREQ(Signal* signal) "incompatible with %s", type == NodeInfo::API ? "api or mysqld" : "management server", apiNodePtr.i, - getVersionString(version,"",buf,sizeof(buf)), + ndbGetVersionString(version,"",buf,sizeof(buf)), NDB_VERSION_STRING); apiNodePtr.p->phase = ZAPI_INACTIVE; sendApiRegRef(signal, ref, ApiRegRef::UnsupportedVersion); diff --git a/storage/ndb/src/kernel/blocks/restore.cpp b/storage/ndb/src/kernel/blocks/restore.cpp index 2d40cd79daa..efc4bc1948a 100644 --- a/storage/ndb/src/kernel/blocks/restore.cpp +++ b/storage/ndb/src/kernel/blocks/restore.cpp @@ -1271,7 +1271,7 @@ Restore::check_file_version(Signal* signal, Uint32 file_version) { char buf[255]; char verbuf[255]; - getVersionString(file_version, 0, verbuf, sizeof(verbuf)); + ndbGetVersionString(file_version, 0, verbuf, sizeof(verbuf)); BaseString::snprintf(buf, sizeof(buf), "Unsupported version of LCP files found on disk, " " found: %s", verbuf); diff --git a/storage/ndb/src/kernel/vm/SimulatedBlock.hpp b/storage/ndb/src/kernel/vm/SimulatedBlock.hpp index a78ee21fb8f..31f219718e5 100644 --- a/storage/ndb/src/kernel/vm/SimulatedBlock.hpp +++ b/storage/ndb/src/kernel/vm/SimulatedBlock.hpp @@ -18,7 +18,7 @@ #include <NdbTick.h> #include <kernel_types.h> -#include <ndb_version.h> +#include <util/version.h> #include <ndb_limits.h> #include "VMSignal.hpp" diff --git a/storage/ndb/src/mgmsrv/Services.cpp b/storage/ndb/src/mgmsrv/Services.cpp index f260ff7e3ec..9272b5ab532 100644 --- a/storage/ndb/src/mgmsrv/Services.cpp +++ b/storage/ndb/src/mgmsrv/Services.cpp @@ -18,7 +18,7 @@ #include <uucode.h> #include <socket_io.h> -#include <ndb_version.h> +#include <util/version.h> #include <mgmapi.h> #include <EventLogger.hpp> #include <signaldata/SetLogLevelOrd.hpp> diff --git a/storage/ndb/src/ndbapi/ClusterMgr.cpp b/storage/ndb/src/ndbapi/ClusterMgr.cpp index f51a5098c53..448bc1025e8 100644 --- a/storage/ndb/src/ndbapi/ClusterMgr.cpp +++ b/storage/ndb/src/ndbapi/ClusterMgr.cpp @@ -16,7 +16,7 @@ #include <ndb_global.h> #include <my_pthread.h> #include <ndb_limits.h> -#include <ndb_version.h> +#include <util/version.h> #include "TransporterFacade.hpp" #include "ClusterMgr.hpp" diff --git a/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp b/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp index 63d36bf012f..ab6d90ad59e 100644 --- a/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp +++ b/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp @@ -42,7 +42,7 @@ #include <my_sys.h> #include <NdbEnv.h> #include <NdbMem.h> -#include <ndb_version.h> +#include <util/version.h> #define DEBUG_PRINT 0 #define INCOMPATIBLE_VERSION -2 diff --git a/storage/ndb/tools/restore/restore_main.cpp b/storage/ndb/tools/restore/restore_main.cpp index ec2550118d3..c12dc4dd0e8 100644 --- a/storage/ndb/tools/restore/restore_main.cpp +++ b/storage/ndb/tools/restore/restore_main.cpp @@ -684,7 +684,7 @@ main(int argc, char** argv) char buf[NDB_VERSION_STRING_BUF_SZ]; info.setLevel(254); info << "Ndb version in backup files: " - << getVersionString(version, 0, buf, sizeof(buf)) << endl; + << ndbGetVersionString(version, 0, buf, sizeof(buf)) << endl; /** * check wheater we can restore the backup (right version). @@ -694,9 +694,9 @@ main(int argc, char** argv) if (version >= MAKE_VERSION(5,1,3) && version <= MAKE_VERSION(5,1,9)) { err << "Restore program incompatible with backup versions between " - << getVersionString(MAKE_VERSION(5,1,3), 0, buf, sizeof(buf)) + << ndbGetVersionString(MAKE_VERSION(5,1,3), 0, buf, sizeof(buf)) << " and " - << getVersionString(MAKE_VERSION(5,1,9), 0, buf, sizeof(buf)) + << ndbGetVersionString(MAKE_VERSION(5,1,9), 0, buf, sizeof(buf)) << endl; exitHandler(NDBT_FAILED); } |