List:Commits« Previous MessageNext Message »
From:Bjorn Munch Date:August 31 2010 8:04am
Subject:bzr push into mysql-5.1-mtr branch (bjorn.munch:2925 to 2927)
View as plain text  
 2927 Bjorn Munch	2010-08-30 [merge]
      merge 55413

    modified:
      client/mysqltest.cc
      mysql-test/r/mysqltest.result
      mysql-test/t/mysqltest.test
 2926 Bjorn Munch	2010-08-30
      Bug #55178 Set timeout on test-to-test-basis
      Allow --testcase-timeout=<mins> to be set in .opt file for test

    modified:
      mysql-test/lib/mtr_cases.pm
      mysql-test/mysql-test-run.pl
 2925 Bjorn Munch	2010-08-25
      Cherry pick 55501

    modified:
      mysql-test/include/have_innodb_plugin.inc
=== modified file 'client/mysqltest.cc'
--- a/client/mysqltest.cc	2010-08-25 08:23:19 +0000
+++ b/client/mysqltest.cc	2010-08-30 09:26:40 +0000
@@ -5509,6 +5509,8 @@ int read_line(char *buf, int size)
   char c, UNINIT_VAR(last_quote);
   char *p= buf, *buf_end= buf + size - 1;
   int skip_char= 0;
+  my_bool have_slash= FALSE;
+  
   enum {R_NORMAL, R_Q, R_SLASH_IN_Q,
         R_COMMENT, R_LINE_START} state= R_LINE_START;
   DBUG_ENTER("read_line");
@@ -5580,9 +5582,13 @@ int read_line(char *buf, int size)
       }
       else if (c == '\'' || c == '"' || c == '`')
       {
-        last_quote= c;
-	state= R_Q;
+        if (! have_slash) 
+        {
+	  last_quote= c;
+	  state= R_Q;
+	}
       }
+      have_slash= (c == '\\');
       break;
 
     case R_COMMENT:

=== modified file 'mysql-test/lib/mtr_cases.pm'
--- a/mysql-test/lib/mtr_cases.pm	2010-08-04 10:19:51 +0000
+++ b/mysql-test/lib/mtr_cases.pm	2010-08-30 09:25:10 +0000
@@ -684,6 +684,13 @@ sub process_opts_file {
 	next;
       }
 
+      $value= mtr_match_prefix($opt, "--testcase-timeout=");
+      if ( defined $value ) {
+	# Overrides test case timeout for this test
+	$tinfo->{'case-timeout'}= $value;
+	next;
+      }
+
       # Ok, this was a real option, add it
       push(@{$tinfo->{$opt_name}}, $opt);
     }

=== modified file 'mysql-test/mysql-test-run.pl'
--- a/mysql-test/mysql-test-run.pl	2010-08-04 10:19:51 +0000
+++ b/mysql-test/mysql-test-run.pl	2010-08-30 09:25:10 +0000
@@ -212,7 +212,6 @@ my $opt_suite_timeout   = $ENV{MTR_SUITE
 my $opt_shutdown_timeout= $ENV{MTR_SHUTDOWN_TIMEOUT} ||  10; # seconds
 my $opt_start_timeout   = $ENV{MTR_START_TIMEOUT}    || 180; # seconds
 
-sub testcase_timeout { return $opt_testcase_timeout * 60; };
 sub suite_timeout { return $opt_suite_timeout * 60; };
 sub check_timeout { return $opt_testcase_timeout * 6; };
 
@@ -241,6 +240,17 @@ my $opt_callgrind;
 my %mysqld_logs;
 my $opt_debug_sync_timeout= 300; # Default timeout for WAIT_FOR actions.
 
+sub testcase_timeout ($) {
+  my ($tinfo)= @_;
+  if (exists $tinfo->{'case-timeout'}) {
+    # Return test specific timeout if *longer* that the general timeout
+    my $test_to= $tinfo->{'case-timeout'};
+    $test_to*= 10 if $opt_valgrind;
+    return $test_to * 60 if $test_to > $opt_testcase_timeout;
+  }
+  return $opt_testcase_timeout * 60;
+}
+
 our $opt_warnings= 1;
 
 our $opt_skip_ndbcluster= 0;
@@ -3469,7 +3479,7 @@ sub run_testcase ($) {
     }
   }
 
-  my $test_timeout= start_timer(testcase_timeout());
+  my $test_timeout= start_timer(testcase_timeout($tinfo));
 
   do_before_run_mysqltest($tinfo);
 
@@ -3669,7 +3679,7 @@ sub run_testcase ($) {
     {
       my $log_file_name= $opt_vardir."/log/".$tinfo->{shortname}.".log";
       $tinfo->{comment}=
-        "Test case timeout after ".testcase_timeout().
+        "Test case timeout after ".testcase_timeout($tinfo).
 	  " seconds\n\n";
       # Add 20 last executed commands from test case log file
       if  (-e $log_file_name)
@@ -3678,7 +3688,7 @@ sub run_testcase ($) {
 	   "== $log_file_name == \n".
 	     mtr_lastlinesfromfile($log_file_name, 20)."\n";
       }
-      $tinfo->{'timeout'}= testcase_timeout(); # Mark as timeout
+      $tinfo->{'timeout'}= testcase_timeout($tinfo); # Mark as timeout
       run_on_all($tinfo, 'analyze-timeout');
 
       report_failure_and_restart($tinfo);

=== modified file 'mysql-test/r/mysqltest.result'
--- a/mysql-test/r/mysqltest.result	2010-08-04 08:52:45 +0000
+++ b/mysql-test/r/mysqltest.result	2010-08-10 10:13:58 +0000
@@ -262,6 +262,9 @@ a long \$where variable content
 
 banana = banana
 Not a banana: ba\$cat\$cat
+with\`some"escaped\'quotes
+with\`some"escaped\'quotes
+single'tick`backtick
 mysqltest: At line 1: Missing arguments to let
 mysqltest: At line 1: Missing variable name in let
 mysqltest: At line 1: Missing assignment operator in let

=== modified file 'mysql-test/t/mysqltest.test'
--- a/mysql-test/t/mysqltest.test	2010-08-04 08:52:45 +0000
+++ b/mysql-test/t/mysqltest.test	2010-08-10 10:13:58 +0000
@@ -701,6 +701,16 @@ echo banana = $cat;
 let $cat=ba\\\$cat\\\$cat;
 echo Not a banana: $cat;
 
+# Bug #55413 would cause this to fail
+let $escape= with\`some\"escaped\'quotes;
+echo $escape;
+
+--let $escape= with\`some\"escaped\'quotes
+echo $escape;
+
+# This only works with "--let" syntax
+--let $tick= single'tick`backtick
+echo $tick;
 
 # Test illegal uses of let
 


Attachment: [text/bzr-bundle] bzr/bjorn.munch@oracle.com-20100830092640-o2dkp5nz4scxx29n.bundle
Thread
bzr push into mysql-5.1-mtr branch (bjorn.munch:2925 to 2927) Bjorn Munch31 Aug