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
206e1dc6
Commit
206e1dc6
authored
Apr 21, 2008
by
msvensson@pilot.mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename "shutdown" -> "send_shutdown" and "kill_server" to "shutdown_server"
Fix warnings
parent
2ba565cd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
31 deletions
+47
-31
client/mysqltest.c
client/mysqltest.c
+27
-27
mysql-test/include/restart_mysqld.inc
mysql-test/include/restart_mysqld.inc
+1
-1
mysql-test/mysql-test-run.pl
mysql-test/mysql-test-run.pl
+19
-3
No files found.
client/mysqltest.c
View file @
206e1dc6
...
...
@@ -268,7 +268,7 @@ enum enum_commands {
Q_WRITE_FILE
,
Q_COPY_FILE
,
Q_PERL
,
Q_DIE
,
Q_EXIT
,
Q_SKIP
,
Q_CHMOD_FILE
,
Q_APPEND_FILE
,
Q_CAT_FILE
,
Q_DIFF_FILES
,
Q_SEND_QUIT
,
Q_CHANGE_USER
,
Q_MKDIR
,
Q_RMDIR
,
Q_S
HUTDOWN
,
Q_KILL
_SERVER
,
Q_S
END_SHUTDOWN
,
Q_SHUTDOWN
_SERVER
,
Q_UNKNOWN
,
/* Unknown command. */
Q_COMMENT
,
/* Comments, ignored. */
...
...
@@ -360,8 +360,8 @@ const char *command_names[]=
"change_user"
,
"mkdir"
,
"rmdir"
,
"shutdown"
,
"
kill
_server"
,
"s
end_s
hutdown"
,
"
shutdown
_server"
,
0
};
...
...
@@ -2056,9 +2056,9 @@ void var_set_query_get_value(struct st_command *command, VAR *var)
static
DYNAMIC_STRING
ds_col
;
static
DYNAMIC_STRING
ds_row
;
const
struct
command_arg
query_get_value_args
[]
=
{
"query"
,
ARG_STRING
,
TRUE
,
&
ds_query
,
"Query to run"
,
"column name"
,
ARG_STRING
,
TRUE
,
&
ds_col
,
"Name of column"
,
"row number"
,
ARG_STRING
,
TRUE
,
&
ds_row
,
"Number for row"
{
"query"
,
ARG_STRING
,
TRUE
,
&
ds_query
,
"Query to run"
}
,
{
"column name"
,
ARG_STRING
,
TRUE
,
&
ds_col
,
"Name of column"
}
,
{
"row number"
,
ARG_STRING
,
TRUE
,
&
ds_row
,
"Number for row"
}
};
DBUG_ENTER
(
"var_set_query_get_value"
);
...
...
@@ -2821,7 +2821,7 @@ void do_mkdir(struct st_command *command)
int
error
;
static
DYNAMIC_STRING
ds_dirname
;
const
struct
command_arg
mkdir_args
[]
=
{
"dirname"
,
ARG_STRING
,
TRUE
,
&
ds_dirname
,
"Directory to create"
{
"dirname"
,
ARG_STRING
,
TRUE
,
&
ds_dirname
,
"Directory to create"
}
};
DBUG_ENTER
(
"do_mkdir"
);
...
...
@@ -2851,7 +2851,7 @@ void do_rmdir(struct st_command *command)
int
error
;
static
DYNAMIC_STRING
ds_dirname
;
const
struct
command_arg
rmdir_args
[]
=
{
"dirname"
,
ARG_STRING
,
TRUE
,
&
ds_dirname
,
"Directory to remove"
{
"dirname"
,
ARG_STRING
,
TRUE
,
&
ds_dirname
,
"Directory to remove"
}
};
DBUG_ENTER
(
"do_rmdir"
);
...
...
@@ -3817,7 +3817,7 @@ void do_set_charset(struct st_command *command)
int
query_get_string
(
MYSQL
*
mysql
,
const
char
*
query
,
int
column
,
DYNAMIC_STRING
*
ds
)
{
MYSQL_RES
*
res
;
MYSQL_RES
*
res
=
NULL
;
MYSQL_ROW
row
;
if
(
mysql_query
(
mysql
,
query
)
||
!
(
res
=
mysql_store_result
(
mysql
)))
...
...
@@ -3842,27 +3842,27 @@ int query_get_string(MYSQL* mysql, const char* query,
NOTE! Currently only works with local server
SYNOPSIS
do_
kill
_server()
do_
shutdown
_server()
command called command
DESCRIPTION
kill_server
[<timeout>]
shutdown
[<timeout>]
*/
void
do_
kill
_server
(
struct
st_command
*
command
)
void
do_
shutdown
_server
(
struct
st_command
*
command
)
{
int
timeout
=
60
,
pid
;
DYNAMIC_STRING
*
ds_pidfile_name
;
DYNAMIC_STRING
ds_pidfile_name
;
MYSQL
*
mysql
=
&
cur_con
->
mysql
;
static
DYNAMIC_STRING
ds_timeout
;
const
struct
command_arg
kill
_args
[]
=
{
"timeout"
,
ARG_STRING
,
FALSE
,
&
ds_timeout
,
"Timeout before killing server"
const
struct
command_arg
shutdown
_args
[]
=
{
{
"timeout"
,
ARG_STRING
,
FALSE
,
&
ds_timeout
,
"Timeout before killing server"
}
};
DBUG_ENTER
(
"do_
kill
_server"
);
DBUG_ENTER
(
"do_
shutdown
_server"
);
check_command_args
(
command
,
command
->
first_argument
,
kill_args
,
sizeof
(
kill
_args
)
/
sizeof
(
struct
command_arg
),
check_command_args
(
command
,
command
->
first_argument
,
shutdown_args
,
sizeof
(
shutdown
_args
)
/
sizeof
(
struct
command_arg
),
' '
);
if
(
ds_timeout
.
length
)
...
...
@@ -3874,7 +3874,7 @@ void do_kill_server(struct st_command *command)
/* Get the servers pid_file name and use it to read pid */
if
(
query_get_string
(
mysql
,
"SHOW VARIABLES LIKE 'pid_file'"
,
1
,
ds_pidfile_name
))
&
ds_pidfile_name
))
die
(
"Failed to get pid_file from server"
);
/* Read the pid from the file */
...
...
@@ -3882,8 +3882,8 @@ void do_kill_server(struct st_command *command)
int
fd
;
char
buff
[
32
];
if
((
fd
=
my_open
(
ds_pidfile_name
->
str
,
O_RDONLY
,
MYF
(
0
)))
<
0
)
die
(
"Failed to open file '%s'"
,
ds_pidfile_name
->
str
);
if
((
fd
=
my_open
(
ds_pidfile_name
.
str
,
O_RDONLY
,
MYF
(
0
)))
<
0
)
die
(
"Failed to open file '%s'"
,
ds_pidfile_name
.
str
);
if
(
my_read
(
fd
,
(
uchar
*
)
&
buff
,
sizeof
(
buff
),
MYF
(
0
))
<=
0
){
my_close
(
fd
,
MYF
(
0
));
...
...
@@ -3895,13 +3895,13 @@ void do_kill_server(struct st_command *command)
my_close
(
fd
,
MYF
(
0
));
die
(
"pid file was empty"
);
}
DBUG_PRINT
(
"info"
,
(
"Read pid %d from '%s'"
,
pid
,
ds_pidfile_name
->
str
));
DBUG_PRINT
(
"info"
,
(
"Read pid %d from '%s'"
,
pid
,
ds_pidfile_name
.
str
));
my_close
(
fd
,
MYF
(
0
));
}
DBUG_PRINT
(
"info"
,
(
"Got pid %d"
,
pid
));
/* Tell server to shutdown */
if
(
mysql_shutdown
(
&
cur_con
->
mysql
,
SHUTDOWN_DEFAULT
))
/* Tell server to shutdown
if timeout > 0
*/
if
(
timeout
&&
mysql_shutdown
(
&
cur_con
->
mysql
,
SHUTDOWN_DEFAULT
))
die
(
"mysql_shutdown failed"
);
/* Check that server dies */
...
...
@@ -7311,13 +7311,13 @@ int main(int argc, char **argv)
case
Q_PING
:
handle_command_error
(
command
,
mysql_ping
(
&
cur_con
->
mysql
));
break
;
case
Q_SHUTDOWN
:
case
Q_S
END_S
HUTDOWN
:
handle_command_error
(
command
,
mysql_shutdown
(
&
cur_con
->
mysql
,
SHUTDOWN_DEFAULT
));
break
;
case
Q_
KILL
_SERVER
:
do_
kill
_server
(
command
);
case
Q_
SHUTDOWN
_SERVER
:
do_
shutdown
_server
(
command
);
break
;
case
Q_EXEC
:
do_exec
(
command
);
...
...
mysql-test/include/restart_mysqld.inc
View file @
206e1dc6
...
...
@@ -6,7 +6,7 @@ EOF
# Send shutdown to the connected server and give
# it 10 seconds to die before zapping it
kill
_server
10
;
shutdown
_server
10
;
# Turn on reconnect
...
...
mysql-test/mysql-test-run.pl
View file @
206e1dc6
...
...
@@ -1303,6 +1303,18 @@ sub remove_stale_vardir () {
mtr_error
("
No, don't remove the vardir when running with --extern
")
if
using_extern
();
my
$tmpdir
=
"
$opt_vardir
/tmp
";
if
(
-
l
$tmpdir
)
{
# var/tmp is a symlink
mtr_verbose
("
Removing
"
.
readlink
(
$tmpdir
));
rmtree
(
readlink
(
$tmpdir
));
# Remove the "tmp" symlink
mtr_verbose
("
unlink(
$tmpdir
)
");
unlink
(
$tmpdir
);
}
mtr_verbose
("
opt_vardir:
$opt_vardir
");
if
(
$opt_vardir
eq
$default_vardir
)
{
...
...
@@ -1422,8 +1434,12 @@ sub setup_vardir() {
mkpath
("
$opt_vardir
/log
");
mkpath
("
$opt_vardir
/run
");
mkpath
("
$opt_vardir
/tmp
");
mkpath
(
$opt_tmpdir
)
if
$opt_tmpdir
ne
"
$opt_vardir
/tmp
";
mkpath
(
$opt_tmpdir
);
if
(
$opt_tmpdir
ne
"
$opt_vardir
/tmp
"){
mtr_report
("
- symlinking 'var/tmp' to '
$opt_tmpdir
'
");
symlink
(
$opt_tmpdir
,
"
$opt_vardir
/tmp
");
}
# copy all files from std_data into var/std_data
# and make them writable
...
...
@@ -2701,7 +2717,7 @@ sub after_test_failure ($) {
}
}
# Remove all files in
var/tmp
# Remove all files in
the tmpdir
rmtree
(
$opt_tmpdir
);
mkpath
(
$opt_tmpdir
);
...
...
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