Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
fbda2fc1
Commit
fbda2fc1
authored
Dec 09, 2004
by
tomas@poseidon.ndb.mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed so that trailing ';' are accepted by the ndb_mgm to be more "mysql client" like
some cleanup
parent
bf72f5da
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
19 deletions
+32
-19
ndb/src/mgmclient/CommandInterpreter.cpp
ndb/src/mgmclient/CommandInterpreter.cpp
+32
-19
No files found.
ndb/src/mgmclient/CommandInterpreter.cpp
View file @
fbda2fc1
...
@@ -484,6 +484,13 @@ CommandInterpreter::execute(const char *_line, int _try_reconnect,
...
@@ -484,6 +484,13 @@ CommandInterpreter::execute(const char *_line, int _try_reconnect,
return
result
;
return
result
;
}
}
static
void
invalid_command
(
const
char
*
cmd
)
{
ndbout
<<
"Invalid command: "
<<
cmd
<<
endl
;
ndbout
<<
"Type HELP for help."
<<
endl
<<
endl
;
}
int
int
CommandInterpreter
::
execute_impl
(
const
char
*
_line
)
CommandInterpreter
::
execute_impl
(
const
char
*
_line
)
{
{
...
@@ -493,17 +500,30 @@ CommandInterpreter::execute_impl(const char *_line)
...
@@ -493,17 +500,30 @@ CommandInterpreter::execute_impl(const char *_line)
char
*
line
;
char
*
line
;
if
(
_line
==
NULL
)
{
if
(
_line
==
NULL
)
{
// ndbout << endl;
DBUG_RETURN
(
false
);
DBUG_RETURN
(
false
);
}
}
line
=
my_strdup
(
_line
,
MYF
(
MY_WME
));
line
=
my_strdup
(
_line
,
MYF
(
MY_WME
));
My_auto_ptr
<
char
>
ptr
(
line
);
My_auto_ptr
<
char
>
ptr
(
line
);
if
(
emptyString
(
line
)
||
int
do_continue
;
line
[
0
]
==
'#'
)
{
do
{
do_continue
=
0
;
BaseString
::
trim
(
line
,
"
\t
"
);
if
(
line
[
0
]
==
0
||
line
[
0
]
==
'#'
)
{
DBUG_RETURN
(
true
);
DBUG_RETURN
(
true
);
}
}
// for mysql client compatability remove trailing ';'
{
unsigned
last
=
strlen
(
line
)
-
1
;
if
(
line
[
last
]
==
';'
)
{
line
[
last
]
=
0
;
do_continue
=
1
;
}
}
}
while
(
do_continue
);
// if there is anything in the line proceed
// if there is anything in the line proceed
char
*
firstToken
=
strtok
(
line
,
" "
);
char
*
firstToken
=
strtok
(
line
,
" "
);
char
*
allAfterFirstToken
=
strtok
(
NULL
,
""
);
char
*
allAfterFirstToken
=
strtok
(
NULL
,
""
);
...
@@ -590,8 +610,7 @@ CommandInterpreter::execute_impl(const char *_line)
...
@@ -590,8 +610,7 @@ CommandInterpreter::execute_impl(const char *_line)
int
nodeId
;
int
nodeId
;
if
(
!
convert
(
firstToken
,
nodeId
))
{
if
(
!
convert
(
firstToken
,
nodeId
))
{
ndbout
<<
"Invalid command: "
<<
_line
<<
endl
;
invalid_command
(
_line
);
ndbout
<<
"Type HELP for help."
<<
endl
<<
endl
;
DBUG_RETURN
(
true
);
DBUG_RETURN
(
true
);
}
}
...
@@ -640,12 +659,8 @@ CommandInterpreter::analyseAfterFirstToken(int processId,
...
@@ -640,12 +659,8 @@ CommandInterpreter::analyseAfterFirstToken(int processId,
char
*
allAfterFirstToken
)
{
char
*
allAfterFirstToken
)
{
if
(
emptyString
(
allAfterFirstToken
))
{
if
(
emptyString
(
allAfterFirstToken
))
{
if
(
processId
==
-
1
)
{
ndbout
<<
"Expected a command after "
ndbout
<<
"Expected a command after ALL."
<<
endl
;
<<
((
processId
==
-
1
)
?
"ALL."
:
"node ID."
)
<<
endl
;
}
else
{
ndbout
<<
"Expected a command after node ID."
<<
endl
;
}
return
;
return
;
}
}
...
@@ -664,8 +679,7 @@ CommandInterpreter::analyseAfterFirstToken(int processId,
...
@@ -664,8 +679,7 @@ CommandInterpreter::analyseAfterFirstToken(int processId,
}
}
if
(
fun
==
0
){
if
(
fun
==
0
){
ndbout
<<
"Invalid command: "
<<
secondToken
<<
endl
;
invalid_command
(
secondToken
);
ndbout
<<
"Type HELP for help."
<<
endl
<<
endl
;
return
;
return
;
}
}
...
@@ -846,8 +860,7 @@ CommandInterpreter::executeHelp(char* parameters)
...
@@ -846,8 +860,7 @@ CommandInterpreter::executeHelp(char* parameters)
ndbout
<<
helpTextDebug
;
ndbout
<<
helpTextDebug
;
#endif
#endif
}
else
{
}
else
{
ndbout
<<
"Invalid argument: "
<<
parameters
<<
endl
;
invalid_command
(
parameters
);
ndbout
<<
"Type HELP for help."
<<
endl
<<
endl
;
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment