Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
1051676c
Commit
1051676c
authored
Jul 11, 2007
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix ndb_version.h so that it is usable and make some functions public to handle ndb version
parent
df1bbc8f
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
70 additions
and
55 deletions
+70
-55
storage/ndb/include/ndb_version.h.in
storage/ndb/include/ndb_version.h.in
+36
-21
storage/ndb/include/util/version.h
storage/ndb/include/util/version.h
+8
-15
storage/ndb/src/common/util/version.c
storage/ndb/src/common/util/version.c
+15
-8
storage/ndb/src/kernel/blocks/dbdict/printSchemaFile.cpp
storage/ndb/src/kernel/blocks/dbdict/printSchemaFile.cpp
+1
-1
storage/ndb/src/kernel/blocks/diskpage.cpp
storage/ndb/src/kernel/blocks/diskpage.cpp
+1
-1
storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp
storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp
+1
-1
storage/ndb/src/kernel/blocks/restore.cpp
storage/ndb/src/kernel/blocks/restore.cpp
+1
-1
storage/ndb/src/kernel/vm/SimulatedBlock.hpp
storage/ndb/src/kernel/vm/SimulatedBlock.hpp
+1
-1
storage/ndb/src/mgmsrv/Services.cpp
storage/ndb/src/mgmsrv/Services.cpp
+1
-1
storage/ndb/src/ndbapi/ClusterMgr.cpp
storage/ndb/src/ndbapi/ClusterMgr.cpp
+1
-1
storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp
storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp
+1
-1
storage/ndb/tools/restore/restore_main.cpp
storage/ndb/tools/restore/restore_main.cpp
+3
-3
No files found.
storage/ndb/include/ndb_version.h.in
View file @
1051676c
...
@@ -16,8 +16,7 @@
...
@@ -16,8 +16,7 @@
#ifndef NDB_VERSION_H
#ifndef NDB_VERSION_H
#define NDB_VERSION_H
#define NDB_VERSION_H
#include <ndb_global.h>
#include <ndb_types.h>
#include <version.h>
/* NDB build version */
/* NDB build version */
#define NDB_VERSION_BUILD @NDB_VERSION_BUILD@
#define NDB_VERSION_BUILD @NDB_VERSION_BUILD@
...
@@ -32,19 +31,35 @@
...
@@ -32,19 +31,35 @@
#define NDB_VERSION_STATUS "@NDB_VERSION_STATUS@"
#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
#define NDB_VERSION_STRING_BUF_SZ 100
#ifdef __cplusplus
#ifdef __cplusplus
extern "C"
extern "C" {
#else
extern
#endif
#endif
char ndb_version_string_buf[NDB_VERSION_STRING_BUF_SZ];
#define NDB_VERSION_STRING (getVersionString(NDB_VERSION, NDB_VERSION_STATUS, \
void ndbPrintVersion();
ndb_version_string_buf, \
sizeof(ndb_version_string_buf)))
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()
#define NDB_VERSION ndbGetOwnVersion()
...
@@ -59,19 +74,19 @@ char ndb_version_string_buf[NDB_VERSION_STRING_BUF_SZ];
...
@@ -59,19 +74,19 @@ char ndb_version_string_buf[NDB_VERSION_STRING_BUF_SZ];
/**
/**
* From which version do we support rowid
* From which version do we support rowid
*/
*/
#define NDBD_ROWID_VERSION (MAKE_VERSION(5,1,6))
#define NDBD_ROWID_VERSION (
NDB_
MAKE_VERSION(5,1,6))
#define NDBD_INCL_NODECONF_VERSION_4 MAKE_VERSION(4,1,17)
#define NDBD_INCL_NODECONF_VERSION_4
NDB_
MAKE_VERSION(4,1,17)
#define NDBD_INCL_NODECONF_VERSION_5 MAKE_VERSION(5,0,18)
#define NDBD_INCL_NODECONF_VERSION_5
NDB_
MAKE_VERSION(5,0,18)
#define NDBD_FRAGID_VERSION (MAKE_VERSION(5,1,6))
#define NDBD_FRAGID_VERSION (
NDB_
MAKE_VERSION(5,1,6))
#define NDBD_DICT_LOCK_VERSION_5 MAKE_VERSION(5,0,23)
#define NDBD_DICT_LOCK_VERSION_5
NDB_
MAKE_VERSION(5,0,23)
#define NDBD_DICT_LOCK_VERSION_5_1 MAKE_VERSION(5,1,12)
#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_50
NDB_
MAKE_VERSION(5,0,26)
#define NDBD_UPDATE_FRAG_DIST_KEY_51 MAKE_VERSION(5,1,12)
#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
#endif
storage/ndb/include/util/version.h
View file @
1051676c
...
@@ -16,25 +16,18 @@
...
@@ -16,25 +16,18 @@
#ifndef VERSION_H
#ifndef VERSION_H
#define 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
#ifdef __cplusplus
extern
"C"
{
extern
"C"
{
#endif
#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_mgmt_ndb
(
Uint32
ownVersion
,
Uint32
otherVersion
);
int
ndbCompatible_ndb_mgmt
(
Uint32
ownVersion
,
Uint32
otherVersion
);
int
ndbCompatible_ndb_mgmt
(
Uint32
ownVersion
,
Uint32
otherVersion
);
int
ndbCompatible_mgmt_api
(
Uint32
ownVersion
,
Uint32
otherVersion
);
int
ndbCompatible_mgmt_api
(
Uint32
ownVersion
,
Uint32
otherVersion
);
...
...
storage/ndb/src/common/util/version.c
View file @
1051676c
...
@@ -20,26 +20,33 @@
...
@@ -20,26 +20,33 @@
#include <NdbEnv.h>
#include <NdbEnv.h>
#include <NdbOut.hpp>
#include <NdbOut.hpp>
Uint32
g
etMajor
(
Uint32
version
)
{
Uint32
ndbG
etMajor
(
Uint32
version
)
{
return
(
version
>>
16
)
&
0xFF
;
return
(
version
>>
16
)
&
0xFF
;
}
}
Uint32
g
etMinor
(
Uint32
version
)
{
Uint32
ndbG
etMinor
(
Uint32
version
)
{
return
(
version
>>
8
)
&
0xFF
;
return
(
version
>>
8
)
&
0xFF
;
}
}
Uint32
g
etBuild
(
Uint32
version
)
{
Uint32
ndbG
etBuild
(
Uint32
version
)
{
return
(
version
>>
0
)
&
0xFF
;
return
(
version
>>
0
)
&
0xFF
;
}
}
Uint32
m
akeVersion
(
Uint32
major
,
Uint32
minor
,
Uint32
build
)
{
Uint32
ndbM
akeVersion
(
Uint32
major
,
Uint32
minor
,
Uint32
build
)
{
return
MAKE_VERSION
(
major
,
minor
,
build
);
return
NDB_
MAKE_VERSION
(
major
,
minor
,
build
);
}
}
char
ndb_version_string_buf
[
NDB_VERSION_STRING_BUF_SZ
];
const
char
*
ndbGetOwnVersionString
()
const
char
*
getVersionString
(
Uint32
version
,
const
char
*
status
,
{
char
*
buf
,
unsigned
sz
)
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
)
if
(
status
&&
status
[
0
]
!=
0
)
basestring_snprintf
(
buf
,
sz
,
basestring_snprintf
(
buf
,
sz
,
...
...
storage/ndb/src/kernel/blocks/dbdict/printSchemaFile.cpp
View file @
1051676c
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
#include <ndb_global.h>
#include <ndb_global.h>
#include <
ndb_
version.h>
#include <
util/
version.h>
#include <NdbMain.h>
#include <NdbMain.h>
#include <NdbOut.hpp>
#include <NdbOut.hpp>
...
...
storage/ndb/src/kernel/blocks/diskpage.cpp
View file @
1051676c
...
@@ -49,7 +49,7 @@ operator<<(NdbOut& out, const File_formats::Zero_page_header& obj)
...
@@ -49,7 +49,7 @@ operator<<(NdbOut& out, const File_formats::Zero_page_header& obj)
char
buf
[
256
];
char
buf
[
256
];
out
<<
"page size: "
<<
obj
.
m_page_size
<<
endl
;
out
<<
"page size: "
<<
obj
.
m_page_size
<<
endl
;
out
<<
"ndb version: "
<<
obj
.
m_ndb_version
<<
", "
<<
out
<<
"ndb version: "
<<
obj
.
m_ndb_version
<<
", "
<<
g
etVersionString
(
obj
.
m_ndb_version
,
0
,
buf
,
sizeof
(
buf
))
<<
endl
;
ndbG
etVersionString
(
obj
.
m_ndb_version
,
0
,
buf
,
sizeof
(
buf
))
<<
endl
;
out
<<
"ndb node id: "
<<
obj
.
m_node_id
<<
endl
;
out
<<
"ndb node id: "
<<
obj
.
m_node_id
<<
endl
;
out
<<
"file type: "
<<
obj
.
m_file_type
<<
endl
;
out
<<
"file type: "
<<
obj
.
m_file_type
<<
endl
;
out
<<
"time: "
<<
obj
.
m_time
<<
", "
out
<<
"time: "
<<
obj
.
m_time
<<
", "
...
...
storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp
View file @
1051676c
...
@@ -2793,7 +2793,7 @@ void Qmgr::execAPI_REGREQ(Signal* signal)
...
@@ -2793,7 +2793,7 @@ void Qmgr::execAPI_REGREQ(Signal* signal)
"incompatible with %s"
,
"incompatible with %s"
,
type
==
NodeInfo
::
API
?
"api or mysqld"
:
"management server"
,
type
==
NodeInfo
::
API
?
"api or mysqld"
:
"management server"
,
apiNodePtr
.
i
,
apiNodePtr
.
i
,
g
etVersionString
(
version
,
""
,
buf
,
sizeof
(
buf
)),
ndbG
etVersionString
(
version
,
""
,
buf
,
sizeof
(
buf
)),
NDB_VERSION_STRING
);
NDB_VERSION_STRING
);
apiNodePtr
.
p
->
phase
=
ZAPI_INACTIVE
;
apiNodePtr
.
p
->
phase
=
ZAPI_INACTIVE
;
sendApiRegRef
(
signal
,
ref
,
ApiRegRef
::
UnsupportedVersion
);
sendApiRegRef
(
signal
,
ref
,
ApiRegRef
::
UnsupportedVersion
);
...
...
storage/ndb/src/kernel/blocks/restore.cpp
View file @
1051676c
...
@@ -1271,7 +1271,7 @@ Restore::check_file_version(Signal* signal, Uint32 file_version)
...
@@ -1271,7 +1271,7 @@ Restore::check_file_version(Signal* signal, Uint32 file_version)
{
{
char
buf
[
255
];
char
buf
[
255
];
char
verbuf
[
255
];
char
verbuf
[
255
];
g
etVersionString
(
file_version
,
0
,
verbuf
,
sizeof
(
verbuf
));
ndbG
etVersionString
(
file_version
,
0
,
verbuf
,
sizeof
(
verbuf
));
BaseString
::
snprintf
(
buf
,
sizeof
(
buf
),
BaseString
::
snprintf
(
buf
,
sizeof
(
buf
),
"Unsupported version of LCP files found on disk, "
"Unsupported version of LCP files found on disk, "
" found: %s"
,
verbuf
);
" found: %s"
,
verbuf
);
...
...
storage/ndb/src/kernel/vm/SimulatedBlock.hpp
View file @
1051676c
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
#include <NdbTick.h>
#include <NdbTick.h>
#include <kernel_types.h>
#include <kernel_types.h>
#include <
ndb_
version.h>
#include <
util/
version.h>
#include <ndb_limits.h>
#include <ndb_limits.h>
#include "VMSignal.hpp"
#include "VMSignal.hpp"
...
...
storage/ndb/src/mgmsrv/Services.cpp
View file @
1051676c
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
#include <uucode.h>
#include <uucode.h>
#include <socket_io.h>
#include <socket_io.h>
#include <
ndb_
version.h>
#include <
util/
version.h>
#include <mgmapi.h>
#include <mgmapi.h>
#include <EventLogger.hpp>
#include <EventLogger.hpp>
#include <signaldata/SetLogLevelOrd.hpp>
#include <signaldata/SetLogLevelOrd.hpp>
...
...
storage/ndb/src/ndbapi/ClusterMgr.cpp
View file @
1051676c
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
#include <ndb_global.h>
#include <ndb_global.h>
#include <my_pthread.h>
#include <my_pthread.h>
#include <ndb_limits.h>
#include <ndb_limits.h>
#include <
ndb_
version.h>
#include <
util/
version.h>
#include "TransporterFacade.hpp"
#include "TransporterFacade.hpp"
#include "ClusterMgr.hpp"
#include "ClusterMgr.hpp"
...
...
storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp
View file @
1051676c
...
@@ -42,7 +42,7 @@
...
@@ -42,7 +42,7 @@
#include <my_sys.h>
#include <my_sys.h>
#include <NdbEnv.h>
#include <NdbEnv.h>
#include <NdbMem.h>
#include <NdbMem.h>
#include <
ndb_
version.h>
#include <
util/
version.h>
#define DEBUG_PRINT 0
#define DEBUG_PRINT 0
#define INCOMPATIBLE_VERSION -2
#define INCOMPATIBLE_VERSION -2
...
...
storage/ndb/tools/restore/restore_main.cpp
View file @
1051676c
...
@@ -684,7 +684,7 @@ main(int argc, char** argv)
...
@@ -684,7 +684,7 @@ main(int argc, char** argv)
char
buf
[
NDB_VERSION_STRING_BUF_SZ
];
char
buf
[
NDB_VERSION_STRING_BUF_SZ
];
info
.
setLevel
(
254
);
info
.
setLevel
(
254
);
info
<<
"Ndb version in backup files: "
info
<<
"Ndb version in backup files: "
<<
g
etVersionString
(
version
,
0
,
buf
,
sizeof
(
buf
))
<<
endl
;
<<
ndbG
etVersionString
(
version
,
0
,
buf
,
sizeof
(
buf
))
<<
endl
;
/**
/**
* check wheater we can restore the backup (right version).
* check wheater we can restore the backup (right version).
...
@@ -694,9 +694,9 @@ main(int argc, char** argv)
...
@@ -694,9 +694,9 @@ main(int argc, char** argv)
if
(
version
>=
MAKE_VERSION
(
5
,
1
,
3
)
&&
version
<=
MAKE_VERSION
(
5
,
1
,
9
))
if
(
version
>=
MAKE_VERSION
(
5
,
1
,
3
)
&&
version
<=
MAKE_VERSION
(
5
,
1
,
9
))
{
{
err
<<
"Restore program incompatible with backup versions between "
err
<<
"Restore program incompatible with backup versions between "
<<
g
etVersionString
(
MAKE_VERSION
(
5
,
1
,
3
),
0
,
buf
,
sizeof
(
buf
))
<<
ndbG
etVersionString
(
MAKE_VERSION
(
5
,
1
,
3
),
0
,
buf
,
sizeof
(
buf
))
<<
" and "
<<
" and "
<<
g
etVersionString
(
MAKE_VERSION
(
5
,
1
,
9
),
0
,
buf
,
sizeof
(
buf
))
<<
ndbG
etVersionString
(
MAKE_VERSION
(
5
,
1
,
9
),
0
,
buf
,
sizeof
(
buf
))
<<
endl
;
<<
endl
;
exitHandler
(
NDBT_FAILED
);
exitHandler
(
NDBT_FAILED
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment