Commit 7f1715a7 authored by Kristofer Pettersson's avatar Kristofer Pettersson

5.0-bugteam -> 5.1-bugteam

parents 0c5207f5 6455c568
...@@ -4264,41 +4264,36 @@ com_status(String *buffer __attribute__((unused)), ...@@ -4264,41 +4264,36 @@ 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));
/*
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)); MYSQL_ROW cur=mysql_fetch_row(result);
/* if (cur)
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); tee_fprintf(stdout, "Current database:\t%s\n", cur[0] ? cur[0] : "");
if (cur) tee_fprintf(stdout, "Current user:\t\t%s\n", cur[1]);
{ }
tee_fprintf(stdout, "Current database:\t%s\n", cur[0] ? cur[0] : ""); mysql_free_result(result);
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);
} }
#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 else
{ #endif /* HAVE_OPENSSL */
vidattr(A_BOLD); tee_puts("SSL:\t\t\tNot in use", stdout);
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)), ...@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment