Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
1621a97f
Commit
1621a97f
authored
Jul 03, 2009
by
Kristofer Pettersson
Browse files
Options
Browse Files
Download
Plain Diff
5.0-bugteam -> 5.1-bugteam
parents
cfebaf44
5899e13a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
31 deletions
+32
-31
client/mysql.cc
client/mysql.cc
+32
-31
No files found.
client/mysql.cc
View file @
1621a97f
...
...
@@ -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
,
"
\n
Connection 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
,
"
\n
Connection 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
);
}
#ifdef HAVE_OPENSSL
if
((
status_str
=
mysql_get_ssl_cipher
(
&
mysql
)))
tee_fprintf
(
stdout
,
"SSL:
\t\t\t
Cipher in use is %s
\n
"
,
status_str
);
else
#endif
/* HAVE_OPENSSL */
tee_puts
(
"SSL:
\t\t\t
Not in use"
,
stdout
);
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\t
Cipher in use is %s
\n
"
,
status_str
);
else
{
vidattr
(
A_BOLD
);
tee_fprintf
(
stdout
,
"
\n
No connection
\n
"
);
vidattr
(
A_NORMAL
);
return
0
;
}
#endif
/* HAVE_OPENSSL */
tee_puts
(
"SSL:
\t\t\t
Not 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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment