~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysql-test/mysql-test-run.pl

  • Committer: Brian Aker
  • Date: 2008-07-07 16:07:49 UTC
  • mfrom: (80.1.1 food)
  • Revision ID: brian@tangent.org-20080707160749-qj89fnnwufz4xgop
Clean up install, we no longer have system tables.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
#
5
5
##############################################################################
6
6
#
7
 
#  drizzle-test-run.pl
 
7
#  mysql-test-run.pl
8
8
#
9
9
#  Tool used for executing a suite of .test file
10
10
#
11
 
#  For now, see the "MySQL Test framework manual" for more information
 
11
#  See the "MySQL Test framework manual" for more information
12
12
#  http://dev.mysql.com/doc/mysqltest/en/index.html
13
 
#  (as the Drizzle test environment is currently still fairly similar)
14
13
#
15
14
#  Please keep the test framework tools identical in all versions!
16
15
#
50
49
# A nice way to trace the execution of this script while debugging
51
50
# is to use the Devel::Trace package found at
52
51
# "http://www.plover.com/~mjd/perl/Trace/" and run this script like
53
 
# "perl -d:Trace drizzle-test-run.pl"
 
52
# "perl -d:Trace mysql-test-run.pl"
54
53
#
55
54
 
56
55
 
74
73
select(STDOUT);
75
74
$| = 1; # Automatically flush STDOUT
76
75
 
77
 
require "mtr_cases.pl";
78
 
require "mtr_process.pl";
79
 
require "mtr_timer.pl";
80
 
require "mtr_io.pl";
81
 
require "mtr_gcov.pl";
82
 
require "mtr_gprof.pl";
83
 
require "mtr_report.pl";
84
 
require "mtr_match.pl";
85
 
require "mtr_misc.pl";
86
 
require "mtr_stress.pl";
87
 
require "mtr_unique.pl";
 
76
our $glob_win32_perl=  ($^O eq "MSWin32"); # ActiveState Win32 Perl
 
77
our $glob_cygwin_perl= ($^O eq "cygwin");  # Cygwin Perl
 
78
our $glob_win32=       ($glob_win32_perl or $glob_cygwin_perl);
 
79
our $glob_netware=     ($^O eq "NetWare"); # NetWare
 
80
 
 
81
require "lib/mtr_cases.pl";
 
82
require "lib/mtr_process.pl";
 
83
require "lib/mtr_timer.pl";
 
84
require "lib/mtr_io.pl";
 
85
require "lib/mtr_gcov.pl";
 
86
require "lib/mtr_gprof.pl";
 
87
require "lib/mtr_report.pl";
 
88
require "lib/mtr_match.pl";
 
89
require "lib/mtr_misc.pl";
 
90
require "lib/mtr_stress.pl";
 
91
require "lib/mtr_unique.pl";
88
92
 
89
93
$Devel::Trace::TRACE= 1;
90
94
 
100
104
our $glob_mysql_bench_dir=        undef;
101
105
our $glob_scriptname=             undef;
102
106
our $glob_timers=                 undef;
 
107
our $glob_use_embedded_server=    0;
103
108
our @glob_test_mode;
104
109
 
105
110
our $glob_basedir;
106
111
 
 
112
our $path_charsetsdir;
107
113
our $path_client_bindir;
 
114
our $path_share;
 
115
our $path_language;
108
116
our $path_timefile;
109
117
our $path_snapshot;
110
 
our $path_drizzletest_log;
 
118
our $path_mysqltest_log;
111
119
our $path_current_test_log;
112
120
our $path_my_basedir;
113
121
 
115
123
our $path_vardir_trace;          # unix formatted opt_vardir for trace files
116
124
our $opt_tmpdir;                 # A path but set directly on cmd line
117
125
 
 
126
# Visual Studio produces executables in different sub-directories based on the
 
127
# configuration used to build them.  To make life easier, an environment
 
128
# variable or command-line option may be specified to control which set of
 
129
# executables will be used by the test suite.
 
130
our $opt_vs_config = $ENV{'MTR_VS_CONFIG'};
118
131
 
119
132
our $default_vardir;
120
133
 
125
138
our $opt_verbose= 0;  # Verbose output, enable with --verbose
126
139
 
127
140
our $exe_master_mysqld;
128
 
our $exe_drizzle;
129
 
our $exe_drizzleadmin;
130
 
our $exe_drizzle_client_test;
 
141
our $exe_mysql;
 
142
our $exe_mysqladmin;
 
143
our $exe_mysqlbinlog;
 
144
our $exe_mysql_client_test;
131
145
our $exe_bug25714;
132
 
our $exe_drizzled;
133
 
our $exe_drizzlecheck;
134
 
our $exe_drizzledump;
135
 
our $exe_drizzleslap;
136
 
our $exe_drizzleimport;
137
 
our $exe_drizzle_fix_system_tables;
138
 
our $exe_drizzletest;
 
146
our $exe_mysqld;
 
147
our $exe_mysqlcheck;
 
148
our $exe_mysqldump;
 
149
our $exe_mysqlslap;
 
150
our $exe_mysqlimport;
 
151
our $exe_mysqlshow;
 
152
our $exe_mysql_fix_system_tables;
 
153
our $exe_mysqltest;
 
154
our $exe_ndbd;
 
155
our $exe_ndb_mgmd;
139
156
our $exe_slave_mysqld;
140
157
our $exe_my_print_defaults;
141
158
our $exe_perror;
153
170
our @opt_extra_mysqld_opt;
154
171
 
155
172
our $opt_compress;
 
173
our $opt_ssl;
 
174
our $opt_skip_ssl;
 
175
our $opt_ssl_supported;
 
176
our $opt_ps_protocol;
 
177
our $opt_sp_protocol;
 
178
our $opt_cursor_protocol;
 
179
our $opt_view_protocol;
156
180
 
157
181
our $opt_debug;
158
182
our $opt_do_test;
159
183
our @opt_cases;                  # The test cases names in argv
 
184
our $opt_embedded_server;
160
185
 
161
186
our $opt_extern= 0;
162
187
our $opt_socket;
194
219
 
195
220
our $opt_master_myport;
196
221
our $opt_slave_myport;
 
222
our $opt_ndbcluster_port;
 
223
our $opt_ndbconnectstring;
 
224
our $opt_ndbcluster_port_slave;
 
225
our $opt_ndbconnectstring_slave;
 
226
 
197
227
our $opt_record;
198
228
my $opt_report_features;
199
229
our $opt_check_testcases;
224
254
 
225
255
my $opt_valgrind= 0;
226
256
my $opt_valgrind_mysqld= 0;
227
 
my $opt_valgrind_drizzletest= 0;
 
257
my $opt_valgrind_mysqltest= 0;
228
258
my @default_valgrind_args= ("--show-reachable=yes");
229
259
my @valgrind_args;
230
260
my $opt_valgrind_path;
242
272
 
243
273
our $opt_warnings;
244
274
 
 
275
our $opt_skip_ndbcluster= 0;
 
276
our $opt_skip_ndbcluster_slave= 0;
 
277
our $opt_with_ndbcluster= 0;
 
278
our $opt_with_ndbcluster_only= 0;
 
279
our $glob_ndbcluster_supported= 0;
 
280
our $opt_ndb_extra_test= 0;
245
281
our $opt_skip_master_binlog= 0;
246
282
our $opt_skip_slave_binlog= 0;
247
283
 
 
284
our $exe_ndb_mgm;
 
285
our $exe_ndb_waiter;
 
286
our $path_ndb_tools_dir;
 
287
our $path_ndb_examples_dir;
 
288
our $exe_ndb_example;
 
289
our $path_ndb_testrun_log;
 
290
 
248
291
our $path_sql_dir;
249
292
 
250
293
our @data_dir_lst;
276
319
sub kill_running_servers ();
277
320
sub remove_stale_vardir ();
278
321
sub setup_vardir ();
 
322
sub check_ssl_support ($);
279
323
sub check_running_as_root();
 
324
sub check_ndbcluster_support ($);
 
325
sub rm_ndbcluster_tables ($);
 
326
sub ndbcluster_start_install ($);
 
327
sub ndbcluster_start ($$);
 
328
sub ndbcluster_wait_started ($$);
280
329
sub mysqld_wait_started($);
281
330
sub run_benchmarks ($);
282
331
sub initialize_servers ();
283
332
sub mysql_install_db ();
 
333
sub install_db ($$);
284
334
sub copy_install_db ($$);
285
335
sub run_testcase ($);
286
336
sub run_testcase_stop_servers ($$$);
289
339
sub report_failure_and_restart ($);
290
340
sub do_before_start_master ($);
291
341
sub do_before_start_slave ($);
 
342
sub ndbd_start ($$$);
 
343
sub ndb_mgmd_start ($);
292
344
sub mysqld_start ($$$);
293
345
sub mysqld_arguments ($$$$);
294
346
sub stop_all_servers ();
295
 
sub run_drizzletest ($);
 
347
sub run_mysqltest ($);
296
348
sub usage ($);
297
349
 
298
350
 
308
360
 
309
361
  command_line_setup();
310
362
 
 
363
  check_ndbcluster_support(\%mysqld_variables);
 
364
  check_ssl_support(\%mysqld_variables);
311
365
  check_debug_support(\%mysqld_variables);
312
366
 
313
367
  executable_setup();
343
397
      $opt_suites= $opt_suites_default;
344
398
 
345
399
      # Check for any extra suites to enable based on the path name
346
 
      my %extra_suites= ();
 
400
      my %extra_suites=
 
401
        (
 
402
         "mysql-5.1-new-ndb"              => "ndb_team",
 
403
         "mysql-5.1-new-ndb-merge"        => "ndb_team",
 
404
         "mysql-5.1-telco-6.2"            => "ndb_team",
 
405
         "mysql-5.1-telco-6.2-merge"      => "ndb_team",
 
406
         "mysql-5.1-telco-6.3"            => "ndb_team",
 
407
         "mysql-6.0-ndb"                  => "ndb_team",
 
408
        );
347
409
 
348
410
      foreach my $dir ( reverse splitdir($glob_basedir) )
349
411
      {
359
421
    my $tests= collect_test_cases($opt_suites);
360
422
 
361
423
    # Turn off NDB and other similar options if no tests use it
 
424
    my ($need_ndbcluster);
362
425
    foreach my $test (@$tests)
363
426
    {
364
427
      next if $test->{skip};
365
428
 
366
429
      if (!$opt_extern)
367
430
      {
 
431
        $need_ndbcluster||= $test->{ndb_test};
 
432
 
368
433
        # Count max number of slaves used by a test case
369
434
        if ( $test->{slave_num} > $max_slave_num) {
370
435
          $max_slave_num= $test->{slave_num};
381
446
      $use_innodb||= $test->{'innodb_test'};
382
447
    }
383
448
 
 
449
    # Check if cluster can be skipped
 
450
    if ( !$need_ndbcluster )
 
451
    {
 
452
      $opt_skip_ndbcluster= 1;
 
453
      $opt_skip_ndbcluster_slave= 1;
 
454
    }
 
455
 
 
456
    # Check if slave cluster can be skipped
 
457
    if ($max_slave_num == 0)
 
458
    {
 
459
      $opt_skip_ndbcluster_slave= 1;
 
460
    }
 
461
 
384
462
    initialize_servers();
385
463
 
386
464
    if ( $opt_report_features ) {
456
534
  Getopt::Long::Configure("pass_through");
457
535
  GetOptions(
458
536
             # Control what engine/variation to run
 
537
             'embedded-server'          => \$opt_embedded_server,
 
538
             'ps-protocol'              => \$opt_ps_protocol,
 
539
             'sp-protocol'              => \$opt_sp_protocol,
 
540
             'view-protocol'            => \$opt_view_protocol,
 
541
             'cursor-protocol'          => \$opt_cursor_protocol,
 
542
             'ssl|with-openssl'         => \$opt_ssl,
 
543
             'skip-ssl'                 => \$opt_skip_ssl,
459
544
             'compress'                 => \$opt_compress,
460
545
             'bench'                    => \$opt_bench,
461
546
             'small-bench'              => \$opt_small_bench,
 
547
             'with-ndbcluster|ndb'      => \$opt_with_ndbcluster,
 
548
             'vs-config'            => \$opt_vs_config,
462
549
 
463
550
             # Control what test suites or cases to run
464
551
             'force'                    => \$opt_force,
 
552
             'with-ndbcluster-only'     => \$opt_with_ndbcluster_only,
 
553
             'skip-ndbcluster|skip-ndb' => \$opt_skip_ndbcluster,
 
554
             'skip-ndbcluster-slave|skip-ndb-slave'
 
555
                                        => \$opt_skip_ndbcluster_slave,
 
556
             'ndb-extra-test'           => \$opt_ndb_extra_test,
465
557
             'skip-master-binlog'       => \$opt_skip_master_binlog,
466
558
             'skip-slave-binlog'        => \$opt_skip_slave_binlog,
467
559
             'do-test=s'                => \$opt_do_test,
476
568
             # Specify ports
477
569
             'master_port=i'            => \$opt_master_myport,
478
570
             'slave_port=i'             => \$opt_slave_myport,
 
571
             'ndbcluster-port|ndbcluster_port=i' => \$opt_ndbcluster_port,
 
572
             'ndbcluster-port-slave=i'  => \$opt_ndbcluster_port_slave,
479
573
             'mtr-build-thread=i'       => \$opt_mtr_build_thread,
480
574
 
481
575
             # Test case authoring
488
582
 
489
583
             # Run test on running server
490
584
             'extern'                   => \$opt_extern,
 
585
             'ndb-connectstring=s'       => \$opt_ndbconnectstring,
 
586
             'ndb-connectstring-slave=s' => \$opt_ndbconnectstring_slave,
491
587
 
492
588
             # Debugging
493
589
             'gdb'                      => \$opt_gdb,
508
604
             'gcov'                     => \$opt_gcov,
509
605
             'gprof'                    => \$opt_gprof,
510
606
             'valgrind|valgrind-all'    => \$opt_valgrind,
511
 
             'valgrind-drizzletest'       => \$opt_valgrind_drizzletest,
 
607
             'valgrind-mysqltest'       => \$opt_valgrind_mysqltest,
512
608
             'valgrind-mysqld'          => \$opt_valgrind_mysqld,
513
609
             'valgrind-options=s'       => sub {
514
610
               my ($opt, $value)= @_;
581
677
  }
582
678
 
583
679
  # We require that we are in the "mysql-test" directory
584
 
  # to run drizzle-test-run
 
680
  # to run mysql-test-run
585
681
  if (! -f $glob_scriptname)
586
682
  {
587
 
    mtr_error("Can't find the location for the drizzle-test-run script\n" .
 
683
    mtr_error("Can't find the location for the mysql-test-run script\n" .
588
684
              "Go to to the mysql-test directory and execute the script " .
589
685
              "as follows:\n./$glob_scriptname");
590
686
  }
591
687
 
592
 
  if ( -d "../drizzled" )
 
688
  if ( -d "../sql" )
593
689
  {
594
690
    $source_dist=  1;
595
691
  }
596
692
 
597
693
  # Find the absolute path to the test directory
598
694
  $glob_mysql_test_dir=  cwd();
 
695
  if ( $glob_cygwin_perl )
 
696
  {
 
697
    # Windows programs like 'mysqld' needs Windows paths
 
698
    $glob_mysql_test_dir= `cygpath -m "$glob_mysql_test_dir"`;
 
699
    chomp($glob_mysql_test_dir);
 
700
  }
599
701
  $default_vardir= "$glob_mysql_test_dir/var";
600
702
 
601
703
  # In most cases, the base directory we find everything relative to,
624
726
 
625
727
  $glob_timers= mtr_init_timers();
626
728
 
 
729
  # --------------------------------------------------------------------------
 
730
  # Embedded server flag
 
731
  # --------------------------------------------------------------------------
 
732
  if ( $opt_embedded_server )
 
733
  {
 
734
    $glob_use_embedded_server= 1;
 
735
    # Add the location for libmysqld.dll to the path.
 
736
    if ( $glob_win32 )
 
737
    {
 
738
      my $lib_mysqld=
 
739
        mtr_path_exists(vs_config_dirs('libmysqld',''));
 
740
          $lib_mysqld= $glob_cygwin_perl ? ":".`cygpath "$lib_mysqld"` 
 
741
                                     : ";".$lib_mysqld;
 
742
      chomp($lib_mysqld);
 
743
      $ENV{'PATH'}="$ENV{'PATH'}".$lib_mysqld;
 
744
    }
 
745
 
 
746
    push(@glob_test_mode, "embedded");
 
747
    $opt_skip_rpl= 1;              # We never run replication with embedded
 
748
    $opt_skip_ndbcluster= 1;       # Turn off use of NDB cluster
 
749
    $opt_skip_ssl= 1;              # Turn off use of SSL
 
750
 
 
751
    # Turn off use of bin log
 
752
    push(@opt_extra_mysqld_opt, "--skip-log-bin");
 
753
 
 
754
    if ( $opt_extern )
 
755
    {
 
756
      mtr_error("Can't use --extern with --embedded-server");
 
757
    }
 
758
  }
 
759
 
627
760
  #
628
761
  # Find the mysqld executable to be able to find the mysqld version
629
762
  # number as early as possible
630
763
  #
631
764
 
632
765
  # Look for the client binaries directory
633
 
  $path_client_bindir= mtr_path_exists("$glob_basedir/client",
 
766
  $path_client_bindir= mtr_path_exists("$glob_basedir/client_release",
 
767
                                       "$glob_basedir/client_debug",
 
768
                                       vs_config_dirs('client', ''),
 
769
                                       "$glob_basedir/client",
634
770
                                       "$glob_basedir/bin");
635
771
 
 
772
  # Look for language files and charsetsdir, use same share
 
773
  $path_share=      mtr_path_exists("$glob_basedir/share/mysql",
 
774
                                    "$glob_basedir/sql/share",
 
775
                                    "$glob_basedir/share");
 
776
 
 
777
  $path_language=      mtr_path_exists("$path_share/english");
 
778
  $path_charsetsdir=   mtr_path_exists("$path_share/charsets");
 
779
 
 
780
 
636
781
  if (!$opt_extern)
637
782
  {
638
 
    $exe_drizzled=       mtr_exe_exists ("$glob_basedir/drizzled/drizzled",
639
 
                                       "$path_client_bindir/drizzled",
640
 
                                       "$glob_basedir/libexec/drizzled",
641
 
                                       "$glob_basedir/bin/drizzled",
642
 
                                       "$glob_basedir/sbin/drizzled");
 
783
    $exe_mysqld=       mtr_exe_exists (vs_config_dirs('sql', 'mysqld'),
 
784
                                       vs_config_dirs('sql', 'mysqld-debug'),
 
785
                                       "$glob_basedir/sql/mysqld",
 
786
                                       "$path_client_bindir/mysqld-max-nt",
 
787
                                       "$path_client_bindir/mysqld-max",
 
788
                                       "$path_client_bindir/mysqld-nt",
 
789
                                       "$path_client_bindir/mysqld",
 
790
                                       "$path_client_bindir/mysqld-debug",
 
791
                                       "$path_client_bindir/mysqld-max",
 
792
                                       "$glob_basedir/libexec/mysqld",
 
793
                                       "$glob_basedir/bin/mysqld",
 
794
                                       "$glob_basedir/sbin/mysqld");
643
795
 
644
796
    # Use the mysqld found above to find out what features are available
645
797
    collect_mysqld_features();
646
798
  }
647
799
  else
648
800
  {
649
 
    $mysqld_variables{'port'}= 4427;
 
801
    $mysqld_variables{'port'}= 3306;
650
802
  }
651
803
 
652
804
  if ( $opt_comment )
705
857
  # --------------------------------------------------------------------------
706
858
  # Find out default storage engine being used(if any)
707
859
  # --------------------------------------------------------------------------
 
860
  if ( $opt_with_ndbcluster )
 
861
  {
 
862
    # --ndb or --with-ndbcluster turns on --default-storage-engine=ndbcluster
 
863
    push(@opt_extra_mysqld_opt, "--default-storage-engine=ndbcluster");
 
864
  }
 
865
 
708
866
  foreach my $arg ( @opt_extra_mysqld_opt )
709
867
  {
710
868
    if ( $arg =~ /default-storage-engine=(\S+)/ )
755
913
    # Version 4.1 and --vardir was specified
756
914
    # Only supported as a symlink from var/
757
915
    # by setting up $opt_mem that symlink will be created
 
916
    if ( ! $glob_win32 )
758
917
    {
759
918
      # Only platforms that have native symlinks can use the vardir trick
760
919
      $opt_mem= $opt_vardir;
769
928
  $path_vardir_trace=~ s/^\w://;
770
929
 
771
930
  # We make the path absolute, as the server will do a chdir() before usage
772
 
  unless ( $opt_vardir =~ m,^/,)
 
931
  unless ( $opt_vardir =~ m,^/, or
 
932
           ($glob_win32 and $opt_vardir =~ m,^[a-z]:/,i) )
773
933
  {
774
934
    # Make absolute path, relative test dir
775
935
    $opt_vardir= "$glob_mysql_test_dir/$opt_vardir";
795
955
  }
796
956
 
797
957
  # --------------------------------------------------------------------------
 
958
  # ps protcol flag
 
959
  # --------------------------------------------------------------------------
 
960
  if ( $opt_ps_protocol )
 
961
  {
 
962
    push(@glob_test_mode, "ps-protocol");
 
963
  }
 
964
 
 
965
  # --------------------------------------------------------------------------
798
966
  # Bench flags
799
967
  # --------------------------------------------------------------------------
800
968
  if ( $opt_small_bench )
836
1004
  # --------------------------------------------------------------------------
837
1005
  # Check if special exe was selected for master or slave
838
1006
  # --------------------------------------------------------------------------
839
 
  $exe_master_mysqld= $exe_master_mysqld || $exe_drizzled;
840
 
  $exe_slave_mysqld=  $exe_slave_mysqld  || $exe_drizzled;
 
1007
  $exe_master_mysqld= $exe_master_mysqld || $exe_mysqld;
 
1008
  $exe_slave_mysqld=  $exe_slave_mysqld  || $exe_mysqld;
841
1009
 
842
1010
  # --------------------------------------------------------------------------
843
1011
  # Check valgrind arguments
847
1015
    mtr_report("Turning on valgrind for all executables");
848
1016
    $opt_valgrind= 1;
849
1017
    $opt_valgrind_mysqld= 1;
850
 
    $opt_valgrind_drizzletest= 1;
 
1018
    $opt_valgrind_mysqltest= 1;
851
1019
  }
852
1020
  elsif ( $opt_valgrind_mysqld )
853
1021
  {
854
1022
    mtr_report("Turning on valgrind for mysqld(s) only");
855
1023
    $opt_valgrind= 1;
856
1024
  }
857
 
  elsif ( $opt_valgrind_drizzletest )
 
1025
  elsif ( $opt_valgrind_mysqltest )
858
1026
  {
859
 
    mtr_report("Turning on valgrind for drizzletest and drizzle_client_test only");
 
1027
    mtr_report("Turning on valgrind for mysqltest and mysql_client_test only");
860
1028
    $opt_valgrind= 1;
861
1029
  }
862
1030
 
885
1053
  {
886
1054
    $opt_testcase_timeout= $default_testcase_timeout;
887
1055
    $opt_testcase_timeout*= 10 if $opt_valgrind;
 
1056
    $opt_testcase_timeout*= 10 if ($opt_debug and $glob_win32);
888
1057
  }
889
1058
 
890
1059
  if ( ! $opt_suite_timeout )
891
1060
  {
892
1061
    $opt_suite_timeout= $default_suite_timeout;
893
1062
    $opt_suite_timeout*= 6 if $opt_valgrind;
 
1063
    $opt_suite_timeout*= 6 if ($opt_debug and $glob_win32);
894
1064
  }
895
1065
 
896
1066
  if ( ! $opt_user )
993
1163
  };
994
1164
 
995
1165
 
 
1166
  my $data_dir= "$opt_vardir/ndbcluster-$opt_ndbcluster_port";
 
1167
  $clusters->[0]=
 
1168
  {
 
1169
   name            => "Master",
 
1170
   nodes           => 2,
 
1171
   port            => "$opt_ndbcluster_port",
 
1172
   data_dir        => "$data_dir",
 
1173
   connect_string  => "host=localhost:$opt_ndbcluster_port",
 
1174
   path_pid        => "$data_dir/ndb_3.pid", # Nodes + 1
 
1175
   pid             => 0, # pid of ndb_mgmd
 
1176
   installed_ok    => 0,
 
1177
  };
 
1178
 
 
1179
  $data_dir= "$opt_vardir/ndbcluster-$opt_ndbcluster_port_slave";
 
1180
  $clusters->[1]=
 
1181
  {
 
1182
   name            => "Slave",
 
1183
   nodes           => 1,
 
1184
   port            => "$opt_ndbcluster_port_slave",
 
1185
   data_dir        => "$data_dir",
 
1186
   connect_string  => "host=localhost:$opt_ndbcluster_port_slave",
 
1187
   path_pid        => "$data_dir/ndb_2.pid", # Nodes + 1
 
1188
   pid             => 0, # pid of ndb_mgmd
 
1189
   installed_ok    => 0,
 
1190
  };
 
1191
 
 
1192
  # Init pids of ndbd's
 
1193
  foreach my $cluster ( @{$clusters} )
 
1194
  {
 
1195
    for ( my $idx= 0; $idx < $cluster->{'nodes'}; $idx++ )
 
1196
    {
 
1197
      my $nodeid= $idx+1;
 
1198
      $cluster->{'ndbds'}->[$idx]=
 
1199
        {
 
1200
         pid      => 0,
 
1201
         nodeid => $nodeid,
 
1202
         path_pid => "$cluster->{'data_dir'}/ndb_${nodeid}.pid",
 
1203
         path_fs => "$cluster->{'data_dir'}/ndb_${nodeid}_fs",
 
1204
        };
 
1205
    }
 
1206
  }
 
1207
 
996
1208
  # --------------------------------------------------------------------------
997
1209
  # extern
998
1210
  # --------------------------------------------------------------------------
1000
1212
  {
1001
1213
    # Turn off features not supported when running with extern server
1002
1214
    $opt_skip_rpl= 1;
 
1215
    $opt_skip_ndbcluster= 1;
1003
1216
    warn("Currenty broken --extern");
1004
1217
 
1005
1218
    # Setup master->[0] with the settings for the extern server
1013
1226
  }
1014
1227
 
1015
1228
 
1016
 
  $path_timefile=  "$opt_vardir/log/drizzletest-time";
1017
 
  $path_drizzletest_log=  "$opt_vardir/log/drizzletest.log";
 
1229
  # --------------------------------------------------------------------------
 
1230
  # ndbconnectstring and ndbconnectstring_slave
 
1231
  # --------------------------------------------------------------------------
 
1232
  if ( $opt_ndbconnectstring )
 
1233
  {
 
1234
    # ndbconnectstring was supplied by user, the tests shoudl be run
 
1235
    # against an already started cluster, change settings
 
1236
    my $cluster= $clusters->[0]; # Master cluster
 
1237
    $cluster->{'connect_string'}= $opt_ndbconnectstring;
 
1238
    $cluster->{'use_running'}= 1;
 
1239
 
 
1240
    mtr_error("Can't specify --ndb-connectstring and --skip-ndbcluster")
 
1241
      if $opt_skip_ndbcluster;
 
1242
  }
 
1243
  $ENV{'NDB_CONNECTSTRING'}= $clusters->[0]->{'connect_string'};
 
1244
 
 
1245
 
 
1246
  if ( $opt_ndbconnectstring_slave )
 
1247
  {
 
1248
    # ndbconnectstring-slave was supplied by user, the tests should be run
 
1249
    # agains an already started slave cluster, change settings
 
1250
    my $cluster= $clusters->[1]; # Slave cluster
 
1251
    $cluster->{'connect_string'}= $opt_ndbconnectstring_slave;
 
1252
    $cluster->{'use_running'}= 1;
 
1253
 
 
1254
    mtr_error("Can't specify ndb-connectstring_slave and " .
 
1255
              "--skip-ndbcluster-slave")
 
1256
      if $opt_skip_ndbcluster_slave;
 
1257
  }
 
1258
 
 
1259
 
 
1260
  $path_timefile=  "$opt_vardir/log/mysqltest-time";
 
1261
  $path_mysqltest_log=  "$opt_vardir/log/mysqltest.log";
1018
1262
  $path_current_test_log= "$opt_vardir/log/current_test";
 
1263
  $path_ndb_testrun_log= "$opt_vardir/log/ndb_testrun.log";
1019
1264
 
1020
1265
  $path_snapshot= "$opt_tmpdir/snapshot_$opt_master_myport/";
1021
1266
 
1062
1307
  # A magic value in command_line_setup depends on these equations.
1063
1308
  $opt_master_myport=         $mtr_build_thread * 10 + 10000; # and 1
1064
1309
  $opt_slave_myport=          $opt_master_myport + 2;  # and 3 4
 
1310
  $opt_ndbcluster_port=       $opt_master_myport + 5;
 
1311
  $opt_ndbcluster_port_slave= $opt_master_myport + 6;
1065
1312
 
1066
1313
  if ( $opt_master_myport < 5001 or $opt_master_myport + 10 >= 32767 )
1067
1314
  {
1107
1354
  #
1108
1355
  # --datadir must exist, mysqld will chdir into it
1109
1356
  #
1110
 
  my $list= `$exe_drizzled --no-defaults --datadir=$tmpdir --skip-grant-tables --verbose --help`;
 
1357
  my $list= `$exe_mysqld --no-defaults --datadir=$tmpdir --language=$path_language --skip-grant-tables --verbose --help`;
1111
1358
 
1112
1359
  foreach my $line (split('\n', $list))
1113
1360
  {
1115
1362
    if ( !$mysql_version_id )
1116
1363
    {
1117
1364
      # Look for version
1118
 
      my $exe_name= basename($exe_drizzled);
 
1365
      my $exe_name= basename($exe_mysqld);
1119
1366
      mtr_verbose("exe_name: $exe_name");
1120
1367
      if ( $line =~ /^\S*$exe_name\s\sVer\s([0-9]*)\.([0-9]*)\.([0-9]*)/ )
1121
1368
      {
1181
1428
  mtr_add_arg($args, "--silent"); # Tab separated output
1182
1429
  mtr_add_arg($args, "-e '%s'", $query);
1183
1430
 
1184
 
  my $cmd= "$exe_drizzle " . join(' ', @$args);
 
1431
  my $cmd= "$exe_mysql " . join(' ', @$args);
1185
1432
  mtr_verbose("cmd: $cmd");
1186
1433
  return `$cmd`;
1187
1434
}
1202
1449
  }
1203
1450
}
1204
1451
 
 
1452
 
 
1453
sub executable_setup_ndb () {
 
1454
 
 
1455
  # Look for ndb tols and binaries
 
1456
  my $ndb_path= mtr_file_exists("$glob_basedir/ndb",
 
1457
                                "$glob_basedir/storage/ndb",
 
1458
                                "$glob_basedir/bin");
 
1459
 
 
1460
  $exe_ndbd=
 
1461
    mtr_exe_maybe_exists("$ndb_path/src/kernel/ndbd",
 
1462
                         "$ndb_path/ndbd");
 
1463
  $exe_ndb_mgm=
 
1464
    mtr_exe_maybe_exists("$ndb_path/src/mgmclient/ndb_mgm",
 
1465
                         "$ndb_path/ndb_mgm");
 
1466
  $exe_ndb_mgmd=
 
1467
    mtr_exe_maybe_exists("$ndb_path/src/mgmsrv/ndb_mgmd",
 
1468
                         "$ndb_path/ndb_mgmd");
 
1469
  $exe_ndb_waiter=
 
1470
    mtr_exe_maybe_exists("$ndb_path/tools/ndb_waiter",
 
1471
                         "$ndb_path/ndb_waiter");
 
1472
 
 
1473
  # May not exist
 
1474
  $path_ndb_tools_dir= mtr_file_exists("$ndb_path/tools",
 
1475
                                       "$ndb_path");
 
1476
  # May not exist
 
1477
  $path_ndb_examples_dir=
 
1478
    mtr_file_exists("$ndb_path/ndbapi-examples",
 
1479
                    "$ndb_path/examples");
 
1480
  # May not exist
 
1481
  $exe_ndb_example=
 
1482
    mtr_file_exists("$path_ndb_examples_dir/ndbapi_simple/ndbapi_simple");
 
1483
 
 
1484
  return ( $exe_ndbd eq "" or
 
1485
           $exe_ndb_mgm eq "" or
 
1486
           $exe_ndb_mgmd eq "" or
 
1487
           $exe_ndb_waiter eq "");
 
1488
}
 
1489
 
1205
1490
sub executable_setup () {
1206
1491
 
1207
 
#
1208
 
# Check if libtool is available in this distribution/clone
1209
 
# we need it when valgrinding or debugging non installed binary
1210
 
# Otherwise valgrind will valgrind the libtool wrapper or bash
1211
 
# and gdb will not find the real executable to debug
1212
 
#
 
1492
  #
 
1493
  # Check if libtool is available in this distribution/clone
 
1494
  # we need it when valgrinding or debugging non installed binary
 
1495
  # Otherwise valgrind will valgrind the libtool wrapper or bash
 
1496
  # and gdb will not find the real executable to debug
 
1497
  #
1213
1498
  if ( -x "../libtool")
1214
1499
  {
1215
1500
    $exe_libtool= "../libtool";
1219
1504
    }
1220
1505
  }
1221
1506
 
1222
 
# Look for my_print_defaults
 
1507
  # Look for my_print_defaults
1223
1508
  $exe_my_print_defaults=
1224
 
    mtr_exe_exists(
1225
 
        "$path_client_bindir/my_print_defaults",
1226
 
        "$glob_basedir/extra/my_print_defaults");
 
1509
    mtr_exe_exists(vs_config_dirs('extra', 'my_print_defaults'),
 
1510
                           "$path_client_bindir/my_print_defaults",
 
1511
                           "$glob_basedir/extra/my_print_defaults");
1227
1512
 
1228
 
# Look for perror
 
1513
  # Look for perror
1229
1514
  $exe_perror= "perror";
1230
1515
 
1231
 
# Look for the client binaries
1232
 
  $exe_drizzlecheck= mtr_exe_exists("$path_client_bindir/drizzlecheck");
1233
 
  $exe_drizzledump= mtr_exe_exists("$path_client_bindir/drizzledump");
1234
 
  $exe_drizzleimport= mtr_exe_exists("$path_client_bindir/drizzleimport");
1235
 
  $exe_drizzleadmin= mtr_exe_exists("$path_client_bindir/drizzleadmin");
1236
 
  $exe_drizzle=          mtr_exe_exists("$path_client_bindir/drizzle");
 
1516
  # Look for the client binaries
 
1517
  $exe_mysqlcheck=     mtr_exe_exists("$path_client_bindir/mysqlcheck");
 
1518
  $exe_mysqldump=      mtr_exe_exists("$path_client_bindir/mysqldump");
 
1519
  $exe_mysqlimport=    mtr_exe_exists("$path_client_bindir/mysqlimport");
 
1520
  $exe_mysqlshow=      mtr_exe_exists("$path_client_bindir/mysqlshow");
 
1521
  $exe_mysqlbinlog=    mtr_exe_exists("$path_client_bindir/mysqlbinlog");
 
1522
  $exe_mysqladmin=     mtr_exe_exists("$path_client_bindir/mysqladmin");
 
1523
  $exe_mysql=          mtr_exe_exists("$path_client_bindir/mysql");
1237
1524
 
1238
1525
  if (!$opt_extern)
1239
1526
  {
1240
 
# Look for SQL scripts directory
1241
 
     if ( $mysql_version_id >= 50100 )
1242
 
     {
1243
 
         $exe_drizzleslap= mtr_exe_exists("$path_client_bindir/drizzleslap");
1244
 
     }
1245
 
  }
1246
 
 
1247
 
# Look for drizzletest executable
1248
 
  {
1249
 
    $exe_drizzletest= mtr_exe_exists("$path_client_bindir/drizzletest");
1250
 
  }
1251
 
 
1252
 
# Look for drizzle_client_test executable which may _not_ exist in
1253
 
# some versions, test using it should be skipped
1254
 
  {
1255
 
    $exe_drizzle_client_test=
 
1527
  # Look for SQL scripts directory
 
1528
    if ( $mysql_version_id >= 50100 )
 
1529
    {
 
1530
      $exe_mysqlslap=    mtr_exe_exists("$path_client_bindir/mysqlslap");
 
1531
    }
 
1532
 
 
1533
 
 
1534
    if ( ! $opt_skip_ndbcluster and executable_setup_ndb())
 
1535
    {
 
1536
      mtr_warning("Could not find all required ndb binaries, " .
 
1537
                "all ndb tests will fail, use --skip-ndbcluster to " .
 
1538
                "skip testing it.");
 
1539
 
 
1540
      foreach my $cluster (@{$clusters})
 
1541
      {
 
1542
        $cluster->{"executable_setup_failed"}= 1;
 
1543
      }
 
1544
    }
 
1545
 
 
1546
 
 
1547
    # Look for the udf_example library
 
1548
    $lib_udf_example=
 
1549
      mtr_file_exists(vs_config_dirs('sql', 'udf_example.dll'),
 
1550
                      "$glob_basedir/sql/.libs/udf_example.so",);
 
1551
 
 
1552
    # Look for the ha_example library
 
1553
    $lib_example_plugin=
 
1554
      mtr_file_exists(vs_config_dirs('storage/example', 'ha_example.dll'),
 
1555
                      "$glob_basedir/storage/example/.libs/ha_example.so",);
 
1556
 
 
1557
  }
 
1558
 
 
1559
  # Look for mysqltest executable
 
1560
  if ( $glob_use_embedded_server )
 
1561
  {
 
1562
    $exe_mysqltest=
 
1563
      mtr_exe_exists(vs_config_dirs('libmysqld/examples','mysqltest_embedded'),
 
1564
                     "$glob_basedir/libmysqld/examples/mysqltest_embedded",
 
1565
                     "$path_client_bindir/mysqltest_embedded");
 
1566
  }
 
1567
  else
 
1568
  {
 
1569
    $exe_mysqltest= mtr_exe_exists("$path_client_bindir/mysqltest");
 
1570
  }
 
1571
 
 
1572
  # Look for mysql_client_test executable which may _not_ exist in
 
1573
  # some versions, test using it should be skipped
 
1574
  if ( $glob_use_embedded_server )
 
1575
  {
 
1576
    $exe_mysql_client_test=
1256
1577
      mtr_exe_maybe_exists(
1257
 
          "$glob_basedir/tests/drizzle_client_test",
1258
 
          "$glob_basedir/bin/drizzle_client_test");
 
1578
        vs_config_dirs('libmysqld/examples', 'mysql_client_test_embedded'),
 
1579
        "$glob_basedir/libmysqld/examples/mysql_client_test_embedded");
 
1580
  }
 
1581
  else
 
1582
  {
 
1583
    $exe_mysql_client_test=
 
1584
      mtr_exe_maybe_exists(vs_config_dirs('tests', 'mysql_client_test'),
 
1585
                           "$glob_basedir/tests/mysql_client_test",
 
1586
                           "$glob_basedir/bin/mysql_client_test");
1259
1587
  }
1260
1588
 
1261
 
# Look for bug25714 executable which may _not_ exist in
1262
 
# some versions, test using it should be skipped
 
1589
  # Look for bug25714 executable which may _not_ exist in
 
1590
  # some versions, test using it should be skipped
1263
1591
  $exe_bug25714=
1264
 
    mtr_exe_maybe_exists(
1265
 
        "$glob_basedir/tests/bug25714");
 
1592
      mtr_exe_maybe_exists(vs_config_dirs('tests', 'bug25714'),
 
1593
                           "$glob_basedir/tests/bug25714");
1266
1594
}
1267
1595
 
1268
1596
 
1269
 
 
1270
1597
sub generate_cmdline_mysqldump ($) {
1271
1598
  my($mysqld) = @_;
1272
1599
  return
1273
 
    mtr_native_path($exe_drizzledump) .
 
1600
    mtr_native_path($exe_mysqldump) .
1274
1601
      " --no-defaults -uroot --debug-check " .
1275
1602
      "--port=$mysqld->{'port'} ";
1276
1603
}
1279
1606
##############################################################################
1280
1607
#
1281
1608
#  Set environment to be used by childs of this process for
1282
 
#  things that are constant duting the whole lifetime of drizzle-test-run.pl
 
1609
#  things that are constant duting the whole lifetime of mysql-test-run.pl
1283
1610
#
1284
1611
##############################################################################
1285
1612
 
1286
 
sub drizzle_client_test_arguments()
 
1613
sub mysql_client_test_arguments()
1287
1614
{
1288
 
  my $exe= $exe_drizzle_client_test;
 
1615
  my $exe= $exe_mysql_client_test;
1289
1616
 
1290
1617
  my $args;
1291
1618
  mtr_init_args(\$args);
1292
 
  if ( $opt_valgrind_drizzletest )
 
1619
  if ( $opt_valgrind_mysqltest )
1293
1620
  {
1294
1621
    valgrind_arguments($args, \$exe);
1295
1622
  }
1307
1634
  if ( $opt_debug )
1308
1635
  {
1309
1636
    mtr_add_arg($args,
1310
 
      "--debug=d:t:A,$path_vardir_trace/log/drizzle_client_test.trace");
 
1637
      "--debug=d:t:A,$path_vardir_trace/log/mysql_client_test.trace");
 
1638
  }
 
1639
 
 
1640
  if ( $glob_use_embedded_server )
 
1641
  {
 
1642
    mtr_add_arg($args,
 
1643
      " -A --language=$path_language");
 
1644
    mtr_add_arg($args,
 
1645
      " -A --datadir=$slave->[0]->{'path_myddir'}");
 
1646
    mtr_add_arg($args,
 
1647
      " -A --character-sets-dir=$path_charsetsdir");
1311
1648
  }
1312
1649
 
1313
1650
  return join(" ", $exe, @$args);
1337
1674
    push(@ld_library_paths, "$glob_basedir/lib");
1338
1675
  }
1339
1676
 
 
1677
 # --------------------------------------------------------------------------
 
1678
  # Add the path where libndbclient can be found
 
1679
  # --------------------------------------------------------------------------
 
1680
  if ( $glob_ndbcluster_supported )
 
1681
  {
 
1682
    push(@ld_library_paths,  "$glob_basedir/storage/ndb/src/.libs");
 
1683
  }
 
1684
 
1340
1685
  # --------------------------------------------------------------------------
1341
1686
  # Valgrind need to be run with debug libraries otherwise it's almost
1342
1687
  # impossible to add correct supressions, that means if "/usr/lib/debug"
1383
1728
  # Also command lines in .opt files may contain env vars
1384
1729
  # --------------------------------------------------------------------------
1385
1730
 
1386
 
  $ENV{'CHARSETSDIR'}=              "";
 
1731
  $ENV{'CHARSETSDIR'}=              $path_charsetsdir;
1387
1732
  $ENV{'UMASK'}=              "0660"; # The octal *string*
1388
1733
  $ENV{'UMASK_DIR'}=          "0770"; # The octal *string*
1389
1734
  
1400
1745
  
1401
1746
  $ENV{'LC_COLLATE'}=         "C";
1402
1747
  $ENV{'USE_RUNNING_SERVER'}= $opt_extern;
1403
 
  $ENV{'DRIZZLE_TEST_DIR'}=     $glob_mysql_test_dir;
 
1748
  $ENV{'MYSQL_TEST_DIR'}=     $glob_mysql_test_dir;
1404
1749
  $ENV{'MYSQLTEST_VARDIR'}=   $opt_vardir;
1405
 
  $ENV{'DRIZZLE_TMP_DIR'}=      $opt_tmpdir;
 
1750
  $ENV{'MYSQL_TMP_DIR'}=      $opt_tmpdir;
1406
1751
  $ENV{'MASTER_MYSOCK'}=      $master->[0]->{'path_sock'};
1407
1752
  $ENV{'MASTER_MYSOCK1'}=     $master->[1]->{'path_sock'};
1408
1753
  $ENV{'MASTER_MYPORT'}=      $master->[0]->{'port'};
1411
1756
  $ENV{'SLAVE_MYPORT'}=       $slave->[0]->{'port'};
1412
1757
  $ENV{'SLAVE_MYPORT1'}=      $slave->[1]->{'port'};
1413
1758
  $ENV{'SLAVE_MYPORT2'}=      $slave->[2]->{'port'};
1414
 
  $ENV{'DRIZZLE_TCP_PORT'}=     $mysqld_variables{'port'};
 
1759
  $ENV{'MYSQL_TCP_PORT'}=     $mysqld_variables{'port'};
1415
1760
 
1416
1761
  $ENV{MTR_BUILD_THREAD}=      $opt_mtr_build_thread;
1417
1762
 
1418
 
  $ENV{'EXE_MYSQL'}=          $exe_drizzle;
 
1763
  $ENV{'EXE_MYSQL'}=          $exe_mysql;
 
1764
 
 
1765
 
 
1766
  # ----------------------------------------------------
 
1767
  # Setup env for NDB
 
1768
  # ----------------------------------------------------
 
1769
  if ( ! $opt_skip_ndbcluster )
 
1770
  {
 
1771
    $ENV{'NDB_MGM'}=                  $exe_ndb_mgm;
 
1772
 
 
1773
    $ENV{'NDBCLUSTER_PORT'}=          $opt_ndbcluster_port;
 
1774
    $ENV{'NDBCLUSTER_PORT_SLAVE'}=    $opt_ndbcluster_port_slave;
 
1775
 
 
1776
    $ENV{'NDB_EXTRA_TEST'}=           $opt_ndb_extra_test;
 
1777
 
 
1778
    $ENV{'NDB_BACKUP_DIR'}=           $clusters->[0]->{'data_dir'};
 
1779
    $ENV{'NDB_DATA_DIR'}=             $clusters->[0]->{'data_dir'};
 
1780
    $ENV{'NDB_TOOLS_DIR'}=            $path_ndb_tools_dir;
 
1781
    $ENV{'NDB_TOOLS_OUTPUT'}=         $path_ndb_testrun_log;
 
1782
 
 
1783
    if ( $mysql_version_id >= 50000 )
 
1784
    {
 
1785
      $ENV{'NDB_EXAMPLES_DIR'}=         $path_ndb_examples_dir;
 
1786
      $ENV{'MY_NDB_EXAMPLES_BINARY'}=   $exe_ndb_example;
 
1787
    }
 
1788
    $ENV{'NDB_EXAMPLES_OUTPUT'}=      $path_ndb_testrun_log;
 
1789
  }
1419
1790
 
1420
1791
  # ----------------------------------------------------
1421
1792
  # Setup env so childs can execute mysqlcheck
1422
1793
  # ----------------------------------------------------
1423
1794
  my $cmdline_mysqlcheck=
1424
 
    mtr_native_path($exe_drizzlecheck) .
 
1795
    mtr_native_path($exe_mysqlcheck) .
1425
1796
    " --no-defaults --debug-check -uroot " .
1426
1797
    "--port=$master->[0]->{'port'} ";
1427
1798
 
1430
1801
    $cmdline_mysqlcheck .=
1431
1802
      " --debug=d:t:A,$path_vardir_trace/log/mysqlcheck.trace";
1432
1803
  }
1433
 
  $ENV{'DRIZZLE_CHECK'}=              $cmdline_mysqlcheck;
 
1804
  $ENV{'MYSQL_CHECK'}=              $cmdline_mysqlcheck;
1434
1805
 
1435
1806
  # ----------------------------------------------------
1436
1807
  # Setup env to childs can execute myqldump
1445
1816
    $cmdline_mysqldumpslave .=
1446
1817
      " --debug=d:t:A,$path_vardir_trace/log/mysqldump-slave.trace";
1447
1818
  }
1448
 
  $ENV{'DRIZZLE_DUMP'}= $cmdline_mysqldump;
1449
 
  $ENV{'DRIZZLE_DUMP_SLAVE'}= $cmdline_mysqldumpslave;
 
1819
  $ENV{'MYSQL_DUMP'}= $cmdline_mysqldump;
 
1820
  $ENV{'MYSQL_DUMP_SLAVE'}= $cmdline_mysqldumpslave;
 
1821
 
1450
1822
 
1451
1823
  # ----------------------------------------------------
1452
1824
  # Setup env so childs can execute mysqlslap
1453
1825
  # ----------------------------------------------------
1454
 
  if ( $exe_drizzleslap )
 
1826
  if ( $exe_mysqlslap )
1455
1827
  {
1456
 
    my $cmdline_drizzleslap=
1457
 
      mtr_native_path($exe_drizzleslap) .
 
1828
    my $cmdline_mysqlslap=
 
1829
      mtr_native_path($exe_mysqlslap) .
1458
1830
      " -uroot " .
1459
1831
      "--port=$master->[0]->{'port'} ";
1460
1832
 
1461
1833
    if ( $opt_debug )
1462
1834
   {
1463
 
      $cmdline_drizzleslap .=
1464
 
        " --debug=d:t:A,$path_vardir_trace/log/drizzleslap.trace";
 
1835
      $cmdline_mysqlslap .=
 
1836
        " --debug=d:t:A,$path_vardir_trace/log/mysqlslap.trace";
1465
1837
    }
1466
 
    $ENV{'DRIZZLE_SLAP'}= $cmdline_drizzleslap;
 
1838
    $ENV{'MYSQL_SLAP'}= $cmdline_mysqlslap;
1467
1839
  }
1468
1840
 
1469
 
 
1470
 
 
1471
1841
  # ----------------------------------------------------
1472
1842
  # Setup env so childs can execute mysqlimport
1473
1843
  # ----------------------------------------------------
1474
1844
  my $cmdline_mysqlimport=
1475
 
    mtr_native_path($exe_drizzleimport) .
 
1845
    mtr_native_path($exe_mysqlimport) .
1476
1846
    " -uroot --debug-check " .
1477
1847
    "--port=$master->[0]->{'port'} ";
1478
1848
 
1481
1851
    $cmdline_mysqlimport .=
1482
1852
      " --debug=d:t:A,$path_vardir_trace/log/mysqlimport.trace";
1483
1853
  }
1484
 
  $ENV{'DRIZZLE_IMPORT'}= $cmdline_mysqlimport;
1485
 
 
 
1854
  $ENV{'MYSQL_IMPORT'}= $cmdline_mysqlimport;
 
1855
 
 
1856
 
 
1857
  # ----------------------------------------------------
 
1858
  # Setup env so childs can execute mysqlshow
 
1859
  # ----------------------------------------------------
 
1860
  my $cmdline_mysqlshow=
 
1861
    mtr_native_path($exe_mysqlshow) .
 
1862
    " -uroot --debug-check " .
 
1863
    "--port=$master->[0]->{'port'} ";
 
1864
 
 
1865
  if ( $opt_debug )
 
1866
  {
 
1867
    $cmdline_mysqlshow .=
 
1868
      " --debug=d:t:A,$path_vardir_trace/log/mysqlshow.trace";
 
1869
  }
 
1870
  $ENV{'MYSQL_SHOW'}= $cmdline_mysqlshow;
 
1871
 
 
1872
  # ----------------------------------------------------
 
1873
  # Setup env so childs can execute mysqlbinlog
 
1874
  # ----------------------------------------------------
 
1875
  my $cmdline_mysqlbinlog=
 
1876
    mtr_native_path($exe_mysqlbinlog) .
 
1877
      " --no-defaults --disable-force-if-open --debug-check";
 
1878
  if ( !$opt_extern && $mysql_version_id >= 50000 )
 
1879
  {
 
1880
    $cmdline_mysqlbinlog .=" --character-sets-dir=$path_charsetsdir";
 
1881
  }
 
1882
 
 
1883
  if ( $opt_debug )
 
1884
  {
 
1885
    $cmdline_mysqlbinlog .=
 
1886
      " --debug=d:t:A,$path_vardir_trace/log/mysqlbinlog.trace";
 
1887
  }
 
1888
  $ENV{'MYSQL_BINLOG'}= $cmdline_mysqlbinlog;
1486
1889
 
1487
1890
  # ----------------------------------------------------
1488
1891
  # Setup env so childs can execute mysql
1489
1892
  # ----------------------------------------------------
1490
1893
  my $cmdline_mysql=
1491
 
    mtr_native_path($exe_drizzle) .
 
1894
    mtr_native_path($exe_mysql) .
1492
1895
    " --no-defaults --debug-check --host=localhost  --user=root --password= " .
1493
 
    "--port=$master->[0]->{'port'} ";
 
1896
    "--port=$master->[0]->{'port'} " .
 
1897
    "--character-sets-dir=$path_charsetsdir";
1494
1898
 
1495
1899
  $ENV{'MYSQL'}= $cmdline_mysql;
1496
1900
 
1497
1901
  # ----------------------------------------------------
1498
1902
  # Setup env so childs can execute bug25714
1499
1903
  # ----------------------------------------------------
1500
 
  $ENV{'DRIZZLE_BUG25714'}=  $exe_bug25714;
 
1904
  $ENV{'MYSQL_BUG25714'}=  $exe_bug25714;
1501
1905
 
1502
1906
  # ----------------------------------------------------
1503
 
  # Setup env so childs can execute drizzle_client_test
 
1907
  # Setup env so childs can execute mysql_client_test
1504
1908
  # ----------------------------------------------------
1505
 
  $ENV{'DRIZZLE_CLIENT_TEST'}=  drizzle_client_test_arguments();
 
1909
  $ENV{'MYSQL_CLIENT_TEST'}=  mysql_client_test_arguments();
1506
1910
 
1507
1911
 
1508
1912
  # ----------------------------------------------------
1509
1913
  # Setup env so childs can execute mysql_fix_system_tables
1510
1914
  # ----------------------------------------------------
1511
 
  #if ( !$opt_extern)
 
1915
  #if ( !$opt_extern && ! $glob_win32 )
1512
1916
  if ( 0 )
1513
1917
  {
1514
1918
    my $cmdline_mysql_fix_system_tables=
1515
 
      "$exe_drizzle_fix_system_tables --no-defaults --host=localhost " .
 
1919
      "$exe_mysql_fix_system_tables --no-defaults --host=localhost " .
1516
1920
      "--user=root --password= " .
1517
1921
      "--basedir=$glob_basedir --bindir=$path_client_bindir --verbose " .
1518
1922
      "--port=$master->[0]->{'port'} ";
1519
 
    $ENV{'DRIZZLE_FIX_SYSTEM_TABLES'}=  $cmdline_mysql_fix_system_tables;
 
1923
    $ENV{'MYSQL_FIX_SYSTEM_TABLES'}=  $cmdline_mysql_fix_system_tables;
1520
1924
 
1521
1925
  }
1522
1926
 
1523
1927
  # ----------------------------------------------------
1524
1928
  # Setup env so childs can execute my_print_defaults
1525
1929
  # ----------------------------------------------------
1526
 
  $ENV{'DRIZZLE_MY_PRINT_DEFAULTS'}= mtr_native_path($exe_my_print_defaults);
 
1930
  $ENV{'MYSQL_MY_PRINT_DEFAULTS'}= mtr_native_path($exe_my_print_defaults);
1527
1931
 
1528
1932
  # ----------------------------------------------------
1529
1933
  # Setup env so childs can execute mysqladmin
1530
1934
  # ----------------------------------------------------
1531
 
  $ENV{'MYSQLADMIN'}= mtr_native_path($exe_drizzleadmin);
 
1935
  $ENV{'MYSQLADMIN'}= mtr_native_path($exe_mysqladmin);
1532
1936
 
1533
1937
  # ----------------------------------------------------
1534
1938
  # Setup env so childs can execute perror  
1536
1940
  $ENV{'MY_PERROR'}= mtr_native_path($exe_perror);
1537
1941
 
1538
1942
  # ----------------------------------------------------
 
1943
  # Add the path where mysqld will find udf_example.so
 
1944
  # ----------------------------------------------------
 
1945
  $ENV{'UDF_EXAMPLE_LIB'}=
 
1946
    ($lib_udf_example ? basename($lib_udf_example) : "");
 
1947
  $ENV{'UDF_EXAMPLE_LIB_OPT'}=
 
1948
    ($lib_udf_example ? "--plugin_dir=" . dirname($lib_udf_example) : "");
 
1949
 
 
1950
  # ----------------------------------------------------
1539
1951
  # Add the path where mysqld will find ha_example.so
1540
1952
  # ----------------------------------------------------
1541
1953
  $ENV{'EXAMPLE_PLUGIN'}=
1547
1959
  # Setup env so childs can execute myisampack and myisamchk
1548
1960
  # ----------------------------------------------------
1549
1961
#  $ENV{'MYISAMCHK'}= mtr_native_path(mtr_exe_exists(
 
1962
#                       vs_config_dirs('storage/myisam', 'myisamchk'),
 
1963
#                       vs_config_dirs('myisam', 'myisamchk'),
1550
1964
#                       "$path_client_bindir/myisamchk",
1551
1965
#                       "$glob_basedir/storage/myisam/myisamchk",
1552
1966
#                       "$glob_basedir/myisam/myisamchk"));
1553
1967
#  $ENV{'MYISAMPACK'}= mtr_native_path(mtr_exe_exists(
 
1968
#                        vs_config_dirs('storage/myisam', 'myisampack'),
 
1969
#                        vs_config_dirs('myisam', 'myisampack'),
1554
1970
#                        "$path_client_bindir/myisampack",
1555
1971
#                        "$glob_basedir/storage/myisam/myisampack",
1556
1972
#                        "$glob_basedir/myisam/myisampack"));
1566
1982
    print "Using SLAVE_MYPORT          = $ENV{SLAVE_MYPORT}\n";
1567
1983
    print "Using SLAVE_MYPORT1         = $ENV{SLAVE_MYPORT1}\n";
1568
1984
    print "Using SLAVE_MYPORT2         = $ENV{SLAVE_MYPORT2}\n";
 
1985
    if ( ! $opt_skip_ndbcluster )
 
1986
    {
 
1987
      print "Using NDBCLUSTER_PORT       = $ENV{NDBCLUSTER_PORT}\n";
 
1988
      if ( ! $opt_skip_ndbcluster_slave )
 
1989
      {
 
1990
        print "Using NDBCLUSTER_PORT_SLAVE = $ENV{NDBCLUSTER_PORT_SLAVE}\n";
 
1991
      }
 
1992
    }
1569
1993
  }
1570
1994
 
1571
1995
  # Create an environment variable to make it possible
1602
2026
##############################################################################
1603
2027
 
1604
2028
sub kill_running_servers () {
 
2029
 
 
2030
  if ( $opt_fast or $glob_use_embedded_server )
 
2031
  {
 
2032
    # FIXME is embedded server really using PID files?!
 
2033
    unlink($master->[0]->{'path_pid'});
 
2034
    unlink($master->[1]->{'path_pid'});
 
2035
    unlink($slave->[0]->{'path_pid'});
 
2036
    unlink($slave->[1]->{'path_pid'});
 
2037
    unlink($slave->[2]->{'path_pid'});
 
2038
  }
 
2039
  else
1605
2040
  {
1606
2041
    # Ensure that no old mysqld test servers are running
1607
2042
    # This is different from terminating processes we have
1759
2194
  }
1760
2195
 
1761
2196
  # Make a link std_data_ln in var/ that points to std_data
1762
 
  symlink("$glob_mysql_test_dir/std_data", "$opt_vardir/std_data_ln");
 
2197
  if ( ! $glob_win32 )
 
2198
  {
 
2199
    symlink("$glob_mysql_test_dir/std_data", "$opt_vardir/std_data_ln");
 
2200
  }
 
2201
  else
 
2202
  {
 
2203
    # on windows, copy all files from std_data into var/std_data_ln
 
2204
    mkpath("$opt_vardir/std_data_ln");
 
2205
    opendir(DIR, "$glob_mysql_test_dir/std_data")
 
2206
      or mtr_error("Can't find the std_data directory: $!");
 
2207
    for(readdir(DIR)) {
 
2208
      next if -d "$glob_mysql_test_dir/std_data/$_";
 
2209
      copy("$glob_mysql_test_dir/std_data/$_", "$opt_vardir/std_data_ln/$_");
 
2210
    }
 
2211
    closedir(DIR);
 
2212
  }
1763
2213
 
1764
2214
  # Remove old log files
1765
2215
  foreach my $name (glob("r/*.progress r/*.log r/*.warnings"))
1788
2238
  # the file will not return 0000
1789
2239
  my $file_mode= (stat($test_file))[2] & 07777;
1790
2240
 
1791
 
  $ENV{'DRIZZLE_TEST_ROOT'}= "NO";
 
2241
  $ENV{'MYSQL_TEST_ROOT'}= "NO";
1792
2242
  mtr_verbose("result: $result, file_mode: $file_mode");
1793
2243
  if ($result eq "MySQL" && $file_mode == 0)
1794
2244
  {
1795
2245
    mtr_warning("running this script as _root_ will cause some " .
1796
2246
                "tests to be skipped");
1797
 
    $ENV{'DRIZZLE_TEST_ROOT'}= "YES";
 
2247
    $ENV{'MYSQL_TEST_ROOT'}= "YES";
1798
2248
  }
1799
2249
 
1800
2250
  chmod(oct("0755"), $test_file);
1803
2253
}
1804
2254
 
1805
2255
 
 
2256
sub check_ssl_support ($) {
 
2257
  my $mysqld_variables= shift;
 
2258
 
 
2259
  if ($opt_skip_ssl || $opt_extern)
 
2260
  {
 
2261
    if (!$opt_extern)
 
2262
    {
 
2263
      mtr_report("Skipping SSL");
 
2264
    }
 
2265
    $opt_ssl_supported= 0;
 
2266
    $opt_ssl= 0;
 
2267
    return;
 
2268
  }
 
2269
 
 
2270
  if ( ! $mysqld_variables->{'ssl'} )
 
2271
  {
 
2272
    if ( $opt_ssl)
 
2273
    {
 
2274
      mtr_error("Couldn't find support for SSL");
 
2275
      return;
 
2276
    }
 
2277
    mtr_report("Skipping SSL, mysqld not compiled with SSL");
 
2278
    $opt_ssl_supported= 0;
 
2279
    $opt_ssl= 0;
 
2280
    return;
 
2281
  }
 
2282
  mtr_report("Setting mysqld to support SSL connections");
 
2283
  $opt_ssl_supported= 1;
 
2284
}
 
2285
 
 
2286
 
1806
2287
sub check_debug_support ($) {
1807
2288
  my $mysqld_variables= shift;
1808
2289
 
1821
2302
  $debug_compiled_binaries= 1;
1822
2303
}
1823
2304
 
 
2305
##############################################################################
 
2306
#
 
2307
# Helper function to handle configuration-based subdirectories which Visual
 
2308
# Studio uses for storing binaries.  If opt_vs_config is set, this returns
 
2309
# a path based on that setting; if not, it returns paths for the default
 
2310
# /release/ and /debug/ subdirectories.
 
2311
#
 
2312
# $exe can be undefined, if the directory itself will be used
 
2313
#
 
2314
###############################################################################
 
2315
 
 
2316
sub vs_config_dirs ($$) {
 
2317
  my ($path_part, $exe) = @_;
 
2318
 
 
2319
  $exe = "" if not defined $exe;
 
2320
 
 
2321
  if ($opt_vs_config)
 
2322
  {
 
2323
    return ("$glob_basedir/$path_part/$opt_vs_config/$exe");
 
2324
  }
 
2325
 
 
2326
  return ("$glob_basedir/$path_part/release/$exe",
 
2327
          "$glob_basedir/$path_part/relwithdebinfo/$exe",
 
2328
          "$glob_basedir/$path_part/debug/$exe");
 
2329
}
 
2330
 
 
2331
##############################################################################
 
2332
#
 
2333
#  Start the ndb cluster
 
2334
#
 
2335
##############################################################################
 
2336
 
 
2337
sub check_ndbcluster_support ($) {
 
2338
  my $mysqld_variables= shift;
 
2339
 
 
2340
  if ($opt_skip_ndbcluster || $opt_extern)
 
2341
  {
 
2342
    if (!$opt_extern)
 
2343
    {
 
2344
      mtr_report("Skipping ndbcluster");
 
2345
    }
 
2346
    $opt_skip_ndbcluster_slave= 1;
 
2347
    return;
 
2348
  }
 
2349
 
 
2350
  if ( ! $mysqld_variables->{'ndb-connectstring'} )
 
2351
  {
 
2352
    mtr_report("Skipping ndbcluster, mysqld not compiled with ndbcluster");
 
2353
    $opt_skip_ndbcluster= 1;
 
2354
    $opt_skip_ndbcluster_slave= 1;
 
2355
    return;
 
2356
  }
 
2357
  $glob_ndbcluster_supported= 1;
 
2358
  mtr_report("Using ndbcluster when necessary, mysqld supports it");
 
2359
 
 
2360
  if ( $mysql_version_id < 50100 )
 
2361
  {
 
2362
    # Slave cluster is not supported until 5.1
 
2363
    $opt_skip_ndbcluster_slave= 1;
 
2364
 
 
2365
  }
 
2366
 
 
2367
  return;
 
2368
}
 
2369
 
 
2370
 
 
2371
sub ndbcluster_start_install ($) {
 
2372
  my $cluster= shift;
 
2373
 
 
2374
  mtr_report("Installing $cluster->{'name'} Cluster");
 
2375
 
 
2376
  mkdir($cluster->{'data_dir'});
 
2377
 
 
2378
  # Create a config file from template
 
2379
  my $ndb_no_ord=512;
 
2380
  my $ndb_no_attr=2048;
 
2381
  my $ndb_con_op=105000;
 
2382
  my $ndb_dmem="80M";
 
2383
  my $ndb_imem="24M";
 
2384
  my $ndb_pbmem="32M";
 
2385
  my $nodes= $cluster->{'nodes'};
 
2386
  my $ndb_host= "localhost";
 
2387
  my $ndb_diskless= 0;
 
2388
 
 
2389
  if (!$opt_bench)
 
2390
  {
 
2391
    # Use a smaller configuration
 
2392
    if (  $mysql_version_id < 50100 )
 
2393
    {
 
2394
      # 4.1 and 5.0 is using a "larger" --small configuration
 
2395
      $ndb_no_ord=128;
 
2396
      $ndb_con_op=10000;
 
2397
      $ndb_dmem="40M";
 
2398
      $ndb_imem="12M";
 
2399
    }
 
2400
    else
 
2401
    {
 
2402
      $ndb_no_ord=32;
 
2403
      $ndb_con_op=10000;
 
2404
      $ndb_dmem="20M";
 
2405
      $ndb_imem="1M";
 
2406
      $ndb_pbmem="4M";
 
2407
    }
 
2408
  }
 
2409
 
 
2410
  my $config_file_template=     "ndb/ndb_config_${nodes}_node.ini";
 
2411
  my $config_file= "$cluster->{'data_dir'}/config.ini";
 
2412
 
 
2413
  open(IN, $config_file_template)
 
2414
    or mtr_error("Can't open $config_file_template: $!");
 
2415
  open(OUT, ">", $config_file)
 
2416
    or mtr_error("Can't write to $config_file: $!");
 
2417
  while (<IN>)
 
2418
  {
 
2419
    chomp;
 
2420
 
 
2421
    s/CHOOSE_MaxNoOfAttributes/$ndb_no_attr/;
 
2422
    s/CHOOSE_MaxNoOfOrderedIndexes/$ndb_no_ord/;
 
2423
    s/CHOOSE_MaxNoOfConcurrentOperations/$ndb_con_op/;
 
2424
    s/CHOOSE_DataMemory/$ndb_dmem/;
 
2425
    s/CHOOSE_IndexMemory/$ndb_imem/;
 
2426
    s/CHOOSE_Diskless/$ndb_diskless/;
 
2427
    s/CHOOSE_HOSTNAME_.*/$ndb_host/;
 
2428
    s/CHOOSE_FILESYSTEM/$cluster->{'data_dir'}/;
 
2429
    s/CHOOSE_PORT_MGM/$cluster->{'port'}/;
 
2430
    if ( $mysql_version_id < 50000 )
 
2431
    {
 
2432
      my $base_port= $cluster->{'port'} + 1;
 
2433
      s/CHOOSE_PORT_TRANSPORTER/$base_port/;
 
2434
    }
 
2435
    s/CHOOSE_DiskPageBufferMemory/$ndb_pbmem/;
 
2436
 
 
2437
    print OUT "$_ \n";
 
2438
  }
 
2439
  close OUT;
 
2440
  close IN;
 
2441
 
 
2442
 
 
2443
  # Start cluster with "--initial"
 
2444
 
 
2445
  ndbcluster_start($cluster, "--initial");
 
2446
 
 
2447
  return 0;
 
2448
}
 
2449
 
 
2450
 
 
2451
sub ndbcluster_wait_started($$){
 
2452
  my $cluster= shift;
 
2453
  my $ndb_waiter_extra_opt= shift;
 
2454
  my $path_waiter_log= "$cluster->{'data_dir'}/ndb_waiter.log";
 
2455
  my $args;
 
2456
 
 
2457
  mtr_init_args(\$args);
 
2458
 
 
2459
  mtr_add_arg($args, "--no-defaults");
 
2460
  mtr_add_arg($args, "--core");
 
2461
  mtr_add_arg($args, "--ndb-connectstring=%s", $cluster->{'connect_string'});
 
2462
  mtr_add_arg($args, "--timeout=60");
 
2463
 
 
2464
  if ($ndb_waiter_extra_opt)
 
2465
  {
 
2466
    mtr_add_arg($args, "$ndb_waiter_extra_opt");
 
2467
  }
 
2468
 
 
2469
  # Start the ndb_waiter which will connect to the ndb_mgmd
 
2470
  # and poll it for state of the ndbd's, will return when
 
2471
  # all nodes in the cluster is started
 
2472
  my $res= mtr_run($exe_ndb_waiter, $args,
 
2473
                   "", $path_waiter_log, $path_waiter_log, "");
 
2474
  mtr_verbose("ndbcluster_wait_started, returns: $res") if $res;
 
2475
  return $res;
 
2476
}
 
2477
 
 
2478
 
 
2479
 
 
2480
sub mysqld_wait_started($){
 
2481
  my $mysqld= shift;
 
2482
 
 
2483
  if (sleep_until_file_created($mysqld->{'path_pid'},
 
2484
                               $mysqld->{'start_timeout'},
 
2485
                               $mysqld->{'pid'}) == 0)
 
2486
  {
 
2487
    # Failed to wait for pid file
 
2488
    return 1;
 
2489
  }
 
2490
 
 
2491
  # Get the "real pid" of the process, it will be used for killing
 
2492
  # the process in ActiveState's perl on windows
 
2493
  $mysqld->{'real_pid'}= mtr_get_pid_from_file($mysqld->{'path_pid'});
 
2494
 
 
2495
  return 0;
 
2496
}
 
2497
 
 
2498
 
 
2499
sub ndb_mgmd_wait_started($) {
 
2500
  my ($cluster)= @_;
 
2501
 
 
2502
  my $retries= 100;
 
2503
  while (ndbcluster_wait_started($cluster, "--no-contact") and
 
2504
         $retries)
 
2505
  {
 
2506
    # Millisceond sleep emulated with select
 
2507
    select(undef, undef, undef, (0.1));
 
2508
 
 
2509
    $retries--;
 
2510
  }
 
2511
 
 
2512
  return $retries == 0;
 
2513
 
 
2514
}
 
2515
 
 
2516
sub ndb_mgmd_start ($) {
 
2517
  my $cluster= shift;
 
2518
 
 
2519
  my $args;                             # Arg vector
 
2520
  my $pid= -1;
 
2521
 
 
2522
  mtr_init_args(\$args);
 
2523
  mtr_add_arg($args, "--no-defaults");
 
2524
  mtr_add_arg($args, "--core");
 
2525
  mtr_add_arg($args, "--nodaemon");
 
2526
  mtr_add_arg($args, "--config-file=%s", "$cluster->{'data_dir'}/config.ini");
 
2527
 
 
2528
 
 
2529
  my $path_ndb_mgmd_log= "$cluster->{'data_dir'}/\l$cluster->{'name'}_ndb_mgmd.log";
 
2530
  $pid= mtr_spawn($exe_ndb_mgmd, $args, "",
 
2531
                  $path_ndb_mgmd_log,
 
2532
                  $path_ndb_mgmd_log,
 
2533
                  "",
 
2534
                  { append_log_file => 1 });
 
2535
 
 
2536
  # FIXME Should not be needed
 
2537
  # Unfortunately the cluster nodes will fail to start
 
2538
  # if ndb_mgmd has not started properly
 
2539
  if (ndb_mgmd_wait_started($cluster))
 
2540
  {
 
2541
    mtr_error("Failed to wait for start of ndb_mgmd");
 
2542
  }
 
2543
 
 
2544
  # Remember pid of ndb_mgmd
 
2545
  $cluster->{'pid'}= $pid;
 
2546
 
 
2547
  mtr_verbose("ndb_mgmd_start, pid: $pid");
 
2548
 
 
2549
  return $pid;
 
2550
}
 
2551
 
 
2552
 
 
2553
sub ndbd_start ($$$) {
 
2554
  my $cluster= shift;
 
2555
  my $idx= shift;
 
2556
  my $extra_args= shift;
 
2557
 
 
2558
  my $args;                             # Arg vector
 
2559
  my $pid= -1;
 
2560
 
 
2561
  mtr_init_args(\$args);
 
2562
  mtr_add_arg($args, "--no-defaults");
 
2563
  mtr_add_arg($args, "--core");
 
2564
  mtr_add_arg($args, "--ndb-connectstring=%s", "$cluster->{'connect_string'}");
 
2565
  if ( $mysql_version_id >= 50000)
 
2566
  {
 
2567
    mtr_add_arg($args, "--character-sets-dir=%s", "$path_charsetsdir");
 
2568
  }
 
2569
  mtr_add_arg($args, "--nodaemon");
 
2570
  mtr_add_arg($args, "$extra_args");
 
2571
 
 
2572
  my $nodeid= $cluster->{'ndbds'}->[$idx]->{'nodeid'};
 
2573
  my $path_ndbd_log= "$cluster->{'data_dir'}/ndb_${nodeid}.log";
 
2574
  $pid= mtr_spawn($exe_ndbd, $args, "",
 
2575
                  $path_ndbd_log,
 
2576
                  $path_ndbd_log,
 
2577
                  "",
 
2578
                  { append_log_file => 1 });
 
2579
 
 
2580
  # Add pid to list of pids for this cluster
 
2581
  $cluster->{'ndbds'}->[$idx]->{'pid'}= $pid;
 
2582
 
 
2583
  # Rememeber options used when starting
 
2584
  $cluster->{'ndbds'}->[$idx]->{'start_extra_args'}= $extra_args;
 
2585
  $cluster->{'ndbds'}->[$idx]->{'idx'}= $idx;
 
2586
 
 
2587
  mtr_verbose("ndbd_start, pid: $pid");
 
2588
 
 
2589
  return $pid;
 
2590
}
 
2591
 
 
2592
 
 
2593
sub ndbcluster_start ($$) {
 
2594
  my $cluster= shift;
 
2595
  my $extra_args= shift;
 
2596
 
 
2597
  mtr_verbose("ndbcluster_start '$cluster->{'name'}'");
 
2598
 
 
2599
  if ( $cluster->{'use_running'} )
 
2600
  {
 
2601
    return 0;
 
2602
  }
 
2603
 
 
2604
  if ( $cluster->{'pid'} )
 
2605
  {
 
2606
    mtr_error("Cluster '$cluster->{'name'}' already started");
 
2607
  }
 
2608
 
 
2609
  ndb_mgmd_start($cluster);
 
2610
 
 
2611
  for ( my $idx= 0; $idx < $cluster->{'nodes'}; $idx++ )
 
2612
  {
 
2613
    ndbd_start($cluster, $idx, $extra_args);
 
2614
  }
 
2615
 
 
2616
  return 0;
 
2617
}
 
2618
 
 
2619
 
 
2620
sub rm_ndbcluster_tables ($) {
 
2621
  my $dir=       shift;
 
2622
  foreach my $bin ( glob("$dir/mysql/ndb_apply_status*"),
 
2623
                    glob("$dir/mysql/ndb_schema*"))
 
2624
  {
 
2625
    unlink($bin);
 
2626
  }
 
2627
}
 
2628
 
1824
2629
 
1825
2630
##############################################################################
1826
2631
#
1833
2638
 
1834
2639
  my $args;
1835
2640
 
 
2641
  if ( ! $glob_use_embedded_server )
1836
2642
  {
1837
2643
    mysqld_start($master->[0],[],[]);
1838
2644
    if ( ! $master->[0]->{'pid'} )
1851
2657
    mtr_add_arg($args, "--small-tables");
1852
2658
  }
1853
2659
 
 
2660
  if ( $opt_with_ndbcluster )
 
2661
  {
 
2662
    mtr_add_arg($args, "--create-options=TYPE=ndb");
 
2663
  }
 
2664
 
1854
2665
  chdir($glob_mysql_bench_dir)
1855
2666
    or mtr_error("Couldn't chdir to '$glob_mysql_bench_dir': $!");
1856
2667
 
1872
2683
 
1873
2684
  chdir($glob_mysql_test_dir);          # Go back
1874
2685
 
 
2686
  if ( ! $glob_use_embedded_server )
1875
2687
  {
1876
2688
    stop_masters();
1877
2689
  }
1910
2722
  mtr_print_line();
1911
2723
 
1912
2724
  if ( ! $glob_debugger and
1913
 
       ! $opt_extern )
 
2725
       ! $opt_extern and
 
2726
       ! $glob_use_embedded_server )
1914
2727
  {
1915
2728
    stop_all_servers();
1916
2729
  }
1974
2787
  }
1975
2788
  check_running_as_root();
1976
2789
 
1977
 
  mtr_log_init("$opt_vardir/log/drizzle-test-run.log");
 
2790
  mtr_log_init("$opt_vardir/log/mysql-test-run.log");
1978
2791
 
1979
2792
}
1980
2793
 
1981
2794
sub mysql_install_db () {
1982
2795
 
 
2796
  install_db('master', $master->[0]->{'path_myddir'});
 
2797
 
1983
2798
  if ($max_master_num > 1)
1984
2799
  {
1985
2800
    copy_install_db('master', $master->[1]->{'path_myddir'});
1991
2806
    copy_install_db("slave".($idx+1), $slave->[$idx]->{'path_myddir'});
1992
2807
  }
1993
2808
 
 
2809
  my $cluster_started_ok= 1; # Assume it can be started
 
2810
 
 
2811
  my $cluster= $clusters->[0]; # Master cluster
 
2812
  if ($opt_skip_ndbcluster ||
 
2813
      $cluster->{'use_running'} ||
 
2814
      $cluster->{executable_setup_failed})
 
2815
  {
 
2816
    # Don't install master cluster
 
2817
  }
 
2818
  elsif (ndbcluster_start_install($cluster))
 
2819
  {
 
2820
    mtr_warning("Failed to start install of $cluster->{name}");
 
2821
    $cluster_started_ok= 0;
 
2822
  }
 
2823
 
 
2824
  $cluster= $clusters->[1]; # Slave cluster
 
2825
  if ($max_slave_num == 0 ||
 
2826
      $opt_skip_ndbcluster_slave ||
 
2827
      $cluster->{'use_running'} ||
 
2828
      $cluster->{executable_setup_failed})
 
2829
  {
 
2830
    # Don't install slave cluster
 
2831
  }
 
2832
  elsif (ndbcluster_start_install($cluster))
 
2833
  {
 
2834
    mtr_warning("Failed to start install of $cluster->{name}");
 
2835
    $cluster_started_ok= 0;
 
2836
  }
 
2837
 
 
2838
  foreach $cluster (@{$clusters})
 
2839
  {
 
2840
 
 
2841
    next if !$cluster->{'pid'};
 
2842
 
 
2843
    $cluster->{'installed_ok'}= 1; # Assume install suceeds
 
2844
 
 
2845
    if (ndbcluster_wait_started($cluster, ""))
 
2846
    {
 
2847
      # failed to install, disable usage and flag that its no ok
 
2848
      mtr_report("ndbcluster_install of $cluster->{'name'} failed");
 
2849
      $cluster->{"installed_ok"}= 0;
 
2850
 
 
2851
      $cluster_started_ok= 0;
 
2852
    }
 
2853
  }
 
2854
 
 
2855
  if ( ! $cluster_started_ok )
 
2856
  {
 
2857
    if ( $opt_force)
 
2858
    {
 
2859
      # Continue without cluster
 
2860
    }
 
2861
    else
 
2862
    {
 
2863
      mtr_error("To continue, re-run with '--force'.");
 
2864
    }
 
2865
  }
 
2866
 
1994
2867
  return 0;
1995
2868
}
1996
2869
 
2007
2880
}
2008
2881
 
2009
2882
 
 
2883
sub install_db ($$) {
 
2884
  my $type=      shift;
 
2885
  my $data_dir=  shift;
 
2886
 
 
2887
  mtr_report("Installing \u$type Database");
 
2888
 
 
2889
 
 
2890
  my $args;
 
2891
  mtr_init_args(\$args);
 
2892
  mtr_add_arg($args, "--no-defaults");
 
2893
  mtr_add_arg($args, "--bootstrap");
 
2894
  mtr_add_arg($args, "--basedir=%s", $path_my_basedir);
 
2895
  mtr_add_arg($args, "--datadir=%s", $data_dir);
 
2896
  mtr_add_arg($args, "--loose-skip-innodb");
 
2897
  mtr_add_arg($args, "--tmpdir=.");
 
2898
  mtr_add_arg($args, "--core-file");
 
2899
 
 
2900
  if ( $opt_debug )
 
2901
  {
 
2902
    mtr_add_arg($args, "--debug=d:t:i:A,%s/log/bootstrap_%s.trace",
 
2903
                $path_vardir_trace, $type);
 
2904
  }
 
2905
 
 
2906
  if ( ! $glob_netware )
 
2907
  {
 
2908
    mtr_add_arg($args, "--language=%s", $path_language);
 
2909
    mtr_add_arg($args, "--character-sets-dir=%s", $path_charsetsdir);
 
2910
  }
 
2911
 
 
2912
  # If DISABLE_GRANT_OPTIONS is defined when the server is compiled (e.g.,
 
2913
  # configure --disable-grant-options), mysqld will not recognize the
 
2914
  # --bootstrap or --skip-grant-tables options.  The user can set
 
2915
  # MYSQLD_BOOTSTRAP to the full path to a mysqld which does accept
 
2916
  # --bootstrap, to accommodate this.
 
2917
  my $exe_mysqld_bootstrap = $ENV{'MYSQLD_BOOTSTRAP'} || $exe_mysqld;
 
2918
 
 
2919
  # ----------------------------------------------------------------------
 
2920
  # export MYSQLD_BOOTSTRAP_CMD variable containing <path>/mysqld <args>
 
2921
  # ----------------------------------------------------------------------
 
2922
  $ENV{'MYSQLD_BOOTSTRAP_CMD'}= "$exe_mysqld_bootstrap " . join(" ", @$args);
 
2923
}
 
2924
 
 
2925
 
2010
2926
#
2011
2927
# Restore snapshot of the installed slave databases
2012
2928
# if the snapshot exists
2035
2951
  # If marked to skip, just print out and return.
2036
2952
  # Note that a test case not marked as 'skip' can still be
2037
2953
  # skipped later, because of the test case itself in cooperation
2038
 
  # with the drizzletest program tells us so.
 
2954
  # with the mysqltest program tells us so.
2039
2955
  # ----------------------------------------------------------------------
2040
2956
 
2041
2957
  if ( $tinfo->{'skip'} )
2045
2961
    return 1;
2046
2962
  }
2047
2963
 
 
2964
  if ($tinfo->{'ndb_test'})
 
2965
  {
 
2966
    foreach my $cluster (@{$clusters})
 
2967
    {
 
2968
      # Slave cluster is skipped and thus not
 
2969
      # installed, no need to perform checks
 
2970
      last if ($opt_skip_ndbcluster_slave and
 
2971
               $cluster->{'name'} eq 'Slave');
 
2972
 
 
2973
      # Using running cluster - no need
 
2974
      # to check if test should be skipped
 
2975
      # will be done by test itself
 
2976
      last if ($cluster->{'use_running'});
 
2977
 
 
2978
      # If test needs this cluster, check binaries was found ok
 
2979
      if ( $cluster->{'executable_setup_failed'} )
 
2980
      {
 
2981
        mtr_report_test_name($tinfo);
 
2982
        $tinfo->{comment}=
 
2983
          "Failed to find cluster binaries";
 
2984
        mtr_report_test_failed($tinfo);
 
2985
        return 1;
 
2986
      }
 
2987
 
 
2988
      # If test needs this cluster, check it was installed ok
 
2989
      if ( !$cluster->{'installed_ok'} )
 
2990
      {
 
2991
        mtr_report_test_name($tinfo);
 
2992
        $tinfo->{comment}=
 
2993
          "Cluster $cluster->{'name'} was not installed ok";
 
2994
        mtr_report_test_failed($tinfo);
 
2995
        return 1;
 
2996
      }
 
2997
 
 
2998
    }
 
2999
  }
 
3000
 
2048
3001
  return 0;
2049
3002
}
2050
3003
 
2051
3004
 
2052
 
sub do_before_run_drizzletest($)
 
3005
sub do_before_run_mysqltest($)
2053
3006
{
2054
3007
  my $tinfo= shift;
2055
3008
  my $args;
2056
3009
 
2057
 
  # Remove old files produced by drizzletest
 
3010
  # Remove old files produced by mysqltest
2058
3011
  my $base_file= mtr_match_extension($tinfo->{'result_file'},
2059
3012
                                    "result"); # Trim extension
2060
3013
  unlink("$base_file.reject");
2064
3017
 
2065
3018
  if (!$opt_extern)
2066
3019
  {
 
3020
    if ( $mysql_version_id < 50000 ) {
 
3021
      # Set environment variable NDB_STATUS_OK to 1
 
3022
      # if script decided to run mysqltest cluster _is_ installed ok
 
3023
      $ENV{'NDB_STATUS_OK'} = "1";
 
3024
    } elsif ( $mysql_version_id < 50100 ) {
 
3025
      # Set environment variable NDB_STATUS_OK to YES
 
3026
      # if script decided to run mysqltest cluster _is_ installed ok
 
3027
      $ENV{'NDB_STATUS_OK'} = "YES";
 
3028
    }
2067
3029
    if (defined $tinfo->{binlog_format} and  $mysql_version_id > 50100 )
2068
3030
    {
2069
3031
      # Dynamically switch binlog format of
2079
3041
 
2080
3042
        my $sql= "include/set_binlog_format_".$tinfo->{binlog_format}.".sql";
2081
3043
        mtr_verbose("Setting binlog format:", $tinfo->{binlog_format});
2082
 
        if (mtr_run($exe_drizzle, $args, $sql, "", "", "") != 0)
 
3044
        if (mtr_run($exe_mysql, $args, $sql, "", "", "") != 0)
2083
3045
        {
2084
3046
          mtr_error("Failed to switch binlog format");
2085
3047
        }
2088
3050
  }
2089
3051
}
2090
3052
 
2091
 
sub do_after_run_drizzletest($)
 
3053
sub do_after_run_mysqltest($)
2092
3054
{
2093
3055
  my $tinfo= shift;
2094
3056
 
2095
 
  # Save info from this testcase run to drizzletest.log
2096
 
  mtr_appendfile_to_file($path_current_test_log, $path_drizzletest_log)
 
3057
  # Save info from this testcase run to mysqltest.log
 
3058
  mtr_appendfile_to_file($path_current_test_log, $path_mysqltest_log)
2097
3059
    if -f $path_current_test_log;
2098
 
  mtr_appendfile_to_file($path_timefile, $path_drizzletest_log)
 
3060
  mtr_appendfile_to_file($path_timefile, $path_mysqltest_log)
2099
3061
    if -f $path_timefile;
2100
3062
}
2101
3063
 
2115
3077
    mtr_tofile($mysqld->{path_myerr}, $log_msg);
2116
3078
  }
2117
3079
 
 
3080
  # ndbcluster log file
 
3081
  mtr_tofile($path_ndb_testrun_log, $log_msg);
 
3082
 
2118
3083
}
2119
3084
 
2120
3085
sub find_testcase_skipped_reason($)
2124
3089
  # Set default message
2125
3090
  $tinfo->{'comment'}= "Detected by testcase(no log file)";
2126
3091
 
2127
 
  # Open drizzletest-time(the drizzletest log file)
 
3092
  # Open mysqltest-time(the mysqltest log file)
2128
3093
  my $F= IO::File->new($path_timefile)
2129
3094
    or return;
2130
3095
  my $reason;
2203
3168
      return 1;
2204
3169
    }
2205
3170
  }
 
3171
  elsif ($glob_use_embedded_server)
 
3172
  {
 
3173
    run_master_init_script($tinfo);
 
3174
  }
 
3175
 
2206
3176
  # ----------------------------------------------------------------------
2207
3177
  # If --start-and-exit or --start-dirty given, stop here to let user manually
2208
3178
  # run tests
2215
3185
  }
2216
3186
 
2217
3187
  {
2218
 
    do_before_run_drizzletest($tinfo);
 
3188
    do_before_run_mysqltest($tinfo);
2219
3189
 
2220
 
    my $res= run_drizzletest($tinfo);
 
3190
    my $res= run_mysqltest($tinfo);
2221
3191
    mtr_report_test_name($tinfo);
2222
3192
 
2223
 
    do_after_run_drizzletest($tinfo);
 
3193
    do_after_run_mysqltest($tinfo);
2224
3194
 
2225
3195
    if ( $res == 0 )
2226
3196
    {
2230
3200
    {
2231
3201
      # Testcase itself tell us to skip this one
2232
3202
 
2233
 
      # Try to get reason from drizzletest.log
 
3203
      # Try to get reason from mysqltest.log
2234
3204
      find_testcase_skipped_reason($tinfo);
2235
3205
      mtr_report_test_skipped($tinfo);
2236
3206
    }
2241
3211
    }
2242
3212
    elsif ( $res == 1 )
2243
3213
    {
2244
 
      # Test case failure reported by drizzletest
 
3214
      # Test case failure reported by mysqltest
2245
3215
      report_failure_and_restart($tinfo);
2246
3216
    }
2247
3217
    else
2248
3218
    {
2249
 
      # drizzletest failed, probably crashed
 
3219
      # mysqltest failed, probably crashed
2250
3220
      $tinfo->{comment}=
2251
 
        "drizzletest returned unexpected code $res, it has probably crashed";
 
3221
        "mysqltest returned unexpected code $res, it has probably crashed";
2252
3222
      report_failure_and_restart($tinfo);
2253
3223
    }
2254
3224
  }
2255
3225
 
2256
 
  # Remove the file that drizzletest writes info to
 
3226
  # Remove the file that mysqltest writes info to
2257
3227
  unlink($path_timefile);
2258
3228
 
2259
3229
  # ----------------------------------------------------------------------
2319
3289
      mtr_rmtree("$data_dir");
2320
3290
      mtr_copy_dir("$path_snapshot/$name", "$data_dir");
2321
3291
    }
 
3292
 
 
3293
    # Remove the ndb_*_fs dirs for all ndbd nodes
 
3294
    # forcing a clean start of ndb
 
3295
    foreach my $cluster (@{$clusters})
 
3296
    {
 
3297
      foreach my $ndbd (@{$cluster->{'ndbds'}})
 
3298
      {
 
3299
        mtr_rmtree("$ndbd->{'path_fs'}" );
 
3300
      }
 
3301
    }
2322
3302
  }
2323
3303
  else
2324
3304
  {
2347
3327
  mtr_report("Aborting: $tinfo->{'name'} failed in $test_mode mode. ");
2348
3328
  mtr_report("To continue, re-run with '--force'.");
2349
3329
  if ( ! $glob_debugger and
2350
 
       ! $opt_extern )
 
3330
       ! $opt_extern and
 
3331
       ! $glob_use_embedded_server )
2351
3332
  {
2352
3333
    stop_all_servers();
2353
3334
  }
2454
3435
    $sidx= $idx;
2455
3436
  }
2456
3437
 
2457
 
  my $prefix= "";               # If drizzletest server arg
 
3438
  my $prefix= "";               # If mysqltest server arg
 
3439
  if ( $glob_use_embedded_server )
 
3440
  {
 
3441
    $prefix= "--server-arg=";
 
3442
  }
2458
3443
 
2459
3444
  mtr_add_arg($args, "%s--no-defaults", $prefix);
2460
3445
 
2461
3446
  mtr_add_arg($args, "%s--basedir=%s", $prefix, $path_my_basedir);
 
3447
  mtr_add_arg($args, "%s--character-sets-dir=%s", $prefix, $path_charsetsdir);
2462
3448
 
2463
3449
  if ( $mysql_version_id >= 50036)
2464
3450
  {
2466
3452
    mtr_add_arg($args, "%s--secure-file-priv=%s", $prefix, $opt_vardir);
2467
3453
  }
2468
3454
 
 
3455
  if ( $mysql_version_id >= 50000 )
 
3456
  {
 
3457
    mtr_add_arg($args, "%s--log-bin-trust-function-creators", $prefix);
 
3458
  }
 
3459
 
 
3460
  mtr_add_arg($args, "%s--default-character-set=latin1", $prefix);
 
3461
  mtr_add_arg($args, "%s--language=%s", $prefix, $path_language);
2469
3462
  mtr_add_arg($args, "%s--tmpdir=$opt_tmpdir", $prefix);
2470
3463
 
2471
3464
  # Increase default connect_timeout to avoid intermittent
2477
3470
  # When mysqld is run by a root user(euid is 0), it will fail
2478
3471
  # to start unless we specify what user to run as, see BUG#30630
2479
3472
  my $euid= $>;
2480
 
  if (grep(/^--user/, @$extra_opt, @opt_extra_mysqld_opt) == 0) {
 
3473
  if (!$glob_win32 and $euid == 0 and
 
3474
      grep(/^--user/, @$extra_opt, @opt_extra_mysqld_opt) == 0) {
2481
3475
    mtr_add_arg($args, "%s--user=root", $prefix);
2482
3476
  }
2483
3477
 
2490
3484
  mtr_add_arg($args, "%s--datadir=%s", $prefix,
2491
3485
              $mysqld->{'path_myddir'});
2492
3486
 
 
3487
 
 
3488
  if ( $mysql_version_id >= 50106 )
 
3489
  {
 
3490
    # Turn on logging to bothe tables and file
 
3491
    mtr_add_arg($args, "%s--log-output=table,file", $prefix);
 
3492
  }
 
3493
 
2493
3494
  my $log_base_path= "$opt_vardir/log/$mysqld->{'type'}$sidx";
2494
3495
  mtr_add_arg($args, "%s--log=%s.log", $prefix, $log_base_path);
 
3496
  mtr_add_arg($args,
 
3497
              "%s--log-slow-queries=%s-slow.log", $prefix, $log_base_path);
2495
3498
 
2496
3499
  # Check if "extra_opt" contains --skip-log-bin
2497
3500
  my $skip_binlog= grep(/^--skip-log-bin/, @$extra_opt, @opt_extra_mysqld_opt);
2515
3518
    {
2516
3519
      mtr_add_arg($args, "%s--loose-skip-innodb", $prefix);
2517
3520
    }
 
3521
 
 
3522
    my $cluster= $clusters->[$mysqld->{'cluster'}];
 
3523
    if ( $cluster->{'pid'} ||           # Cluster is started
 
3524
         $cluster->{'use_running'} )    # Using running cluster
 
3525
    {
 
3526
      mtr_add_arg($args, "%s--ndbcluster", $prefix);
 
3527
      mtr_add_arg($args, "%s--ndb-connectstring=%s", $prefix,
 
3528
                  $cluster->{'connect_string'});
 
3529
      mtr_add_arg($args, "%s--ndb-wait-connected=20", $prefix);
 
3530
      mtr_add_arg($args, "%s--ndb-cluster-connection-pool=3", $prefix);
 
3531
      mtr_add_arg($args, "%s--slave-allow-batching", $prefix);
 
3532
      if ( $mysql_version_id >= 50100 )
 
3533
      {
 
3534
        mtr_add_arg($args, "%s--ndb-extra-logging", $prefix);
 
3535
        mtr_add_arg($args, "%s--ndb-log-orig", $prefix);
 
3536
      }
 
3537
    }
 
3538
    else
 
3539
    {
 
3540
      mtr_add_arg($args, "%s--loose-skip-ndbcluster", $prefix);
 
3541
    }
2518
3542
  }
2519
3543
  else
2520
3544
  {
2562
3586
      mtr_add_arg($args, "%s--server-id=%d", $prefix, $slave_server_id);
2563
3587
#      mtr_add_arg($args, "%s--rpl-recovery-rank=%d", $prefix, $slave_rpl_rank);
2564
3588
    }
 
3589
 
 
3590
   my $cluster= $clusters->[$mysqld->{'cluster'}];
 
3591
   if ( $cluster->{'pid'} ||         # Slave cluster is started
 
3592
        $cluster->{'use_running'} )  # Using running slave cluster
 
3593
    {
 
3594
      mtr_add_arg($args, "%s--ndbcluster", $prefix);
 
3595
      mtr_add_arg($args, "%s--ndb-connectstring=%s", $prefix,
 
3596
                  $cluster->{'connect_string'});
 
3597
      mtr_add_arg($args, "%s--ndb-wait-connected=20", $prefix);
 
3598
      mtr_add_arg($args, "%s--ndb-cluster-connection-pool=3", $prefix);
 
3599
      mtr_add_arg($args, "%s--slave-allow-batching", $prefix);
 
3600
      if ( $mysql_version_id >= 50100 )
 
3601
      {
 
3602
        mtr_add_arg($args, "%s--ndb-extra-logging", $prefix);
 
3603
        mtr_add_arg($args, "%s--ndb-log-orig", $prefix);
 
3604
      }
 
3605
    }
 
3606
    else
 
3607
    {
 
3608
      mtr_add_arg($args, "%s--loose-skip-ndbcluster", $prefix);
 
3609
    }
2565
3610
  } # end slave
2566
3611
 
2567
3612
  if ( $opt_debug )
2574
3619
  mtr_add_arg($args, "%s--sort_buffer=256K", $prefix);
2575
3620
  mtr_add_arg($args, "%s--max_heap_table_size=1M", $prefix);
2576
3621
 
 
3622
  if ( $opt_ssl_supported )
 
3623
  {
 
3624
    mtr_add_arg($args, "%s--ssl-ca=%s/std_data/cacert.pem", $prefix,
 
3625
                $glob_mysql_test_dir);
 
3626
    mtr_add_arg($args, "%s--ssl-cert=%s/std_data/server-cert.pem", $prefix,
 
3627
                $glob_mysql_test_dir);
 
3628
    mtr_add_arg($args, "%s--ssl-key=%s/std_data/server-key.pem", $prefix,
 
3629
                $glob_mysql_test_dir);
 
3630
  }
 
3631
 
2577
3632
  if ( $opt_warnings )
2578
3633
  {
2579
3634
    mtr_add_arg($args, "%s--log-warnings", $prefix);
2640
3695
  my $type= $mysqld->{'type'};
2641
3696
  my $idx= $mysqld->{'idx'};
2642
3697
 
 
3698
  mtr_error("Internal error: mysqld should never be started for embedded")
 
3699
    if $glob_use_embedded_server;
 
3700
 
2643
3701
  if ( $type eq 'master' )
2644
3702
  {
2645
3703
    $exe= $exe_master_mysqld;
2754
3812
    }
2755
3813
  }
2756
3814
 
 
3815
  # Start shutdown of clusters
 
3816
  foreach my $cluster (@{$clusters})
 
3817
  {
 
3818
    if ( $cluster->{'pid'} )
 
3819
    {
 
3820
      $pid= mtr_ndbmgm_start($cluster, "shutdown");
 
3821
      $admin_pids{$pid}= 1;
 
3822
 
 
3823
      push(@kill_pids,{
 
3824
                       pid      => $cluster->{'pid'},
 
3825
                       pidfile  => $cluster->{'path_pid'}
 
3826
                      });
 
3827
 
 
3828
      $cluster->{'pid'}= 0; # Assume we are done with it
 
3829
 
 
3830
      foreach my $ndbd (@{$cluster->{'ndbds'}})
 
3831
      {
 
3832
        if ( $ndbd->{'pid'} )
 
3833
        {
 
3834
          push(@kill_pids,{
 
3835
                           pid      => $ndbd->{'pid'},
 
3836
                           pidfile  => $ndbd->{'path_pid'},
 
3837
                          });
 
3838
          $ndbd->{'pid'}= 0;
 
3839
        }
 
3840
      }
 
3841
    }
 
3842
  }
 
3843
 
2757
3844
  # Wait blocking until all shutdown processes has completed
2758
3845
  mtr_wait_blocking(\%admin_pids);
2759
3846
 
2760
3847
  # Make sure that process has shutdown else try to kill them
2761
3848
  mtr_check_stop_servers(\@kill_pids);
 
3849
 
 
3850
  foreach my $mysqld (@{$master}, @{$slave})
 
3851
  {
 
3852
    rm_ndbcluster_tables($mysqld->{'path_myddir'});
 
3853
  }
2762
3854
}
2763
3855
 
2764
3856
 
2769
3861
  # We try to find out if we are to restart the master(s)
2770
3862
  my $do_restart= 0;          # Assumes we don't have to
2771
3863
 
2772
 
  if ( $tinfo->{'master_sh'} )
 
3864
  if ( $glob_use_embedded_server )
 
3865
  {
 
3866
    mtr_verbose("Never start or restart for embedded server");
 
3867
    return $do_restart;
 
3868
  }
 
3869
  elsif ( $tinfo->{'master_sh'} )
2773
3870
  {
2774
3871
    $do_restart= 1;           # Always restart if script to run
2775
3872
    mtr_verbose("Restart master: Always restart if script to run");
2779
3876
    $do_restart= 1; # Always restart if --force-restart in -opt file
2780
3877
    mtr_verbose("Restart master: Restart forced with --force-restart");
2781
3878
  }
 
3879
  elsif ( ! $opt_skip_ndbcluster and
 
3880
          !$tinfo->{'ndb_test'} and
 
3881
          $clusters->[0]->{'pid'} != 0 )
 
3882
  {
 
3883
    $do_restart= 1;           # Restart without cluster
 
3884
    mtr_verbose("Restart master: Test does not need cluster");
 
3885
  }
 
3886
  elsif ( ! $opt_skip_ndbcluster and
 
3887
          $tinfo->{'ndb_test'} and
 
3888
          $clusters->[0]->{'pid'} == 0 )
 
3889
  {
 
3890
    $do_restart= 1;           # Restart with cluster
 
3891
    mtr_verbose("Restart master: Test need cluster");
 
3892
  }
2782
3893
  elsif( $tinfo->{'component_id'} eq 'im' )
2783
3894
  {
2784
3895
    $do_restart= 1;
2833
3944
  # We try to find out if we are to restart the slaves
2834
3945
  my $do_slave_restart= 0;     # Assumes we don't have to
2835
3946
 
2836
 
  if ( $max_slave_num == 0)
 
3947
  if ( $glob_use_embedded_server )
 
3948
  {
 
3949
    mtr_verbose("Never start or restart for embedded server");
 
3950
    return $do_slave_restart;
 
3951
  }
 
3952
  elsif ( $max_slave_num == 0)
2837
3953
  {
2838
3954
    mtr_verbose("Skip slave restart: No testcase use slaves");
2839
3955
  }
2912
4028
        $mysqld->{'pid'}= 0; # Assume we are done with it
2913
4029
      }
2914
4030
    }
 
4031
 
 
4032
    # Start shutdown of master cluster
 
4033
    my $cluster= $clusters->[0];
 
4034
    if ( $cluster->{'pid'} )
 
4035
    {
 
4036
      $pid= mtr_ndbmgm_start($cluster, "shutdown");
 
4037
      $admin_pids{$pid}= 1;
 
4038
 
 
4039
      push(@kill_pids,{
 
4040
                       pid      => $cluster->{'pid'},
 
4041
                       pidfile  => $cluster->{'path_pid'}
 
4042
                      });
 
4043
 
 
4044
      $cluster->{'pid'}= 0; # Assume we are done with it
 
4045
 
 
4046
      foreach my $ndbd (@{$cluster->{'ndbds'}})
 
4047
      {
 
4048
        push(@kill_pids,{
 
4049
                         pid      => $ndbd->{'pid'},
 
4050
                         pidfile  => $ndbd->{'path_pid'},
 
4051
                        });
 
4052
        $ndbd->{'pid'}= 0; # Assume we are done with it
 
4053
      }
 
4054
    }
2915
4055
  }
2916
4056
 
2917
4057
  if ( $do_restart || $do_slave_restart )
2941
4081
        $mysqld->{'pid'}= 0; # Assume we are done with it
2942
4082
      }
2943
4083
    }
 
4084
 
 
4085
    # Start shutdown of slave cluster
 
4086
    my $cluster= $clusters->[1];
 
4087
    if ( $cluster->{'pid'} )
 
4088
    {
 
4089
      $pid= mtr_ndbmgm_start($cluster, "shutdown");
 
4090
 
 
4091
      $admin_pids{$pid}= 1;
 
4092
 
 
4093
      push(@kill_pids,{
 
4094
                       pid      => $cluster->{'pid'},
 
4095
                       pidfile  => $cluster->{'path_pid'}
 
4096
                      });
 
4097
 
 
4098
      $cluster->{'pid'}= 0; # Assume we are done with it
 
4099
 
 
4100
      foreach my $ndbd (@{$cluster->{'ndbds'}} )
 
4101
      {
 
4102
        push(@kill_pids,{
 
4103
                         pid      => $ndbd->{'pid'},
 
4104
                         pidfile  => $ndbd->{'path_pid'},
 
4105
                        });
 
4106
        $ndbd->{'pid'}= 0; # Assume we are done with it
 
4107
      }
 
4108
    }
2944
4109
  }
2945
4110
 
2946
4111
  # ----------------------------------------------------------------------
2954
4119
 
2955
4120
  # Make sure that process has shutdown else try to kill them
2956
4121
  mtr_check_stop_servers(\@kill_pids);
 
4122
 
 
4123
  foreach my $mysqld (@{$master}, @{$slave})
 
4124
  {
 
4125
    if ( ! $mysqld->{'pid'} )
 
4126
    {
 
4127
      # Remove ndbcluster tables if server is stopped
 
4128
      rm_ndbcluster_tables($mysqld->{'path_myddir'});
 
4129
    }
 
4130
  }
2957
4131
}
2958
4132
 
2959
4133
 
2973
4147
 
2974
4148
  if ( $tinfo->{'component_id'} eq 'mysqld' )
2975
4149
  {
 
4150
    if ( ! $opt_skip_ndbcluster and
 
4151
         !$clusters->[0]->{'pid'} and
 
4152
         $tinfo->{'ndb_test'} )
 
4153
    {
 
4154
      # Test need cluster, cluster is not started, start it
 
4155
      ndbcluster_start($clusters->[0], "");
 
4156
    }
 
4157
 
2976
4158
    if ( !$master->[0]->{'pid'} )
2977
4159
    {
2978
4160
      # Master mysqld is not started
2982
4164
 
2983
4165
    }
2984
4166
 
 
4167
    if ( $clusters->[0]->{'pid'} || $clusters->[0]->{'use_running'}
 
4168
         and ! $master->[1]->{'pid'} and
 
4169
         $tinfo->{'master_num'} > 1 )
 
4170
    {
 
4171
      # Test needs cluster, start an extra mysqld connected to cluster
 
4172
 
 
4173
      if ( $mysql_version_id >= 50100 )
 
4174
      {
 
4175
        # First wait for first mysql server to have created ndb system
 
4176
        # tables ok FIXME This is a workaround so that only one mysqld
 
4177
        # create the tables
 
4178
        if ( ! sleep_until_file_created(
 
4179
                  "$master->[0]->{'path_myddir'}/mysql/ndb_apply_status.ndb",
 
4180
                                        $master->[0]->{'start_timeout'},
 
4181
                                        $master->[0]->{'pid'}))
 
4182
        {
 
4183
 
 
4184
          $tinfo->{'comment'}= "Failed to create 'mysql/ndb_apply_status' table";
 
4185
          return 1;
 
4186
        }
 
4187
      }
 
4188
      mysqld_start($master->[1],$tinfo->{'master_opt'},[]);
 
4189
    }
 
4190
 
2985
4191
    # Save this test case information, so next can examine it
2986
4192
    $master->[0]->{'running_master_options'}= $tinfo;
2987
4193
  }
2995
4201
 
2996
4202
    do_before_start_slave($tinfo);
2997
4203
 
 
4204
    if ( ! $opt_skip_ndbcluster_slave and
 
4205
         !$clusters->[1]->{'pid'} and
 
4206
         $tinfo->{'ndb_test'} )
 
4207
    {
 
4208
      # Test need slave cluster, cluster is not started, start it
 
4209
      ndbcluster_start($clusters->[1], "");
 
4210
    }
 
4211
 
2998
4212
    for ( my $idx= 0; $idx <  $tinfo->{'slave_num'}; $idx++ )
2999
4213
    {
3000
4214
      if ( ! $slave->[$idx]->{'pid'} )
3009
4223
    $slave->[0]->{'running_slave_options'}= $tinfo;
3010
4224
  }
3011
4225
 
 
4226
  # Wait for clusters to start
 
4227
  foreach my $cluster (@{$clusters})
 
4228
  {
 
4229
 
 
4230
    next if !$cluster->{'pid'};
 
4231
 
 
4232
    if (ndbcluster_wait_started($cluster, ""))
 
4233
    {
 
4234
      # failed to start
 
4235
      $tinfo->{'comment'}= "Start of $cluster->{'name'} cluster failed";
 
4236
      return 1;
 
4237
    }
 
4238
  }
 
4239
 
3012
4240
  # Wait for mysqld's to start
3013
4241
  foreach my $mysqld (@{$master},@{$slave})
3014
4242
  {
3048
4276
  mtr_add_arg($args, "--no-defaults");
3049
4277
  mtr_add_arg($args, "--silent");
3050
4278
  mtr_add_arg($args, "--tmpdir=%s", $opt_tmpdir);
 
4279
  mtr_add_arg($args, "--character-sets-dir=%s", $path_charsetsdir);
3051
4280
 
3052
4281
  mtr_add_arg($args, "--port=%d", $mysqld->{'port'});
3053
4282
  mtr_add_arg($args, "--database=test");
3062
4291
    mtr_add_arg($args, "--record");
3063
4292
  }
3064
4293
 
3065
 
  my $res = mtr_run_test($exe_drizzletest,$args,
 
4294
  my $res = mtr_run_test($exe_mysqltest,$args,
3066
4295
                "include/check-testcase.test", "", "", "");
3067
4296
 
3068
4297
  if ( $res == 1  and $mode eq "after")
3088
4317
sub run_report_features () {
3089
4318
  my $args;
3090
4319
 
 
4320
  if ( ! $glob_use_embedded_server )
3091
4321
  {
3092
4322
    mysqld_start($master->[0],[],[]);
3093
4323
    if ( ! $master->[0]->{'pid'} )
3108
4338
  $tinfo->{'slave_opt'} = [];
3109
4339
  $tinfo->{'slave_mi'} = [];
3110
4340
  $tinfo->{'comment'} = 'report server features';
3111
 
  run_drizzletest($tinfo);
 
4341
  run_mysqltest($tinfo);
3112
4342
 
 
4343
  if ( ! $glob_use_embedded_server )
3113
4344
  {
3114
4345
    stop_all_servers();
3115
4346
  }
3116
4347
}
3117
4348
 
3118
4349
 
3119
 
sub run_drizzletest ($) {
 
4350
sub run_mysqltest ($) {
3120
4351
  my ($tinfo)= @_;
3121
 
  my $exe= $exe_drizzletest;
 
4352
  my $exe= $exe_mysqltest;
3122
4353
  my $args;
3123
4354
 
3124
4355
  mtr_init_args(\$args);
3126
4357
  mtr_add_arg($args, "--no-defaults");
3127
4358
  mtr_add_arg($args, "--silent");
3128
4359
  mtr_add_arg($args, "--tmpdir=%s", $opt_tmpdir);
 
4360
  mtr_add_arg($args, "--character-sets-dir=%s", $path_charsetsdir);
3129
4361
  mtr_add_arg($args, "--logdir=%s/log", $opt_vardir);
3130
4362
 
3131
4363
  # Log line number and time  for each line in .test file
3139
4371
    mtr_add_arg($args, "--password=");
3140
4372
  }
3141
4373
 
 
4374
  if ( $opt_ps_protocol )
 
4375
  {
 
4376
    mtr_add_arg($args, "--ps-protocol");
 
4377
  }
 
4378
 
 
4379
  if ( $opt_sp_protocol )
 
4380
  {
 
4381
    mtr_add_arg($args, "--sp-protocol");
 
4382
  }
 
4383
 
 
4384
  if ( $opt_view_protocol )
 
4385
  {
 
4386
    mtr_add_arg($args, "--view-protocol");
 
4387
  }
 
4388
 
 
4389
  if ( $opt_cursor_protocol )
 
4390
  {
 
4391
    mtr_add_arg($args, "--cursor-protocol");
 
4392
  }
 
4393
 
3142
4394
  if ( $opt_strace_client )
3143
4395
  {
3144
4396
    $exe=  "strace";            # FIXME there are ktrace, ....
3145
4397
    mtr_add_arg($args, "-o");
3146
 
    mtr_add_arg($args, "%s/log/drizzletest.strace", $opt_vardir);
3147
 
    mtr_add_arg($args, "$exe_drizzletest");
 
4398
    mtr_add_arg($args, "%s/log/mysqltest.strace", $opt_vardir);
 
4399
    mtr_add_arg($args, "$exe_mysqltest");
3148
4400
  }
3149
4401
 
3150
4402
  if ( $opt_timer )
3164
4416
 
3165
4417
  if ( $opt_debug )
3166
4418
  {
3167
 
    mtr_add_arg($args, "--debug=d:t:A,%s/log/drizzletest.trace",
 
4419
    mtr_add_arg($args, "--debug=d:t:A,%s/log/mysqltest.trace",
3168
4420
                $path_vardir_trace);
3169
4421
  }
3170
4422
 
3171
 
  # ----------------------------------------------------------------------
3172
 
  # export DRIZZLE_TEST variable containing <path>/drizzletest <args>
3173
 
  # ----------------------------------------------------------------------
3174
 
  $ENV{'DRIZZLE_TEST'}=
3175
 
    mtr_native_path($exe_drizzletest) . " " . join(" ", @$args);
3176
 
 
3177
 
  # ----------------------------------------------------------------------
3178
 
  # Add arguments that should not go into the DRIZZLE_TEST env var
3179
 
  # ----------------------------------------------------------------------
3180
 
 
3181
 
  if ( $opt_valgrind_drizzletest )
 
4423
  if ( $opt_ssl_supported )
 
4424
  {
 
4425
    mtr_add_arg($args, "--ssl-ca=%s/std_data/cacert.pem",
 
4426
                $glob_mysql_test_dir);
 
4427
    mtr_add_arg($args, "--ssl-cert=%s/std_data/client-cert.pem",
 
4428
                $glob_mysql_test_dir);
 
4429
    mtr_add_arg($args, "--ssl-key=%s/std_data/client-key.pem",
 
4430
                $glob_mysql_test_dir);
 
4431
  }
 
4432
 
 
4433
  if ( $opt_ssl )
 
4434
  {
 
4435
    # Turn on SSL for _all_ test cases if option --ssl was used
 
4436
    mtr_add_arg($args, "--ssl");
 
4437
  }
 
4438
  elsif ( $opt_ssl_supported )
 
4439
  {
 
4440
    mtr_add_arg($args, "--skip-ssl");
 
4441
  }
 
4442
 
 
4443
  # ----------------------------------------------------------------------
 
4444
  # If embedded server, we create server args to give mysqltest to pass on
 
4445
  # ----------------------------------------------------------------------
 
4446
 
 
4447
  if ( $glob_use_embedded_server )
 
4448
  {
 
4449
    mysqld_arguments($args,$master->[0],$tinfo->{'master_opt'},[]);
 
4450
  }
 
4451
 
 
4452
  # ----------------------------------------------------------------------
 
4453
  # export MYSQL_TEST variable containing <path>/mysqltest <args>
 
4454
  # ----------------------------------------------------------------------
 
4455
  $ENV{'MYSQL_TEST'}=
 
4456
    mtr_native_path($exe_mysqltest) . " " . join(" ", @$args);
 
4457
 
 
4458
  # ----------------------------------------------------------------------
 
4459
  # Add arguments that should not go into the MYSQL_TEST env var
 
4460
  # ----------------------------------------------------------------------
 
4461
 
 
4462
  if ( $opt_valgrind_mysqltest )
3182
4463
  {
3183
4464
    # Prefix the Valgrind options to the argument list.
3184
4465
    # We do this here, since we do not want to Valgrind the nested invocations
3185
 
    # of drizzletest; that would mess up the stderr output causing test failure.
 
4466
    # of mysqltest; that would mess up the stderr output causing test failure.
3186
4467
    my @args_saved = @$args;
3187
4468
    mtr_init_args(\$args);
3188
4469
    valgrind_arguments($args, \$exe);
3394
4675
    $$exe= $debugger;
3395
4676
 
3396
4677
  }
 
4678
  elsif ( $debugger =~ /windbg/ )
 
4679
  {
 
4680
    # windbg exe arg1 .. argn
 
4681
 
 
4682
    # Add name of the exe before args
 
4683
    unshift(@$$args, "$$exe");
 
4684
 
 
4685
    # Set exe to debuggername
 
4686
    $$exe= $debugger;
 
4687
 
 
4688
  }
3397
4689
  elsif ( $debugger eq "dbx" )
3398
4690
  {
3399
4691
    # xterm -e dbx -r exe arg1 .. argn
3452
4744
}
3453
4745
 
3454
4746
 
3455
 
sub mysqld_wait_started($){
3456
 
  my $mysqld= shift;
3457
 
 
3458
 
  if (sleep_until_file_created($mysqld->{'path_pid'},
3459
 
            $mysqld->{'start_timeout'},
3460
 
            $mysqld->{'pid'}) == 0)
3461
 
  {
3462
 
    # Failed to wait for pid file
3463
 
    return 1;
3464
 
  }
3465
 
 
3466
 
  # Get the "real pid" of the process, it will be used for killing
3467
 
  # the process in ActiveState's perl on windows
3468
 
  $mysqld->{'real_pid'}= mtr_get_pid_from_file($mysqld->{'path_pid'});
3469
 
 
3470
 
  return 0;
3471
 
}
3472
 
 
3473
 
 
3474
4747
##############################################################################
3475
4748
#
3476
4749
#  Usage
3491
4764
 
3492
4765
Options to control what engine/variation to run
3493
4766
 
 
4767
  embedded-server       Use the embedded server, i.e. no mysqld daemons
 
4768
  ps-protocol           Use the binary protocol between client and server
 
4769
  cursor-protocol       Use the cursor protocol between client and server
 
4770
                        (implies --ps-protocol)
 
4771
  view-protocol         Create a view to execute all non updating queries
 
4772
  sp-protocol           Create a stored procedure to execute all queries
3494
4773
  compress              Use the compressed protocol between client and server
 
4774
  ssl                   Use ssl protocol between client and server
 
4775
  skip-ssl              Dont start server with support for ssl connections
3495
4776
  bench                 Run the benchmark suite
3496
4777
  small-bench           Run the benchmarks with --small-tests --small-tables
 
4778
  ndb|with-ndbcluster   Use cluster as default table type
 
4779
  vs-config             Visual Studio configuration used to create executables
 
4780
                        (default: MTR_VS_CONFIG environment variable)
3497
4781
 
3498
4782
Options to control directories to use
3499
4783
  benchdir=DIR          The directory where the benchmark suite is stored
3513
4797
Options to control what test suites or cases to run
3514
4798
 
3515
4799
  force                 Continue to run the suite after failure
 
4800
  with-ndbcluster-only  Run only tests that include "ndb" in the filename
 
4801
  skip-ndb[cluster]     Skip all tests that need cluster
 
4802
  skip-ndb[cluster]-slave Skip all tests that need a slave cluster
 
4803
  ndb-extra             Run extra tests from ndb directory
3516
4804
  do-test=PREFIX or REGEX
3517
4805
                        Run test cases which name are prefixed with PREFIX
3518
4806
                        or fulfills REGEX
3534
4822
 
3535
4823
  master_port=PORT      Specify the port number used by the first master
3536
4824
  slave_port=PORT       Specify the port number used by the first slave
 
4825
  ndbcluster-port=PORT  Specify the port number used by cluster
 
4826
  ndbcluster-port-slave=PORT  Specify the port number used by slave cluster
3537
4827
  mtr-build-thread=#    Specify unique collection of ports. Can also be set by
3538
4828
                        setting the environment variable MTR_BUILD_THREAD.
3539
4829
 
3550
4840
Options to run test on running server
3551
4841
 
3552
4842
  extern                Use running server for tests
 
4843
  ndb-connectstring=STR Use running cluster, and connect using STR
 
4844
  ndb-connectstring-slave=STR Use running slave cluster, and connect using STR
3553
4845
  user=USER             User for connection to extern server
 
4846
  socket=PATH           Socket for connection to extern server
3554
4847
 
3555
4848
Options for debugging the product
3556
4849
 
3557
 
  client-ddd            Start drizzletest client in ddd
3558
 
  client-debugger=NAME  Start drizzletest in the selected debugger
3559
 
  client-gdb            Start drizzletest client in gdb
 
4850
  client-ddd            Start mysqltest client in ddd
 
4851
  client-debugger=NAME  Start mysqltest in the selected debugger
 
4852
  client-gdb            Start mysqltest client in gdb
3560
4853
  ddd                   Start mysqld in ddd
3561
4854
  debug                 Dump trace output for all servers and client programs
3562
4855
  debugger=NAME         Start mysqld in the selected debugger
3569
4862
                        test(s)
3570
4863
  master-binary=PATH    Specify the master "mysqld" to use
3571
4864
  slave-binary=PATH     Specify the slave "mysqld" to use
3572
 
  strace-client         Create strace output for drizzletest client
 
4865
  strace-client         Create strace output for mysqltest client
3573
4866
  max-save-core         Limit the number of core files saved (to avoid filling
3574
4867
                        up disks for heavily crashing server). Defaults to
3575
4868
                        $opt_max_save_core, set to 0 for no limit.
3577
4870
Options for coverage, profiling etc
3578
4871
 
3579
4872
  gcov                  FIXME
3580
 
  gprof                 See online documentation on how to use it.
3581
 
  valgrind              Run the "drizzletest" and "mysqld" executables using
 
4873
  gprof                 FIXME
 
4874
  valgrind              Run the "mysqltest" and "mysqld" executables using
3582
4875
                        valgrind with default options
3583
4876
  valgrind-all          Synonym for --valgrind
3584
 
  valgrind-drizzletest    Run the "drizzletest" and "drizzle_client_test" executable
 
4877
  valgrind-mysqltest    Run the "mysqltest" and "mysql_client_test" executable
3585
4878
                        with valgrind
3586
4879
  valgrind-mysqld       Run the "mysqld" executable with valgrind
3587
4880
  valgrind-options=ARGS Deprecated, use --valgrind-option
3608
4901
  suite-timeout=MINUTES Max test suite run time (default $default_suite_timeout)
3609
4902
  warnings | log-warnings Pass --log-warnings to mysqld
3610
4903
 
3611
 
  sleep=SECONDS         Passed to drizzletest, will be used as fixed sleep time
 
4904
  sleep=SECONDS         Passed to mysqltest, will be used as fixed sleep time
 
4905
 
 
4906
Deprecated options
 
4907
  with-openssl          Deprecated option for ssl
 
4908
 
3612
4909
 
3613
4910
HERE
3614
4911
  mtr_exit(1);