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