diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 1ebf554e1fd..f4274b7a474 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -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= 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 diff --git a/mysql-test/suite/funcs_1/t/is_engines_innodb.test b/mysql-test/suite/funcs_1/t/is_engines_innodb.test index 6c20b9697f0..44c7d7652d7 100644 --- a/mysql-test/suite/funcs_1/t/is_engines_innodb.test +++ b/mysql-test/suite/funcs_1/t/is_engines_innodb.test @@ -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'; diff --git a/mysql-test/suite/innodb_plugin/t/innodb.test b/mysql-test/suite/innodb_plugin/t/innodb.test index 5be5e6c4837..c6ae49d6e3b 100644 --- a/mysql-test/suite/innodb_plugin/t/innodb.test +++ b/mysql-test/suite/innodb_plugin/t/innodb.test @@ -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 diff --git a/mysql-test/suite/innodb_plugin/t/innodb_mysql.test b/mysql-test/suite/innodb_plugin/t/innodb_mysql.test index 3f6d9d96bb8..5adaba43050 100644 --- a/mysql-test/suite/innodb_plugin/t/innodb_mysql.test +++ b/mysql-test/suite/innodb_plugin/t/innodb_mysql.test @@ -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 diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 7db10019c97..b79e01f5ef4 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -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}, diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc index ce89d4ef57c..cbac193a0cc 100644 --- a/storage/xtradb/handler/ha_innodb.cc +++ b/storage/xtradb/handler/ha_innodb.cc @@ -3502,7 +3502,7 @@ retry: 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 @@ retry: 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 "