Commit 4743deeb authored by unknown's avatar unknown
Browse files

Merge pilot.mysql.com:/home/msvensson/mysql/mysql-4.1

into  pilot.mysql.com:/home/msvensson/mysql/mysql-4.1-maint


mysql-test/t/mysqladmin.test:
  Auto merged
mysys/mf_iocache.c:
  Auto merged
mysys/my_read.c:
  Auto merged
mysys/my_seek.c:
  Auto merged
sql/sql_parse.cc:
  Auto merged
parents 5f9a8075 56e91690
Loading
Loading
Loading
Loading
+26 −25
Original line number Diff line number Diff line
@@ -95,7 +95,11 @@ dist-hook:

tags:
	support-files/build-tags
.PHONY:		init-db bin-dist

.PHONY:	init-db bin-dist \
  test    test-force    test-full    test-force-full    test-force-mem \
  test-pl test-force-pl test-full-pl test-force-full-pl test-force-pl-mem \
  test-ps test-ns

# Target 'test' will run the regression test suite using the built server.
#
@@ -105,36 +109,33 @@ tags:
# will then calculate the various port numbers it needs from this,
# making sure each user use different ports.

test:
test-ps:
	cd mysql-test ; \
	./mysql-test-run && \
	./mysql-test-run --ps-protocol
	@PERL@ ./mysql-test-run.pl $(force) --ps-protocol

test-force:
test-ns:
	cd mysql-test ; \
	./mysql-test-run --force && \
	./mysql-test-run --ps-protocol --force
	@PERL@ ./mysql-test-run.pl $(force)

test-force-mem:
	cd mysql-test; \
	./mysql-test-run --force --mem && \
	./mysql-test-run --ps-protocol --force --mem
test:	test-ns test-ps

# To ease script-writing, although in 4.1 it is identical to 'test'
test-full:	test

# We are testing a new Perl version of the test script
test-pl:
	cd mysql-test; \
	./mysql-test-run.pl && \
	./mysql-test-run.pl --ps-protocol
test-force:
	$(MAKE) force=--force test

test-force-pl:
	cd mysql-test; \
	./mysql-test-run.pl --force && \
	./mysql-test-run.pl --ps-protocol --force
test-force-full:
	$(MAKE) force=--force test-full

#used by autopush.pl to run memory based tests
test-force-pl-mem:
	cd mysql-test; \
	./mysql-test-run.pl --force --mem && \
	./mysql-test-run.pl --ps-protocol --force --mem
test-force-mem:
	$(MAKE) 'force=--force --mem' test

# Keep these for a while
test-pl:	test
test-full-pl:	test-full
test-force-pl:	test-force
test-force-pl-mem:  test-force-mem
test-force-full-pl: test-force-full
+14 −5
Original line number Diff line number Diff line
@@ -1240,7 +1240,9 @@ void var_set(const char *var_name, const char *var_name_end,
      v->int_dirty= 0;
      v->str_val_len= strlen(v->str_val);
    }
    strxmov(buf, v->name, "=", v->str_val, NullS);
    my_snprintf(buf, sizeof(buf), "%.*s=%.*s",
                v->name_len, v->name,
                v->str_val_len, v->str_val);
    if (!(v->env_s= my_strdup(buf, MYF(MY_WME))))
      die("Out of memory");
    putenv(v->env_s);
@@ -2968,7 +2970,12 @@ void safe_connect(MYSQL* mysql, const char *name, const char *host,
    if ((mysql_errno(mysql) == CR_CONN_HOST_ERROR ||
         mysql_errno(mysql) == CR_CONNECTION_ERROR) &&
        failed_attempts < opt_max_connect_retries)
    {
      verbose_msg("Connect attempt %d/%d failed: %d: %s", failed_attempts,
                  opt_max_connect_retries, mysql_errno(mysql),
                  mysql_error(mysql));
      my_sleep(connection_retry_sleep);
    }
    else
    {
      if (failed_attempts > 0)
@@ -4678,10 +4685,9 @@ void run_query_normal(struct st_connection *cn, struct st_command *command,
    }

    /*
      Store the result. If res is NULL, use mysql_field_count to
      determine if that was expected
      Store the result of the query if it will return any fields
    */
    if (!(res= mysql_store_result(mysql)) && mysql_field_count(mysql))
    if (mysql_field_count(mysql) && ((res= mysql_store_result(mysql)) == 0))
    {
      handle_error(command, mysql_errno(mysql), mysql_error(mysql),
		   mysql_sqlstate(mysql), ds);
@@ -4733,7 +4739,10 @@ void run_query_normal(struct st_connection *cn, struct st_command *command,
    }

    if (res)
    {
      mysql_free_result(res);
      res= 0;
    }
    counter++;
  } while (!(err= mysql_next_result(mysql)));
  if (err > 0)
+2 −5
Original line number Diff line number Diff line
@@ -288,6 +288,7 @@ sub collect_one_test_case($$$$$$$) {
  $tinfo->{'timezone'}= "GMT-3"; # for UNIX_TIMESTAMP tests to work

  $tinfo->{'slave_num'}= 0; # Default, no slave
  $tinfo->{'master_num'}= 1; # Default, 1 master
  if ( defined mtr_match_prefix($tname,"rpl") )
  {
    if ( $::opt_skip_rpl )
@@ -297,13 +298,8 @@ sub collect_one_test_case($$$$$$$) {
      return;
    }


    $tinfo->{'slave_num'}= 1; # Default for rpl* tests, use one slave

    if ( $tname eq 'rpl_failsafe' or $tname eq 'rpl_chain_temp_table' )
    {
      # $tinfo->{'slave_num'}= 3;         # Not 3 ? Check old code, strange
    }
  }

  if ( defined mtr_match_prefix($tname,"federated") )
@@ -582,6 +578,7 @@ our @tags=
 ["include/have_debug.inc", "need_debug", 1],
 ["include/have_ndb.inc", "ndb_test", 1],
 ["include/have_ndb_extra.inc", "ndb_extra", 1],
 ["include/have_multi_ndb.inc", "master_num", 2],
 ["require_manager", "require_manager", 1],
);

+2 −1
Original line number Diff line number Diff line
@@ -220,7 +220,8 @@ sub spawn_parent_impl {
      my $ret_pid= waitpid($pid,0);
      if ( $ret_pid != $pid )
      {
        mtr_error("$path ($pid) got lost somehow");
        mtr_error("waitpid($pid, 0) returned $ret_pid " .
		  "when waiting for '$path'");
      }

      return mtr_process_exit_status($?);
+42 −9
Original line number Diff line number Diff line
@@ -222,10 +222,12 @@ our $opt_ndbconnectstring_slave;
our $opt_record;
our $opt_report_features;
our $opt_check_testcases;
our $opt_mark_progress;

our $opt_skip;
our $opt_skip_rpl;
our $max_slave_num= 0;
our $max_master_num= 0;
our $use_innodb;
our $opt_skip_test;
our $opt_skip_im;
@@ -403,6 +405,15 @@ sub main () {
	$max_slave_num= $test->{slave_num};
	mtr_error("Too many slaves") if $max_slave_num > 3;
      }

      # Count max number of masters used by a test case
      if ( $test->{master_num} > $max_master_num)
      {
	$max_master_num= $test->{master_num};
	mtr_error("Too many masters") if $max_master_num > 2;
	mtr_error("Too few masters") if $max_master_num < 1;
      }

      $use_innodb||= $test->{'innodb_test'};
    }

@@ -555,6 +566,7 @@ sub command_line_setup () {
             # Test case authoring
             'record'                   => \$opt_record,
             'check-testcases'          => \$opt_check_testcases,
             'mark-progress'            => \$opt_mark_progress,

             # Extra options used when starting mysqld
             'mysqld=s'                 => \@opt_extra_mysqld_opt,
@@ -1215,14 +1227,28 @@ sub command_line_setup () {
  $path_ndb_testrun_log= "$opt_vardir/log/ndb_testrun.log";

  $path_snapshot= "$opt_tmpdir/snapshot_$opt_master_myport/";

  if ( $opt_valgrind and $opt_debug )
  {
    # When both --valgrind and --debug is selected, send
    # all output to the trace file, making it possible to
    # see the exact location where valgrind complains
    foreach my $mysqld (@{$master}, @{$slave})
    {
      my $sidx= $mysqld->{idx} ? "$mysqld->{idx}" : "";
      $mysqld->{path_myerr}=
	"$opt_vardir/log/" . $mysqld->{type} . "$sidx.trace";
    }
  }
}

sub datadir_list_setup () {

  # Make a list of all data_dirs
  @data_dir_lst = (
    $master->[0]->{'path_myddir'},
    $master->[1]->{'path_myddir'});
  for (my $idx= 0; $idx < $max_master_num; $idx++)
  {
    push(@data_dir_lst, $master->[$idx]->{'path_myddir'});
  }

  for (my $idx= 0; $idx < $max_slave_num; $idx++)
  {
@@ -2629,8 +2655,10 @@ sub mysql_install_db () {

  install_db('master', $master->[0]->{'path_myddir'});

  # FIXME check if testcase really is using second master
  if ($max_master_num)
  {
    copy_install_db('master', $master->[1]->{'path_myddir'});
  }

  # Install the number of slave databses needed
  for (my $idx= 0; $idx < $max_slave_num; $idx++)
@@ -3432,11 +3460,10 @@ sub mysqld_arguments ($$$$$) {
  if ( $glob_use_embedded_server )
  {
    $prefix= "--server-arg=";
  } else {
    # We can't pass embedded server --no-defaults
    mtr_add_arg($args, "--no-defaults");
  }

  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);
@@ -4165,7 +4192,8 @@ sub run_testcase_start_servers($) {

    }

    if ( $clusters->[0]->{'pid'} and ! $master->[1]->{'pid'} )
    if ( $clusters->[0]->{'pid'} and ! $master->[1]->{'pid'} and
	 $tinfo->{'master_num'} > 1 )
    {
      # Test needs cluster, start an extra mysqld connected to cluster

@@ -4376,6 +4404,10 @@ sub run_mysqltest ($) {
  mtr_add_arg($args, "--tmpdir=%s", $opt_tmpdir);
  mtr_add_arg($args, "--character-sets-dir=%s", $path_charsetsdir);

  # Log line number and time  for each line in .test file
  mtr_add_arg($args, "--mark-progress")
    if $opt_mark_progress;

  if ($tinfo->{'component_id'} eq 'im')
  {
    mtr_add_arg($args, "--socket=%s", $instance_manager->{'path_sock'});
@@ -4829,6 +4861,7 @@ Options for test case authoring

  record TESTNAME       (Re)genereate the result file for TESTNAME
  check-testcases       Check testcases for sideeffects
  mark-progress         Log line number and elapsed time to <testname>.progress

Options that pass on options

Loading