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
a6d87b4c
Commit
a6d87b4c
authored
Oct 25, 2006
by
msvensson@neptunus.(none)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add valgrinding support for mysql_client_test
Fix two memory leaks in mysql_client_test
parent
49690815
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
44 deletions
+56
-44
mysql-test/mysql-test-run.pl
mysql-test/mysql-test-run.pl
+54
-44
tests/mysql_client_test.c
tests/mysql_client_test.c
+2
-0
No files found.
mysql-test/mysql-test-run.pl
View file @
a6d87b4c
...
...
@@ -975,7 +975,7 @@ sub command_line_setup () {
}
elsif
(
$opt_valgrind_mysqltest
)
{
mtr_report
("
Turning on valgrind for mysqltest only
");
mtr_report
("
Turning on valgrind for mysqltest
and mysql_client_test
only
");
$opt_valgrind
=
1
;
}
...
...
@@ -1507,6 +1507,47 @@ sub generate_cmdline_mysqldump ($) {
#
##############################################################################
sub
mysql_client_test_arguments
()
{
my
$exe
=
$exe_mysql_client_test
;
my
$args
;
mtr_init_args
(
\
$args
);
if
(
$opt_valgrind_mysqltest
)
{
valgrind_arguments
(
$args
,
\
$exe
);
}
mtr_add_arg
(
$args
,
"
--no-defaults
");
mtr_add_arg
(
$args
,
"
--testcase
");
mtr_add_arg
(
$args
,
"
--user=root
");
mtr_add_arg
(
$args
,
"
--port=
$master
->[0]->{'port'}
");
mtr_add_arg
(
$args
,
"
--socket=
$master
->[0]->{'path_sock'}
");
if
(
$mysql_version_id
>=
50000
)
{
mtr_add_arg
(
$args
,
"
--vardir=
$opt_vardir
")
}
if
(
$opt_debug
)
{
mtr_add_arg
(
$args
,
"
--debug=d:t:A,
$path_vardir_trace
/log/mysql_client_test.trace
");
}
if
(
$glob_use_embedded_server
)
{
mtr_add_arg
(
$args
,
"
-A --language=
$path_language
");
mtr_add_arg
(
$args
,
"
-A --datadir=
$slave
->[0]->{'path_myddir'}
");
mtr_add_arg
(
$args
,
"
-A --character-sets-dir=
$path_charsetsdir
");
}
return
join
("
",
$exe
,
@$args
);
}
# Note that some env is setup in spawn/run, in "mtr_process.pl"
sub
environment_setup
()
{
...
...
@@ -1758,30 +1799,7 @@ sub environment_setup () {
# ----------------------------------------------------
# Setup env so childs can execute mysql_client_test
# ----------------------------------------------------
my
$cmdline_mysql_client_test
=
"
$exe_mysql_client_test
--no-defaults --testcase --user=root
"
.
"
--port=
$master
->[0]->{'port'}
"
.
"
--socket=
$master
->[0]->{'path_sock'}
";
if
(
$mysql_version_id
>=
50000
)
{
$cmdline_mysql_client_test
.=
"
--vardir=
$opt_vardir
";
}
if
(
$opt_debug
)
{
$cmdline_mysql_client_test
.=
"
--debug=d:t:A,
$path_vardir_trace
/log/mysql_client_test.trace
";
}
if
(
$glob_use_embedded_server
)
{
$cmdline_mysql_client_test
.=
"
-A --language=
$path_language
"
.
"
-A --datadir=
$slave
->[0]->{'path_myddir'}
"
.
"
-A --character-sets-dir=
$path_charsetsdir
";
}
$ENV
{'
MYSQL_CLIENT_TEST
'}
=
$cmdline_mysql_client_test
;
$ENV
{'
MYSQL_CLIENT_TEST
'}
=
mysql_client_test_arguments
();
# ----------------------------------------------------
# Setup env so childs can execute mysql_fix_system_tables
...
...
@@ -3611,15 +3629,6 @@ sub mysqld_start ($$$) {
$wait_for_pid_file
=
0
;
}
if
(
$exe_libtool
and
$opt_valgrind
)
{
# Add "libtool --mode-execute"
# if running in valgrind(to avoid valgrinding bash)
unshift
(
@$args
,
"
--mode=execute
",
$exe
);
$exe
=
$exe_libtool
;
}
if
(
defined
$exe
)
{
$pid
=
mtr_spawn
(
$exe
,
$args
,
"",
...
...
@@ -4342,14 +4351,6 @@ sub run_mysqltest ($) {
debugger_arguments
(
\
$args
,
\
$exe
,
"
client
");
}
if
(
$exe_libtool
and
$opt_valgrind
)
{
# Add "libtool --mode-execute" before the test to execute
# if running in valgrind(to avoid valgrinding bash)
unshift
(
@$args
,
"
--mode=execute
",
$exe
);
$exe
=
$exe_libtool
;
}
if
(
$opt_check_testcases
)
{
foreach
my
$mysqld
(
@
{
$master
},
@
{
$slave
})
...
...
@@ -4575,6 +4576,14 @@ sub valgrind_arguments {
mtr_add_arg
(
$args
,
$$exe
);
$$exe
=
$opt_valgrind_path
||
"
valgrind
";
if
(
$exe_libtool
)
{
# Add "libtool --mode-execute" before the test to execute
# if running in valgrind(to avoid valgrinding bash)
unshift
(
@$args
,
"
--mode=execute
",
$$exe
);
$$exe
=
$exe_libtool
;
}
}
...
...
@@ -4687,7 +4696,8 @@ Options for coverage, profiling etc
valgrind Run the "mysqltest" and "mysqld" executables using
valgrind with options($default_valgrind_options)
valgrind-all Synonym for --valgrind
valgrind-mysqltest Run the "mysqltest" executable with valgrind
valgrind-mysqltest Run the "mysqltest" and "mysql_client_test" executable
with valgrind
valgrind-mysqld Run the "mysqld" executable with valgrind
valgrind-options=ARGS Options to give valgrind, replaces default options
valgrind-path=[EXE] Path to the valgrind executable
...
...
tests/mysql_client_test.c
View file @
a6d87b4c
...
...
@@ -11778,6 +11778,7 @@ static void test_bug11718()
printf
(
"return type: %s"
,
(
res
->
fields
[
0
].
type
==
MYSQL_TYPE_DATE
)
?
"DATE"
:
"not DATE"
);
DIE_UNLESS
(
res
->
fields
[
0
].
type
==
MYSQL_TYPE_DATE
);
mysql_free_result
(
res
);
rc
=
mysql_query
(
mysql
,
"drop table t1, t2"
);
myquery
(
rc
);
}
...
...
@@ -11849,6 +11850,7 @@ static void test_bug15613()
DIE_UNLESS
(
field
[
4
].
length
==
255
);
DIE_UNLESS
(
field
[
5
].
length
==
255
);
DIE_UNLESS
(
field
[
6
].
length
==
255
);
mysql_free_result
(
metadata
);
/* III. Cleanup */
rc
=
mysql_query
(
mysql
,
"drop table t1"
);
...
...
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