List:Commits« Previous MessageNext Message »
From:Magnus Blåudd Date:April 18 2011 2:14pm
Subject:bzr commit into mysql-5.1-telco-7.0 branch (magnus.blaudd:4319) Bug#58758
View as plain text  
#At file:///home/msvensson/mysql/7.0/ based on revid:magnus.blaudd@stripped

 4319 Magnus Blåudd	2011-04-18
      Bug #58758 Ndb Internal : Defaults for enum type config values not supported
       - Make ConfigInfo::getDefaultString retrive the default value as string by
        double  storing the default value as string with the key "DefaultString"

    modified:
      storage/ndb/src/mgmsrv/ConfigInfo.cpp
=== modified file 'storage/ndb/src/mgmsrv/ConfigInfo.cpp'
--- a/storage/ndb/src/mgmsrv/ConfigInfo.cpp	2011-04-18 11:00:45 +0000
+++ b/storage/ndb/src/mgmsrv/ConfigInfo.cpp	2011-04-18 14:14:30 +0000
@@ -3177,6 +3177,9 @@ ConfigInfo::ConfigInfo()
           Uint32 default_value;
           require(values.get(param._default, &default_value));
           require(pinfo.put("Default", default_value));
+
+          /* Also store the default as string */
+          require(pinfo.put("DefaultString", param._default));
         }
         break;
       }
@@ -3290,7 +3293,7 @@ ConfigInfo::ConfigInfo()
       ndbout << "Edit file " << __FILE__ << "." << endl;
       require(false);
     }
-  }
+   }
 
 }
 
@@ -3376,8 +3379,29 @@ ConfigInfo::getDefault(const Properties
 
 const char*
 ConfigInfo::getDefaultString(const Properties * section,
-                             const char* fname) const {
-  return getInfoString(section, fname, "Default");
+                             const char* fname) const
+{
+  switch (getType(section, fname))
+  {
+  case ConfigInfo::CI_BITMASK:
+  case ConfigInfo::CI_STRING:
+    return getInfoString(section, fname, "Default");
+
+  case ConfigInfo::CI_ENUM:
+  {
+    /*
+      Default value for enum are stored as int internally
+      but also stores the orignal string, use different
+      key to get at the default value as string
+     */
+    return getInfoString(section, fname, "DefaultString");
+  }
+
+  default:
+    require(false);
+  }
+
+  return NULL;
 }
 
 bool

Attachment: [text/bzr-bundle] bzr/magnus.blaudd@oracle.com-20110418141430-23s2fmdoh80fop9s.bundle
Thread
bzr commit into mysql-5.1-telco-7.0 branch (magnus.blaudd:4319) Bug#58758Magnus Blåudd18 Apr