Commit 95f6b2eb authored by mskold@mysql.com's avatar mskold@mysql.com

Merge mskold@bk-internal.mysql.com:/home/bk/mysql-5.0-ndb

into mysql.com:/usr/local/home/marty/MySQL/test/mysql-5.0-ndb
parents 96188c81 703811c7
......@@ -3155,10 +3155,51 @@ fixPortNumber(InitConfigFileParser::Context & ctx, const char * data){
else if(strcmp(type2, MGM_TOKEN)==0)
node2->get("PortNumber",&port);
if (!node->get("ServerPort", &port) &&
!ctx.m_userProperties.get("ServerPort_", id1, &port)) {
if (!port &&
!node->get("ServerPort", &port) &&
!ctx.m_userProperties.get("ServerPort_", id1, &port))
{
Uint32 base= 0;
/*
* If the connection doesn't involve an mgm server,
* and a default port number has been set, behave the old
* way of allocating port numbers for transporters.
*/
if(ctx.m_userDefaults && ctx.m_userDefaults->get("PortNumber", &base))
{
Uint32 adder= 0;
{
BaseString server_port_adder(hostname);
server_port_adder.append("_ServerPortAdder");
ctx.m_userProperties.get(server_port_adder.c_str(), &adder);
ctx.m_userProperties.put(server_port_adder.c_str(), adder+1, true);
}
if (!ctx.m_userProperties.get("ServerPortBase", &base)){
if(!(ctx.m_userDefaults &&
ctx.m_userDefaults->get("PortNumber", &base)) &&
!ctx.m_systemDefaults->get("PortNumber", &base)) {
base= strtoll(NDB_TCP_BASE_PORT,0,0);
}
ctx.m_userProperties.put("ServerPortBase", base);
}
port= base + adder;
ctx.m_userProperties.put("ServerPort_", id1, port);
}
}
if(ctx.m_currentSection->contains("PortNumber")) {
ndbout << "PortNumber should no longer be specificied "
<< "per connection, please remove from config. "
<< "Will be changed to " << port << endl;
ctx.m_currentSection->put("PortNumber", port, true);
}
else
{
ctx.m_currentSection->put("PortNumber", port);
}
DBUG_PRINT("info", ("connection %d-%d port %d host %s",
id1, id2, port, hostname.c_str()));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment