Commit 9f7548ae authored by unknown's avatar unknown
Browse files

Merge mysql.com:/home/jimw/my/tmp_merge

into  mysql.com:/home/jimw/my/mysql-5.1-clean


mysql-test/r/user_var.result:
  Auto merged
mysql-test/r/variables.result:
  Auto merged
mysql-test/t/variables.test:
  Auto merged
sql/item.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
mysql-test/mysql-test-run.pl:
  Resolve conflict
mysql-test/ndb/ndbcluster.sh:
  Resolve conflict
sql/set_var.cc:
  Resolve conflict
sql/share/errmsg.txt:
  Resolve conflict
parents 472f4a84 96f58e1b
Loading
Loading
Loading
Loading
+77 −59
Original line number Diff line number Diff line
@@ -343,6 +343,7 @@ our @data_dir_lst;
sub main ();
sub initial_setup ();
sub command_line_setup ();
sub snapshot_setup ();
sub executable_setup ();
sub environment_setup ();
sub kill_running_server ();
@@ -357,7 +358,7 @@ sub ndbcluster_install_slave ();
sub ndbcluster_start_slave ($);
sub ndbcluster_stop_slave ();
sub run_benchmarks ($);
sub run_tests ();
sub initialize_servers ();
sub mysql_install_db ();
sub install_db ($$);
sub run_testcase ($);
@@ -388,7 +389,7 @@ sub main () {
  command_line_setup();
  executable_setup();

  check_ndbcluster_support();
  check_ndbcluster_support(); # We check whether to actually use it later
  check_ssl_support();

  environment_setup();
@@ -404,49 +405,37 @@ sub main () {
    gprof_prepare();
  }

  if ( ! $glob_use_running_server )
  {
    if ( $opt_start_dirty )
    {
      kill_running_server();
    }
    else
    {
      kill_and_cleanup();
      mysql_install_db();
      if ( $opt_force )
      {
	save_installed_db();
      }
    }
  }

  if ( $opt_start_dirty )
  {
    if ( ndbcluster_start($opt_with_ndbcluster) )
    {
      mtr_error("Can't start ndbcluster");
    }
    if ( mysqld_start('master',0,[],[],$using_ndbcluster_master) )
    {
      mtr_report("Servers started, exiting");
    }
    else
    {
      mtr_error("Can't start the mysqld server");
    }
  }
  elsif ( $opt_bench )
  if ( $opt_bench )
  {
    initialize_servers();
    run_benchmarks(shift);      # Shift what? Extra arguments?!
  }
  elsif ( $opt_stress )
  {
    initialize_servers();
    run_stress_test()
  }
  else
  {
    run_tests();
    # Figure out which tests we are going to run
    my $tests= collect_test_cases($opt_suite);

    # Turn off NDB and other similar options if no tests use it
    my ($need_ndbcluster,$need_im,$need_slave);
    foreach my $test (@$tests)
    {
      $need_ndbcluster||= $test->{ndb_test};
      $need_im||= $test->{component_id} eq 'im';
      $need_slave||= $test->{slave_num};
    }
    $opt_with_ndbcluster= 0 unless $need_ndbcluster;
    $opt_skip_im= 1 unless $need_im;
    $opt_skip_rpl= 1 unless $need_slave;

    snapshot_setup();
    initialize_servers();

    run_suite($opt_suite, $tests);
  }

  mtr_exit(0);
@@ -996,20 +985,29 @@ sub command_line_setup () {
  $path_mysqltest_log=  "$opt_vardir/log/mysqltest.log";

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

sub snapshot_setup () {

  # Make a list of all data_dirs
  @data_dir_lst = (
    $master->[0]->{'path_myddir'},
    $master->[1]->{'path_myddir'},
    $slave->[0]->{'path_myddir'},
    $master->[1]->{'path_myddir'});

  unless ($opt_skip_rpl)
  {
    push @data_dir_lst, ($slave->[0]->{'path_myddir'},
                         $slave->[1]->{'path_myddir'},
                         $slave->[2]->{'path_myddir'});
  }

  unless ($opt_skip_im)
  {
    foreach my $instance (@{$instance_manager->{'instances'}})
    {
      push(@data_dir_lst, $instance->{'path_datadir'});
    }

  }
}


@@ -1440,7 +1438,7 @@ sub check_ndbcluster_support () {
    return;
  }

  mtr_report("Using ndbcluster, mysqld supports it");
  mtr_report("Using ndbcluster if necessary, mysqld supports it");
  $opt_with_ndbcluster= 1;
  if ( $opt_ndbconnectstring )
  {
@@ -1728,12 +1726,9 @@ sub run_benchmarks ($) {

# FIXME how to specify several suites to run? Comma separated list?

sub run_tests () {
  run_suite($opt_suite);
}

sub run_suite () {
  my $suite= shift;
  my ($suite, $tests)= @_;

  mtr_print_thick_line();

@@ -1741,8 +1736,6 @@ sub run_suite () {

  mtr_timer_start($glob_timers,"suite", 60 * $opt_suite_timeout);

  my $tests= collect_test_cases($suite);

  mtr_report("Starting Tests in the '$suite' suite");

  mtr_print_header();
@@ -1784,14 +1777,37 @@ sub run_suite () {
#
##############################################################################

sub initialize_servers () {
  if ( ! $glob_use_running_server )
  {
    if ( $opt_start_dirty )
    {
      kill_running_server();
    }
    else
    {
      kill_and_cleanup();
      mysql_install_db();
      if ( $opt_force )
      {
	save_installed_db();
      }
    }
  }
}

sub mysql_install_db () {

  # FIXME not exactly true I think, needs improvements
  install_db('master', $master->[0]->{'path_myddir'});
  install_db('master', $master->[1]->{'path_myddir'});

  if ( ! $opt_skip_rpl )
  {
    install_db('slave',  $slave->[0]->{'path_myddir'});
    install_db('slave',  $slave->[1]->{'path_myddir'});
    install_db('slave',  $slave->[2]->{'path_myddir'});
  }

  if ( ! $opt_skip_im )
  {
@@ -2243,10 +2259,11 @@ sub run_testcase ($) {
  }

  # ----------------------------------------------------------------------
  # If --start-and-exit given, stop here to let user manually run tests
  # If --start-and-exit or --start-dirty given, stop here to let user manually
  # run tests
  # ----------------------------------------------------------------------

  if ( $opt_start_and_exit )
  if ( $opt_start_and_exit or $opt_start_dirty )
  {
    mtr_report("\nServers started, exiting");
    exit(0);
@@ -3700,11 +3717,12 @@ Misc options
  comment=STR           Write STR to the output
  notimer               Don't show test case execution time
  script-debug          Debug this script itself
  start-and-exit        Only initiate and start the "mysqld" servers, use
                        the startup settings for the specified test case if any
  start-dirty           Only start the "mysqld" servers without initiation
  start-and-exit        Only initialize and start the servers, using the
                        startup settings for the specified test case (if any)
  start-dirty           Only start the servers (without initialization) for
                        the specified test case (if any)
  fast                  Don't try to clean up from earlier runs
  reorder               Reorder tests to get less server restarts
  reorder               Reorder tests to get fewer server restarts
  help                  Get this help text
  unified-diff | udiff  When presenting differences, use unified diff

+1 −1
Original line number Diff line number Diff line
@@ -264,7 +264,7 @@ done
# test if Ndb Cluster starts properly

if [ `expr $VERBOSE \> 1` = 1 ] ; then
  echo "Waiting for started..."
  echo "Waiting for NDB data nodes to start..."
fi
if ( $exec_waiter ) | grep "NDBT_ProgramExit: 0 - OK" > /dev/null 2>&1 ; then :; else
  if [ `expr $VERBOSE \> 0` = 1 ] ; then
+13 −0
Original line number Diff line number Diff line
@@ -392,3 +392,16 @@ HAVING HU.PROJ.CITY = HU.STAFF.CITY);
EMPNUM	GRADE*1000
E3	13000
DROP SCHEMA HU;
USE test;
create table t1(f1 int);
select f1 from t1 having max(f1)=f1;
f1
select f1 from t1 group by f1 having max(f1)=f1;
f1
set session sql_mode='ONLY_FULL_GROUP_BY';
select f1 from t1 having max(f1)=f1;
ERROR 42000: non-grouping field 'f1' is used in HAVING clause
select f1 from t1 group by f1 having max(f1)=f1;
f1
set session sql_mode='';
drop table t1;
+0 −3
Original line number Diff line number Diff line
@@ -215,9 +215,6 @@ select @@version;
select @@global.version;
@@global.version
#
select @@session.VERSION;
@@session.VERSION
#
set @first_var= NULL;
create table t1 select @first_var;
show create table t1;
+30 −1
Original line number Diff line number Diff line
@@ -275,7 +275,7 @@ ERROR HY000: Variable 'autocommit' is a SESSION variable and can't be used with
select @@global.timestamp;
ERROR HY000: Variable 'timestamp' is a SESSION variable
set @@version='';
ERROR HY000: Unknown system variable 'version'
ERROR HY000: Variable 'version' is a read only variable
set @@concurrent_insert=1;
ERROR HY000: Variable 'concurrent_insert' is a GLOBAL variable and should be set with SET GLOBAL
set @@global.sql_auto_is_null=1;
@@ -384,6 +384,7 @@ select @@sql_max_join_size,@@max_join_size;
set sql_quote_show_create=1;
set sql_safe_updates=1;
set sql_select_limit=1;
set sql_select_limit=default;
set sql_warnings=1;
set global table_open_cache=100;
set storage_engine=myisam;
@@ -584,3 +585,31 @@ set @@global.character_set_filesystem=default;
select @@global.character_set_filesystem;
@@global.character_set_filesystem
binary
set @old_sql_big_selects = @@sql_big_selects;
set @@sql_big_selects = 1;
show variables like 'sql_big_selects';
Variable_name	Value
sql_big_selects	ON
set @@sql_big_selects = @old_sql_big_selects;
set @@sql_notes = 0, @@sql_warnings = 0;
show variables like 'sql_notes';
Variable_name	Value
sql_notes	OFF
show variables like 'sql_warnings';
Variable_name	Value
sql_warnings	OFF
set @@sql_notes = 1, @@sql_warnings = 1;
show variables like 'sql_notes';
Variable_name	Value
sql_notes	ON
show variables like 'sql_warnings';
Variable_name	Value
sql_warnings	ON
select @@system_time_zone;
@@system_time_zone
#
select @@version, @@version_comment, @@version_compile_machine,
@@version_compile_os;
@@version	@@version_comment	@@version_compile_machine	@@version_compile_os
#	#	#	#
End of 5.0 tests
Loading