#At file:///home/msvensson/mysql/bug44685/ based on revid:magnus.blaudd@strippedpn6lkkeyfmnnp88
2961 Magnus Blåudd 2009-05-18
Bug#44685 ndb_config --xml does not give all section variants
- part 3
- Add new attribute "flags" to the list of configuration parameters
- print the check="writable" tag if parameter has CI_CHECK_WRITABLE flag set
modified:
storage/ndb/src/mgmsrv/ConfigInfo.cpp
storage/ndb/src/mgmsrv/ConfigInfo.hpp
=== modified file 'storage/ndb/src/mgmsrv/ConfigInfo.cpp'
--- a/storage/ndb/src/mgmsrv/ConfigInfo.cpp 2009-05-18 11:00:22 +0000
+++ b/storage/ndb/src/mgmsrv/ConfigInfo.cpp 2009-05-18 11:08:17 +0000
@@ -1220,7 +1220,7 @@ const ConfigInfo::ParamInfo ConfigInfo::
DB_TOKEN,
"Data directory for this node",
ConfigInfo::CI_USED,
- false,
+ CI_CHECK_WRITABLE,
ConfigInfo::CI_STRING,
MYSQLCLUSTERDIR,
0, 0 },
@@ -1231,7 +1231,7 @@ const ConfigInfo::ParamInfo ConfigInfo::
DB_TOKEN,
"Path to directory where the "DB_TOKEN_PRINT" node stores its data (directory must exist)",
ConfigInfo::CI_USED,
- false,
+ CI_CHECK_WRITABLE,
ConfigInfo::CI_STRING,
UNDEFINED,
0, 0 },
@@ -1365,7 +1365,7 @@ const ConfigInfo::ParamInfo ConfigInfo::
DB_TOKEN,
"Path to where to store backups",
ConfigInfo::CI_USED,
- false,
+ CI_CHECK_WRITABLE,
ConfigInfo::CI_STRING,
UNDEFINED,
0, 0 },
@@ -1565,7 +1565,7 @@ const ConfigInfo::ParamInfo ConfigInfo::
DB_TOKEN,
"Path to directory where the "DB_TOKEN_PRINT" node stores its disk-data-files",
ConfigInfo::CI_USED,
- false,
+ CI_CHECK_WRITABLE,
ConfigInfo::CI_STRING,
UNDEFINED,
0, 0 },
@@ -1819,7 +1819,7 @@ const ConfigInfo::ParamInfo ConfigInfo::
MGM_TOKEN,
"Data directory for this node",
ConfigInfo::CI_USED,
- false,
+ CI_CHECK_WRITABLE,
ConfigInfo::CI_STRING,
MYSQLCLUSTERDIR,
0, 0 },
@@ -2598,7 +2598,7 @@ ConfigInfo::ConfigInfo()
pinfo.put("Id", param._paramId);
pinfo.put("Fname", param._fname);
pinfo.put("Description", param._description);
- pinfo.put("Updateable", param._updateable);
+ pinfo.put("Flags", param._flags);
pinfo.put("Type", param._type);
pinfo.put("Status", param._status);
@@ -2900,6 +2900,11 @@ ConfigInfo::getStatus(const Properties *
return (ConfigInfo::Status) getInfoInt(section, fname, "Status");
}
+Uint32
+ConfigInfo::getFlags(const Properties* section, const char* fname) const {
+ return getInfoInt(section, fname, "Flags");
+}
+
/****************************************************************************
* Printers
****************************************************************************/
@@ -3110,6 +3115,16 @@ public:
case ConfigInfo::CI_SECTION:
return; // Don't print anything for the section itself
}
+
+ // Get "check" flag(s)
+ Uint32 flags = info.getFlags(section, param_name);
+ buf.clear();
+ if (flags & ConfigInfo::CI_CHECK_WRITABLE)
+ buf.append("writable");
+
+ if (buf.length())
+ pairs.put("check", buf.c_str());
+
print_xml("param", pairs);
}
};
=== modified file 'storage/ndb/src/mgmsrv/ConfigInfo.hpp'
--- a/storage/ndb/src/mgmsrv/ConfigInfo.hpp 2009-03-20 08:25:46 +0000
+++ b/storage/ndb/src/mgmsrv/ConfigInfo.hpp 2009-05-18 11:08:17 +0000
@@ -49,6 +49,11 @@ public:
CI_INTERNAL ///< Not configurable by the user
};
+ enum Flags {
+ CI_UPDATEABLE = 1, // Parameter can be updated
+ CI_CHECK_WRITABLE = 2 // Path given by parameter should be writable
+ };
+
/**
* Entry for one configuration parameter
*/
@@ -58,7 +63,7 @@ public:
const char* _section;
const char* _description;
Status _status;
- bool _updateable;
+ Uint32 _flags;
Type _type;
const char* _default;
const char* _min;
@@ -120,6 +125,7 @@ public:
Uint64 getMin(const Properties * section, const char* fname) const;
Uint64 getMax(const Properties * section, const char* fname) const;
Uint64 getDefault(const Properties * section, const char* fname) const;
+ Uint32 getFlags(const Properties* section, const char* fname) const;
const char* getDefaultString(const Properties * section,
const char* fname) const;
bool getMandatory(const Properties * section, const char* fname) const;
Attachment: [text/bzr-bundle] bzr/magnus.blaudd@sun.com-20090518110817-aer4ikm871a9438d.bundle
| Thread |
|---|
| • bzr commit into mysql-5.1-telco-6.3 branch (magnus.blaudd:2961)Bug#44685 | Magnus Blåudd | 18 May |