Commit 7ee0c6b5 authored by unknown's avatar unknown
Browse files

Merge...

Merge neptunus.(none):/home/msvensson/mysql/mysqltestrun_check_testcases/my50-mysqltestrun_check_testcases
into  neptunus.(none):/home/msvensson/mysql/mysqltest_var/my50-mysqltest_var-integration


mysql-test/mysql-test-run.pl:
  Auto merged
mysql-test/r/query_cache.result:
  Auto merged
mysql-test/r/rpl000001.result:
  Auto merged
mysql-test/r/rpl_loaddata.result:
  Auto merged
mysql-test/r/rpl_loaddata_rule_m.result:
  Auto merged
mysql-test/r/rpl_loaddata_rule_s.result:
  Auto merged
mysql-test/r/rpl_misc_functions.result:
  Auto merged
mysql-test/r/rpl_replicate_do.result:
  Auto merged
mysql-test/r/sp-security.result:
  Auto merged
mysql-test/r/variables.result:
  Auto merged
mysql-test/r/view_grant.result:
  Auto merged
mysql-test/t/query_cache.test:
  Auto merged
mysql-test/t/rpl000001.test:
  Auto merged
mysql-test/t/rpl_loaddata.test:
  Auto merged
mysql-test/t/rpl_loaddata_rule_m.test:
  Auto merged
mysql-test/t/rpl_loaddata_rule_s.test:
  Auto merged
mysql-test/t/rpl_misc_functions.test:
  Auto merged
mysql-test/t/rpl_replicate_do.test:
  Auto merged
mysql-test/t/sp-security.test:
  Auto merged
mysql-test/t/trigger-compat.test:
  Auto merged
mysql-test/r/trigger-compat.result:
  Merge
parents f300c891 313ea47d
Loading
Loading
Loading
Loading
+51 −0
Original line number Diff line number Diff line
#
# This test is executed twice for each test case if mysql-test-run is passed
# the flag --check-testcase.
# Before every testcase it's run with mysqltest in record mode and will
# thus produce an output file
# that can be compared to output from after the tescase.
# In that way it's possible to check that a testcase does not have
# any unwanted side affects.
#

#
# Dump all global variables
#
show global variables;

#
# Dump all databases
#
show databases;

#
# Dump the "test" database, all it's tables and their data
#
--exec $MYSQL_DUMP --skip-comments test

#
# Dump the "mysql" database and it's tables
# Select data separately to add "order by"
#
--exec $MYSQL_DUMP --skip-comments --no-data mysql
use mysql;
select * from columns_priv;
select * from db order by host, db, user;
select * from func;
select * from help_category;
select * from help_keyword;
select * from help_relation;
select * from help_relation;
select * from host;
select * from proc;
select * from procs_priv;
select * from tables_priv;
select * from time_zone;
select * from time_zone_leap_second;
select * from time_zone_name;
select * from time_zone_transition;
select * from time_zone_transition_type;
select * from user;


+63 −1
Original line number Diff line number Diff line
@@ -239,6 +239,7 @@ our $opt_manager_port; # Does nothing now, we never use manager
our $opt_old_master;

our $opt_record;
our $opt_check_testcases;

our $opt_result_ext;

@@ -542,6 +543,7 @@ sub command_line_setup () {

             # Test case authoring
             'record'                   => \$opt_record,
             'check-testcases'          => \$opt_check_testcases,

             # ???
             'mysqld=s'                 => \@opt_extra_mysqld_opt,
@@ -2541,6 +2543,54 @@ sub im_stop($) {
  $instance_manager->{'pid'} = undef;
}

#
# Run include/check-testcase.test
# Before a testcase, run in record mode, save result file to var
# After testcase, run and compare with the recorded file, they should be equal!
#
sub run_check_testcase ($) {

  my $mode=     shift;

  my $args;
  mtr_init_args(\$args);

  mtr_add_arg($args, "--no-defaults");
  mtr_add_arg($args, "--silent");
  mtr_add_arg($args, "-v");
  mtr_add_arg($args, "--skip-safemalloc");
  mtr_add_arg($args, "--tmpdir=%s", $opt_tmpdir);

  mtr_add_arg($args, "--socket=%s", $master->[0]->{'path_mysock'});
  mtr_add_arg($args, "--port=%d", $master->[0]->{'path_myport'});
  mtr_add_arg($args, "--database=test");
  mtr_add_arg($args, "--user=%s", $opt_user);
  mtr_add_arg($args, "--password=");

  mtr_add_arg($args, "-R");
  mtr_add_arg($args, "$opt_vardir/tmp/check-testcase.result");

  if ( $mode eq "before" )
  {
    mtr_add_arg($args, "--record");
  }

  my $res = mtr_run_test($exe_mysqltest,$args,
	        "include/check-testcase.test", "", "", "");

  if ( $res == 1  and $mode = "after")
  {
    mtr_run("diff",["-u",
		    "$opt_vardir/tmp/check-testcase.result",
		    "$opt_vardir/tmp/check-testcase.reject"],
	    "", "", "", "");
  }
  elsif ( $res )
  {
    mtr_error("Could not execute 'check-testcase' $mode testcase");
  }
}

sub run_mysqltest ($) {
  my $tinfo=       shift;

@@ -2770,7 +2820,18 @@ sub run_mysqltest ($) {
    mtr_add_arg($args, "--record");
  }

  return mtr_run_test($exe,$args,$tinfo->{'path'},"",$path_timefile,"");
  if ( $opt_check_testcases )
  {
    run_check_testcase("before");
  }

  my $res = mtr_run_test($exe,$args,$tinfo->{'path'},"",$path_timefile,"");

  if ( $opt_check_testcases )
  {
    run_check_testcase("after");
  }
  return $res;
}


@@ -2852,6 +2913,7 @@ Options that specify ports
Options for test case authoring

  record TESTNAME       (Re)genereate the result file for TESTNAME
  check-testcases       Check testcases for sideeffects

Options that pass on options

+1 −0
Original line number Diff line number Diff line
@@ -46,3 +46,4 @@ Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_
execute stmt1;
Field_name	Min_value	Max_value	Min_length	Max_length	Empties_or_zeros	Nulls	Avg_value_or_avg_length	Std	Optimal_fieldtype
deallocate prepare stmt1;
drop table t1;
+1 −0
Original line number Diff line number Diff line
@@ -17,3 +17,4 @@ CREATE TEMPORARY TABLE t2 ( PRIMARY KEY (a) ) ENGINE=MYISAM SELECT a FROM t1;
ERROR 23000: Duplicate entry '1' for key 1
select * from t2;
ERROR 42S02: Table 'test.t2' doesn't exist
drop table t1;
+1 −0
Original line number Diff line number Diff line
@@ -11366,3 +11366,4 @@ col1
a
a
a
drop table t1;
Loading