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
3df9790e
Commit
3df9790e
authored
Aug 28, 2007
by
msvensson@pilot.(none)
Browse files
Options
Browse Files
Download
Plain Diff
Merge pilot.(none):/data/msvensson/mysql/mysql-5.0-maint
into pilot.(none):/data/msvensson/mysql/mysql-5.1-new-maint
parents
d11d6ea7
4a708752
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
57 additions
and
65 deletions
+57
-65
client/mysqltest.c
client/mysqltest.c
+57
-65
No files found.
client/mysqltest.c
View file @
3df9790e
...
...
@@ -2976,7 +2976,22 @@ void do_diff_files(struct st_command *command)
DBUG_VOID_RETURN
;
}
/*
struct
st_connection
*
find_connection_by_name
(
const
char
*
name
)
{
struct
st_connection
*
con
;
for
(
con
=
connections
;
con
<
next_con
;
con
++
)
{
if
(
!
strcmp
(
con
->
name
,
name
))
{
return
con
;
}
}
return
0
;
/* Connection not found */
}
/*
SYNOPSIS
do_send_quit
command called command
...
...
@@ -2984,7 +2999,7 @@ void do_diff_files(struct st_command *command)
DESCRIPTION
Sends a simple quit command to the server for the named connection.
*/
*/
void
do_send_quit
(
struct
st_command
*
command
)
{
...
...
@@ -2995,7 +3010,7 @@ void do_send_quit(struct st_command *command)
DBUG_PRINT
(
"enter"
,(
"name: '%s'"
,
p
));
if
(
!*
p
)
die
(
"Missing connection name in
do_
send_quit"
);
die
(
"Missing connection name in send_quit"
);
name
=
p
;
while
(
*
p
&&
!
my_isspace
(
charset_info
,
*
p
))
p
++
;
...
...
@@ -3004,17 +3019,12 @@ void do_send_quit(struct st_command *command)
*
p
++=
0
;
command
->
last_argument
=
p
;
/* Loop through connection pool for connection to close */
for
(
con
=
connections
;
con
<
next_con
;
con
++
)
{
DBUG_PRINT
(
"info"
,
(
"con->name: %s"
,
con
->
name
));
if
(
!
strcmp
(
con
->
name
,
name
))
{
if
(
!
(
con
=
find_connection_by_name
(
name
)))
die
(
"connection '%s' not found in connection pool"
,
name
);
simple_command
(
&
con
->
mysql
,
COM_QUIT
,
0
,
0
,
1
);
DBUG_VOID_RETURN
;
}
}
die
(
"connection '%s' not found in connection pool"
,
name
);
}
...
...
@@ -3855,20 +3865,6 @@ void set_reconnect(MYSQL* mysql, int val)
}
struct
st_connection
*
find_connection_by_name
(
const
char
*
name
)
{
struct
st_connection
*
con
;
for
(
con
=
connections
;
con
<
next_con
;
con
++
)
{
if
(
!
strcmp
(
con
->
name
,
name
))
{
return
con
;
}
}
return
0
;
/* Connection not found */
}
int
select_connection_name
(
const
char
*
name
)
{
DBUG_ENTER
(
"select_connection_name"
);
...
...
@@ -3916,12 +3912,9 @@ void do_close_connection(struct st_command *command)
*
p
++=
0
;
command
->
last_argument
=
p
;
/* Loop through connection pool for connection to close */
for
(
con
=
connections
;
con
<
next_con
;
con
++
)
{
DBUG_PRINT
(
"info"
,
(
"con->name: %s"
,
con
->
name
));
if
(
!
strcmp
(
con
->
name
,
name
))
{
if
(
!
(
con
=
find_connection_by_name
(
name
)))
die
(
"connection '%s' not found in connection pool"
,
name
);
DBUG_PRINT
(
"info"
,
(
"Closing connection %s"
,
con
->
name
));
#ifndef EMBEDDED_LIBRARY
if
(
command
->
type
==
Q_DIRTY_CLOSE
)
...
...
@@ -3933,14 +3926,16 @@ void do_close_connection(struct st_command *command)
}
}
#endif
if
(
next_
con
->
stmt
)
mysql_stmt_close
(
next_
con
->
stmt
);
next_
con
->
stmt
=
0
;
if
(
con
->
stmt
)
mysql_stmt_close
(
con
->
stmt
);
con
->
stmt
=
0
;
mysql_close
(
&
con
->
mysql
);
if
(
con
->
util_mysql
)
mysql_close
(
con
->
util_mysql
);
con
->
util_mysql
=
0
;
my_free
(
con
->
name
,
MYF
(
0
));
/*
...
...
@@ -3951,9 +3946,6 @@ void do_close_connection(struct st_command *command)
die
(
"Out of memory"
);
DBUG_VOID_RETURN
;
}
}
die
(
"connection '%s' not found in connection pool"
,
name
);
}
...
...
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