diff options
author | unknown <stewart@mysql.com> | 2005-01-19 15:20:57 +1100 |
---|---|---|
committer | unknown <stewart@mysql.com> | 2005-01-19 15:20:57 +1100 |
commit | 22ae0e897a042f3c1d7660e72ff2739990062471 (patch) | |
tree | bb58f5d564b0ddc450b0d52613c8af2d1f24508a /ndb/src/mgmsrv | |
parent | 4f5de2f3930fcfe4f47bc3b6ebae1e1b28be787a (diff) | |
parent | d357a5a058bf1d8b34e674f59756205cc1ddf0d3 (diff) | |
download | mariadb-git-22ae0e897a042f3c1d7660e72ff2739990062471.tar.gz |
Merge mysql.com:/home/stewart/Documents/MySQL/5.0/ndb-dynamic-ports-impl3
into mysql.com:/home/stewart/Documents/MySQL/5.0/ndb-dynamic-ports-impl4
ndb/src/ndbapi/ndb_cluster_connection.cpp:
Auto merged
Diffstat (limited to 'ndb/src/mgmsrv')
-rw-r--r-- | ndb/src/mgmsrv/ConfigInfo.cpp | 29 | ||||
-rw-r--r-- | ndb/src/mgmsrv/InitConfigFileParser.cpp | 12 |
2 files changed, 36 insertions, 5 deletions
diff --git a/ndb/src/mgmsrv/ConfigInfo.cpp b/ndb/src/mgmsrv/ConfigInfo.cpp index 2e2f35f76fa..15ed7703899 100644 --- a/ndb/src/mgmsrv/ConfigInfo.cpp +++ b/ndb/src/mgmsrv/ConfigInfo.cpp @@ -98,6 +98,7 @@ static bool fixDepricated(InitConfigFileParser::Context & ctx, const char *); static bool saveInConfigValues(InitConfigFileParser::Context & ctx, const char *); static bool fixFileSystemPath(InitConfigFileParser::Context & ctx, const char * data); static bool fixBackupDataDir(InitConfigFileParser::Context & ctx, const char * data); +static bool fixShmUniqueId(InitConfigFileParser::Context & ctx, const char * data); const ConfigInfo::SectionRule ConfigInfo::m_SectionRules[] = { @@ -111,6 +112,8 @@ ConfigInfo::m_SectionRules[] = { { "REP", transformNode, 0 }, { "EXTERNAL REP", transformExtNode, 0 }, + { MGM_TOKEN, fixShmUniqueId, 0 }, + { "TCP", checkConnectionSupport, 0 }, { "SHM", checkConnectionSupport, 0 }, { "SCI", checkConnectionSupport, 0 }, @@ -3136,19 +3139,39 @@ fixPortNumber(InitConfigFileParser::Context & ctx, const char * data){ DBUG_RETURN(true); } +static bool +fixShmUniqueId(InitConfigFileParser::Context & ctx, const char * data) +{ + DBUG_ENTER("fixShmUniqueId"); + Uint32 nodes= 0; + ctx.m_userProperties.get(ctx.fname, &nodes); + if (nodes == 1) // first management server + { + Uint32 portno= atoi(NDB_PORT); + ctx.m_currentSection->get("PortNumber", &portno); + ctx.m_userProperties.put("ShmUniqueId", portno); + } + DBUG_RETURN(true); +} + static bool fixShmKey(InitConfigFileParser::Context & ctx, const char *) { + DBUG_ENTER("fixShmKey"); Uint32 id1= 0, id2= 0, key= 0; require(ctx.m_currentSection->get("NodeId1", &id1)); require(ctx.m_currentSection->get("NodeId2", &id2)); if(ctx.m_currentSection->get("ShmKey", &key)) - return true; + { + DBUG_RETURN(true); + } - key= (id1 > id2 ? id1 << 16 | id2 : id2 << 16 | id1); + require(ctx.m_userProperties.get("ShmUniqueId", &key)); + key= key << 16 | (id1 > id2 ? id1 << 8 | id2 : id2 << 8 | id1); ctx.m_currentSection->put("ShmKey", key); - return true; + DBUG_PRINT("info",("Added ShmKey=0x%x", key)); + DBUG_RETURN(true); } /** diff --git a/ndb/src/mgmsrv/InitConfigFileParser.cpp b/ndb/src/mgmsrv/InitConfigFileParser.cpp index 5cc5c3e9b32..822e10c89aa 100644 --- a/ndb/src/mgmsrv/InitConfigFileParser.cpp +++ b/ndb/src/mgmsrv/InitConfigFileParser.cpp @@ -228,14 +228,22 @@ bool InitConfigFileParser::parseNameValuePair(Context& ctx, const char* line) Vector<BaseString> tmp_string_split; if (BaseString(line).split(tmp_string_split, - BaseString("=:"), - 2) != 2) + "=:", 2) != 2) { ctx.reportError("Parse error"); return false; } // ************************************* + // Remove all after # + // ************************************* + + Vector<BaseString> tmp_string_split2; + tmp_string_split[1].split(tmp_string_split2, + "#", 2); + tmp_string_split[1]=tmp_string_split2[0]; + + // ************************************* // Remove leading and trailing chars // ************************************* { |