Commit 8af5e4f8 authored by unknown's avatar unknown

Merge maint1.mysql.com:/data/localhome/tsmith/bk/51

into  maint1.mysql.com:/data/localhome/tsmith/bk/maint/51


client/mysqldump.c:
  Auto merged
mysql-test/lib/mtr_cases.pl:
  Auto merged
mysql-test/lib/mtr_report.pl:
  Auto merged
mysql-test/r/mysqldump.result:
  Auto merged
mysql-test/suite/binlog/r/binlog_multi_engine.result:
  Auto merged
mysql-test/suite/binlog/t/binlog_multi_engine.test:
  Auto merged
mysql-test/suite/ndb/r/ndb_read_multi_range.result:
  Auto merged
mysql-test/suite/ndb/r/ndb_sp.result:
  Auto merged
mysql-test/suite/ndb/r/ndb_trigger.result:
  Auto merged
mysql-test/suite/ndb/r/ps_7ndb.result:
  Auto merged
mysql-test/suite/ndb/t/loaddata_autocom_ndb.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_alter_table.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_alter_table2.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_alter_table3.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_autodiscover.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_autodiscover2.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_autodiscover3.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_basic.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_binlog_ddl_multi.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_binlog_log_bin.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_binlog_multi.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_bitfield.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_blob.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_blob_partition.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_cache.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_cache2.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_cache_multi.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_cache_multi2.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_charset.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_condition_pushdown.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_config.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_config2.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_cursor.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_database.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_dd_alter.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_dd_backuprestore.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_dd_basic.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_dd_ddl.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_dd_disk2memory.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_dd_dump.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_dd_sql_features.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_gis.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_index.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_index_ordered.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_index_unique.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_insert.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_limit.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_loaddatalocal.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_lock.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_minmax.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_multi.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_partition_error.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_partition_key.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_partition_list.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_partition_range.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_read_multi_range.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_rename.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_replace.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_restore.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_restore_partition.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_restore_print.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_row_format.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_single_user.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_sp.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_subquery.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_temporary.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_transaction.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_trigger.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_truncate.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_types.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_update.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_view.test:
  Auto merged
mysql-test/suite/ndb/t/ndbapi.test:
  Auto merged
mysql-test/suite/ndb/t/ps_7ndb.test:
  Auto merged
mysql-test/suite/ndb/t/strict_autoinc_5ndb.test:
  Auto merged
mysql-test/suite/rpl/r/rpl_events.result:
  Auto merged
mysql-test/suite/rpl/r/rpl_replicate_do.result:
  Auto merged
mysql-test/suite/rpl/r/rpl_row_UUID.result:
  Auto merged
mysql-test/suite/rpl/r/rpl_sp.result:
  Auto merged
mysql-test/suite/rpl/r/rpl_switch_stm_row_mixed.result:
  Auto merged
mysql-test/suite/rpl/r/rpl_trigger.result:
  Auto merged
mysql-test/suite/rpl/r/rpl_view.result:
  Auto merged
mysql-test/suite/rpl_ndb/r/rpl_ndb_UUID.result:
  Auto merged
mysql-test/suite/rpl_ndb/r/rpl_ndb_dd_advance.result:
  Auto merged
mysql-test/suite/rpl_ndb/r/rpl_ndb_stm_innodb.result:
  Auto merged
mysql-test/suite/rpl_ndb/t/rpl_ndb_commit_afterflush.test:
  Auto merged
mysql-test/suite/rpl_ndb/t/rpl_ndb_dd_advance.test:
  Auto merged
mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb_trans.test:
  Auto merged
mysql-test/suite/rpl_ndb/t/rpl_ndb_stm_innodb-master.opt:
  Auto merged
mysql-test/suite/rpl_ndb/t/rpl_ndb_stm_innodb.test:
  Auto merged
mysql-test/t/sp.test:
  Auto merged
sql/Makefile.am:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/sql_class.h:
  Auto merged
mysql-test/t/disabled.def:
  manual merge
  (Will need to follow up with moving a few test cases around post-merge)
parents 8a09b19c e62a77be
......@@ -174,7 +174,7 @@ IF(EMBED_MANIFESTS)
ENDIF(NOT tmp_manifest)
# Set the processor architecture.
IF(CMAKE_GENERATOR MATCHES "Visual Studio 8 2005 Win64")
SET(PROCESSOR_ARCH "X64")
SET(PROCESSOR_ARCH "amd64")
ELSE(CMAKE_GENERATOR MATCHES "Visual Studio 8 2005 Win64")
SET(PROCESSOR_ARCH "X86")
ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 8 2005 Win64")
......
......@@ -709,6 +709,18 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
break;
case 'T':
opt_disable_keys=0;
if (strlen(argument) >= FN_REFLEN)
{
/*
This check is made because the some the file functions below
have FN_REFLEN sized stack allocated buffers and will cause
a crash even if the input destination buffer is large enough
to hold the output.
*/
die(EX_USAGE, "Input filename too long: %s", argument);
}
break;
case '#':
DBUG_PUSH(argument ? argument : default_dbug_option);
......@@ -2803,17 +2815,6 @@ static void dump_table(char *table, char *db)
{
char filename[FN_REFLEN], tmp_path[FN_REFLEN];
if (strlen(path) >= FN_REFLEN)
{
/*
This check is made because the some the file functions below
have FN_REFLEN sized stack allocated buffers and will cause
a crash even if the input destination buffer is large enough
to hold the output.
*/
die(EX_USAGE, "Input filename or options too long: %s", path);
}
/*
Convert the path to native os format
and resolve to the full filepath.
......
......@@ -968,7 +968,12 @@ typedef unsigned long uint32;
typedef unsigned long ulong; /* Short for unsigned long */
#endif
#ifndef longlong_defined
#if defined(HAVE_LONG_LONG) && SIZEOF_LONG != 8
/*
Using [unsigned] long long is preferable as [u]longlong because we use
[unsigned] long long unconditionally in many places,
for example in constants with [U]LL suffix.
*/
#if defined(HAVE_LONG_LONG) && SIZEOF_LONG_LONG == 8
typedef unsigned long long int ulonglong; /* ulong or unsigned long long */
typedef long long int longlong;
#else
......
......@@ -655,7 +655,8 @@ void **thd_ha_data(const MYSQL_THD thd, const struct handlerton *hton);
int thd_tx_isolation(const MYSQL_THD thd);
char *thd_security_context(MYSQL_THD thd, char *buffer, unsigned int length,
unsigned int max_query_len);
/* Increments the row counter, see THD::row_count */
void thd_inc_row_count(MYSQL_THD thd);
#ifdef __cplusplus
}
......
......@@ -52,8 +52,8 @@ dist-hook:
-$(INSTALL_DATA) $(srcdir)/t/*.imtest $(distdir)/t
$(INSTALL_DATA) $(srcdir)/t/*.sql $(distdir)/t
-$(INSTALL_DATA) $(srcdir)/t/*.disabled $(distdir)/t
$(INSTALL_DATA) $(srcdir)/t/*.opt $(srcdir)/t/*.slave-mi $(distdir)/t
$(INSTALL_SCRIPT) $(srcdir)/t/*.sh $(distdir)/t
-$(INSTALL_DATA) $(srcdir)/t/*.opt $(srcdir)/t/*.slave-mi $(distdir)/t
-$(INSTALL_SCRIPT) $(srcdir)/t/*.sh $(distdir)/t
$(INSTALL_DATA) $(srcdir)/extra/binlog_tests/*.test $(distdir)/extra/binlog_tests
$(INSTALL_DATA) $(srcdir)/extra/rpl_tests/*.test $(distdir)/extra/rpl_tests
-$(INSTALL_DATA) $(srcdir)/extra/binlog_tests/*.opt $(distdir)/extra/binlog_tests
......@@ -91,9 +91,9 @@ install-data-local:
-$(INSTALL_DATA) $(srcdir)/t/*.imtest $(DESTDIR)$(testdir)/t
$(INSTALL_DATA) $(srcdir)/t/*.sql $(DESTDIR)$(testdir)/t
-$(INSTALL_DATA) $(srcdir)/t/*.disabled $(DESTDIR)$(testdir)/t
$(INSTALL_DATA) $(srcdir)/t/*.opt $(DESTDIR)$(testdir)/t
$(INSTALL_SCRIPT) $(srcdir)/t/*.sh $(DESTDIR)$(testdir)/t
$(INSTALL_DATA) $(srcdir)/t/*.slave-mi $(DESTDIR)$(testdir)/t
-$(INSTALL_DATA) $(srcdir)/t/*.opt $(DESTDIR)$(testdir)/t
-$(INSTALL_SCRIPT) $(srcdir)/t/*.sh $(DESTDIR)$(testdir)/t
-$(INSTALL_DATA) $(srcdir)/t/*.slave-mi $(DESTDIR)$(testdir)/t
$(INSTALL_DATA) $(srcdir)/r/*.result $(DESTDIR)$(testdir)/r
$(INSTALL_DATA) $(srcdir)/r/*.require $(DESTDIR)$(testdir)/r
$(INSTALL_DATA) $(srcdir)/extra/binlog_tests/*.test $(DESTDIR)$(testdir)/extra/binlog_tests
......
......@@ -5,7 +5,6 @@
-- source include/have_log_bin.inc
-- source include/not_embedded.inc
-- source include/have_innodb.inc
-- source include/have_log_bin.inc
-- source include/have_debug.inc
--disable_warnings
......@@ -49,6 +48,129 @@ show binlog events in 'master-bin.000001' from 106;
--replace_regex /table_id: [0-9]+/table_id: #/ /\/\* xid=.* \*\//\/* xid= *\//
show binlog events in 'master-bin.000002' from 106;
#
# Bug#22540 - Incorrect value in column End_log_pos of
# SHOW BINLOG EVENTS using InnoDB
#
# the following tests will show that certain queries now return
# absolute offsets (from binlog start, rather than relative to
# the beginning of the current transaction). under what
# conditions it should be allowed / is sensible to put the
# slider into the middle of a transaction is not our concern
# here; we just guarantee that if and when it's done, the
# user has valid offsets to use. if the setter function still
# wants to throw a "positioning into middle of transaction"
# warning, that's its prerogative and handled elsewhere.
set @ac = @@autocommit;
# first show this to work for SHOW BINLOG EVENTS
set autocommit= 0;
reset master;
create table t1(n int) engine=innodb;
begin;
insert into t1 values (1);
insert into t1 values (2);
insert into t1 values (3);
commit;
drop table t1;
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ /Server ver: [^,]*,/Server version,/
show binlog events from 0;
set autocommit= 1;
reset master;
create table t1(n int) engine=innodb;
insert into t1 values (1);
insert into t1 values (2);
insert into t1 values (3);
commit;
drop table t1;
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ /Server ver: [^,]*,/Server version,/
show binlog events from 0;
reset master;
create table t1(n int) engine=myisam;
begin;
insert into t1 values (4);
insert into t1 values (5);
insert into t1 values (6);
commit;
drop table t1;
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ /Server ver: [^,]*,/Server version,/
show binlog events from 0;
# now show this also works for SHOW MASTER STATUS
# as this is what "mysqldump --master-data=1" uses.
set autocommit= 1;
reset master;
create table t1(n int) engine=innodb;
show master status;
insert into t1 values (1);
show master status;
insert into t1 values (2);
insert into t1 values (3);
show master status;
commit;
show master status;
drop table t1;
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ /Server ver: [^,]*,/Server version,/
show binlog events from 0;
set autocommit= 0;
reset master;
create table t1(n int) engine=myisam;
show master status;
insert into t1 values (4);
show master status;
insert into t1 values (5);
insert into t1 values (6);
show master status;
commit;
show master status;
drop table t1;
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ /Server ver: [^,]*,/Server version,/
show binlog events from 0;
set session autocommit = @ac;
# now show that nothing breaks if we need to read from the cache more
# than once, resulting in split event-headers
set @bcs = @@binlog_cache_size;
set @ac = @@autocommit;
set global binlog_cache_size=4096;
set autocommit= 0;
reset master;
create table t1 (a int) engine=innodb;
let $1=400;
disable_query_log;
begin;
while ($1)
{
eval insert into t1 values( $1 );
dec $1;
}
commit;
enable_query_log;
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ /Server ver: [^,]*,/Server version,/
show binlog events from 0;
drop table t1;
set global binlog_cache_size=@bcs;
set session autocommit = @ac;
--echo End of 5.0 tests
# Test of a too big SET INSERT_ID: see if the truncated value goes
# into binlog (right), or the too big value (wrong); we look at the
# binlog further down with SHOW BINLOG EVENTS.
......
-- require r/have_outfile.require
disable_query_log;
select load_file(concat(@tmpdir,"/outfile.test"));
--exec rm $MYSQLTEST_VARDIR/tmp/outfile.test
--remove_file $MYSQLTEST_VARDIR/tmp/outfile.test
enable_query_log;
......@@ -23,7 +23,8 @@ use IO::File();
use strict;
sub collect_test_cases ($);
sub collect_one_test_case ($$$$$$$);
sub collect_one_suite ($$);
sub collect_one_test_case ($$$$$$$$$);
sub mtr_options_from_test_file($$);
......@@ -34,7 +35,120 @@ sub mtr_options_from_test_file($$);
##############################################################################
sub collect_test_cases ($) {
my $suite= shift; # Test suite name
my $suites= shift; # Semicolon separated list of test suites
my $cases = []; # Array of hash
foreach my $suite (split(",", $suites))
{
collect_one_suite($suite, $cases);
}
if ( @::opt_cases )
{
# Check that the tests specified was found
# in at least one suite
foreach my $tname ( @::opt_cases )
{
my $found= 0;
foreach my $test ( @$cases )
{
if ( mtr_match_extension($test->{'name'}, $tname) )
{
$found= 1;
}
}
if ( not $found )
{
mtr_error("Could not find $tname in any suite");
}
}
}
if ( $::opt_reorder )
{
# Reorder the test cases in an order that will make them faster to run
my %sort_criteria;
# Make a mapping of test name to a string that represents how that test
# should be sorted among the other tests. Put the most important criterion
# first, then a sub-criterion, then sub-sub-criterion, et c.
foreach my $tinfo (@$cases)
{
my @criteria = ();
# Look for tests that muct be in run in a defined order
# that is defined by test having the same name except for
# the ending digit
# Put variables into hash
my $test_name= $tinfo->{'name'};
my $depend_on_test_name;
if ( $test_name =~ /^([\D]+)([0-9]{1})$/ )
{
my $base_name= $1;
my $idx= $2;
mtr_verbose("$test_name => $base_name idx=$idx");
if ( $idx > 1 )
{
$idx-= 1;
$base_name= "$base_name$idx";
mtr_verbose("New basename $base_name");
}
foreach my $tinfo2 (@$cases)
{
if ( $tinfo2->{'name'} eq $base_name )
{
mtr_verbose("found dependent test $tinfo2->{'name'}");
$depend_on_test_name=$base_name;
}
}
}
if ( defined $depend_on_test_name )
{
mtr_verbose("Giving $test_name same critera as $depend_on_test_name");
$sort_criteria{$test_name} = $sort_criteria{$depend_on_test_name};
}
else
{
#
# Append the criteria for sorting, in order of importance.
#
push(@criteria, "ndb=" . ($tinfo->{'ndb_test'} ? "1" : "0"));
# Group test with equal options together.
# Ending with "~" makes empty sort later than filled
push(@criteria, join("!", sort @{$tinfo->{'master_opt'}}) . "~");
$sort_criteria{$test_name} = join(" ", @criteria);
}
}
@$cases = sort {
$sort_criteria{$a->{'name'}} . $a->{'name'} cmp
$sort_criteria{$b->{'name'}} . $b->{'name'}; } @$cases;
if ( $::opt_script_debug )
{
# For debugging the sort-order
foreach my $tinfo (@$cases)
{
print("$sort_criteria{$tinfo->{'name'}} -> \t$tinfo->{'name'}\n");
}
}
}
return $cases;
}
sub collect_one_suite($$)
{
my $suite= shift; # Test suite name
my $cases= shift; # List of test cases
mtr_verbose("Collecting: $suite");
my $testdir;
my $resdir;
......@@ -50,12 +164,8 @@ sub collect_test_cases ($) {
$resdir= "$::glob_mysql_test_dir/suite/$suite/r";
}
my $cases = []; # Array of hash, will be array of C struct
opendir(TESTDIR, $testdir) or mtr_error("Can't open dir \"$testdir\": $!");
# ----------------------------------------------------------------------
# Disable some tests listed in disabled.def
# Build a hash of disabled testcases for this suite
# ----------------------------------------------------------------------
my %disabled;
if ( open(DISABLED, "$testdir/disabled.def" ) )
......@@ -71,11 +181,19 @@ sub collect_test_cases ($) {
close DISABLED;
}
# Read suite.opt file
my $suite_opt_file= "$testdir/suite.opt";
my $suite_opts= [];
if ( -f $suite_opt_file )
{
$suite_opts= mtr_get_opts_from_file($suite_opt_file);
}
if ( @::opt_cases )
{
# Collect in specified order, no sort
foreach my $tname ( @::opt_cases )
{
# Run in specified order, no sort
my $elem= undef;
my $component_id= undef;
......@@ -122,7 +240,8 @@ sub collect_test_cases ($) {
}
elsif ( ! $mysqld_test_exists and ! $im_test_exists )
{
mtr_error("Test case $tname is not found");
# Silently skip, could exist in another suite
next;
}
elsif ( $mysqld_test_exists )
{
......@@ -136,13 +255,15 @@ sub collect_test_cases ($) {
}
}
collect_one_test_case($testdir,$resdir,$tname,$elem,$cases,\%disabled,
$component_id);
collect_one_test_case($testdir,$resdir,$suite,$tname,
$elem,$cases,\%disabled,$component_id,
$suite_opts);
}
closedir TESTDIR;
}
else
{
opendir(TESTDIR, $testdir) or mtr_error("Can't open dir \"$testdir\": $!");
foreach my $elem ( sort readdir(TESTDIR) )
{
my $component_id= undef;
......@@ -165,87 +286,13 @@ sub collect_test_cases ($) {
next if $::opt_do_test and
! defined mtr_match_prefix($elem,$::opt_do_test);
collect_one_test_case($testdir,$resdir,$tname,$elem,$cases,\%disabled,
$component_id);
collect_one_test_case($testdir,$resdir,$suite,$tname,
$elem,$cases,\%disabled,$component_id,
$suite_opts);
}
closedir TESTDIR;
}
# Reorder the test cases in an order that will make them faster to run
if ( $::opt_reorder )
{
my %sort_criteria;
# Make a mapping of test name to a string that represents how that test
# should be sorted among the other tests. Put the most important criterion
# first, then a sub-criterion, then sub-sub-criterion, et c.
foreach my $tinfo (@$cases)
{
my @criteria = ();
# Look for tests that muct be in run in a defined order
# that is defined by test having the same name except for
# the ending digit
# Put variables into hash
my $test_name= $tinfo->{'name'};
my $depend_on_test_name;
if ( $test_name =~ /^([\D]+)([0-9]{1})$/ )
{
my $base_name= $1;
my $idx= $2;
mtr_verbose("$test_name => $base_name idx=$idx");
if ( $idx > 1 )
{
$idx-= 1;
$base_name= "$base_name$idx";
mtr_verbose("New basename $base_name");
}
foreach my $tinfo2 (@$cases)
{
if ( $tinfo2->{'name'} eq $base_name )
{
mtr_verbose("found dependent test $tinfo2->{'name'}");
$depend_on_test_name=$base_name;
}
}
}
if ( defined $depend_on_test_name )
{
mtr_verbose("Giving $test_name same critera as $depend_on_test_name");
$sort_criteria{$test_name} = $sort_criteria{$depend_on_test_name};
}
else
{
#
# Append the criteria for sorting, in order of importance.
#
push(@criteria, "ndb=" . ($tinfo->{'ndb_test'} ? "1" : "0"));
# Group test with equal options together.
# Ending with "~" makes empty sort later than filled
push(@criteria, join("!", sort @{$tinfo->{'master_opt'}}) . "~");
$sort_criteria{$test_name} = join(" ", @criteria);
}
}
@$cases = sort {
$sort_criteria{$a->{'name'}} . $a->{'name'} cmp
$sort_criteria{$b->{'name'}} . $b->{'name'}; } @$cases;
if ( $::opt_script_debug )
{
# For debugging the sort-order
foreach my $tinfo (@$cases)
{
print("$sort_criteria{$tinfo->{'name'}} -> \t$tinfo->{'name'}\n");
}
}
}
return $cases;
}
......@@ -257,14 +304,16 @@ sub collect_test_cases ($) {
##############################################################################
sub collect_one_test_case($$$$$$$) {
sub collect_one_test_case($$$$$$$$$) {
my $testdir= shift;
my $resdir= shift;
my $suite= shift;
my $tname= shift;
my $elem= shift;
my $cases= shift;
my $disabled=shift;
my $component_id= shift;
my $suite_opts= shift;
my $path= "$testdir/$elem";
......@@ -279,7 +328,7 @@ sub collect_one_test_case($$$$$$$) {
my $tinfo= {};
$tinfo->{'name'}= $tname;
$tinfo->{'name'}= "$suite.$tname";
$tinfo->{'result_file'}= "$resdir/$tname.result";
$tinfo->{'component_id'} = $component_id;
push(@$cases, $tinfo);
......@@ -334,6 +383,15 @@ sub collect_one_test_case($$$$$$$) {
$tinfo->{'slave_opt'}= [];
$tinfo->{'slave_mi'}= [];
# Add suite opts
foreach my $opt ( @$suite_opts )
{
mtr_verbose($opt);
push(@{$tinfo->{'master_opt'}}, $opt);
push(@{$tinfo->{'slave_opt'}}, $opt);
}
# Add master opts
if ( -f $master_opt_file )
{
......@@ -394,6 +452,7 @@ sub collect_one_test_case($$$$$$$) {
}
}
# Add slave opts
if ( -f $slave_opt_file )
{
my $slave_opt= mtr_get_opts_from_file($slave_opt_file);
......
......@@ -142,6 +142,7 @@ sub spawn_impl ($$$$$$$) {
if ( $pid )
{
select(STDOUT) if $::glob_win32_perl;
return spawn_parent_impl($pid,$mode,$path);
}
else
......@@ -163,9 +164,6 @@ sub spawn_impl ($$$$$$$) {
{
# Don't redirect stdout on ActiveState perl since this is
# just another thread in the same process.
# Should be fixed so that the thread that is created with fork
# executes the exe in another process and wait's for it to return.
# In the meanwhile, we get all the output from mysqld's to screen
}
elsif ( ! open(STDOUT,$log_file_open_mode,$output) )
{
......@@ -175,7 +173,7 @@ sub spawn_impl ($$$$$$$) {
if ( $error )
{
if ( $output eq $error )
if ( !$::glob_win32_perl and $output eq $error )
{
if ( ! open(STDERR,">&STDOUT") )
{
......@@ -184,15 +182,7 @@ sub spawn_impl ($$$$$$$) {
}
else
{
if ( $::glob_win32_perl )
{
# Don't redirect stdout on ActiveState perl since this is
# just another thread in the same process.
# Should be fixed so that the thread that is created with fork
# executes the exe in another process and wait's for it to return.
# In the meanwhile, we get all the output from mysqld's to screen
}
elsif ( ! open(STDERR,$log_file_open_mode,$error) )
if ( ! open(STDERR,$log_file_open_mode,$error) )
{
mtr_child_error("can't redirect STDERR to \"$error\": $!");
}
......@@ -369,7 +359,7 @@ sub mtr_kill_leftovers () {
"socket: '$srv->{path_sock}'; ".
"port: $srv->{port})");
my $pid= mtr_mysqladmin_start($srv, "shutdown", 70);
my $pid= mtr_mysqladmin_start($srv, "shutdown", 20);
# Save the pid of the mysqladmin process
$admin_pids{$pid}= 1;
......@@ -613,6 +603,11 @@ sub mtr_check_stop_servers ($) {
if ( $pid )
{
# Server is still alive, put it in list to be hard killed
if ($::glob_win32_perl)
{
# Kill the real process if it's known
$pid= $srv->{'real_pid'} if ($srv->{'real_pid'});
}
$kill_pids{$pid}= 1;
# Write a message to the process's error log (if it has one)
......@@ -666,6 +661,16 @@ sub mtr_check_stop_servers ($) {
}
}
if ($::glob_win32_perl and $srv->{'real_pid'})
{
# Wait for the pseudo pid - if the real_pid was known
# the pseudo pid has not been waited for yet, wai blocking
# since it's "such a simple program"
mtr_verbose("Wait for pseudo process $srv->{'pid'}");
my $ret_pid= waitpid($srv->{'pid'}, 0);
mtr_verbose("Pseudo process $ret_pid died");
}
$srv->{'pid'}= 0;
}
}
......@@ -1043,7 +1048,7 @@ sub sleep_until_file_created ($$$) {
{
if ( -r $pidfile )
{
return $pid;
return 1;
}
# Check if it died after the fork() was successful
......
......@@ -48,30 +48,15 @@ sub mtr_verbose (@);
# We can't use diff -u or diff -a as these are not portable
sub mtr_show_failed_diff ($) {
my $result_file_name= shift;
my $tinfo= shift;
# The reject and log files have been dumped to
# to filenames based on the result_file's name
my $tname= basename($result_file_name);
$tname=~ s/\..*$//;
my $reject_file= "r/$tname.reject";
my $result_file= "r/$tname.result";
my $log_file= "$::opt_vardir/log/$tname.log";
my $eval_file= "r/$tname.eval";
if ( $::opt_suite ne "main" )
{
$reject_file= "$::glob_mysql_test_dir/suite/$::opt_suite/$reject_file";
$result_file= "$::glob_mysql_test_dir/suite/$::opt_suite/$result_file";
$eval_file= "$::glob_mysql_test_dir/suite/$::opt_suite/$eval_file";
$log_file= "$::glob_mysql_test_dir/suite/$::opt_suite/$log_file";
}
if ( -f $eval_file )
{
$result_file= $eval_file;
}
my $base_file= mtr_match_extension($tinfo->{'result_file'},
"result"); # Trim extension
my $reject_file= "$base_file.reject";
my $result_file= "$base_file.result";
my $log_file= "$base_file.log";
my $diffopts= $::opt_udiff ? "-u" : "-c";
......
......@@ -97,9 +97,14 @@ sub mtr_timer_start($$$) {
# clearing the signal handler.
$SIG{INT}= 'DEFAULT';
$SIG{TERM}= sub {
mtr_verbose("timer woke up, exiting!");
exit(0);
};
$0= "mtr_timer(timers,$name,$duration)";
mtr_verbose("timer child $name, sleep $duration");
sleep($duration);
mtr_verbose("timer expired after $duration seconds");
exit(0);
}
}
......@@ -118,7 +123,7 @@ sub mtr_timer_stop ($$) {
# FIXME as Cygwin reuses pids fast, maybe check that is
# the expected process somehow?!
kill(9, $tpid);
kill(15, $tpid);
# As the timers are so simple programs, we trust them to terminate,
# and use blocking wait for it. We wait just to avoid a zombie.
......
......@@ -132,7 +132,7 @@ our $opt_vs_config = $ENV{'MTR_VS_CONFIG'};
our $default_vardir;
our $opt_usage;
our $opt_suite;
our $opt_suites= "main,binlog,rpl,rpl_ndb,ndb"; # Default suites to run
our $opt_script_debug= 0; # Script debugging, enable with --script-debug
our $opt_verbose= 0; # Verbose output, enable with --verbose
......@@ -404,7 +404,7 @@ sub main () {
else
{
# Figure out which tests we are going to run
my $tests= collect_test_cases($opt_suite);
my $tests= collect_test_cases($opt_suites);
# Turn off NDB and other similar options if no tests use it
my ($need_ndbcluster,$need_im);
......@@ -458,7 +458,7 @@ sub main () {
run_report_features();
}
run_suite($opt_suite, $tests);
run_tests($tests);
}
mtr_exit(0);
......@@ -474,7 +474,6 @@ sub command_line_setup () {
# These are defaults for things that are set on the command line
$opt_suite= "main"; # Special default suite
my $opt_comment;
$opt_master_myport= 9306;
......@@ -534,7 +533,7 @@ sub command_line_setup () {
'skip-slave-binlog' => \$opt_skip_slave_binlog,
'do-test=s' => \$opt_do_test,
'start-from=s' => \$opt_start_from,
'suite=s' => \$opt_suite,
'suite|suites=s' => \$opt_suites,
'skip-rpl' => \$opt_skip_rpl,
'skip-im' => \$opt_skip_im,
'skip-test=s' => \$opt_skip_test,
......@@ -2593,10 +2592,19 @@ sub ndbcluster_wait_started($$){
sub mysqld_wait_started($){
my $mysqld= shift;
my $res= sleep_until_file_created($mysqld->{'path_pid'},
$mysqld->{'start_timeout'},
$mysqld->{'pid'});
return $res == 0;
if (sleep_until_file_created($mysqld->{'path_pid'},
$mysqld->{'start_timeout'},
$mysqld->{'pid'}) == 0)
{
# Failed to wait for pid file
return 1;
}
# Get the "real pid" of the process, it will be used for killing
# the process in ActiveState's perl on windows
$mysqld->{'real_pid'}= mtr_get_pid_from_file($mysqld->{'path_pid'});
return 0;
}
......@@ -2797,19 +2805,17 @@ sub run_benchmarks ($) {
##############################################################################
#
# Run the test suite
# Run the tests
#
##############################################################################
sub run_suite () {
my ($suite, $tests)= @_;
sub run_tests () {
my ($tests)= @_;
mtr_print_thick_line();
mtr_timer_start($glob_timers,"suite", 60 * $opt_suite_timeout);
mtr_report("Starting Tests in the '$suite' suite");
mtr_report_tests_not_skipped_though_disabled($tests);
mtr_print_header();
......@@ -3272,18 +3278,14 @@ sub run_testcase_check_skip_test($)
sub do_before_run_mysqltest($)
{
my $tinfo= shift;
my $tname= $tinfo->{'name'};
# Remove old files produced by mysqltest
my $result_dir= "r";
if ( $opt_suite ne "main" )
{
$result_dir= "suite/$opt_suite/r";
}
unlink("$result_dir/$tname.reject");
unlink("$result_dir/$tname.progress");
unlink("$result_dir/$tname.log");
unlink("$result_dir/$tname.warnings");
my $base_file= mtr_match_extension($tinfo->{'result_file'},
"result"); # Trim extension
unlink("$base_file.reject");
unlink("$base_file.progress");
unlink("$base_file.log");
unlink("$base_file.warnings");
if (!$opt_extern)
{
......@@ -3302,7 +3304,6 @@ sub do_before_run_mysqltest($)
sub do_after_run_mysqltest($)
{
my $tinfo= shift;
my $tname= $tinfo->{'name'};
# Save info from this testcase run to mysqltest.log
mtr_appendfile_to_file($path_current_test_log, $path_mysqltest_log)
......@@ -3626,7 +3627,7 @@ sub report_failure_and_restart ($) {
my $tinfo= shift;
mtr_report_test_failed($tinfo);
mtr_show_failed_diff($tinfo->{'result_file'});
mtr_show_failed_diff($tinfo);
print "\n";
if ( $opt_force )
{
......@@ -3759,22 +3760,13 @@ sub mysqld_arguments ($$$$) {
mtr_add_arg($args, "%s--no-defaults", $prefix);
mtr_add_arg($args, "%s--console", $prefix);
mtr_add_arg($args, "%s--basedir=%s", $prefix, $path_my_basedir);
mtr_add_arg($args, "%s--character-sets-dir=%s", $prefix, $path_charsetsdir);
if ( $mysql_version_id >= 50036)
{
# By default, prevent the started mysqld to access files outside of vardir
my $secure_file_dir= $opt_vardir;
if ( $opt_suite ne "main" )
{
# When running a suite other than default allow the mysqld
# access to subdirs of mysql-test/ in order to make it possible
# to "load data" from the suites data/ directory.
$secure_file_dir= $glob_mysql_test_dir;
}
mtr_add_arg($args, "%s--secure-file-priv=%s", $prefix, $secure_file_dir);
mtr_add_arg($args, "%s--secure-file-priv=%s", $prefix, $opt_vardir);
}
if ( $mysql_version_id >= 50000 )
......@@ -4134,6 +4126,7 @@ sub stop_all_servers () {
push(@kill_pids,{
pid => $mysqld->{'pid'},
real_pid => $mysqld->{'real_pid'},
pidfile => $mysqld->{'path_pid'},
sockfile => $mysqld->{'path_sock'},
port => $mysqld->{'port'},
......@@ -4335,12 +4328,13 @@ sub run_testcase_stop_servers($$$) {
{
if ( $mysqld->{'pid'} )
{
$pid= mtr_mysqladmin_start($mysqld, "shutdown", 70);
$pid= mtr_mysqladmin_start($mysqld, "shutdown", 20);
$admin_pids{$pid}= 1;
push(@kill_pids,{
pid => $mysqld->{'pid'},
real_pid => $mysqld->{'real_pid'},
pidfile => $mysqld->{'path_pid'},
sockfile => $mysqld->{'path_sock'},
port => $mysqld->{'port'},
......@@ -4386,12 +4380,13 @@ sub run_testcase_stop_servers($$$) {
{
if ( $mysqld->{'pid'} )
{
$pid= mtr_mysqladmin_start($mysqld, "shutdown", 70);
$pid= mtr_mysqladmin_start($mysqld, "shutdown", 20);
$admin_pids{$pid}= 1;
push(@kill_pids,{
pid => $mysqld->{'pid'},
real_pid => $mysqld->{'real_pid'},
pidfile => $mysqld->{'path_pid'},
sockfile => $mysqld->{'path_sock'},
port => $mysqld->{'port'},
......@@ -4818,12 +4813,10 @@ sub run_mysqltest ($) {
mtr_add_arg($args, "%s", $_) for @args_saved;
}
mtr_add_arg($args, "--test-file");
mtr_add_arg($args, $tinfo->{'path'});
mtr_add_arg($args, "--test-file=%s", $tinfo->{'path'});
if ( defined $tinfo->{'result_file'} ) {
mtr_add_arg($args, "--result-file");
mtr_add_arg($args, $tinfo->{'result_file'});
mtr_add_arg($args, "--result-file=%s", $tinfo->{'result_file'});
}
if ( $opt_record )
......@@ -5150,7 +5143,9 @@ Options to control what test suites or cases to run
ndb-extra Run extra tests from ndb directory
do-test=PREFIX Run test cases which name are prefixed with PREFIX
start-from=PREFIX Run test cases starting from test prefixed with PREFIX
suite=NAME Run the test suite named NAME. The default is "main"
suite[s]=NAME1,..,NAMEN Collect tests in suites from the comma separated
list of suite names.
The default is: "$opt_suites"
skip-rpl Skip the replication test cases.
skip-im Don't start IM, and skip the IM test cases
skip-test=PREFIX Skip test cases which name are prefixed with PREFIX
......
This diff is collapsed.
......@@ -5261,3 +5261,34 @@ CREATE TABLE `bug21328` (
insert into bug21328 values (1,NULL,NULL);
alter table bug21328 engine=myisam;
drop table bug21328;
create table t1(a int) engine=csv;
insert into t1 values(-1), (-123.34), (2), (-23);
select * from t1;
a
-1
-123
2
-23
check table t1;
Table Op Msg_type Msg_text
test.t1 check status OK
drop table t1;
create table t1(a int, b int) engine=csv;
repair table t1;
Table Op Msg_type Msg_text
test.t1 repair Warning Data truncated for column 'a' at row 5
test.t1 repair status OK
check table t1;
Table Op Msg_type Msg_text
test.t1 check status OK
select * from t1;
a b
1 0
-200 1
-1 -1
-1 -100
check table t1;
Table Op Msg_type Msg_text
test.t1 check status OK
drop table t1;
End of 5.1 tests
......@@ -3441,7 +3441,7 @@ DROP TABLE t1;
#
CREATE TABLE t1(a int);
INSERT INTO t1 VALUES (1), (2);
mysqldump: Input filename or options too long: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
mysqldump: Input filename too long: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
DROP TABLE t1;
CREATE TABLE t2 (a int);
CREATE TABLE t3 (a int);
......
mysqld is alive
End of 5.0 tests.
This diff is collapsed.
--secure-file-priv=$MYSQL_TEST_DIR
--secure-file-priv=$MYSQL_TEST_DIR
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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