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
0192e8ab
Commit
0192e8ab
authored
Oct 18, 2006
by
Justin.He/justin.he@qa3-104.qa.cn.tlan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add a new mgmapi ndb_mgm_get_db_parameter_info, which retrieve parameter's name
parent
01c02f34
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
2204 additions
and
1 deletion
+2204
-1
storage/ndb/include/mgmapi/mgmapi.h
storage/ndb/include/mgmapi/mgmapi.h
+8
-0
storage/ndb/src/mgmapi/Makefile.am
storage/ndb/src/mgmapi/Makefile.am
+1
-1
storage/ndb/src/mgmapi/mgmapi_configuration.cpp
storage/ndb/src/mgmapi/mgmapi_configuration.cpp
+38
-0
storage/ndb/src/mgmsrv/ParamInfo.cpp
storage/ndb/src/mgmsrv/ParamInfo.cpp
+2113
-0
storage/ndb/src/mgmsrv/ParamInfo.hpp
storage/ndb/src/mgmsrv/ParamInfo.hpp
+44
-0
No files found.
storage/ndb/include/mgmapi/mgmapi.h
View file @
0192e8ab
...
...
@@ -1133,6 +1133,14 @@ extern "C" {
int
ndb_mgm_check_connection
(
NdbMgmHandle
handle
);
int
ndb_mgm_report_event
(
NdbMgmHandle
handle
,
Uint32
*
data
,
Uint32
length
);
struct
ndb_mgm_param_info
{
Uint32
m_id
;
const
char
*
m_name
;
};
int
ndb_mgm_get_db_parameter_info
(
Uint32
paramId
,
struct
ndb_mgm_param_info
*
info
,
size_t
*
size
);
#endif
#ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED
...
...
storage/ndb/src/mgmapi/Makefile.am
View file @
0192e8ab
noinst_LTLIBRARIES
=
libmgmapi.la
libmgmapi_la_SOURCES
=
mgmapi.cpp ndb_logevent.cpp mgmapi_configuration.cpp LocalConfig.cpp ../kernel/error/ndbd_exit_codes.c
libmgmapi_la_SOURCES
=
mgmapi.cpp ndb_logevent.cpp mgmapi_configuration.cpp LocalConfig.cpp ../kernel/error/ndbd_exit_codes.c
../mgmsrv/ParamInfo.cpp
INCLUDES_LOC
=
-I
$(top_srcdir)
/storage/ndb/include/mgmapi
...
...
storage/ndb/src/mgmapi/mgmapi_configuration.cpp
View file @
0192e8ab
#include <ndb_types.h>
#include <mgmapi.h>
#include "mgmapi_configuration.hpp"
#include "../mgmsrv/ParamInfo.hpp"
extern
const
ParamInfo
ParamInfoArray
[];
extern
const
int
ParamInfoNum
;
ndb_mgm_configuration_iterator
::
ndb_mgm_configuration_iterator
(
const
ndb_mgm_configuration
&
conf
,
unsigned
type_of_section
)
...
...
@@ -155,3 +159,37 @@ ndb_mgm_find(ndb_mgm_configuration_iterator* iter,
int
param
,
unsigned
search
){
return
iter
->
find
(
param
,
search
);
}
/**
* Retrieve information about parameter
* @param info : in - pointer to structure allocated by caller
* @param size : in/out : pointer to int initialized to sizeof(ndb_mgm_param_info)...will be set to bytes set by function on return
*/
extern
"C"
int
ndb_mgm_get_db_parameter_info
(
Uint32
paramId
,
struct
ndb_mgm_param_info
*
info
,
size_t
*
size
)
{
if
(
paramId
==
0
)
{
return
-
1
;
}
for
(
int
i
=
0
;
i
<
ParamInfoNum
;
i
++
)
{
if
(
paramId
==
ParamInfoArray
[
i
].
_paramId
&&
strcmp
(
DB_TOKEN
,
ParamInfoArray
[
i
].
_section
)
==
0
)
{
size_t
tmp
=
0
;
if
(
tmp
+
sizeof
(
info
->
m_id
)
<=
*
size
)
{
info
->
m_id
=
ParamInfoArray
[
i
].
_paramId
;
tmp
+=
sizeof
(
info
->
m_id
);
}
if
(
tmp
+
sizeof
(
info
->
m_name
)
<=
*
size
)
{
info
->
m_name
=
ParamInfoArray
[
i
].
_fname
;
tmp
+=
sizeof
(
info
->
m_name
);
}
*
size
=
tmp
;
return
0
;
}
}
return
-
1
;
}
storage/ndb/src/mgmsrv/ParamInfo.cpp
0 → 100644
View file @
0192e8ab
This diff is collapsed.
Click to expand it.
storage/ndb/src/mgmsrv/ParamInfo.hpp
0 → 100644
View file @
0192e8ab
#ifndef PARAMINFO_H
#define PARAMINFO_H
#define DB_TOKEN "DB"
#define MGM_TOKEN "MGM"
#define API_TOKEN "API"
#ifdef __cplusplus
extern
"C"
{
#endif
/**
* The Configuration parameter type and status
*/
enum
ParameterType
{
CI_BOOL
,
CI_INT
,
CI_INT64
,
CI_STRING
,
CI_SECTION
};
enum
ParameterStatus
{
CI_USED
,
///< Active
CI_DEPRICATED
,
///< Can be, but shouldn't
CI_NOTIMPLEMENTED
,
///< Is ignored.
CI_INTERNAL
///< Not configurable by the user
};
/**
* Entry for one configuration parameter
*/
typedef
struct
m_ParamInfo
{
Uint32
_paramId
;
const
char
*
_fname
;
const
char
*
_section
;
const
char
*
_description
;
ParameterStatus
_status
;
bool
_updateable
;
ParameterType
_type
;
const
char
*
_default
;
const
char
*
_min
;
const
char
*
_max
;
}
ParamInfo
;
#ifdef __cplusplus
}
#endif
#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