mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 20:12:31 +01:00
5.0-bugteam -> 5.1-bugteam
This commit is contained in:
commit
1621a97fd4
1 changed files with 32 additions and 31 deletions
|
@ -4264,41 +4264,36 @@ com_status(String *buffer __attribute__((unused)),
|
|||
MYSQL_RES *result;
|
||||
LINT_INIT(result);
|
||||
|
||||
if (mysql_real_query_for_lazy(
|
||||
C_STRING_WITH_LEN("select DATABASE(), USER() limit 1")))
|
||||
return 0;
|
||||
|
||||
tee_puts("--------------", stdout);
|
||||
usage(1); /* Print version */
|
||||
if (connected)
|
||||
tee_fprintf(stdout, "\nConnection id:\t\t%lu\n",mysql_thread_id(&mysql));
|
||||
/*
|
||||
Don't remove "limit 1",
|
||||
it is protection againts SQL_SELECT_LIMIT=0
|
||||
*/
|
||||
if (mysql_store_result_for_lazy(&result))
|
||||
{
|
||||
tee_fprintf(stdout, "\nConnection id:\t\t%lu\n",mysql_thread_id(&mysql));
|
||||
/*
|
||||
Don't remove "limit 1",
|
||||
it is protection againts SQL_SELECT_LIMIT=0
|
||||
*/
|
||||
if (!mysql_query(&mysql,"select DATABASE(), USER() limit 1") &&
|
||||
(result=mysql_use_result(&mysql)))
|
||||
MYSQL_ROW cur=mysql_fetch_row(result);
|
||||
if (cur)
|
||||
{
|
||||
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);
|
||||
}
|
||||
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 ((status_str= mysql_get_ssl_cipher(&mysql)))
|
||||
tee_fprintf(stdout, "SSL:\t\t\tCipher in use is %s\n",
|
||||
status_str);
|
||||
else
|
||||
#endif /* HAVE_OPENSSL */
|
||||
tee_puts("SSL:\t\t\tNot in use", stdout);
|
||||
}
|
||||
if ((status_str= mysql_get_ssl_cipher(&mysql)))
|
||||
tee_fprintf(stdout, "SSL:\t\t\tCipher in use is %s\n",
|
||||
status_str);
|
||||
else
|
||||
{
|
||||
vidattr(A_BOLD);
|
||||
tee_fprintf(stdout, "\nNo connection\n");
|
||||
vidattr(A_NORMAL);
|
||||
return 0;
|
||||
}
|
||||
#endif /* HAVE_OPENSSL */
|
||||
tee_puts("SSL:\t\t\tNot in use", stdout);
|
||||
|
||||
if (skip_updates)
|
||||
{
|
||||
vidattr(A_BOLD);
|
||||
|
@ -4317,8 +4312,14 @@ com_status(String *buffer __attribute__((unused)),
|
|||
tee_fprintf(stdout, "Insert id:\t\t%s\n", llstr(id, buff));
|
||||
|
||||
/* "limit 1" is protection against SQL_SELECT_LIMIT=0 */
|
||||
if (!mysql_query(&mysql,"select @@character_set_client, @@character_set_connection, @@character_set_server, @@character_set_database limit 1") &&
|
||||
(result=mysql_use_result(&mysql)))
|
||||
if (mysql_real_query_for_lazy(C_STRING_WITH_LEN(
|
||||
"select @@character_set_client, @@character_set_connection, "
|
||||
"@@character_set_server, @@character_set_database limit 1")))
|
||||
{
|
||||
if (mysql_errno(&mysql) == CR_SERVER_GONE_ERROR)
|
||||
return 0;
|
||||
}
|
||||
if (mysql_store_result_for_lazy(&result))
|
||||
{
|
||||
MYSQL_ROW cur=mysql_fetch_row(result);
|
||||
if (cur)
|
||||
|
|
Loading…
Reference in a new issue