BUG#26355 FIXME: use constant for max loglevel in ndb_mgmd

parent 02c847eb
...@@ -16,6 +16,8 @@ ...@@ -16,6 +16,8 @@
#ifndef MGMAPI_H #ifndef MGMAPI_H
#define MGMAPI_H #define MGMAPI_H
#define NDB_MGM_MAX_LOGLEVEL 15
/** /**
* @mainpage MySQL Cluster Management API * @mainpage MySQL Cluster Management API
* *
......
...@@ -764,8 +764,7 @@ MgmApiSession::setClusterLogLevel(Parser<MgmApiSession>::Context &, ...@@ -764,8 +764,7 @@ MgmApiSession::setClusterLogLevel(Parser<MgmApiSession>::Context &,
DBUG_PRINT("enter",("node=%d, category=%d, level=%d", node, cat, level)); DBUG_PRINT("enter",("node=%d, category=%d, level=%d", node, cat, level));
/* XXX should use constants for this value */ if(level > NDB_MGM_MAX_LOGLEVEL) {
if(level > 15) {
m_output->println(reply); m_output->println(reply);
m_output->println("result: Invalid loglevel %d", level); m_output->println("result: Invalid loglevel %d", level);
m_output->println(""); m_output->println("");
...@@ -809,8 +808,7 @@ MgmApiSession::setLogLevel(Parser<MgmApiSession>::Context &, ...@@ -809,8 +808,7 @@ MgmApiSession::setLogLevel(Parser<MgmApiSession>::Context &,
args.get("category", &cat); args.get("category", &cat);
args.get("level", &level); args.get("level", &level);
/* XXX should use constants for this value */ if(level > NDB_MGM_MAX_LOGLEVEL) {
if(level > 15) {
m_output->println("set loglevel reply"); m_output->println("set loglevel reply");
m_output->println("result: Invalid loglevel", errorString.c_str()); m_output->println("result: Invalid loglevel", errorString.c_str());
m_output->println(""); m_output->println("");
...@@ -1510,7 +1508,7 @@ MgmApiSession::listen_event(Parser<MgmApiSession>::Context & ctx, ...@@ -1510,7 +1508,7 @@ MgmApiSession::listen_event(Parser<MgmApiSession>::Context & ctx,
} }
int level = atoi(spec[1].c_str()); int level = atoi(spec[1].c_str());
if(level < 0 || level > 15){ if(level < 0 || level > NDB_MGM_MAX_LOGLEVEL){
msg.appfmt("Invalid level: >%s<", spec[1].c_str()); msg.appfmt("Invalid level: >%s<", spec[1].c_str());
result = -1; result = -1;
goto done; goto done;
......
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