List:Commits« Previous MessageNext Message »
From:Bjorn Munch Date:February 27 2009 3:29pm
Subject:bzr commit into mysql-5.1-mtr branch (Bjorn.Munch:2759) Bug#40978
View as plain text  
#At file:///home/bm136801/mysql/40978-51/

 2759 Bjorn Munch	2009-02-27
      Bug #40978 Error log gets truncated during testsuite, prevents debugging
      Error log gets truncated when mysqld is restarted by MTR
modified:
  mysql-test/include/check-warnings.test
  mysql-test/lib/My/ConfigFactory.pm
  mysql-test/mysql-test-run.pl

per-file messages:
  mysql-test/include/check-warnings.test
    Since server doesn't have log-error, get it from env. var. set by MTR
  mysql-test/lib/My/ConfigFactory.pm
    "Hide" log-error in a comment
  mysql-test/mysql-test-run.pl
    "Hide" log-error in my.cnf by comment
    add --console to arguments on Windows
    Move .err file to var/log
=== modified file 'mysql-test/include/check-warnings.test'
--- a/mysql-test/include/check-warnings.test	2009-01-27 20:14:23 +0000
+++ b/mysql-test/include/check-warnings.test	2009-02-27 14:29:15 +0000
@@ -26,7 +26,7 @@ create temporary table error_log (
 ) engine=myisam;
 
 # Get the name of servers error log
-let $log_error= query_get_value(show variables like 'log_error', Value, 1);
+let $log_error= $MTR_LOG_ERROR;
 let $log_warning= $log_error.warnings;
 
 # Try tload the warnings into a temporary table,

=== modified file 'mysql-test/lib/My/ConfigFactory.pm'
--- a/mysql-test/lib/My/ConfigFactory.pm	2009-01-27 13:21:18 +0000
+++ b/mysql-test/lib/My/ConfigFactory.pm	2009-02-27 14:29:15 +0000
@@ -116,8 +116,8 @@ sub fix_tmpdir {
 
 sub fix_log_error {
   my ($self, $config, $group_name, $group)= @_;
-  my $dir= dirname($group->value('datadir'));
-  return "$dir/mysqld.err";
+  my $dir= $self->{ARGS}->{vardir};
+  return "$dir/log/$group_name.err";
 }
 
 sub fix_log {
@@ -203,7 +203,7 @@ my @mysqld_rules=
  { '#host' => \&fix_host },
  { 'port' => \&fix_port },
  { 'socket' => \&fix_socket },
- { 'log-error' => \&fix_log_error },
+ { '#log-error' => \&fix_log_error },
  { 'log' => \&fix_log },
  { 'log-slow-queries' => \&fix_log_slow_queries },
  { '#user' => sub { return shift->{ARGS}->{user} || ""; } },
@@ -389,7 +389,7 @@ sub post_check_embedded_group {
 
   my @no_copy =
     (
-     'log-error', # Embedded server writes stderr to mysqltest's log file
+     '#log-error', # Embedded server writes stderr to mysqltest's log file
      'slave-net-timeout', # Embedded server are not build with replication
     );
 

=== modified file 'mysql-test/mysql-test-run.pl'
--- a/mysql-test/mysql-test-run.pl	2009-02-27 12:07:01 +0000
+++ b/mysql-test/mysql-test-run.pl	2009-02-27 14:29:15 +0000
@@ -3470,7 +3470,10 @@ sub start_check_warnings ($$) {
 
   my $name= "warnings-".$mysqld->name();
 
-  extract_warning_lines($mysqld->value('log-error'));
+  my $log_error= $mysqld->value('#log-error');
+  # To be communicated to the test
+  $ENV{MTR_LOG_ERROR}= $log_error;
+  extract_warning_lines($log_error);
 
   my $args;
   mtr_init_args(\$args);
@@ -4018,7 +4021,7 @@ sub mysqld_start ($$) {
   # Remove the old pidfile if any
   unlink($mysqld->value('pid-file'));
 
-  my $output= $mysqld->value('log-error');
+  my $output= $mysqld->value('#log-error');
   if ( $opt_valgrind and $opt_debug )
   {
     # When both --valgrind and --debug is selected, send
@@ -4319,7 +4322,7 @@ sub start_servers($) {
       # Already started
 
       # Write start of testcase to log file
-      mark_log($mysqld->value('log-error'), $tinfo);
+      mark_log($mysqld->value('#log-error'), $tinfo);
 
       next;
     }
@@ -4378,7 +4381,7 @@ sub start_servers($) {
     mkpath($tmpdir) unless -d $tmpdir;
 
     # Write start of testcase to log file
-    mark_log($mysqld->value('log-error'), $tinfo);
+    mark_log($mysqld->value('#log-error'), $tinfo);
 
     # Run <tname>-master.sh
     if ($mysqld->option('#!run-master-sh') and
@@ -4429,7 +4432,7 @@ sub start_servers($) {
       $tinfo->{comment}=
 	"Failed to start ".$mysqld->name();
 
-      my $logfile= $mysqld->value('log-error');
+      my $logfile= $mysqld->value('#log-error');
       if ( defined $logfile and -f $logfile )
       {
 	$tinfo->{logfile}= mtr_fromfile($logfile);
@@ -4567,6 +4570,11 @@ sub start_mysqltest ($) {
     mtr_add_arg($args, "--ssl");
   }
 
+  if (IS_WINDOWS) {
+    # Trick the server to send output to stderr, with --console
+    mtr_add_arg($args, "--console");
+  }
+
   if ( $opt_embedded_server )
   {
 

Thread
bzr commit into mysql-5.1-mtr branch (Bjorn.Munch:2759) Bug#40978Bjorn Munch27 Feb 2009