mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 04:53:01 +01:00
Merge tulin@bk-internal.mysql.com:/home/bk/mysql-4.1-ndb
into poseidon.(none):/home/tomas/mysql-4.1-ndb
This commit is contained in:
commit
6fe88305d9
3 changed files with 49 additions and 15 deletions
|
@ -14,6 +14,8 @@
|
|||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
|
||||
#include <ndb_global.h>
|
||||
|
||||
#include <NdbTCP.h>
|
||||
#include "ConfigInfo.hpp"
|
||||
#include <mgmapi_config_parameters.h>
|
||||
|
@ -2369,12 +2371,40 @@ transformNode(InitConfigFileParser::Context & ctx, const char * data){
|
|||
return true;
|
||||
}
|
||||
|
||||
static bool checkLocalhostHostnameMix(InitConfigFileParser::Context & ctx)
|
||||
{
|
||||
DBUG_ENTER("checkLocalhostHostnameMix");
|
||||
const char * hostname= 0;
|
||||
ctx.m_currentSection->get("HostName", &hostname);
|
||||
if (hostname == 0 || hostname[0] == 0)
|
||||
DBUG_RETURN(true);
|
||||
|
||||
Uint32 localhost_used= 0;
|
||||
if(!strcmp(hostname, "localhost") || !strcmp(hostname, "127.0.0.1")){
|
||||
localhost_used= 1;
|
||||
ctx.m_userProperties.put("$computer-localhost-used", localhost_used);
|
||||
if(!ctx.m_userProperties.get("$computer-localhost", &hostname))
|
||||
DBUG_RETURN(true);
|
||||
} else {
|
||||
ctx.m_userProperties.get("$computer-localhost-used", &localhost_used);
|
||||
ctx.m_userProperties.put("$computer-localhost", hostname);
|
||||
}
|
||||
|
||||
if (localhost_used) {
|
||||
ctx.reportError("Mixing of localhost with other hostname(%s) is illegal",
|
||||
hostname);
|
||||
DBUG_RETURN(false);
|
||||
}
|
||||
|
||||
DBUG_RETURN(true);
|
||||
}
|
||||
|
||||
bool
|
||||
fixNodeHostname(InitConfigFileParser::Context & ctx, const char * data){
|
||||
|
||||
const char * hostname;
|
||||
if (ctx.m_currentSection->get("HostName", &hostname))
|
||||
return true;
|
||||
return checkLocalhostHostnameMix(ctx);
|
||||
|
||||
const char * compId;
|
||||
if(!ctx.m_currentSection->get("ExecuteOnComputer", &compId)){
|
||||
|
@ -2383,7 +2413,7 @@ fixNodeHostname(InitConfigFileParser::Context & ctx, const char * data){
|
|||
require(ctx.m_currentSection->put("HostName", "localhost"));
|
||||
else
|
||||
require(ctx.m_currentSection->put("HostName", ""));
|
||||
return true;
|
||||
return checkLocalhostHostnameMix(ctx);
|
||||
}
|
||||
|
||||
const Properties * computer;
|
||||
|
@ -2404,7 +2434,7 @@ fixNodeHostname(InitConfigFileParser::Context & ctx, const char * data){
|
|||
}
|
||||
|
||||
require(ctx.m_currentSection->put("HostName", hostname));
|
||||
return true;
|
||||
return checkLocalhostHostnameMix(ctx);
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -2516,17 +2546,7 @@ transformComputer(InitConfigFileParser::Context & ctx, const char * data){
|
|||
return true;
|
||||
}
|
||||
|
||||
if(!strcmp(hostname, "localhost") || !strcmp(hostname, "127.0.0.1")){
|
||||
if(ctx.m_userProperties.get("$computer-localhost", &hostname)){
|
||||
ctx.reportError("Mixing of localhost with other hostname(%s) is illegal",
|
||||
hostname);
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
ctx.m_userProperties.put("$computer-localhost", hostname);
|
||||
}
|
||||
|
||||
return true;
|
||||
return checkLocalhostHostnameMix(ctx);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -12562,7 +12562,7 @@ void Dbacc::releaseLcpConnectRec(Signal* signal)
|
|||
/* --------------------------------------------------------------------------------- */
|
||||
void Dbacc::releaseOpRec(Signal* signal)
|
||||
{
|
||||
#ifdef VM_TRACE
|
||||
#if 0
|
||||
// DEBUG CODE
|
||||
// Check that the operation to be released isn't
|
||||
// already in the list of free operations
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
|
||||
#include <ndb_global.h>
|
||||
#include <my_sys.h>
|
||||
|
||||
#include "MgmtSrvr.hpp"
|
||||
#include "EventLogger.hpp"
|
||||
|
@ -97,12 +98,19 @@ extern EventLogger g_EventLogger;
|
|||
|
||||
extern int global_mgmt_server_check;
|
||||
int _print_version = 0;
|
||||
#ifndef DBUG_OFF
|
||||
const char *debug_option= 0;
|
||||
#endif
|
||||
|
||||
struct getargs args[] = {
|
||||
{ "version", 'v', arg_flag, &_print_version,
|
||||
"Print ndb_mgmd version"},
|
||||
{ "config-file", 'c', arg_string, &glob.config_filename,
|
||||
"Specify cluster configuration file", "filename" },
|
||||
#ifndef DBUG_OFF
|
||||
{ "debug", 0, arg_string, &debug_option,
|
||||
"Specify debug option e.d. d:t:i:o,out.trace", "options" },
|
||||
#endif
|
||||
{ "daemon", 'd', arg_flag, &glob.daemon,
|
||||
"Run ndb_mgmd in daemon mode" },
|
||||
{ NULL, 'l', arg_string, &glob.local_config_filename,
|
||||
|
@ -135,6 +143,12 @@ NDB_MAIN(mgmsrv){
|
|||
exit(1);
|
||||
}
|
||||
|
||||
my_init();
|
||||
#ifndef DBUG_OFF
|
||||
if (debug_option)
|
||||
DBUG_PUSH(debug_option);
|
||||
#endif
|
||||
|
||||
if (_print_version) {
|
||||
ndbPrintVersion();
|
||||
exit(0);
|
||||
|
|
Loading…
Reference in a new issue