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
0483eb81
Commit
0483eb81
authored
Aug 24, 2004
by
tomas@poseidon.(none)
Browse files
Options
Browse Files
Download
Plain Diff
Merge tulin@bk-internal.mysql.com:/home/bk/mysql-4.1
into poseidon.(none):/home/tomas/mysql-4.1-clean
parents
06affe9b
aae0b7ed
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
54 additions
and
7 deletions
+54
-7
mysql-test/ndb/ndb_config_2_node.ini
mysql-test/ndb/ndb_config_2_node.ini
+4
-4
ndb/src/common/mgmcommon/ConfigInfo.cpp
ndb/src/common/mgmcommon/ConfigInfo.cpp
+15
-0
ndb/src/common/mgmcommon/ConfigInfo.hpp
ndb/src/common/mgmcommon/ConfigInfo.hpp
+7
-0
ndb/src/common/mgmcommon/InitConfigFileParser.cpp
ndb/src/common/mgmcommon/InitConfigFileParser.cpp
+28
-3
No files found.
mysql-test/ndb/ndb_config_2_node.ini
View file @
0483eb81
...
...
@@ -24,13 +24,13 @@ ExecuteOnComputer: 2
[MGM]
PortNumber:
CHOOSE_PORT_MGM
[
API
]
[
MYSQLD
]
[
API
]
[
MYSQLD
]
[
API
]
[
MYSQLD
]
[
API
]
[
MYSQLD
]
[TCP DEFAULT]
PortNumber:
CHOOSE_PORT_TRANSPORTER
ndb/src/common/mgmcommon/ConfigInfo.cpp
View file @
0483eb81
...
...
@@ -25,6 +25,13 @@
/****************************************************************************
* Section names
****************************************************************************/
const
ConfigInfo
::
AliasPair
ConfigInfo
::
m_sectionNameAliases
[]
=
{
{
"API"
,
"MYSQLD"
},
{
0
,
0
}
};
const
char
*
ConfigInfo
::
m_sectionNames
[]
=
{
"SYSTEM"
,
...
...
@@ -2063,6 +2070,14 @@ ConfigInfo::isSection(const char * section) const {
return
false
;
}
const
char
*
ConfigInfo
::
getAlias
(
const
char
*
section
)
const
{
for
(
int
i
=
0
;
m_sectionNameAliases
[
i
].
name
!=
0
;
i
++
)
if
(
!
strcmp
(
section
,
m_sectionNameAliases
[
i
].
alias
))
return
m_sectionNameAliases
[
i
].
name
;
return
0
;
}
bool
ConfigInfo
::
verify
(
const
Properties
*
section
,
const
char
*
fname
,
Uint64
value
)
const
{
...
...
ndb/src/common/mgmcommon/ConfigInfo.hpp
View file @
0483eb81
...
...
@@ -61,6 +61,11 @@ public:
Uint64
_max
;
};
struct
AliasPair
{
const
char
*
name
;
const
char
*
alias
;
};
/**
* Entry for one section rule
*/
...
...
@@ -100,6 +105,7 @@ public:
* @note Result is not defined if section/name are wrong!
*/
bool
verify
(
const
Properties
*
secti
,
const
char
*
fname
,
Uint64
value
)
const
;
const
char
*
getAlias
(
const
char
*
)
const
;
bool
isSection
(
const
char
*
)
const
;
const
char
*
getDescription
(
const
Properties
*
sec
,
const
char
*
fname
)
const
;
...
...
@@ -123,6 +129,7 @@ private:
static
const
ParamInfo
m_ParamInfo
[];
static
const
int
m_NoOfParams
;
static
const
AliasPair
m_sectionNameAliases
[];
static
const
char
*
m_sectionNames
[];
static
const
int
m_noOfSectionNames
;
...
...
ndb/src/common/mgmcommon/InitConfigFileParser.cpp
View file @
0483eb81
...
...
@@ -222,6 +222,8 @@ bool InitConfigFileParser::parseNameValuePair(Context& ctx, const char* line) {
char
tmpLine
[
MAX_LINE_LENGTH
];
char
fname
[
MAX_LINE_LENGTH
],
rest
[
MAX_LINE_LENGTH
];
char
*
t
;
const
char
separator_list
[]
=
{
':'
,
'='
};
char
separator
=
0
;
if
(
ctx
.
m_currentSection
==
NULL
){
ctx
.
reportError
(
"Value specified outside section"
);
...
...
@@ -233,7 +235,14 @@ bool InitConfigFileParser::parseNameValuePair(Context& ctx, const char* line) {
// *************************************
// Check if a separator exists in line
// *************************************
if
(
!
strchr
(
tmpLine
,
':'
))
{
for
(
int
i
=
0
;
i
<
sizeof
(
separator_list
);
i
++
)
{
if
(
strchr
(
tmpLine
,
separator_list
[
i
]))
{
separator
=
separator_list
[
i
];
break
;
}
}
if
(
separator
==
0
)
{
ctx
.
reportError
(
"Parse error"
);
return
false
;
}
...
...
@@ -247,7 +256,7 @@ bool InitConfigFileParser::parseNameValuePair(Context& ctx, const char* line) {
// Count number of tokens before separator
// *****************************************
if
(
sscanf
(
t
,
"%120s%120s"
,
fname
,
rest
)
!=
1
)
{
ctx
.
reportError
(
"Multiple names before
\'
:
\'
"
);
ctx
.
reportError
(
"Multiple names before
\'
%c
\'
"
,
separator
);
return
false
;
}
if
(
!
ctx
.
m_currentInfo
->
contains
(
fname
))
{
...
...
@@ -475,8 +484,24 @@ InitConfigFileParser::parseSectionHeader(const char* line) const {
tmp
[
0
]
=
' '
;
trim
(
tmp
);
// Convert section header to upper
for
(
int
i
=
strlen
(
tmp
)
-
1
;
i
>=
0
;
i
--
)
tmp
[
i
]
=
toupper
(
tmp
[
i
]);
// Get the correct header name if an alias
{
const
char
*
tmp_alias
=
m_info
->
getAlias
(
tmp
);
if
(
tmp_alias
)
{
free
(
tmp
);
tmp
=
strdup
(
tmp_alias
);
}
}
// Lookup token among sections
if
(
!
m_info
->
isSection
(
tmp
))
return
NULL
;
if
(
!
m_info
->
isSection
(
tmp
))
{
free
(
tmp
);
return
NULL
;
}
if
(
m_info
->
getInfo
(
tmp
))
return
tmp
;
free
(
tmp
);
...
...
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