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
483c5c92
Commit
483c5c92
authored
Aug 24, 2004
by
unknown
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
83f6316a
64721c31
Changes
4
Hide 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 @
483c5c92
...
@@ -24,13 +24,13 @@ ExecuteOnComputer: 2
...
@@ -24,13 +24,13 @@ ExecuteOnComputer: 2
[MGM]
[MGM]
PortNumber:
CHOOSE_PORT_MGM
PortNumber:
CHOOSE_PORT_MGM
[
API
]
[
MYSQLD
]
[
API
]
[
MYSQLD
]
[
API
]
[
MYSQLD
]
[
API
]
[
MYSQLD
]
[TCP DEFAULT]
[TCP DEFAULT]
PortNumber:
CHOOSE_PORT_TRANSPORTER
PortNumber:
CHOOSE_PORT_TRANSPORTER
ndb/src/common/mgmcommon/ConfigInfo.cpp
View file @
483c5c92
...
@@ -25,6 +25,13 @@
...
@@ -25,6 +25,13 @@
/****************************************************************************
/****************************************************************************
* Section names
* Section names
****************************************************************************/
****************************************************************************/
const
ConfigInfo
::
AliasPair
ConfigInfo
::
m_sectionNameAliases
[]
=
{
{
"API"
,
"MYSQLD"
},
{
0
,
0
}
};
const
char
*
const
char
*
ConfigInfo
::
m_sectionNames
[]
=
{
ConfigInfo
::
m_sectionNames
[]
=
{
"SYSTEM"
,
"SYSTEM"
,
...
@@ -2063,6 +2070,14 @@ ConfigInfo::isSection(const char * section) const {
...
@@ -2063,6 +2070,14 @@ ConfigInfo::isSection(const char * section) const {
return
false
;
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
bool
ConfigInfo
::
verify
(
const
Properties
*
section
,
const
char
*
fname
,
ConfigInfo
::
verify
(
const
Properties
*
section
,
const
char
*
fname
,
Uint64
value
)
const
{
Uint64
value
)
const
{
...
...
ndb/src/common/mgmcommon/ConfigInfo.hpp
View file @
483c5c92
...
@@ -61,6 +61,11 @@ public:
...
@@ -61,6 +61,11 @@ public:
Uint64
_max
;
Uint64
_max
;
};
};
struct
AliasPair
{
const
char
*
name
;
const
char
*
alias
;
};
/**
/**
* Entry for one section rule
* Entry for one section rule
*/
*/
...
@@ -100,6 +105,7 @@ public:
...
@@ -100,6 +105,7 @@ public:
* @note Result is not defined if section/name are wrong!
* @note Result is not defined if section/name are wrong!
*/
*/
bool
verify
(
const
Properties
*
secti
,
const
char
*
fname
,
Uint64
value
)
const
;
bool
verify
(
const
Properties
*
secti
,
const
char
*
fname
,
Uint64
value
)
const
;
const
char
*
getAlias
(
const
char
*
)
const
;
bool
isSection
(
const
char
*
)
const
;
bool
isSection
(
const
char
*
)
const
;
const
char
*
getDescription
(
const
Properties
*
sec
,
const
char
*
fname
)
const
;
const
char
*
getDescription
(
const
Properties
*
sec
,
const
char
*
fname
)
const
;
...
@@ -123,6 +129,7 @@ private:
...
@@ -123,6 +129,7 @@ private:
static
const
ParamInfo
m_ParamInfo
[];
static
const
ParamInfo
m_ParamInfo
[];
static
const
int
m_NoOfParams
;
static
const
int
m_NoOfParams
;
static
const
AliasPair
m_sectionNameAliases
[];
static
const
char
*
m_sectionNames
[];
static
const
char
*
m_sectionNames
[];
static
const
int
m_noOfSectionNames
;
static
const
int
m_noOfSectionNames
;
...
...
ndb/src/common/mgmcommon/InitConfigFileParser.cpp
View file @
483c5c92
...
@@ -222,6 +222,8 @@ bool InitConfigFileParser::parseNameValuePair(Context& ctx, const char* line) {
...
@@ -222,6 +222,8 @@ bool InitConfigFileParser::parseNameValuePair(Context& ctx, const char* line) {
char
tmpLine
[
MAX_LINE_LENGTH
];
char
tmpLine
[
MAX_LINE_LENGTH
];
char
fname
[
MAX_LINE_LENGTH
],
rest
[
MAX_LINE_LENGTH
];
char
fname
[
MAX_LINE_LENGTH
],
rest
[
MAX_LINE_LENGTH
];
char
*
t
;
char
*
t
;
const
char
separator_list
[]
=
{
':'
,
'='
};
char
separator
=
0
;
if
(
ctx
.
m_currentSection
==
NULL
){
if
(
ctx
.
m_currentSection
==
NULL
){
ctx
.
reportError
(
"Value specified outside section"
);
ctx
.
reportError
(
"Value specified outside section"
);
...
@@ -233,7 +235,14 @@ bool InitConfigFileParser::parseNameValuePair(Context& ctx, const char* line) {
...
@@ -233,7 +235,14 @@ bool InitConfigFileParser::parseNameValuePair(Context& ctx, const char* line) {
// *************************************
// *************************************
// Check if a separator exists in 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"
);
ctx
.
reportError
(
"Parse error"
);
return
false
;
return
false
;
}
}
...
@@ -247,7 +256,7 @@ bool InitConfigFileParser::parseNameValuePair(Context& ctx, const char* line) {
...
@@ -247,7 +256,7 @@ bool InitConfigFileParser::parseNameValuePair(Context& ctx, const char* line) {
// Count number of tokens before separator
// Count number of tokens before separator
// *****************************************
// *****************************************
if
(
sscanf
(
t
,
"%120s%120s"
,
fname
,
rest
)
!=
1
)
{
if
(
sscanf
(
t
,
"%120s%120s"
,
fname
,
rest
)
!=
1
)
{
ctx
.
reportError
(
"Multiple names before
\'
:
\'
"
);
ctx
.
reportError
(
"Multiple names before
\'
%c
\'
"
,
separator
);
return
false
;
return
false
;
}
}
if
(
!
ctx
.
m_currentInfo
->
contains
(
fname
))
{
if
(
!
ctx
.
m_currentInfo
->
contains
(
fname
))
{
...
@@ -475,8 +484,24 @@ InitConfigFileParser::parseSectionHeader(const char* line) const {
...
@@ -475,8 +484,24 @@ InitConfigFileParser::parseSectionHeader(const char* line) const {
tmp
[
0
]
=
' '
;
tmp
[
0
]
=
' '
;
trim
(
tmp
);
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
// 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
;
if
(
m_info
->
getInfo
(
tmp
))
return
tmp
;
free
(
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