mirror of
https://github.com/MariaDB/server.git
synced 2025-01-19 21:42:35 +01:00
Merge mleich@bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/home/matthias/Arbeit/mysql-4.1/src
This commit is contained in:
commit
8ac392e8f8
3 changed files with 39 additions and 2 deletions
|
@ -340,7 +340,6 @@ static const char* helpTextDebug =
|
|||
#ifdef ERROR_INSERT
|
||||
"<id> ERROR <errorNo> Inject error into NDB node\n"
|
||||
#endif
|
||||
"<id> TRACE <traceNo> Set trace number\n"
|
||||
"<id> LOG [BLOCK = {ALL|<block>+}] Set logging on in & out signals\n"
|
||||
"<id> LOGIN [BLOCK = {ALL|<block>+}] Set logging on in signals\n"
|
||||
"<id> LOGOUT [BLOCK = {ALL|<block>+}] Set logging on out signals\n"
|
||||
|
|
|
@ -119,7 +119,8 @@ int CommandInterpreter::readAndExecute() {
|
|||
|
||||
|
||||
static const CommandInterpreter::CommandFunctionPair commands[] = {
|
||||
{ "LOGIN", &CommandInterpreter::executeLogIn }
|
||||
{ "TRACE", &CommandInterpreter::executeTrace }
|
||||
,{ "LOGIN", &CommandInterpreter::executeLogIn }
|
||||
,{ "LOGOUT", &CommandInterpreter::executeLogOut }
|
||||
,{ "LOGOFF", &CommandInterpreter::executeLogOff }
|
||||
};
|
||||
|
@ -306,3 +307,39 @@ void CommandInterpreter::executeLogOff(int processId,
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
void CommandInterpreter::executeTrace(int processId,
|
||||
const char* parameters, bool all) {
|
||||
|
||||
(void)all; // Don't want compiler warning
|
||||
|
||||
if (emptyString(parameters)) {
|
||||
ndbout << "Missing trace number." << endl;
|
||||
return;
|
||||
}
|
||||
|
||||
char* newpar = strdup(parameters);
|
||||
char* firstParameter = strtok(newpar, " ");
|
||||
|
||||
|
||||
int traceNo;
|
||||
if (! convert(firstParameter, traceNo)) {
|
||||
ndbout << "Expected an integer." << endl;
|
||||
free(newpar);
|
||||
return;
|
||||
}
|
||||
|
||||
char* allAfterFirstParameter = strtok(NULL, "\0");
|
||||
|
||||
if (! emptyString(allAfterFirstParameter)) {
|
||||
ndbout << "Nothing expected after trace number." << endl;
|
||||
free(newpar);
|
||||
return;
|
||||
}
|
||||
|
||||
int result = _mgmtSrvr.setTraceNo(processId, traceNo);
|
||||
if (result != 0) {
|
||||
ndbout << get_error_text(result) << endl;
|
||||
}
|
||||
free(newpar);
|
||||
}
|
||||
|
|
|
@ -63,6 +63,7 @@ private:
|
|||
Vector<BaseString>& blocks);
|
||||
|
||||
public:
|
||||
void executeTrace(int processId, const char* parameters, bool all);
|
||||
void executeLogIn(int processId, const char* parameters, bool all);
|
||||
void executeLogOut(int processId, const char* parameters, bool all);
|
||||
void executeLogOff(int processId, const char* parameters, bool all);
|
||||
|
|
Loading…
Reference in a new issue