Commit 4fca6351 authored by Michael Widenius's avatar Michael Widenius

Fixed some test failures after last push (failing tests and valgrind warnings)

Added --strace support to mysql-test-run

mysql-test/mysql-test-run.pl:
  Added support for --strace (usefull for example to check how much memory mysqld was using)
mysql-test/suite/funcs_1/t/is_engines_innodb.test:
  Fixed test case to also work with xtradb
mysql-test/suite/innodb_plugin/t/innodb.test:
  Don't run if we don't have the used character sets.
mysql-test/suite/innodb_plugin/t/innodb_mysql.test:
  Don't run if we don't have the used character sets.
sql/sql_show.cc:
  Extended comment to 160 characters to get full comment from xtradb
storage/xtradb/handler/ha_innodb.cc:
  Fixed valgrind warning.
parent 9dc548b3
......@@ -234,10 +234,12 @@ my $opt_strace_client;
our $opt_user = "root";
my $opt_valgrind= 0;
our $opt_valgrind_mysqld= 0;
my $opt_valgrind_mysqltest= 0;
my @default_valgrind_args= ("--show-reachable=yes");
my @valgrind_args;
our $opt_valgrind_mysqld= 0;
my $opt_valgrind_mysqltest= 0;
my $opt_strace= 0;
my @strace_args;
my $opt_valgrind_path;
my $opt_callgrind;
my %mysqld_logs;
......@@ -929,7 +931,9 @@ sub command_line_setup {
'manual-ddd' => \$opt_manual_ddd,
'debugger=s' => \$opt_debugger,
'client-debugger=s' => \$opt_client_debugger,
'strace' => \$opt_strace,
'strace-client:s' => \$opt_strace_client,
'strace-option=s' => \@strace_args,
'max-save-core=i' => \$opt_max_save_core,
'max-save-datadir=i' => \$opt_max_save_datadir,
'max-test-fail=i' => \$opt_max_test_fail,
......@@ -1473,6 +1477,11 @@ sub command_line_setup {
join(" ", @valgrind_args), "\"");
}
if (@strace_args)
{
$opt_strace=1;
}
# InnoDB does not bother to do individual de-allocations at exit. Instead it
# relies on a custom allocator to track every allocation, and frees all at
# once during exit.
......@@ -1724,9 +1733,9 @@ sub executable_setup () {
if ( -x "../libtool")
{
$exe_libtool= "../libtool";
if ($opt_valgrind or $glob_debugger)
if ($opt_valgrind or $glob_debugger or $opt_strace)
{
mtr_report("Using \"$exe_libtool\" when running valgrind or debugger");
mtr_report("Using \"$exe_libtool\" when running valgrind, strace or debugger");
}
}
......@@ -4636,6 +4645,10 @@ sub mysqld_start ($$) {
{
valgrind_arguments($args, \$exe);
}
if ( $opt_strace)
{
strace_arguments($args, \$exe, $mysqld->name());
}
mtr_add_arg($args, "--defaults-group-suffix=%s", $mysqld->after('mysqld'));
mysqld_arguments($args,$mysqld,$extra_opts);
......@@ -5575,6 +5588,33 @@ sub valgrind_arguments {
}
}
#
# Modify the exe and args so that program is run in strace
#
sub strace_arguments {
my $args= shift;
my $exe= shift;
my $mysqld_name= shift;
mtr_add_arg($args, "-f");
mtr_add_arg($args, "-o%s/var/log/%s.strace", $glob_mysql_test_dir, $mysqld_name);
# Add strace options, can be overriden by user
mtr_add_arg($args, '%s', $_) for (@strace_args);
mtr_add_arg($args, $$exe);
$$exe= "strace";
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;
}
}
#
# Usage
......@@ -5702,9 +5742,6 @@ Options for debugging the product
test(s)
manual-ddd Let user manually start mysqld in ddd, before running
test(s)
strace-client=[path] Create strace output for mysqltest client, optionally
specifying name and path to the trace program to use.
Example: $0 --strace-client=ktrace
max-save-core Limit the number of core files saved (to avoid filling
up disks for heavily crashing server). Defaults to
$opt_max_save_core, set to 0 for no limit. Set
......@@ -5732,6 +5769,15 @@ Options for valgrind
valgrind-path=<EXE> Path to the valgrind executable
callgrind Instruct valgrind to use callgrind
Options for strace
strace Run the "mysqld" executables using strace. Default
options are -f -o var/log/'mysqld-name'.strace
strace-option=ARGS Option to give strace, replaces default option(s),
strace-client=[path] Create strace output for mysqltest client, optionally
specifying name and path to the trace program to use.
Example: $0 --strace-client=ktrace
Misc options
user=USER User for connecting to mysqld(default: $opt_user)
comment=STR Write STR to the output
......
......@@ -11,5 +11,6 @@
let $engine_type= InnoDB;
--source include/have_innodb.inc
--vertical_results
--replace_regex /XtraDB engine based on InnoDB plugin. //
eval SELECT * FROM information_schema.engines
WHERE ENGINE = '$engine_type';
......@@ -16,6 +16,8 @@
-- source include/have_innodb_plugin.inc
let $MYSQLD_DATADIR= `select @@datadir`;
let collation=utf8_unicode_ci;
--source include/have_collation.inc
# Save the original values of some variables in order to be able to
# estimate how much they have changed during the tests. Previously this
......
......@@ -2,10 +2,12 @@
#
# Last update:
# 2006-07-26 ML test refactored (MySQL 5.1)
# main testing code t/innodb_mysql.test -> include/mix1.inc
# main testing code t/innodb_mysql.test -> include/mix1.inc
#
-- source include/have_innodb_plugin.inc
-- source include/have_query_cache.inc
let $engine_type= InnoDB;
let $other_engine_type= MEMORY;
# InnoDB does support FOREIGN KEYFOREIGN KEYs
......
......@@ -6331,7 +6331,7 @@ ST_FIELD_INFO engines_fields_info[]=
{
{"ENGINE", 64, MYSQL_TYPE_STRING, 0, 0, "Engine", SKIP_OPEN_TABLE},
{"SUPPORT", 8, MYSQL_TYPE_STRING, 0, 0, "Support", SKIP_OPEN_TABLE},
{"COMMENT", 80, MYSQL_TYPE_STRING, 0, 0, "Comment", SKIP_OPEN_TABLE},
{"COMMENT", 160, MYSQL_TYPE_STRING, 0, 0, "Comment", SKIP_OPEN_TABLE},
{"TRANSACTIONS", 3, MYSQL_TYPE_STRING, 0, 1, "Transactions", SKIP_OPEN_TABLE},
{"XA", 3, MYSQL_TYPE_STRING, 0, 1, "XA", SKIP_OPEN_TABLE},
{"SAVEPOINTS", 3 ,MYSQL_TYPE_STRING, 0, 1, "Savepoints", SKIP_OPEN_TABLE},
......
......@@ -3502,7 +3502,7 @@ ha_innobase::open(
sql_print_error("Table %s has a primary key in InnoDB data "
"dictionary, but not in MySQL!", name);
}
prebuilt->clust_index_was_generated = FALSE;
/* MySQL allocates the buffer for ref. key_info->key_length
......@@ -3511,7 +3511,8 @@ ha_innobase::open(
save space, because all row reference buffers are allocated
based on ref_length. */
ref_length = table->key_info[primary_key].key_length;
if (primary_key < MAX_KEY)
ref_length = table->key_info[primary_key].key_length;
} else {
if (primary_key != MAX_KEY) {
sql_print_error("Table %s has no primary key in InnoDB data "
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment