List:Commits« Previous MessageNext Message »
From:Magnus Blåudd Date:May 18 2009 1:11pm
Subject:bzr commit into mysql-5.1-telco-7.0 branch (magnus.blaudd:2910)
View as plain text  
#At file:///home/msvensson/mysql/7.0/ based on revid:magnus.blaudd@strippedylallcervq

 2910 Magnus Blåudd	2009-05-18 [merge]
      Merge

    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 10:57:51 +0000
+++ b/storage/ndb/src/mgmsrv/ConfigInfo.cpp	2009-05-18 11:11:32 +0000
@@ -1231,7 +1231,7 @@ const ConfigInfo::ParamInfo ConfigInfo::
     DB_TOKEN,
     "Data directory for this node",
     ConfigInfo::CI_USED,
-    false,
+    CI_CHECK_WRITABLE,
     ConfigInfo::CI_STRING,
     ".",
     0, 0 },
@@ -1242,7 +1242,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 },
@@ -1376,7 +1376,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 },
@@ -1681,7 +1681,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 },
@@ -1948,7 +1948,7 @@ const ConfigInfo::ParamInfo ConfigInfo::
     MGM_TOKEN,
     "Data directory for this node",
     ConfigInfo::CI_USED,
-    false,
+    CI_CHECK_WRITABLE,
     ConfigInfo::CI_STRING,
     "",
     0, 0 },
@@ -2782,7 +2782,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);
 
@@ -3134,6 +3134,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
  ****************************************************************************/
@@ -3344,6 +3349,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);
   }
 };
@@ -3387,8 +3402,9 @@ void ConfigInfo::print_impl(const char* 
     if (is_internal_section(sec))
       continue; // Skip whole section
 
-    printer.section_start(s, nameToAlias(s), sectionPrimaryKeys(s));
-
+    const char* section_alias = nameToAlias(s);
+    printer.section_start(s, section_alias, sectionPrimaryKeys(s));
+ 
     /* Iterate through all parameters in section */
     Properties::Iterator it(sec);
     for (const char* n = it.first(); n != NULL; n = it.next()) {
@@ -3399,6 +3415,27 @@ void ConfigInfo::print_impl(const char* 
       printer.parameter(s, sec, n, *this);
     }
     printer.section_end(s);
+
+    // Print [<section> DEFAULT] for all sections but SYSTEM
+    if (strcmp(s, "SYSTEM") == 0)
+      continue; // Skip SYSTEM section
+
+    BaseString default_section_name;
+    default_section_name.assfmt("%s %s",
+                                section_alias ? section_alias : s,
+                                "DEFAULT");
+    printer.section_start(s, default_section_name.c_str());
+
+    /* Iterate through all parameters in section */
+    for (const char* n = it.first(); n != NULL; n = it.next()) {
+      // Skip entries with different F- and P-names
+      if (getStatus(sec, n) == ConfigInfo::CI_INTERNAL) continue;
+      if (getStatus(sec, n) == ConfigInfo::CI_DEPRICATED) continue;
+      if (getStatus(sec, n) == ConfigInfo::CI_NOTIMPLEMENTED) continue;
+      printer.parameter(s, sec, n, *this);
+    }
+    printer.section_end(s);
+
   }
   printer.end();
 }

=== modified file 'storage/ndb/src/mgmsrv/ConfigInfo.hpp'
--- a/storage/ndb/src/mgmsrv/ConfigInfo.hpp	2009-03-20 09:57:27 +0000
+++ b/storage/ndb/src/mgmsrv/ConfigInfo.hpp	2009-05-18 11:11:32 +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
    */
@@ -71,7 +76,7 @@ public:
     /* Short textual description/documentation for entry. */
     const char*    _description;
     Status         _status;
-    bool           _updateable;    
+    Uint32         _flags;
     Type           _type;          
     /**
      * Default value, minimum value (if any), and maximum value (if any).
@@ -157,6 +162,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-20090518111132-b19f3o98ea4ugou7.bundle
Thread
bzr commit into mysql-5.1-telco-7.0 branch (magnus.blaudd:2910)Magnus Blåudd18 May