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
21f0adc7
Commit
21f0adc7
authored
Feb 28, 2006
by
paul@snake-hub.snake.net
Browse files
Options
Browse Files
Download
Plain Diff
Merge paul@bk-internal.mysql.com:/home/bk/mysql-5.0
into snake-hub.snake.net:/src/extern/MySQL/bk/mysql-5.0
parents
f641a919
5ac33e8e
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
35 additions
and
27 deletions
+35
-27
client/mysqltest.c
client/mysqltest.c
+26
-24
mysql-test/README
mysql-test/README
+1
-1
mysql-test/mysql-test-run.sh
mysql-test/mysql-test-run.sh
+2
-2
mysql-test/r/mysqltest.result
mysql-test/r/mysqltest.result
+2
-0
mysql-test/t/mysqltest.test
mysql-test/t/mysqltest.test
+4
-0
No files found.
client/mysqltest.c
View file @
21f0adc7
...
...
@@ -115,7 +115,7 @@ enum {OPT_MANAGER_USER=256,OPT_MANAGER_HOST,OPT_MANAGER_PASSWD,
The list of error codes to --error are stored in an internal array of
structs. This struct can hold numeric SQL error codes or SQLSTATE codes
as strings. The element next to the last active element in the list is
set to type ERR_EMPTY. When an SQL statement return
an error
we use
set to type ERR_EMPTY. When an SQL statement return
s an error,
we use
this list to check if this is an expected error.
*/
...
...
@@ -345,13 +345,6 @@ const char *command_names[]=
"connection"
,
"query"
,
"connect"
,
/* the difference between sleep and real_sleep is that sleep will use
the delay from command line (--sleep) if there is one.
real_sleep always uses delay from mysqltest's command line argument.
the logic is that sometimes delays are cpu-dependent (and --sleep
can be used to set this delay. real_sleep is used for cpu-independent
delays
*/
"sleep"
,
"real_sleep"
,
"inc"
,
...
...
@@ -1045,8 +1038,8 @@ int do_source(struct st_query *query)
*
p
++=
0
;
query
->
last_argument
=
p
;
/*
If this file has already been sourced, dont source it again.
It's already available in the q_lines cache
If this file has already been sourced, don
'
t source it again.
It's already available in the q_lines cache
.
*/
if
(
parser
.
current_line
<
(
parser
.
read_lines
-
1
))
return
0
;
...
...
@@ -1370,7 +1363,7 @@ int do_modify_var(struct st_query *query, const char *name,
system <command>
Eval the query to expand any $variables in the command.
Execute the command with
e
the "system" command.
Execute the command with the "system" command.
NOTE
If mysqltest is executed from cygwin shell, the command will be
...
...
@@ -1633,11 +1626,19 @@ int do_disable_rpl_parse(struct st_query *query __attribute__((unused)))
do_sleep()
q called command
real_sleep use the value from opt_sleep as number of seconds to sleep
if real_sleep is false
DESCRIPTION
sleep <seconds>
real_sleep
real_sleep <seconds>
The difference between the sleep and real_sleep commands is that sleep
uses the delay from the --sleep command-line option if there is one.
(If the --sleep option is not given, the sleep command uses the delay
specified by its argument.) The real_sleep command always uses the
delay specified by its argument. The logic is that sometimes delays are
cpu-dependent, and --sleep can be used to set this delay. real_sleep is
used for cpu-independent delays.
*/
int
do_sleep
(
struct
st_query
*
query
,
my_bool
real_sleep
)
...
...
@@ -1646,18 +1647,19 @@ int do_sleep(struct st_query *query, my_bool real_sleep)
char
*
p
=
query
->
first_argument
;
char
*
sleep_start
,
*
sleep_end
=
query
->
end
;
double
sleep_val
;
char
*
cmd
=
(
real_sleep
?
"real_sleep"
:
"sleep"
);
while
(
my_isspace
(
charset_info
,
*
p
))
p
++
;
if
(
!*
p
)
die
(
"Missing argument to
sleep"
);
die
(
"Missing argument to
%s"
,
cmd
);
sleep_start
=
p
;
/* Check that arg starts with a digit, not handled by my_strtod */
if
(
!
my_isdigit
(
charset_info
,
*
sleep_start
))
die
(
"Invalid argument to
sleep
\"
%s
\"
"
,
query
->
first_argument
);
die
(
"Invalid argument to
%s
\"
%s
\"
"
,
cmd
,
query
->
first_argument
);
sleep_val
=
my_strtod
(
sleep_start
,
&
sleep_end
,
&
error
);
if
(
error
)
die
(
"Invalid argument to
sleep
\"
%s
\"
"
,
query
->
first_argument
);
die
(
"Invalid argument to
%s
\"
%s
\"
"
,
cmd
,
query
->
first_argument
);
/* Fixed sleep time selected by --sleep option */
if
(
opt_sleep
&&
!
real_sleep
)
...
...
@@ -2099,7 +2101,7 @@ int safe_connect(MYSQL* mysql, const char *host, const char *user,
/*
Connect to a server and handle connection errors in case
when
they occur.
Connect to a server and handle connection errors in case they occur.
SYNOPSIS
connect_n_handle_errors()
...
...
@@ -2534,7 +2536,7 @@ my_bool end_of_query(int c)
Normally that means it will read lines until it reaches the
"delimiter" that marks end of query. Default delimiter is ';'
The function should be smart enough not to detect delimiter's
found inside strings s
o
rrounded with '"' and '\'' escaped strings.
found inside strings s
u
rrounded with '"' and '\'' escaped strings.
If the first line in a query starts with '#' or '-' this line is treated
as a comment. A comment is always terminated when end of line '\n' is
...
...
@@ -2819,7 +2821,7 @@ static struct my_option my_long_options[] =
{
"compress"
,
'C'
,
"Use the compressed server/client protocol."
,
(
gptr
*
)
&
opt_compress
,
(
gptr
*
)
&
opt_compress
,
0
,
GET_BOOL
,
NO_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"cursor-protocol"
,
OPT_CURSOR_PROTOCOL
,
"Use cursors for prepared stat
ment
"
,
{
"cursor-protocol"
,
OPT_CURSOR_PROTOCOL
,
"Use cursors for prepared stat
ements.
"
,
(
gptr
*
)
&
cursor_protocol
,
(
gptr
*
)
&
cursor_protocol
,
0
,
GET_BOOL
,
NO_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"database"
,
'D'
,
"Database to use."
,
(
gptr
*
)
&
db
,
(
gptr
*
)
&
db
,
0
,
...
...
@@ -2861,7 +2863,7 @@ static struct my_option my_long_options[] =
{
"result-file"
,
'R'
,
"Read/Store result from/in this file."
,
(
gptr
*
)
&
result_file
,
(
gptr
*
)
&
result_file
,
0
,
GET_STR
,
REQUIRED_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"server-arg"
,
'A'
,
"Send
enbedded server this as a paramen
ter."
,
{
"server-arg"
,
'A'
,
"Send
option value to embedded server as a parame
ter."
,
0
,
0
,
0
,
GET_STR
,
REQUIRED_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"server-file"
,
'F'
,
"Read embedded server arguments from file."
,
0
,
0
,
0
,
GET_STR
,
REQUIRED_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
...
...
@@ -4315,7 +4317,7 @@ void get_query_type(struct st_query* q)
q
->
type
=
(
enum
enum_commands
)
type
;
/* Found command */
/*
If queries are disabled, only recognize
--enable
-queries and --disable-queries
--enable
_parsing and --disable_parsing
*/
if
(
parsing_disabled
&&
q
->
type
!=
Q_ENABLE_PARSING
&&
q
->
type
!=
Q_DISABLE_PARSING
)
...
...
@@ -4813,8 +4815,8 @@ int main(int argc, char **argv)
/*
my_stat() successful on result file. Check if we have not run a
single query, but we do have a result file that contains data.
Note that we don't care, if my_stat() fails. For example
for
non-existing or non-readable file we assume it's fine to have
Note that we don't care, if my_stat() fails. For example
, for a
non-existing or non-readable file
,
we assume it's fine to have
no query output from the test file, e.g. regarded as no error.
*/
die
(
"No queries executed but result file found!"
);
...
...
mysql-test/README
View file @
21f0adc7
...
...
@@ -21,7 +21,7 @@ conflict with it.
All tests must pass. If one or more of them fail on your system, please
read the following manual section of how to report the problem:
http://dev.mysql.com/doc/mysql/en/
MySQL_test_
suite.html
http://dev.mysql.com/doc/mysql/en/
mysql-test-
suite.html
You can create your own test cases. To create a test case:
...
...
mysql-test/mysql-test-run.sh
View file @
21f0adc7
...
...
@@ -894,7 +894,7 @@ show_failed_diff ()
$DIFF
-c
$result_file
$reject_file
echo
"-------------------------------------------------------"
echo
"Please follow the instructions outlined at"
echo
"http://
www.mysql.com/doc/en/Reporting_mysqltest_
bugs.html"
echo
"http://
dev.mysql.com/doc/mysql/en/reporting-mysqltest-
bugs.html"
echo
"to find the reason to this problem and how to report this."
echo
""
fi
...
...
@@ -990,7 +990,7 @@ report_stats () {
$ECHO
"The log files in
$MY_LOG_DIR
may give you some hint"
$ECHO
"of what went wrong."
$ECHO
"If you want to report this error, please read first the documentation at"
$ECHO
"http://
www.mysql.com/doc/en/MySQL_test_
suite.html"
$ECHO
"http://
dev.mysql.com/doc/mysql/en/mysql-test-
suite.html"
fi
if
[
$USE_RUNNING_SERVER
-eq
0
]
...
...
mysql-test/r/mysqltest.result
View file @
21f0adc7
...
...
@@ -297,7 +297,9 @@ here is the sourced script
In loop
here is the sourced script
mysqltest: At line 1: Missing argument to sleep
mysqltest: At line 1: Missing argument to real_sleep
mysqltest: At line 1: Invalid argument to sleep "abc"
mysqltest: At line 1: Invalid argument to real_sleep "abc"
1
2
101
...
...
mysql-test/t/mysqltest.test
View file @
21f0adc7
...
...
@@ -667,10 +667,14 @@ real_sleep 1;
# Missing parameter
--
error
1
--
exec
echo
"sleep ;"
|
$MYSQL_TEST
2
>&
1
--
error
1
--
exec
echo
"real_sleep ;"
|
$MYSQL_TEST
2
>&
1
# Illegal parameter
--
error
1
--
exec
echo
"sleep abc;"
|
$MYSQL_TEST
2
>&
1
--
error
1
--
exec
echo
"real_sleep abc;"
|
$MYSQL_TEST
2
>&
1
# ----------------------------------------------------------------------------
# Test inc
...
...
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