mirror of
https://github.com/MariaDB/server.git
synced 2025-10-25 18:38:00 +03:00
A fix (bug #3120: 'mysqladmin ping' - return error code).
This commit is contained in:
@@ -246,7 +246,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
|||||||
|
|
||||||
int main(int argc,char *argv[])
|
int main(int argc,char *argv[])
|
||||||
{
|
{
|
||||||
int error, ho_error;
|
int error= 0, ho_error;
|
||||||
MYSQL mysql;
|
MYSQL mysql;
|
||||||
char **commands, **save_argv;
|
char **commands, **save_argv;
|
||||||
|
|
||||||
@@ -285,10 +285,25 @@ int main(int argc,char *argv[])
|
|||||||
opt_ssl_capath, opt_ssl_cipher);
|
opt_ssl_capath, opt_ssl_cipher);
|
||||||
#endif
|
#endif
|
||||||
if (sql_connect(&mysql, option_wait))
|
if (sql_connect(&mysql, option_wait))
|
||||||
|
{
|
||||||
|
unsigned int err= mysql_errno(&mysql);
|
||||||
|
if (err >= CR_MIN_ERROR && err <= CR_MAX_ERROR)
|
||||||
error= 1;
|
error= 1;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
error = 0;
|
/* Return 0 if all commands are PING */
|
||||||
|
for (; argc > 0; argv++, argc--)
|
||||||
|
{
|
||||||
|
if (find_type(argv[0], &command_typelib, 2) != ADMIN_PING)
|
||||||
|
{
|
||||||
|
error= 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
while (!interrupted && (!opt_count_iterations || nr_iterations))
|
while (!interrupted && (!opt_count_iterations || nr_iterations))
|
||||||
{
|
{
|
||||||
new_line = 0;
|
new_line = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user