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
e69cc6b2
Commit
e69cc6b2
authored
Dec 17, 2004
by
tomas@poseidon.ndb.mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
enabled setting version for ndb
parent
7ffe3ce6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
18 deletions
+23
-18
ndb/src/common/util/version.c
ndb/src/common/util/version.c
+23
-18
No files found.
ndb/src/common/util/version.c
View file @
e69cc6b2
...
...
@@ -17,6 +17,8 @@
#include <ndb_global.h>
#include <ndb_version.h>
#include <version.h>
#include <NdbEnv.h>
#include <NdbOut.hpp>
Uint32
getMajor
(
Uint32
version
)
{
return
(
version
>>
16
)
&
0xFF
;
...
...
@@ -67,6 +69,24 @@ struct NdbUpGradeCompatible {
/*#define TEST_VERSION*/
#define HAVE_NDB_SETVERSION
#ifdef HAVE_NDB_SETVERSION
Uint32
ndbOwnVersionTesting
=
0
;
void
ndbSetOwnVersion
()
{
char
buf
[
256
];
if
(
NdbEnv_GetEnv
(
"NDB_SETVERSION"
,
buf
,
sizeof
(
buf
)))
{
Uint32
_v1
,
_v2
,
_v3
;
if
(
sscanf
(
buf
,
"%u.%u.%u"
,
&
_v1
,
&
_v2
,
&
_v3
)
==
3
)
{
ndbOwnVersionTesting
=
MAKE_VERSION
(
_v1
,
_v2
,
_v3
);
ndbout_c
(
"Testing: Version set to 0x%x"
,
ndbOwnVersionTesting
);
}
}
}
#else
void
ndbSetOwnVersion
()
{}
#endif
#ifndef TEST_VERSION
struct
NdbUpGradeCompatible
ndbCompatibleTable_full
[]
=
{
{
MAKE_VERSION
(
4
,
1
,
9
),
MAKE_VERSION
(
4
,
1
,
8
),
UG_Exact
},
...
...
@@ -79,8 +99,6 @@ struct NdbUpGradeCompatible ndbCompatibleTable_upgrade[] = {
{
0
,
0
,
UG_Null
}
};
void
ndbSetOwnVersion
()
{}
#else
/* testing purposes */
struct
NdbUpGradeCompatible
ndbCompatibleTable_full
[]
=
{
...
...
@@ -101,19 +119,6 @@ struct NdbUpGradeCompatible ndbCompatibleTable_upgrade[] = {
};
Uint32
ndbOwnVersionTesting
=
0
;
void
ndbSetOwnVersion
()
{
char
buf
[
256
];
if
(
NdbEnv_GetEnv
(
"NDB_SETVERSION"
,
buf
,
sizeof
(
buf
)))
{
Uint32
_v1
,
_v2
,
_v3
;
if
(
sscanf
(
buf
,
"%u.%u.%u"
,
&
_v1
,
&
_v2
,
&
_v3
)
==
3
)
{
ndbOwnVersionTesting
=
MAKE_VERSION
(
_v1
,
_v2
,
_v3
);
ndbout_c
(
"Testing: Version set to 0x%x"
,
ndbOwnVersionTesting
);
}
}
}
#endif
void
ndbPrintVersion
()
...
...
@@ -127,13 +132,13 @@ void ndbPrintVersion()
Uint32
ndbGetOwnVersion
()
{
#ifndef TEST_VERSION
return
NDB_VERSION_D
;
#else
/* testing purposes */
#ifdef HAVE_NDB_SETVERSION
if
(
ndbOwnVersionTesting
==
0
)
return
NDB_VERSION_D
;
else
return
ndbOwnVersionTesting
;
#else
return
NDB_VERSION_D
;
#endif
}
...
...
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