5.0-bugteam -> 5.1-bugteam
This commit is contained in:
commit
1621a97fd4
@ -4264,17 +4264,18 @@ com_status(String *buffer __attribute__((unused)),
|
|||||||
MYSQL_RES *result;
|
MYSQL_RES *result;
|
||||||
LINT_INIT(result);
|
LINT_INIT(result);
|
||||||
|
|
||||||
|
if (mysql_real_query_for_lazy(
|
||||||
|
C_STRING_WITH_LEN("select DATABASE(), USER() limit 1")))
|
||||||
|
return 0;
|
||||||
|
|
||||||
tee_puts("--------------", stdout);
|
tee_puts("--------------", stdout);
|
||||||
usage(1); /* Print version */
|
usage(1); /* Print version */
|
||||||
if (connected)
|
|
||||||
{
|
|
||||||
tee_fprintf(stdout, "\nConnection id:\t\t%lu\n",mysql_thread_id(&mysql));
|
tee_fprintf(stdout, "\nConnection id:\t\t%lu\n",mysql_thread_id(&mysql));
|
||||||
/*
|
/*
|
||||||
Don't remove "limit 1",
|
Don't remove "limit 1",
|
||||||
it is protection againts SQL_SELECT_LIMIT=0
|
it is protection againts SQL_SELECT_LIMIT=0
|
||||||
*/
|
*/
|
||||||
if (!mysql_query(&mysql,"select DATABASE(), USER() limit 1") &&
|
if (mysql_store_result_for_lazy(&result))
|
||||||
(result=mysql_use_result(&mysql)))
|
|
||||||
{
|
{
|
||||||
MYSQL_ROW cur=mysql_fetch_row(result);
|
MYSQL_ROW cur=mysql_fetch_row(result);
|
||||||
if (cur)
|
if (cur)
|
||||||
@ -4284,6 +4285,7 @@ com_status(String *buffer __attribute__((unused)),
|
|||||||
}
|
}
|
||||||
mysql_free_result(result);
|
mysql_free_result(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_OPENSSL
|
#ifdef HAVE_OPENSSL
|
||||||
if ((status_str= mysql_get_ssl_cipher(&mysql)))
|
if ((status_str= mysql_get_ssl_cipher(&mysql)))
|
||||||
tee_fprintf(stdout, "SSL:\t\t\tCipher in use is %s\n",
|
tee_fprintf(stdout, "SSL:\t\t\tCipher in use is %s\n",
|
||||||
@ -4291,14 +4293,7 @@ com_status(String *buffer __attribute__((unused)),
|
|||||||
else
|
else
|
||||||
#endif /* HAVE_OPENSSL */
|
#endif /* HAVE_OPENSSL */
|
||||||
tee_puts("SSL:\t\t\tNot in use", stdout);
|
tee_puts("SSL:\t\t\tNot in use", stdout);
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
vidattr(A_BOLD);
|
|
||||||
tee_fprintf(stdout, "\nNo connection\n");
|
|
||||||
vidattr(A_NORMAL);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
if (skip_updates)
|
if (skip_updates)
|
||||||
{
|
{
|
||||||
vidattr(A_BOLD);
|
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));
|
tee_fprintf(stdout, "Insert id:\t\t%s\n", llstr(id, buff));
|
||||||
|
|
||||||
/* "limit 1" is protection against SQL_SELECT_LIMIT=0 */
|
/* "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") &&
|
if (mysql_real_query_for_lazy(C_STRING_WITH_LEN(
|
||||||
(result=mysql_use_result(&mysql)))
|
"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);
|
MYSQL_ROW cur=mysql_fetch_row(result);
|
||||||
if (cur)
|
if (cur)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user