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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
80236063
Commit
80236063
authored
Feb 27, 2003
by
bell@sanja.is.com.ua
Browse files
Options
Browse Files
Download
Plain Diff
merging
parents
a0d2a621
352a3381
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
25 additions
and
10 deletions
+25
-10
include/violite.h
include/violite.h
+2
-2
libmysqld/lib_vio.c
libmysqld/lib_vio.c
+1
-1
sql/sql_class.h
sql/sql_class.h
+2
-1
sql/sql_parse.cc
sql/sql_parse.cc
+4
-3
sql/sql_show.cc
sql/sql_show.cc
+13
-2
vio/viosocket.c
vio/viosocket.c
+3
-1
No files found.
include/violite.h
View file @
80236063
...
@@ -95,7 +95,7 @@ my_socket vio_fd(Vio*vio);
...
@@ -95,7 +95,7 @@ my_socket vio_fd(Vio*vio);
/*
/*
* Remote peer's address and name in text form.
* Remote peer's address and name in text form.
*/
*/
my_bool
vio_peer_addr
(
Vio
*
vio
,
char
*
buf
);
my_bool
vio_peer_addr
(
Vio
*
vio
,
char
*
buf
,
u_int16_t
*
port
);
/* Remotes in_addr */
/* Remotes in_addr */
...
@@ -119,7 +119,7 @@ my_bool vio_poll_read(Vio *vio,uint timeout);
...
@@ -119,7 +119,7 @@ my_bool vio_poll_read(Vio *vio,uint timeout);
#define vio_keepalive(vio, set_keep_alive) (vio)->viokeepalive(vio, set_keep_alive)
#define vio_keepalive(vio, set_keep_alive) (vio)->viokeepalive(vio, set_keep_alive)
#define vio_should_retry(vio) (vio)->should_retry(vio)
#define vio_should_retry(vio) (vio)->should_retry(vio)
#define vio_close(vio) ((vio)->vioclose)(vio)
#define vio_close(vio) ((vio)->vioclose)(vio)
#define vio_peer_addr(vio, buf
) (vio)->peer_addr(vio, buf
)
#define vio_peer_addr(vio, buf
, prt) (vio)->peer_addr(vio, buf, prt
)
#define vio_in_addr(vio, in) (vio)->in_addr(vio, in)
#define vio_in_addr(vio, in) (vio)->in_addr(vio, in)
#endif
/* defined(HAVE_VIO) && !defined(DONT_MAP_VIO) */
#endif
/* defined(HAVE_VIO) && !defined(DONT_MAP_VIO) */
...
...
libmysqld/lib_vio.c
View file @
80236063
...
@@ -204,7 +204,7 @@ my_socket vio_fd(Vio* vio)
...
@@ -204,7 +204,7 @@ my_socket vio_fd(Vio* vio)
}
}
my_bool
vio_peer_addr
(
Vio
*
vio
,
char
*
buf
)
my_bool
vio_peer_addr
(
Vio
*
vio
,
char
*
buf
,
u_int16_t
*
port
)
{
{
return
(
0
);
return
(
0
);
}
}
...
...
sql/sql_class.h
View file @
80236063
...
@@ -350,8 +350,9 @@ public:
...
@@ -350,8 +350,9 @@ public:
db - currently selected database
db - currently selected database
ip - client IP
ip - client IP
*/
*/
char
*
host
,
*
user
,
*
priv_user
,
*
db
,
*
ip
;
char
*
host
,
*
user
,
*
priv_user
,
*
db
,
*
ip
;
/* remote (peer) port */
u_int16_t
peer_port
;
/* Points to info-string that will show in SHOW PROCESSLIST */
/* Points to info-string that will show in SHOW PROCESSLIST */
const
char
*
proc_info
;
const
char
*
proc_info
;
/* points to host if host is available, otherwise points to ip */
/* points to host if host is available, otherwise points to ip */
...
...
sql/sql_parse.cc
View file @
80236063
...
@@ -482,7 +482,7 @@ check_connections(THD *thd)
...
@@ -482,7 +482,7 @@ check_connections(THD *thd)
{
{
char
ip
[
30
];
char
ip
[
30
];
if
(
vio_peer_addr
(
net
->
vio
,
ip
))
if
(
vio_peer_addr
(
net
->
vio
,
ip
,
&
thd
->
peer_port
))
return
(
ER_BAD_HOST_ERROR
);
return
(
ER_BAD_HOST_ERROR
);
if
(
!
(
thd
->
ip
=
my_strdup
(
ip
,
MYF
(
0
))))
if
(
!
(
thd
->
ip
=
my_strdup
(
ip
,
MYF
(
0
))))
return
(
ER_OUT_OF_RESOURCES
);
return
(
ER_OUT_OF_RESOURCES
);
...
@@ -512,8 +512,9 @@ check_connections(THD *thd)
...
@@ -512,8 +512,9 @@ check_connections(THD *thd)
else
/* Hostname given means that the connection was on a socket */
else
/* Hostname given means that the connection was on a socket */
{
{
DBUG_PRINT
(
"info"
,(
"Host: %s"
,
thd
->
host
));
DBUG_PRINT
(
"info"
,(
"Host: %s"
,
thd
->
host
));
thd
->
host_or_ip
=
thd
->
host
;
thd
->
host_or_ip
=
thd
->
host
;
thd
->
ip
=
0
;
thd
->
ip
=
0
;
thd
->
peer_port
=
0
;
bzero
((
char
*
)
&
thd
->
remote
,
sizeof
(
struct
sockaddr
));
bzero
((
char
*
)
&
thd
->
remote
,
sizeof
(
struct
sockaddr
));
}
}
/* Ensure that wrong hostnames doesn't cause buffer overflows */
/* Ensure that wrong hostnames doesn't cause buffer overflows */
...
...
sql/sql_show.cc
View file @
80236063
...
@@ -1017,6 +1017,7 @@ public:
...
@@ -1017,6 +1017,7 @@ public:
template
class
I_List
<
thread_info
>;
template
class
I_List
<
thread_info
>;
#endif
#endif
#define LIST_PROCESS_HOST_LEN 64
void
mysqld_list_processes
(
THD
*
thd
,
const
char
*
user
,
bool
verbose
)
void
mysqld_list_processes
(
THD
*
thd
,
const
char
*
user
,
bool
verbose
)
{
{
...
@@ -1030,7 +1031,7 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose)
...
@@ -1030,7 +1031,7 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose)
field_list
.
push_back
(
new
Item_int
(
"Id"
,
0
,
7
));
field_list
.
push_back
(
new
Item_int
(
"Id"
,
0
,
7
));
field_list
.
push_back
(
new
Item_empty_string
(
"User"
,
16
));
field_list
.
push_back
(
new
Item_empty_string
(
"User"
,
16
));
field_list
.
push_back
(
new
Item_empty_string
(
"Host"
,
64
));
field_list
.
push_back
(
new
Item_empty_string
(
"Host"
,
LIST_PROCESS_HOST_LEN
));
field_list
.
push_back
(
field
=
new
Item_empty_string
(
"db"
,
NAME_LEN
));
field_list
.
push_back
(
field
=
new
Item_empty_string
(
"db"
,
NAME_LEN
));
field
->
maybe_null
=
1
;
field
->
maybe_null
=
1
;
field_list
.
push_back
(
new
Item_empty_string
(
"Command"
,
16
));
field_list
.
push_back
(
new
Item_empty_string
(
"Command"
,
16
));
...
@@ -1059,7 +1060,17 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose)
...
@@ -1059,7 +1060,17 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose)
thd_info
->
user
=
thd
->
strdup
(
tmp
->
user
?
tmp
->
user
:
thd_info
->
user
=
thd
->
strdup
(
tmp
->
user
?
tmp
->
user
:
(
tmp
->
system_thread
?
(
tmp
->
system_thread
?
"system user"
:
"unauthenticated user"
));
"system user"
:
"unauthenticated user"
));
thd_info
->
host
=
thd
->
strdup
(
tmp
->
host_or_ip
);
if
(
tmp
->
peer_port
&&
(
tmp
->
host
||
tmp
->
ip
))
{
if
((
thd_info
->
host
=
thd
->
alloc
(
LIST_PROCESS_HOST_LEN
+
1
)))
snprintf
((
char
*
)
thd_info
->
host
,
LIST_PROCESS_HOST_LEN
,
"%s:%u"
,
(
tmp
->
host
?
tmp
->
host
:
tmp
->
ip
),
tmp
->
peer_port
);
}
else
thd_info
->
host
=
thd
->
strdup
(
tmp
->
host
?
tmp
->
host
:
(
tmp
->
ip
?
tmp
->
ip
:
(
tmp
->
system_thread
?
"none"
:
"connecting host"
)));
if
((
thd_info
->
db
=
tmp
->
db
))
// Safe test
if
((
thd_info
->
db
=
tmp
->
db
))
// Safe test
thd_info
->
db
=
thd
->
strdup
(
thd_info
->
db
);
thd_info
->
db
=
thd
->
strdup
(
thd_info
->
db
);
thd_info
->
command
=
(
int
)
tmp
->
command
;
thd_info
->
command
=
(
int
)
tmp
->
command
;
...
...
vio/viosocket.c
View file @
80236063
...
@@ -277,13 +277,14 @@ my_socket vio_fd(Vio* vio)
...
@@ -277,13 +277,14 @@ my_socket vio_fd(Vio* vio)
}
}
my_bool
vio_peer_addr
(
Vio
*
vio
,
char
*
buf
)
my_bool
vio_peer_addr
(
Vio
*
vio
,
char
*
buf
,
u_int16_t
*
port
)
{
{
DBUG_ENTER
(
"vio_peer_addr"
);
DBUG_ENTER
(
"vio_peer_addr"
);
DBUG_PRINT
(
"enter"
,
(
"sd: %d"
,
vio
->
sd
));
DBUG_PRINT
(
"enter"
,
(
"sd: %d"
,
vio
->
sd
));
if
(
vio
->
localhost
)
if
(
vio
->
localhost
)
{
{
strmov
(
buf
,
"127.0.0.1"
);
strmov
(
buf
,
"127.0.0.1"
);
*
port
=
0
;
}
}
else
else
{
{
...
@@ -295,6 +296,7 @@ my_bool vio_peer_addr(Vio * vio, char *buf)
...
@@ -295,6 +296,7 @@ my_bool vio_peer_addr(Vio * vio, char *buf)
DBUG_RETURN
(
1
);
DBUG_RETURN
(
1
);
}
}
my_inet_ntoa
(
vio
->
remote
.
sin_addr
,
buf
);
my_inet_ntoa
(
vio
->
remote
.
sin_addr
,
buf
);
*
port
=
ntohs
(
vio
->
remote
.
sin_port
);
}
}
DBUG_PRINT
(
"exit"
,
(
"addr: %s"
,
buf
));
DBUG_PRINT
(
"exit"
,
(
"addr: %s"
,
buf
));
DBUG_RETURN
(
0
);
DBUG_RETURN
(
0
);
...
...
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