From 3e32ba3ff1068c19dbf0c69de991da426cf7f327 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 10 Mar 2010 11:32:14 +0100 Subject: Fix some compiler warnings seen in Buildbot. Add some extra error output and code cleanup in an attempt to fix/debug a rare random testsuite problem in check_warnings, where the exit code from mysqltest is somehow corrupted inside mysql-test-run.pl. include/my_global.h: Fix compiler warnings on some platforms. mysql-test/lib/My/SafeProcess.pm: Move dereference of $? subprocess exit code closer to where it is generated, to make the code more robust and on the chance that this will fix the occasional problems in check_warnings we see in Buildbot. mysql-test/mysql-test-run.pl: When check_warnings failed, also log the mysqld server for which it failed. sql/sql_lex.cc: Fix compiler warning about possibly uninitialised value, by rewriting a for() loop that is always executed at least once into a do .. while() loop with an assert. sql/table.cc: Fix compiler warning about uninitialised value. storage/federatedx/ha_federatedx.cc: Fix uninitialised variable. storage/maria/ma_delete.c: Fix compiler warning about uninitialised value. storage/maria/ma_loghandler.c: Fix compiler warning about uninitialised value. storage/myisam/ft_stopwords.c: Fix compiler warning. storage/myisam/mi_write.c: Fix compiler warning about possibly uninitialised value, by rewriting a while() loop that is always executed at least once into a do .. while() loop with an assert. storage/xtradb/btr/btr0cur.c: Fix compiler warning about possibly uninitialised value. support-files/compiler_warnings.supp: Fix warning suppression to cover all cases in yassl. vio/viossl.c: Fix compiler warning. --- mysql-test/lib/My/SafeProcess.pm | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'mysql-test/lib/My/SafeProcess.pm') diff --git a/mysql-test/lib/My/SafeProcess.pm b/mysql-test/lib/My/SafeProcess.pm index 7e102b628ca..301392a4d88 100644 --- a/mysql-test/lib/My/SafeProcess.pm +++ b/mysql-test/lib/My/SafeProcess.pm @@ -384,9 +384,9 @@ sub kill { sub _collect { - my ($self)= @_; + my ($self, $exit_code)= @_; - $self->{EXIT_STATUS}= $?; + $self->{EXIT_STATUS}= $exit_code; _verbose("_collect: $self"); # Take the process out of running list @@ -453,6 +453,7 @@ sub wait_one { #_verbose("blocking: $blocking, use_alarm: $use_alarm"); my $retpid; + my $exit_code; eval { # alarm should break the wait @@ -461,6 +462,7 @@ sub wait_one { alarm($timeout) if $use_alarm; $retpid= waitpid($pid, $blocking ? 0 : &WNOHANG); + $exit_code= $?; alarm(0) if $use_alarm; }; @@ -492,7 +494,7 @@ sub wait_one { #warn "wait_one: expected pid $pid but got $retpid" # unless( $retpid == $pid ); - $self->_collect(); + $self->_collect($exit_code); return 0; } @@ -505,6 +507,8 @@ sub wait_one { # sub wait_any { my $ret_pid; + my $exit_code; + if (IS_WIN32PERL) { # Can't wait for -1 => use a polling loop do { @@ -514,6 +518,7 @@ sub wait_any { last if $pid == $ret_pid; } } while ($ret_pid == 0); + $exit_code= $?; } else { @@ -523,6 +528,7 @@ sub wait_any { print STDERR "wait_any, got invalid pid: $ret_pid\n"; return undef; } + $exit_code= $?; } # Look it up in "running" table @@ -532,7 +538,7 @@ sub wait_any { print STDERR "running: ". join(", ", keys(%running)). "\n"; return undef; } - $proc->_collect; + $proc->_collect($exit_code); return $proc; } -- cgit v1.2.1 From 8da7be63027403c5b82eda378842142cdcbad95c Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 17 Aug 2010 11:14:46 +0400 Subject: generalization of mtr to support suite.pm extensions: * no automatic --loose-skip-innodb added by mtr based on the test name. instead loose-skip-innodb is now in the default_mysqld.cnf * have_innodb_plugin.inc is changed to give a verbose "skip" message (instead of "require: true") * My::Suite class. It's support in mtr, and everywhere * support for suite.pm * when sorting tests, take combinations into account * support for SUITENAME_COMBINATIONS * no special treatment for innodb_plugin in mtr_cases.pm * two special pre-created config groups: ENV and OPT * allow option names to start from # * allow magic option to have an argument * remove dead code * fix @-substitution to works as expected * new processes take the value of $opt_verbose automatically, no need to pass it to a constructor * innodb_plugin suite uses suite.pm and combinations file to test as much as possible (innodb plugin, xtradb plugin, xtradb static - whatever available) * besides test-master.opt and test-slave.opt a test.opt file is also loaded, both for master and slave * .opt files for all included files are loaded too * progress report in the xterm titlebar --- mysql-test/lib/My/SafeProcess.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mysql-test/lib/My/SafeProcess.pm') diff --git a/mysql-test/lib/My/SafeProcess.pm b/mysql-test/lib/My/SafeProcess.pm index b3409020f21..084ef408d5b 100644 --- a/mysql-test/lib/My/SafeProcess.pm +++ b/mysql-test/lib/My/SafeProcess.pm @@ -120,7 +120,7 @@ sub new { my $input = delete($opts{'input'}); my $output = delete($opts{'output'}); my $error = delete($opts{'error'}); - my $verbose = delete($opts{'verbose'}); + my $verbose = delete($opts{'verbose'}) || $::opt_verbose; my $nocore = delete($opts{'nocore'}); my $host = delete($opts{'host'}); my $shutdown = delete($opts{'shutdown'}); -- cgit v1.2.1