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
584ce077
Commit
584ce077
authored
Sep 28, 2010
by
Bjorn Munch
Browse files
Options
Browse Files
Download
Plain Diff
upmerge 56125,56921
parents
b76c598e
841f3ac6
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
71 additions
and
24 deletions
+71
-24
client/mysqltest.cc
client/mysqltest.cc
+33
-0
mysql-test/mysql-test-run.pl
mysql-test/mysql-test-run.pl
+15
-7
mysql-test/r/mysqltest.result
mysql-test/r/mysqltest.result
+6
-2
mysql-test/t/mysqltest.test
mysql-test/t/mysqltest.test
+17
-15
No files found.
client/mysqltest.cc
View file @
584ce077
...
...
@@ -112,6 +112,7 @@ static my_bool parsing_disabled= 0;
static
my_bool
display_result_vertically
=
FALSE
,
display_result_lower
=
FALSE
,
display_metadata
=
FALSE
,
display_result_sorted
=
FALSE
;
static
my_bool
disable_query_log
=
0
,
disable_result_log
=
0
;
static
my_bool
disable_connect_log
=
1
;
static
my_bool
disable_warnings
=
0
;
static
my_bool
disable_info
=
1
;
static
my_bool
abort_on_error
=
1
;
...
...
@@ -285,6 +286,7 @@ enum enum_commands {
Q_EVAL_RESULT
,
Q_ENABLE_QUERY_LOG
,
Q_DISABLE_QUERY_LOG
,
Q_ENABLE_RESULT_LOG
,
Q_DISABLE_RESULT_LOG
,
Q_ENABLE_CONNECT_LOG
,
Q_DISABLE_CONNECT_LOG
,
Q_WAIT_FOR_SLAVE_TO_STOP
,
Q_ENABLE_WARNINGS
,
Q_DISABLE_WARNINGS
,
Q_ENABLE_INFO
,
Q_DISABLE_INFO
,
...
...
@@ -350,6 +352,8 @@ const char *command_names[]=
/* Enable/disable that the _result_ from a query is logged to result file */
"enable_result_log"
,
"disable_result_log"
,
"enable_connect_log"
,
"disable_connect_log"
,
"wait_for_slave_to_stop"
,
"enable_warnings"
,
"disable_warnings"
,
...
...
@@ -4836,6 +4840,16 @@ void select_connection_name(const char *name)
set_current_connection
(
con
);
/* Connection logging if enabled */
if
(
!
disable_connect_log
&&
!
disable_query_log
)
{
DYNAMIC_STRING
*
ds
=
&
ds_res
;
dynstr_append_mem
(
ds
,
"connection "
,
11
);
replace_dynstr_append
(
ds
,
name
);
dynstr_append_mem
(
ds
,
";
\n
"
,
2
);
}
DBUG_VOID_RETURN
;
}
...
...
@@ -4923,6 +4937,16 @@ void do_close_connection(struct st_command *command)
var_set_string
(
"$CURRENT_CONNECTION"
,
con
->
name
);
}
/* Connection logging if enabled */
if
(
!
disable_connect_log
&&
!
disable_query_log
)
{
DYNAMIC_STRING
*
ds
=
&
ds_res
;
dynstr_append_mem
(
ds
,
"disconnect "
,
11
);
replace_dynstr_append
(
ds
,
ds_connection
.
str
);
dynstr_append_mem
(
ds
,
";
\n
"
,
2
);
}
DBUG_VOID_RETURN
;
}
...
...
@@ -5057,6 +5081,13 @@ int connect_n_handle_errors(struct st_command *command,
dynstr_append_mem
(
ds
,
delimiter
,
delimiter_length
);
dynstr_append_mem
(
ds
,
"
\n
"
,
1
);
}
/* Simlified logging if enabled */
if
(
!
disable_connect_log
&&
!
disable_query_log
)
{
replace_dynstr_append
(
ds
,
command
->
query
);
dynstr_append_mem
(
ds
,
";
\n
"
,
2
);
}
while
(
!
mysql_real_connect
(
con
,
host
,
user
,
pass
,
db
,
port
,
sock
?
sock
:
0
,
CLIENT_MULTI_STATEMENTS
))
{
...
...
@@ -8127,6 +8158,8 @@ int main(int argc, char **argv)
case
Q_DISABLE_ABORT_ON_ERROR
:
abort_on_error
=
0
;
break
;
case
Q_ENABLE_RESULT_LOG
:
disable_result_log
=
0
;
break
;
case
Q_DISABLE_RESULT_LOG
:
disable_result_log
=
1
;
break
;
case
Q_ENABLE_CONNECT_LOG
:
disable_connect_log
=
0
;
break
;
case
Q_DISABLE_CONNECT_LOG
:
disable_connect_log
=
1
;
break
;
case
Q_ENABLE_WARNINGS
:
disable_warnings
=
0
;
break
;
case
Q_DISABLE_WARNINGS
:
disable_warnings
=
1
;
break
;
case
Q_ENABLE_INFO
:
disable_info
=
0
;
break
;
...
...
mysql-test/mysql-test-run.pl
View file @
584ce077
...
...
@@ -126,12 +126,24 @@ my $path_vardir_trace; # unix formatted opt_vardir for trace files
my
$opt_tmpdir
;
# Path to use for tmp/ dir
my
$opt_tmpdir_pid
;
my
$opt_start
;
my
$opt_start_dirty
;
my
$opt_start_exit
;
my
$start_only
;
END
{
if
(
defined
$opt_tmpdir_pid
and
$opt_tmpdir_pid
==
$$
)
{
# Remove the tempdir this process has created
mtr_verbose
("
Removing tmpdir '
$opt_tmpdir
");
rmtree
(
$opt_tmpdir
);
if
(
!
$opt_start_exit
)
{
# Remove the tempdir this process has created
mtr_verbose
("
Removing tmpdir
$opt_tmpdir
");
rmtree
(
$opt_tmpdir
);
}
else
{
mtr_warning
("
tmpdir
$opt_tmpdir
should be removed after the server has finished
");
}
}
}
...
...
@@ -234,10 +246,6 @@ my $opt_start_timeout = $ENV{MTR_START_TIMEOUT} || 180; # seconds
sub
suite_timeout
{
return
$opt_suite_timeout
*
60
;
};
sub
check_timeout
{
return
$opt_testcase_timeout
*
6
;
};
my
$opt_start
;
my
$opt_start_dirty
;
my
$opt_start_exit
;
my
$start_only
;
my
$opt_wait_all
;
my
$opt_user_args
;
my
$opt_repeat
=
1
;
...
...
mysql-test/r/mysqltest.result
View file @
584ce077
...
...
@@ -453,12 +453,16 @@ mysqltest: At line 1: Missing required argument 'host' to command 'connect'
mysqltest: At line 1: query 'connect con2,localhost,root,,illegal_db' failed: 1049: Unknown database 'illegal_db'
mysqltest: At line 1: Illegal argument for port: 'illegal_port'
mysqltest: At line 1: Illegal option to connect: SMTP
OK
mysqltest: The test didn't produce any output
200 connects succeeded
mysqltest: In included file "MYSQLTEST_VARDIR/tmp/mysqltest.sql": At line 3: connection 'test_con1' not found in connection pool
mysqltest: In included file "MYSQLTEST_VARDIR/tmp/mysqltest.sql": At line 2: Connection test_con1 already exists
show tables;
ERROR 3D000: No database selected
connect con1,localhost,root,,;
connection default;
connection con1;
disconnect con1;
connection default;
Output from mysqltest-x.inc
Output from mysqltest-x.inc
Output from mysqltest-x.inc
...
...
mysql-test/t/mysqltest.test
View file @
584ce077
...
...
@@ -1468,19 +1468,6 @@ eval select "$long_rep" as x;
--
error
1
--
exec
echo
"connect (con1,localhost,root,,,,,SMTP POP);"
|
$MYSQL_TEST
2
>&
1
# Repeat connect/disconnect
--
write_file
$MYSQLTEST_VARDIR
/
tmp
/
mysqltest
.
sql
let
$i
=
100
;
while
(
$i
)
{
connect
(
test_con1
,
localhost
,
root
,,);
disconnect
test_con1
;
dec
$i
;
}
EOF
--
exec
echo
"source
$MYSQLTEST_VARDIR
/tmp/mysqltest.sql; echo OK; exit;"
|
$MYSQL_TEST
2
>&
1
remove_file
$MYSQLTEST_VARDIR
/
tmp
/
mysqltest
.
sql
;
# Repeat connect/disconnect
--
write_file
$MYSQLTEST_VARDIR
/
tmp
/
mysqltest
.
sql
let
$i
=
200
;
...
...
@@ -1490,9 +1477,8 @@ while ($i)
disconnect
test_con1
;
dec
$i
;
}
echo
200
connects
succeeded
;
EOF
--
replace_result
$MYSQLTEST_VARDIR
MYSQLTEST_VARDIR
--
error
1
--
exec
echo
"source
$MYSQLTEST_VARDIR
/tmp/mysqltest.sql;"
|
$MYSQL_TEST
2
>&
1
remove_file
$MYSQLTEST_VARDIR
/
tmp
/
mysqltest
.
sql
;
...
...
@@ -1533,6 +1519,22 @@ show tables;
disconnect
con2
;
connection
default
;
# Test enable_connect_log
--
enable_connect_log
connect
(
con1
,
localhost
,
root
,,);
connection
default
;
connection
con1
;
--
disable_query_log
# These should not be logged
connect
(
con2
,
localhost
,
root
,,
*
NO
-
ONE
*
);
connection
con2
;
disconnect
con2
;
connection
con1
;
--
enable_query_log
disconnect
con1
;
connection
default
;
--
disable_connect_log
# ----------------------------------------------------------------------------
# Test mysqltest arguments
# ----------------------------------------------------------------------------
...
...
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