Restoring old code to be used with 4.0 server if 4.1-compient query fails.
Restoring displaying database and user which was removed in a mistake in the previous change.
This commit is contained in:
parent
10aedc87d8
commit
1992322af5
@ -2841,6 +2841,18 @@ com_status(String *buffer __attribute__((unused)),
|
||||
usage(1); /* Print version */
|
||||
if (connected)
|
||||
{
|
||||
tee_fprintf(stdout, "\nConnection id:\t\t%lu\n",mysql_thread_id(&mysql));
|
||||
if (!mysql_query(&mysql,"select DATABASE(), USER() limit 1") &&
|
||||
(result=mysql_use_result(&mysql)))
|
||||
{
|
||||
MYSQL_ROW cur=mysql_fetch_row(result);
|
||||
if (cur)
|
||||
{
|
||||
tee_fprintf(stdout, "Current database:\t%s\n", cur[0] ? cur[0] : "");
|
||||
tee_fprintf(stdout, "Current user:\t\t%s\n", cur[1]);
|
||||
}
|
||||
mysql_free_result(result);
|
||||
}
|
||||
#ifdef HAVE_OPENSSL
|
||||
if (mysql.net.vio && mysql.net.vio->ssl_arg &&
|
||||
SSL_get_cipher((SSL*) mysql.net.vio->ssl_arg))
|
||||
@ -2887,6 +2899,12 @@ com_status(String *buffer __attribute__((unused)),
|
||||
}
|
||||
mysql_free_result(result);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Probably pre-4.1 server */
|
||||
tee_fprintf(stdout, "Client characterset:\t%s\n", charset_info->csname);
|
||||
tee_fprintf(stdout, "Server characterset:\t%s\n", mysql.charset->csname);
|
||||
}
|
||||
|
||||
#ifndef EMBEDDED_LIBRARY
|
||||
if (strstr(mysql_get_host_info(&mysql),"TCP/IP") || ! mysql.unix_socket)
|
||||
|
Loading…
x
Reference in New Issue
Block a user