100
101
# Misc global variables
101
102
our $mysql_version_id;
102
our $glob_suite_path= undef;
103
103
our $glob_mysql_test_dir= undef;
104
104
our $glob_mysql_bench_dir= undef;
105
105
our $glob_scriptname= undef;
106
106
our $glob_timers= undef;
107
our $glob_use_embedded_server= 0;
107
108
our @glob_test_mode;
111
110
our $glob_basedir;
112
our $path_charsetsdir;
113
113
our $path_client_bindir;
114
116
our $path_timefile;
115
117
our $path_snapshot;
116
our $path_drizzletest_log;
118
our $path_mysqltest_log;
117
119
our $path_current_test_log;
118
120
our $path_my_basedir;
120
122
our $opt_vardir; # A path but set directly on cmd line
121
123
our $path_vardir_trace; # unix formatted opt_vardir for trace files
122
124
our $opt_tmpdir; # A path but set directly on cmd line
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'};
128
132
our $default_vardir;
132
our $opt_suites_default= "main"; # Default suites to run
136
our $opt_suites_default= "main,binlog,rpl"; # Default suites to run
133
137
our $opt_script_debug= 0; # Script debugging, enable with --script-debug
134
138
our $opt_verbose= 0; # Verbose output, enable with --verbose
136
our $opt_repeat_test= 1;
138
140
our $exe_master_mysqld;
140
our $exe_drizzle_client_test;
143
our $exe_mysql_upgrade;
144
our $exe_mysqlbinlog;
145
our $exe_mysql_client_test;
141
146
our $exe_bug25714;
143
our $exe_drizzledump;
144
our $exe_drizzleslap;
145
our $exe_drizzleimport;
146
our $exe_drizzle_fix_system_tables;
147
our $exe_drizzletest;
151
our $exe_mysqlimport;
153
our $exe_mysql_fix_system_tables;
154
our $file_mysql_fix_privilege_tables;
148
158
our $exe_slave_mysqld;
149
159
our $exe_my_print_defaults;
466
536
Getopt::Long::Configure("pass_through");
468
538
# Control what engine/variation to run
539
'embedded-server' => \$opt_embedded_server,
540
'ps-protocol' => \$opt_ps_protocol,
541
'sp-protocol' => \$opt_sp_protocol,
542
'view-protocol' => \$opt_view_protocol,
543
'cursor-protocol' => \$opt_cursor_protocol,
544
'ssl|with-openssl' => \$opt_ssl,
545
'skip-ssl' => \$opt_skip_ssl,
469
546
'compress' => \$opt_compress,
470
547
'bench' => \$opt_bench,
471
548
'small-bench' => \$opt_small_bench,
549
'with-ndbcluster|ndb' => \$opt_with_ndbcluster,
550
'vs-config' => \$opt_vs_config,
473
552
# Control what test suites or cases to run
474
553
'force' => \$opt_force,
554
'with-ndbcluster-only' => \$opt_with_ndbcluster_only,
555
'skip-ndbcluster|skip-ndb' => \$opt_skip_ndbcluster,
556
'skip-ndbcluster-slave|skip-ndb-slave'
557
=> \$opt_skip_ndbcluster_slave,
558
'ndb-extra-test' => \$opt_ndb_extra_test,
559
'skip-master-binlog' => \$opt_skip_master_binlog,
560
'skip-slave-binlog' => \$opt_skip_slave_binlog,
475
561
'do-test=s' => \$opt_do_test,
476
562
'start-from=s' => \$opt_start_from,
477
563
'suite|suites=s' => \$opt_suites,
478
564
'skip-rpl' => \$opt_skip_rpl,
479
565
'skip-test=s' => \$opt_skip_test,
566
'big-test' => \$opt_big_test,
480
567
'combination=s' => \@opt_combinations,
481
568
'skip-combination' => \$opt_skip_combination,
484
571
'master_port=i' => \$opt_master_myport,
485
572
'slave_port=i' => \$opt_slave_myport,
486
'memc_port=i' => \$opt_memc_myport,
573
'ndbcluster-port|ndbcluster_port=i' => \$opt_ndbcluster_port,
574
'ndbcluster-port-slave=i' => \$opt_ndbcluster_port_slave,
487
575
'mtr-build-thread=i' => \$opt_mtr_build_thread,
489
577
# Test case authoring
665
729
$glob_timers= mtr_init_timers();
731
# --------------------------------------------------------------------------
732
# Embedded server flag
733
# --------------------------------------------------------------------------
734
if ( $opt_embedded_server )
736
$glob_use_embedded_server= 1;
737
# Add the location for libmysqld.dll to the path.
741
mtr_path_exists(vs_config_dirs('libmysqld',''));
742
$lib_mysqld= $glob_cygwin_perl ? ":".`cygpath "$lib_mysqld"`
745
$ENV{'PATH'}="$ENV{'PATH'}".$lib_mysqld;
748
push(@glob_test_mode, "embedded");
749
$opt_skip_rpl= 1; # We never run replication with embedded
750
$opt_skip_ndbcluster= 1; # Turn off use of NDB cluster
751
$opt_skip_ssl= 1; # Turn off use of SSL
753
# Turn off use of bin log
754
push(@opt_extra_mysqld_opt, "--skip-log-bin");
758
mtr_error("Can't use --extern with --embedded-server");
668
763
# Find the mysqld executable to be able to find the mysqld version
669
764
# number as early as possible
672
767
# Look for the client binaries directory
673
$path_client_bindir= mtr_path_exists("$glob_builddir/client",
674
"$glob_basedir/client",
768
$path_client_bindir= mtr_path_exists("$glob_basedir/client_release",
769
"$glob_basedir/client_debug",
770
vs_config_dirs('client', ''),
771
"$glob_basedir/client",
675
772
"$glob_basedir/bin");
774
# Look for language files and charsetsdir, use same share
775
$path_share= mtr_path_exists("$glob_basedir/share/mysql",
776
"$glob_basedir/sql/share",
777
"$glob_basedir/share");
779
$path_language= mtr_path_exists("$path_share/english");
780
$path_charsetsdir= mtr_path_exists("$path_share/charsets");
677
783
if (!$opt_extern)
679
$exe_drizzled= mtr_exe_exists ("$glob_basedir/drizzled/drizzled",
680
"$path_client_bindir/drizzled",
681
"$glob_basedir/libexec/drizzled",
682
"$glob_basedir/bin/drizzled",
683
"$glob_basedir/sbin/drizzled",
684
"$glob_builddir/drizzled/drizzled");
785
$exe_mysqld= mtr_exe_exists (vs_config_dirs('sql', 'mysqld'),
786
vs_config_dirs('sql', 'mysqld-debug'),
787
"$glob_basedir/sql/mysqld",
788
"$path_client_bindir/mysqld-max-nt",
789
"$path_client_bindir/mysqld-max",
790
"$path_client_bindir/mysqld-nt",
791
"$path_client_bindir/mysqld",
792
"$path_client_bindir/mysqld-debug",
793
"$path_client_bindir/mysqld-max",
794
"$glob_basedir/libexec/mysqld",
795
"$glob_basedir/bin/mysqld",
796
"$glob_basedir/sbin/mysqld");
686
798
# Use the mysqld found above to find out what features are available
687
799
collect_mysqld_features();
691
$mysqld_variables{'port'}= 4427;
696
$opt_engine= "innodb";
803
$mysqld_variables{'port'}= 3306;
699
806
if ( $opt_comment )
1020
$path_timefile= "$opt_vardir/log/drizzletest-time";
1021
$path_drizzletest_log= "$opt_vardir/log/drizzletest.log";
1231
# --------------------------------------------------------------------------
1232
# ndbconnectstring and ndbconnectstring_slave
1233
# --------------------------------------------------------------------------
1234
if ( $opt_ndbconnectstring )
1236
# ndbconnectstring was supplied by user, the tests shoudl be run
1237
# against an already started cluster, change settings
1238
my $cluster= $clusters->[0]; # Master cluster
1239
$cluster->{'connect_string'}= $opt_ndbconnectstring;
1240
$cluster->{'use_running'}= 1;
1242
mtr_error("Can't specify --ndb-connectstring and --skip-ndbcluster")
1243
if $opt_skip_ndbcluster;
1245
$ENV{'NDB_CONNECTSTRING'}= $clusters->[0]->{'connect_string'};
1248
if ( $opt_ndbconnectstring_slave )
1250
# ndbconnectstring-slave was supplied by user, the tests should be run
1251
# agains an already started slave cluster, change settings
1252
my $cluster= $clusters->[1]; # Slave cluster
1253
$cluster->{'connect_string'}= $opt_ndbconnectstring_slave;
1254
$cluster->{'use_running'}= 1;
1256
mtr_error("Can't specify ndb-connectstring_slave and " .
1257
"--skip-ndbcluster-slave")
1258
if $opt_skip_ndbcluster_slave;
1262
$path_timefile= "$opt_vardir/log/mysqltest-time";
1263
$path_mysqltest_log= "$opt_vardir/log/mysqltest.log";
1022
1264
$path_current_test_log= "$opt_vardir/log/current_test";
1265
$path_ndb_testrun_log= "$opt_vardir/log/ndb_testrun.log";
1024
1267
$path_snapshot= "$opt_tmpdir/snapshot_$opt_master_myport/";
1230
# Look for my_print_defaults
1509
# Look for my_print_defaults
1231
1510
$exe_my_print_defaults=
1233
"$path_client_bindir/my_print_defaults",
1234
"$glob_basedir/extra/my_print_defaults",
1235
"$glob_builddir/extra/my_print_defaults");
1238
$exe_perror= "perror";
1240
# Look for the client binaries
1241
$exe_drizzledump= mtr_exe_exists("$path_client_bindir/drizzledump");
1242
$exe_drizzleimport= mtr_exe_exists("$path_client_bindir/drizzleimport");
1243
$exe_drizzle= mtr_exe_exists("$path_client_bindir/drizzle");
1511
mtr_exe_exists(vs_config_dirs('extra', 'my_print_defaults'),
1512
"$path_client_bindir/my_print_defaults",
1513
"$glob_basedir/extra/my_print_defaults");
1516
$exe_perror= mtr_exe_exists(vs_config_dirs('extra', 'perror'),
1517
"$glob_basedir/extra/perror",
1518
"$path_client_bindir/perror");
1520
# Look for the client binaries
1521
$exe_mysqlcheck= mtr_exe_exists("$path_client_bindir/mysqlcheck");
1522
$exe_mysqldump= mtr_exe_exists("$path_client_bindir/mysqldump");
1523
$exe_mysqlimport= mtr_exe_exists("$path_client_bindir/mysqlimport");
1524
$exe_mysqlshow= mtr_exe_exists("$path_client_bindir/mysqlshow");
1525
$exe_mysqlbinlog= mtr_exe_exists("$path_client_bindir/mysqlbinlog");
1526
$exe_mysqladmin= mtr_exe_exists("$path_client_bindir/mysqladmin");
1527
$exe_mysql= mtr_exe_exists("$path_client_bindir/mysql");
1245
1529
if (!$opt_extern)
1247
# Look for SQL scripts directory
1248
if ( $mysql_version_id >= 50100 )
1250
$exe_drizzleslap= mtr_exe_exists("$path_client_bindir/drizzleslap");
1254
# Look for drizzletest executable
1256
$exe_drizzletest= mtr_exe_exists("$path_client_bindir/drizzletest");
1259
# Look for drizzle_client_test executable which may _not_ exist in
1260
# some versions, test using it should be skipped
1262
$exe_drizzle_client_test=
1531
# Look for SQL scripts directory
1532
if ( mtr_file_exists("$path_share/mysql_system_tables.sql") ne "")
1534
# The SQL scripts are in path_share
1535
$path_sql_dir= $path_share;
1539
$path_sql_dir= mtr_path_exists("$glob_basedir/share",
1540
"$glob_basedir/scripts");
1543
if ( $mysql_version_id >= 50100 )
1545
$exe_mysqlslap= mtr_exe_exists("$path_client_bindir/mysqlslap");
1547
if ( $mysql_version_id >= 50000 and !$glob_use_embedded_server )
1549
$exe_mysql_upgrade= mtr_exe_exists("$path_client_bindir/mysql_upgrade")
1553
$exe_mysql_upgrade= "";
1556
if ( ! $glob_win32 )
1558
# Look for mysql_fix_system_table script
1559
$exe_mysql_fix_system_tables=
1560
mtr_script_exists("$glob_basedir/scripts/mysql_fix_privilege_tables",
1561
"$path_client_bindir/mysql_fix_privilege_tables");
1564
# Look for mysql_fix_privilege_tables.sql script
1565
$file_mysql_fix_privilege_tables=
1566
mtr_file_exists("$glob_basedir/scripts/mysql_fix_privilege_tables.sql",
1567
"$glob_basedir/share/mysql_fix_privilege_tables.sql");
1569
if ( ! $opt_skip_ndbcluster and executable_setup_ndb())
1571
mtr_warning("Could not find all required ndb binaries, " .
1572
"all ndb tests will fail, use --skip-ndbcluster to " .
1573
"skip testing it.");
1575
foreach my $cluster (@{$clusters})
1577
$cluster->{"executable_setup_failed"}= 1;
1582
# Look for the udf_example library
1584
mtr_file_exists(vs_config_dirs('sql', 'udf_example.dll'),
1585
"$glob_basedir/sql/.libs/udf_example.so",);
1587
# Look for the ha_example library
1588
$lib_example_plugin=
1589
mtr_file_exists(vs_config_dirs('storage/example', 'ha_example.dll'),
1590
"$glob_basedir/storage/example/.libs/ha_example.so",);
1594
# Look for mysqltest executable
1595
if ( $glob_use_embedded_server )
1598
mtr_exe_exists(vs_config_dirs('libmysqld/examples','mysqltest_embedded'),
1599
"$glob_basedir/libmysqld/examples/mysqltest_embedded",
1600
"$path_client_bindir/mysqltest_embedded");
1604
$exe_mysqltest= mtr_exe_exists("$path_client_bindir/mysqltest");
1607
# Look for mysql_client_test executable which may _not_ exist in
1608
# some versions, test using it should be skipped
1609
if ( $glob_use_embedded_server )
1611
$exe_mysql_client_test=
1263
1612
mtr_exe_maybe_exists(
1264
"$glob_basedir/tests/drizzle_client_test",
1265
"$glob_basedir/bin/drizzle_client_test");
1613
vs_config_dirs('libmysqld/examples', 'mysql_client_test_embedded'),
1614
"$glob_basedir/libmysqld/examples/mysql_client_test_embedded");
1618
$exe_mysql_client_test=
1619
mtr_exe_maybe_exists(vs_config_dirs('tests', 'mysql_client_test'),
1620
"$glob_basedir/tests/mysql_client_test",
1621
"$glob_basedir/bin/mysql_client_test");
1268
# Look for bug25714 executable which may _not_ exist in
1269
# some versions, test using it should be skipped
1624
# Look for bug25714 executable which may _not_ exist in
1625
# some versions, test using it should be skipped
1271
mtr_exe_maybe_exists(
1272
"$glob_basedir/tests/bug25714");
1627
mtr_exe_maybe_exists(vs_config_dirs('tests', 'bug25714'),
1628
"$glob_basedir/tests/bug25714");
1277
1632
sub generate_cmdline_mysqldump ($) {
1278
1633
my($mysqld) = @_;
1280
mtr_native_path($exe_drizzledump) .
1281
" --no-defaults -uroot " .
1635
mtr_native_path($exe_mysqldump) .
1636
" --no-defaults -uroot --debug-check " .
1282
1637
"--port=$mysqld->{'port'} ";
1421
1816
$ENV{'SLAVE_MYPORT'}= $slave->[0]->{'port'};
1422
1817
$ENV{'SLAVE_MYPORT1'}= $slave->[1]->{'port'};
1423
1818
$ENV{'SLAVE_MYPORT2'}= $slave->[2]->{'port'};
1424
$ENV{'MC_PORT'}= $opt_memc_myport;
1425
$ENV{'DRIZZLE_TCP_PORT'}= $mysqld_variables{'port'};
1427
$ENV{'MTR_BUILD_THREAD'}= $opt_mtr_build_thread;
1429
$ENV{'EXE_MYSQL'}= $exe_drizzle;
1819
$ENV{'MYSQL_TCP_PORT'}= $mysqld_variables{'port'};
1821
$ENV{MTR_BUILD_THREAD}= $opt_mtr_build_thread;
1823
$ENV{'EXE_MYSQL'}= $exe_mysql;
1826
# ----------------------------------------------------
1828
# ----------------------------------------------------
1829
if ( ! $opt_skip_ndbcluster )
1831
$ENV{'NDB_MGM'}= $exe_ndb_mgm;
1833
$ENV{'NDBCLUSTER_PORT'}= $opt_ndbcluster_port;
1834
$ENV{'NDBCLUSTER_PORT_SLAVE'}= $opt_ndbcluster_port_slave;
1836
$ENV{'NDB_EXTRA_TEST'}= $opt_ndb_extra_test;
1838
$ENV{'NDB_BACKUP_DIR'}= $clusters->[0]->{'data_dir'};
1839
$ENV{'NDB_DATA_DIR'}= $clusters->[0]->{'data_dir'};
1840
$ENV{'NDB_TOOLS_DIR'}= $path_ndb_tools_dir;
1841
$ENV{'NDB_TOOLS_OUTPUT'}= $path_ndb_testrun_log;
1843
if ( $mysql_version_id >= 50000 )
1845
$ENV{'NDB_EXAMPLES_DIR'}= $path_ndb_examples_dir;
1846
$ENV{'MY_NDB_EXAMPLES_BINARY'}= $exe_ndb_example;
1848
$ENV{'NDB_EXAMPLES_OUTPUT'}= $path_ndb_testrun_log;
1851
# ----------------------------------------------------
1852
# Setup env so childs can execute mysqlcheck
1853
# ----------------------------------------------------
1854
my $cmdline_mysqlcheck=
1855
mtr_native_path($exe_mysqlcheck) .
1856
" --no-defaults --debug-check -uroot " .
1857
"--port=$master->[0]->{'port'} ";
1861
$cmdline_mysqlcheck .=
1862
" --debug=d:t:A,$path_vardir_trace/log/mysqlcheck.trace";
1864
$ENV{'MYSQL_CHECK'}= $cmdline_mysqlcheck;
1432
1866
# ----------------------------------------------------
1433
1867
# Setup env to childs can execute myqldump
1478
1911
$cmdline_mysqlimport .=
1479
1912
" --debug=d:t:A,$path_vardir_trace/log/mysqlimport.trace";
1481
$ENV{'DRIZZLE_IMPORT'}= $cmdline_mysqlimport;
1914
$ENV{'MYSQL_IMPORT'}= $cmdline_mysqlimport;
1917
# ----------------------------------------------------
1918
# Setup env so childs can execute mysqlshow
1919
# ----------------------------------------------------
1920
my $cmdline_mysqlshow=
1921
mtr_native_path($exe_mysqlshow) .
1922
" -uroot --debug-check " .
1923
"--port=$master->[0]->{'port'} ";
1927
$cmdline_mysqlshow .=
1928
" --debug=d:t:A,$path_vardir_trace/log/mysqlshow.trace";
1930
$ENV{'MYSQL_SHOW'}= $cmdline_mysqlshow;
1932
# ----------------------------------------------------
1933
# Setup env so childs can execute mysqlbinlog
1934
# ----------------------------------------------------
1935
my $cmdline_mysqlbinlog=
1936
mtr_native_path($exe_mysqlbinlog) .
1937
" --no-defaults --disable-force-if-open --debug-check";
1938
if ( !$opt_extern && $mysql_version_id >= 50000 )
1940
$cmdline_mysqlbinlog .=" --character-sets-dir=$path_charsetsdir";
1945
$cmdline_mysqlbinlog .=
1946
" --debug=d:t:A,$path_vardir_trace/log/mysqlbinlog.trace";
1948
$ENV{'MYSQL_BINLOG'}= $cmdline_mysqlbinlog;
1484
1950
# ----------------------------------------------------
1485
1951
# Setup env so childs can execute mysql
1486
1952
# ----------------------------------------------------
1487
1953
my $cmdline_mysql=
1488
mtr_native_path($exe_drizzle) .
1489
" --no-defaults --host=localhost --user=root --password= " .
1490
"--port=$master->[0]->{'port'} ";
1954
mtr_native_path($exe_mysql) .
1955
" --no-defaults --debug-check --host=localhost --user=root --password= " .
1956
"--port=$master->[0]->{'port'} " .
1957
"--character-sets-dir=$path_charsetsdir";
1492
1959
$ENV{'MYSQL'}= $cmdline_mysql;
1494
1961
# ----------------------------------------------------
1495
1962
# Setup env so childs can execute bug25714
1496
1963
# ----------------------------------------------------
1497
$ENV{'DRIZZLE_BUG25714'}= $exe_bug25714;
1499
# ----------------------------------------------------
1500
# Setup env so childs can execute drizzle_client_test
1501
# ----------------------------------------------------
1502
$ENV{'DRIZZLE_CLIENT_TEST'}= drizzle_client_test_arguments();
1964
$ENV{'MYSQL_BUG25714'}= $exe_bug25714;
1966
# ----------------------------------------------------
1967
# Setup env so childs can execute mysql_client_test
1968
# ----------------------------------------------------
1969
$ENV{'MYSQL_CLIENT_TEST'}= mysql_client_test_arguments();
1971
# ----------------------------------------------------
1972
# Setup env so childs can execute mysql_upgrade
1973
# ----------------------------------------------------
1974
if ( !$opt_extern && $mysql_version_id >= 50000 )
1976
$ENV{'MYSQL_UPGRADE'}= mysql_upgrade_arguments();
1505
1979
# ----------------------------------------------------
1506
1980
# Setup env so childs can execute mysql_fix_system_tables
1507
1981
# ----------------------------------------------------
1982
if ( !$opt_extern && ! $glob_win32 )
1511
1984
my $cmdline_mysql_fix_system_tables=
1512
"$exe_drizzle_fix_system_tables --no-defaults --host=localhost " .
1985
"$exe_mysql_fix_system_tables --no-defaults --host=localhost " .
1513
1986
"--user=root --password= " .
1514
1987
"--basedir=$glob_basedir --bindir=$path_client_bindir --verbose " .
1515
1988
"--port=$master->[0]->{'port'} ";
1516
$ENV{'DRIZZLE_FIX_SYSTEM_TABLES'}= $cmdline_mysql_fix_system_tables;
1989
$ENV{'MYSQL_FIX_SYSTEM_TABLES'}= $cmdline_mysql_fix_system_tables;
1992
$ENV{'MYSQL_FIX_PRIVILEGE_TABLES'}= $file_mysql_fix_privilege_tables;
1520
1994
# ----------------------------------------------------
1521
1995
# Setup env so childs can execute my_print_defaults
1522
1996
# ----------------------------------------------------
1523
$ENV{'DRIZZLE_MY_PRINT_DEFAULTS'}= mtr_native_path($exe_my_print_defaults);
1997
$ENV{'MYSQL_MY_PRINT_DEFAULTS'}= mtr_native_path($exe_my_print_defaults);
1525
1999
# ----------------------------------------------------
1526
# Setup env so childs can shutdown the server
2000
# Setup env so childs can execute mysqladmin
1527
2001
# ----------------------------------------------------
1528
$ENV{'DRIZZLED_SHUTDOWN'}= mtr_native_path($exe_drizzle);
2002
$ENV{'MYSQLADMIN'}= mtr_native_path($exe_mysqladmin);
1530
2004
# ----------------------------------------------------
1531
2005
# Setup env so childs can execute perror
1543
2025
# ----------------------------------------------------
1544
2026
# Setup env so childs can execute myisampack and myisamchk
1545
2027
# ----------------------------------------------------
1546
# $ENV{'MYISAMCHK'}= mtr_native_path(mtr_exe_exists(
1547
# "$path_client_bindir/myisamchk",
1548
# "$glob_basedir/storage/myisam/myisamchk",
1549
# "$glob_basedir/myisam/myisamchk"));
1550
# $ENV{'MYISAMPACK'}= mtr_native_path(mtr_exe_exists(
1551
# "$path_client_bindir/myisampack",
1552
# "$glob_basedir/storage/myisam/myisampack",
1553
# "$glob_basedir/myisam/myisampack"));
2028
$ENV{'MYISAMCHK'}= mtr_native_path(mtr_exe_exists(
2029
vs_config_dirs('storage/myisam', 'myisamchk'),
2030
vs_config_dirs('myisam', 'myisamchk'),
2031
"$path_client_bindir/myisamchk",
2032
"$glob_basedir/storage/myisam/myisamchk",
2033
"$glob_basedir/myisam/myisamchk"));
2034
$ENV{'MYISAMPACK'}= mtr_native_path(mtr_exe_exists(
2035
vs_config_dirs('storage/myisam', 'myisampack'),
2036
vs_config_dirs('myisam', 'myisampack'),
2037
"$path_client_bindir/myisampack",
2038
"$glob_basedir/storage/myisam/myisampack",
2039
"$glob_basedir/myisam/myisampack"));
1555
2041
# ----------------------------------------------------
1556
2042
# We are nice and report a bit about our settings
1822
2369
$debug_compiled_binaries= 1;
2372
##############################################################################
2374
# Helper function to handle configuration-based subdirectories which Visual
2375
# Studio uses for storing binaries. If opt_vs_config is set, this returns
2376
# a path based on that setting; if not, it returns paths for the default
2377
# /release/ and /debug/ subdirectories.
2379
# $exe can be undefined, if the directory itself will be used
2381
###############################################################################
2383
sub vs_config_dirs ($$) {
2384
my ($path_part, $exe) = @_;
2386
$exe = "" if not defined $exe;
2390
return ("$glob_basedir/$path_part/$opt_vs_config/$exe");
2393
return ("$glob_basedir/$path_part/release/$exe",
2394
"$glob_basedir/$path_part/relwithdebinfo/$exe",
2395
"$glob_basedir/$path_part/debug/$exe");
2398
##############################################################################
2400
# Start the ndb cluster
2402
##############################################################################
2404
sub check_ndbcluster_support ($) {
2405
my $mysqld_variables= shift;
2407
if ($opt_skip_ndbcluster || $opt_extern)
2411
mtr_report("Skipping ndbcluster");
2413
$opt_skip_ndbcluster_slave= 1;
2417
if ( ! $mysqld_variables->{'ndb-connectstring'} )
2419
mtr_report("Skipping ndbcluster, mysqld not compiled with ndbcluster");
2420
$opt_skip_ndbcluster= 1;
2421
$opt_skip_ndbcluster_slave= 1;
2424
$glob_ndbcluster_supported= 1;
2425
mtr_report("Using ndbcluster when necessary, mysqld supports it");
2427
if ( $mysql_version_id < 50100 )
2429
# Slave cluster is not supported until 5.1
2430
$opt_skip_ndbcluster_slave= 1;
2438
sub ndbcluster_start_install ($) {
2441
mtr_report("Installing $cluster->{'name'} Cluster");
2443
mkdir($cluster->{'data_dir'});
2445
# Create a config file from template
2447
my $ndb_no_attr=2048;
2448
my $ndb_con_op=105000;
2451
my $ndb_pbmem="32M";
2452
my $nodes= $cluster->{'nodes'};
2453
my $ndb_host= "localhost";
2454
my $ndb_diskless= 0;
2458
# Use a smaller configuration
2459
if ( $mysql_version_id < 50100 )
2461
# 4.1 and 5.0 is using a "larger" --small configuration
2477
my $config_file_template= "ndb/ndb_config_${nodes}_node.ini";
2478
my $config_file= "$cluster->{'data_dir'}/config.ini";
2480
open(IN, $config_file_template)
2481
or mtr_error("Can't open $config_file_template: $!");
2482
open(OUT, ">", $config_file)
2483
or mtr_error("Can't write to $config_file: $!");
2488
s/CHOOSE_MaxNoOfAttributes/$ndb_no_attr/;
2489
s/CHOOSE_MaxNoOfOrderedIndexes/$ndb_no_ord/;
2490
s/CHOOSE_MaxNoOfConcurrentOperations/$ndb_con_op/;
2491
s/CHOOSE_DataMemory/$ndb_dmem/;
2492
s/CHOOSE_IndexMemory/$ndb_imem/;
2493
s/CHOOSE_Diskless/$ndb_diskless/;
2494
s/CHOOSE_HOSTNAME_.*/$ndb_host/;
2495
s/CHOOSE_FILESYSTEM/$cluster->{'data_dir'}/;
2496
s/CHOOSE_PORT_MGM/$cluster->{'port'}/;
2497
if ( $mysql_version_id < 50000 )
2499
my $base_port= $cluster->{'port'} + 1;
2500
s/CHOOSE_PORT_TRANSPORTER/$base_port/;
2502
s/CHOOSE_DiskPageBufferMemory/$ndb_pbmem/;
2510
# Start cluster with "--initial"
2512
ndbcluster_start($cluster, "--initial");
2518
sub ndbcluster_wait_started($$){
2520
my $ndb_waiter_extra_opt= shift;
2521
my $path_waiter_log= "$cluster->{'data_dir'}/ndb_waiter.log";
2524
mtr_init_args(\$args);
2526
mtr_add_arg($args, "--no-defaults");
2527
mtr_add_arg($args, "--core");
2528
mtr_add_arg($args, "--ndb-connectstring=%s", $cluster->{'connect_string'});
2529
mtr_add_arg($args, "--timeout=60");
2531
if ($ndb_waiter_extra_opt)
2533
mtr_add_arg($args, "$ndb_waiter_extra_opt");
2536
# Start the ndb_waiter which will connect to the ndb_mgmd
2537
# and poll it for state of the ndbd's, will return when
2538
# all nodes in the cluster is started
2539
my $res= mtr_run($exe_ndb_waiter, $args,
2540
"", $path_waiter_log, $path_waiter_log, "");
2541
mtr_verbose("ndbcluster_wait_started, returns: $res") if $res;
2547
sub mysqld_wait_started($){
2550
if (sleep_until_file_created($mysqld->{'path_pid'},
2551
$mysqld->{'start_timeout'},
2552
$mysqld->{'pid'}) == 0)
2554
# Failed to wait for pid file
2558
# Get the "real pid" of the process, it will be used for killing
2559
# the process in ActiveState's perl on windows
2560
$mysqld->{'real_pid'}= mtr_get_pid_from_file($mysqld->{'path_pid'});
2566
sub ndb_mgmd_wait_started($) {
2570
while (ndbcluster_wait_started($cluster, "--no-contact") and
2573
# Millisceond sleep emulated with select
2574
select(undef, undef, undef, (0.1));
2579
return $retries == 0;
2583
sub ndb_mgmd_start ($) {
2586
my $args; # Arg vector
2589
mtr_init_args(\$args);
2590
mtr_add_arg($args, "--no-defaults");
2591
mtr_add_arg($args, "--core");
2592
mtr_add_arg($args, "--nodaemon");
2593
mtr_add_arg($args, "--config-file=%s", "$cluster->{'data_dir'}/config.ini");
2596
my $path_ndb_mgmd_log= "$cluster->{'data_dir'}/\l$cluster->{'name'}_ndb_mgmd.log";
2597
$pid= mtr_spawn($exe_ndb_mgmd, $args, "",
2601
{ append_log_file => 1 });
2603
# FIXME Should not be needed
2604
# Unfortunately the cluster nodes will fail to start
2605
# if ndb_mgmd has not started properly
2606
if (ndb_mgmd_wait_started($cluster))
2608
mtr_error("Failed to wait for start of ndb_mgmd");
2611
# Remember pid of ndb_mgmd
2612
$cluster->{'pid'}= $pid;
2614
mtr_verbose("ndb_mgmd_start, pid: $pid");
2620
sub ndbd_start ($$$) {
2623
my $extra_args= shift;
2625
my $args; # Arg vector
2628
mtr_init_args(\$args);
2629
mtr_add_arg($args, "--no-defaults");
2630
mtr_add_arg($args, "--core");
2631
mtr_add_arg($args, "--ndb-connectstring=%s", "$cluster->{'connect_string'}");
2632
if ( $mysql_version_id >= 50000)
2634
mtr_add_arg($args, "--character-sets-dir=%s", "$path_charsetsdir");
2636
mtr_add_arg($args, "--nodaemon");
2637
mtr_add_arg($args, "$extra_args");
2639
my $nodeid= $cluster->{'ndbds'}->[$idx]->{'nodeid'};
2640
my $path_ndbd_log= "$cluster->{'data_dir'}/ndb_${nodeid}.log";
2641
$pid= mtr_spawn($exe_ndbd, $args, "",
2645
{ append_log_file => 1 });
2647
# Add pid to list of pids for this cluster
2648
$cluster->{'ndbds'}->[$idx]->{'pid'}= $pid;
2650
# Rememeber options used when starting
2651
$cluster->{'ndbds'}->[$idx]->{'start_extra_args'}= $extra_args;
2652
$cluster->{'ndbds'}->[$idx]->{'idx'}= $idx;
2654
mtr_verbose("ndbd_start, pid: $pid");
2660
sub ndbcluster_start ($$) {
2662
my $extra_args= shift;
2664
mtr_verbose("ndbcluster_start '$cluster->{'name'}'");
2666
if ( $cluster->{'use_running'} )
2671
if ( $cluster->{'pid'} )
2673
mtr_error("Cluster '$cluster->{'name'}' already started");
2676
ndb_mgmd_start($cluster);
2678
for ( my $idx= 0; $idx < $cluster->{'nodes'}; $idx++ )
2680
ndbd_start($cluster, $idx, $extra_args);
2687
sub rm_ndbcluster_tables ($) {
2689
foreach my $bin ( glob("$dir/mysql/ndb_apply_status*"),
2690
glob("$dir/mysql/ndb_schema*"))
1826
2697
##############################################################################
1994
2873
copy_install_db("slave".($idx+1), $slave->[$idx]->{'path_myddir'});
2876
my $cluster_started_ok= 1; # Assume it can be started
2878
my $cluster= $clusters->[0]; # Master cluster
2879
if ($opt_skip_ndbcluster ||
2880
$cluster->{'use_running'} ||
2881
$cluster->{executable_setup_failed})
2883
# Don't install master cluster
2885
elsif (ndbcluster_start_install($cluster))
2887
mtr_warning("Failed to start install of $cluster->{name}");
2888
$cluster_started_ok= 0;
2891
$cluster= $clusters->[1]; # Slave cluster
2892
if ($max_slave_num == 0 ||
2893
$opt_skip_ndbcluster_slave ||
2894
$cluster->{'use_running'} ||
2895
$cluster->{executable_setup_failed})
2897
# Don't install slave cluster
2899
elsif (ndbcluster_start_install($cluster))
2901
mtr_warning("Failed to start install of $cluster->{name}");
2902
$cluster_started_ok= 0;
2905
foreach $cluster (@{$clusters})
2908
next if !$cluster->{'pid'};
2910
$cluster->{'installed_ok'}= 1; # Assume install suceeds
2912
if (ndbcluster_wait_started($cluster, ""))
2914
# failed to install, disable usage and flag that its no ok
2915
mtr_report("ndbcluster_install of $cluster->{'name'} failed");
2916
$cluster->{"installed_ok"}= 0;
2918
$cluster_started_ok= 0;
2922
if ( ! $cluster_started_ok )
2926
# Continue without cluster
2930
mtr_error("To continue, re-run with '--force'.");
2950
sub install_db ($$) {
2952
my $data_dir= shift;
2954
mtr_report("Installing \u$type Database");
2958
mtr_init_args(\$args);
2959
mtr_add_arg($args, "--no-defaults");
2960
mtr_add_arg($args, "--bootstrap");
2961
mtr_add_arg($args, "--basedir=%s", $path_my_basedir);
2962
mtr_add_arg($args, "--datadir=%s", $data_dir);
2963
mtr_add_arg($args, "--loose-skip-innodb");
2964
mtr_add_arg($args, "--tmpdir=.");
2965
mtr_add_arg($args, "--core-file");
2969
mtr_add_arg($args, "--debug=d:t:i:A,%s/log/bootstrap_%s.trace",
2970
$path_vardir_trace, $type);
2973
if ( ! $glob_netware )
2975
mtr_add_arg($args, "--language=%s", $path_language);
2976
mtr_add_arg($args, "--character-sets-dir=%s", $path_charsetsdir);
2979
# If DISABLE_GRANT_OPTIONS is defined when the server is compiled (e.g.,
2980
# configure --disable-grant-options), mysqld will not recognize the
2981
# --bootstrap or --skip-grant-tables options. The user can set
2982
# MYSQLD_BOOTSTRAP to the full path to a mysqld which does accept
2983
# --bootstrap, to accommodate this.
2984
my $exe_mysqld_bootstrap = $ENV{'MYSQLD_BOOTSTRAP'} || $exe_mysqld;
2986
# ----------------------------------------------------------------------
2987
# export MYSQLD_BOOTSTRAP_CMD variable containing <path>/mysqld <args>
2988
# ----------------------------------------------------------------------
2989
$ENV{'MYSQLD_BOOTSTRAP_CMD'}= "$exe_mysqld_bootstrap " . join(" ", @$args);
2991
# ----------------------------------------------------------------------
2992
# Create the bootstrap.sql file
2993
# ----------------------------------------------------------------------
2994
my $bootstrap_sql_file= "$opt_vardir/tmp/bootstrap.sql";
2996
# Use the mysql database for system tables
2997
mtr_tofile($bootstrap_sql_file, "use mysql");
2999
# Add the offical mysql system tables
3000
# for a production system
3001
mtr_appendfile_to_file("$path_sql_dir/mysql_system_tables.sql",
3002
$bootstrap_sql_file);
3004
# Add the mysql system tables initial data
3005
# for a production system
3006
mtr_appendfile_to_file("$path_sql_dir/mysql_system_tables_data.sql",
3007
$bootstrap_sql_file);
3009
# Add test data for timezone - this is just a subset, on a real
3010
# system these tables will be populated either by mysql_tzinfo_to_sql
3011
# or by downloading the timezone table package from our website
3012
mtr_appendfile_to_file("$path_sql_dir/mysql_test_data_timezone.sql",
3013
$bootstrap_sql_file);
3015
# Remove anonymous users
3016
mtr_tofile($bootstrap_sql_file,
3017
"DELETE FROM mysql.user where user= '';");
3019
# Log bootstrap command
3020
my $path_bootstrap_log= "$opt_vardir/log/bootstrap.log";
3021
mtr_tofile($path_bootstrap_log,
3022
"$exe_mysqld_bootstrap " . join(" ", @$args) . "\n");
3025
if ( mtr_run($exe_mysqld_bootstrap, $args, $bootstrap_sql_file,
3026
$path_bootstrap_log, $path_bootstrap_log,
3027
"", { append_log_file => 1 }) != 0 )
3030
mtr_error("Error executing mysqld --bootstrap\n" .
3031
"Could not install system database from $bootstrap_sql_file\n" .
3032
"see $path_bootstrap_log for errors");
2014
3038
# Restore snapshot of the installed slave databases
2015
3039
# if the snapshot exists
3075
if ($tinfo->{'ndb_test'})
3077
foreach my $cluster (@{$clusters})
3079
# Slave cluster is skipped and thus not
3080
# installed, no need to perform checks
3081
last if ($opt_skip_ndbcluster_slave and
3082
$cluster->{'name'} eq 'Slave');
3084
# Using running cluster - no need
3085
# to check if test should be skipped
3086
# will be done by test itself
3087
last if ($cluster->{'use_running'});
3089
# If test needs this cluster, check binaries was found ok
3090
if ( $cluster->{'executable_setup_failed'} )
3092
mtr_report_test_name($tinfo);
3094
"Failed to find cluster binaries";
3095
mtr_report_test_failed($tinfo);
3099
# If test needs this cluster, check it was installed ok
3100
if ( !$cluster->{'installed_ok'} )
3102
mtr_report_test_name($tinfo);
3104
"Cluster $cluster->{'name'} was not installed ok";
3105
mtr_report_test_failed($tinfo);
2055
sub do_before_run_drizzletest($)
3116
sub do_before_run_mysqltest($)
2057
3118
my $tinfo= shift;
2060
# Remove old files produced by drizzletest
3121
# Remove old files produced by mysqltest
2061
3122
my $base_file= mtr_match_extension($tinfo->{'result_file'},
2062
3123
"result"); # Trim extension
2063
3124
unlink("$base_file.reject");
2065
3126
unlink("$base_file.log");
2066
3127
unlink("$base_file.warnings");
3131
if ( $mysql_version_id < 50000 ) {
3132
# Set environment variable NDB_STATUS_OK to 1
3133
# if script decided to run mysqltest cluster _is_ installed ok
3134
$ENV{'NDB_STATUS_OK'} = "1";
3135
} elsif ( $mysql_version_id < 50100 ) {
3136
# Set environment variable NDB_STATUS_OK to YES
3137
# if script decided to run mysqltest cluster _is_ installed ok
3138
$ENV{'NDB_STATUS_OK'} = "YES";
3140
if (defined $tinfo->{binlog_format} and $mysql_version_id > 50100 )
3142
# Dynamically switch binlog format of
3143
# master, slave is always restarted
3144
foreach my $server ( @$master )
3146
next unless ($server->{'pid'});
3148
mtr_init_args(\$args);
3149
mtr_add_arg($args, "--no-defaults");
3150
mtr_add_arg($args, "--user=root");
3151
mtr_add_arg($args, "--port=$server->{'port'}");
3153
my $sql= "include/set_binlog_format_".$tinfo->{binlog_format}.".sql";
3154
mtr_verbose("Setting binlog format:", $tinfo->{binlog_format});
3155
if (mtr_run($exe_mysql, $args, $sql, "", "", "") != 0)
3157
mtr_error("Failed to switch binlog format");
2070
sub do_after_run_drizzletest($)
3164
sub do_after_run_mysqltest($)
2072
3166
my $tinfo= shift;
2074
# Save info from this testcase run to drizzletest.log
2075
mtr_appendfile_to_file($path_current_test_log, $path_drizzletest_log)
3168
# Save info from this testcase run to mysqltest.log
3169
mtr_appendfile_to_file($path_current_test_log, $path_mysqltest_log)
2076
3170
if -f $path_current_test_log;
2077
mtr_appendfile_to_file($path_timefile, $path_drizzletest_log)
3171
mtr_appendfile_to_file($path_timefile, $path_mysqltest_log)
2078
3172
if -f $path_timefile;
2451
3563
mtr_add_arg($args, "%s--secure-file-priv=%s", $prefix, $opt_vardir);
3566
if ( $mysql_version_id >= 50000 )
3568
mtr_add_arg($args, "%s--log-bin-trust-function-creators", $prefix);
3571
mtr_add_arg($args, "%s--default-character-set=latin1", $prefix);
3572
mtr_add_arg($args, "%s--language=%s", $prefix, $path_language);
2454
3573
mtr_add_arg($args, "%s--tmpdir=$opt_tmpdir", $prefix);
2456
3575
# Increase default connect_timeout to avoid intermittent
2457
3576
# disconnects when test servers are put under load
2458
3577
# see BUG#28359
2459
mtr_add_arg($args, "%s--drizzle-protocol-connect-timeout=60", $prefix);
3578
mtr_add_arg($args, "%s--connect-timeout=60", $prefix);
2462
3581
# When mysqld is run by a root user(euid is 0), it will fail
2463
3582
# to start unless we specify what user to run as, see BUG#30630
2465
if (grep(/^--user/, @$extra_opt, @opt_extra_mysqld_opt) == 0) {
3584
if (!$glob_win32 and $euid == 0 and
3585
grep(/^--user/, @$extra_opt, @opt_extra_mysqld_opt) == 0) {
2466
3586
mtr_add_arg($args, "%s--user=root", $prefix);
2469
3589
mtr_add_arg($args, "%s--pid-file=%s", $prefix,
2470
3590
$mysqld->{'path_pid'});
2472
mtr_add_arg($args, "%s--drizzle-protocol-port=%d", $prefix,
3592
mtr_add_arg($args, "%s--port=%d", $prefix,
2473
3593
$mysqld->{'port'});
2475
mtr_add_arg($args, "%s--mysql-protocol-port=%d", $prefix,
2476
$mysqld->{'port'} + 50);
2478
3595
mtr_add_arg($args, "%s--datadir=%s", $prefix,
2479
3596
$mysqld->{'path_myddir'});
3599
if ( $mysql_version_id >= 50106 )
3601
# Turn on logging to bothe tables and file
3602
mtr_add_arg($args, "%s--log-output=table,file", $prefix);
3605
my $log_base_path= "$opt_vardir/log/$mysqld->{'type'}$sidx";
3606
mtr_add_arg($args, "%s--log=%s.log", $prefix, $log_base_path);
3608
"%s--log-slow-queries=%s-slow.log", $prefix, $log_base_path);
2481
3610
# Check if "extra_opt" contains --skip-log-bin
3611
my $skip_binlog= grep(/^--skip-log-bin/, @$extra_opt, @opt_extra_mysqld_opt);
2482
3612
if ( $mysqld->{'type'} eq 'master' )
3614
if (! ($opt_skip_master_binlog || $skip_binlog) )
3616
mtr_add_arg($args, "%s--log-bin=%s/log/master-bin%s", $prefix,
3617
$opt_vardir, $sidx);
2484
3620
mtr_add_arg($args, "%s--server-id=%d", $prefix,
2485
3621
$idx > 0 ? $idx + 101 : 1);
2487
3623
mtr_add_arg($args, "%s--loose-innodb_data_file_path=ibdata1:10M:autoextend",
2490
mtr_add_arg($args, "%s--loose-innodb-lock-wait-timeout=5", $prefix);
3626
mtr_add_arg($args, "%s--local-infile", $prefix);
2492
3628
if ( $idx > 0 or !$use_innodb)
2494
3630
mtr_add_arg($args, "%s--loose-skip-innodb", $prefix);
3633
my $cluster= $clusters->[$mysqld->{'cluster'}];
3634
if ( $cluster->{'pid'} || # Cluster is started
3635
$cluster->{'use_running'} ) # Using running cluster
3637
mtr_add_arg($args, "%s--ndbcluster", $prefix);
3638
mtr_add_arg($args, "%s--ndb-connectstring=%s", $prefix,
3639
$cluster->{'connect_string'});
3640
mtr_add_arg($args, "%s--ndb-wait-connected=20", $prefix);
3641
mtr_add_arg($args, "%s--ndb-cluster-connection-pool=3", $prefix);
3642
mtr_add_arg($args, "%s--slave-allow-batching", $prefix);
3643
if ( $mysql_version_id >= 50100 )
3645
mtr_add_arg($args, "%s--ndb-extra-logging", $prefix);
3646
mtr_add_arg($args, "%s--ndb-log-orig", $prefix);
3651
mtr_add_arg($args, "%s--loose-skip-ndbcluster", $prefix);
2499
3656
mtr_error("unknown mysqld type")
2500
3657
unless $mysqld->{'type'} eq 'slave';
3659
#mtr_add_arg($args, "%s--init-rpl-role=slave", $prefix);
3660
if (! ( $opt_skip_slave_binlog || $skip_binlog ))
3662
mtr_add_arg($args, "%s--log-bin=%s/log/slave%s-bin", $prefix,
3663
$opt_vardir, $sidx); # FIXME use own dir for binlogs
3664
mtr_add_arg($args, "%s--log-slave-updates", $prefix);
3667
mtr_add_arg($args, "%s--master-retry-count=10", $prefix);
3669
mtr_add_arg($args, "%s--relay-log=%s/log/slave%s-relay-bin", $prefix,
3670
$opt_vardir, $sidx);
3671
mtr_add_arg($args, "%s--report-host=127.0.0.1", $prefix);
3672
mtr_add_arg($args, "%s--report-port=%d", $prefix,
3674
# mtr_add_arg($args, "%s--report-user=root", $prefix);
3675
mtr_add_arg($args, "%s--loose-skip-innodb", $prefix);
3676
mtr_add_arg($args, "%s--skip-slave-start", $prefix);
2502
3678
# Directory where slaves find the dumps generated by "load data"
2503
3679
# on the server. The path need to have constant length otherwise
2504
3680
# test results will vary, thus a relative path is used.
2505
3681
my $slave_load_path= "../tmp";
3682
mtr_add_arg($args, "%s--slave-load-tmpdir=%s", $prefix,
3684
mtr_add_arg($args, "%s--set-variable=slave_net_timeout=120", $prefix);
2507
3686
if ( @$slave_master_info )
2516
3695
my $slave_server_id= 2 + $idx;
2517
3696
my $slave_rpl_rank= $slave_server_id;
2518
3697
mtr_add_arg($args, "%s--server-id=%d", $prefix, $slave_server_id);
3698
# mtr_add_arg($args, "%s--rpl-recovery-rank=%d", $prefix, $slave_rpl_rank);
3701
my $cluster= $clusters->[$mysqld->{'cluster'}];
3702
if ( $cluster->{'pid'} || # Slave cluster is started
3703
$cluster->{'use_running'} ) # Using running slave cluster
3705
mtr_add_arg($args, "%s--ndbcluster", $prefix);
3706
mtr_add_arg($args, "%s--ndb-connectstring=%s", $prefix,
3707
$cluster->{'connect_string'});
3708
mtr_add_arg($args, "%s--ndb-wait-connected=20", $prefix);
3709
mtr_add_arg($args, "%s--ndb-cluster-connection-pool=3", $prefix);
3710
mtr_add_arg($args, "%s--slave-allow-batching", $prefix);
3711
if ( $mysql_version_id >= 50100 )
3713
mtr_add_arg($args, "%s--ndb-extra-logging", $prefix);
3714
mtr_add_arg($args, "%s--ndb-log-orig", $prefix);
3719
mtr_add_arg($args, "%s--loose-skip-ndbcluster", $prefix);
2842
4124
if ( $mysqld->{'pid'} )
2844
$pid= mtr_server_shutdown($mysqld);
2846
$admin_pids{$pid}= 1;
2849
pid => $mysqld->{'pid'},
2850
real_pid => $mysqld->{'real_pid'},
2851
pidfile => $mysqld->{'path_pid'},
2852
sockfile => $mysqld->{'path_sock'},
2853
port => $mysqld->{'port'},
2854
errfile => $mysqld->{'path_myerr'},
2857
$mysqld->{'pid'}= 0; # Assume we are done with it
4126
$pid= mtr_mysqladmin_start($mysqld, "shutdown", 20);
4128
$admin_pids{$pid}= 1;
4131
pid => $mysqld->{'pid'},
4132
real_pid => $mysqld->{'real_pid'},
4133
pidfile => $mysqld->{'path_pid'},
4134
sockfile => $mysqld->{'path_sock'},
4135
port => $mysqld->{'port'},
4136
errfile => $mysqld->{'path_myerr'},
4139
$mysqld->{'pid'}= 0; # Assume we are done with it
4143
# Start shutdown of master cluster
4144
my $cluster= $clusters->[0];
4145
if ( $cluster->{'pid'} )
4147
$pid= mtr_ndbmgm_start($cluster, "shutdown");
4148
$admin_pids{$pid}= 1;
4151
pid => $cluster->{'pid'},
4152
pidfile => $cluster->{'path_pid'}
4155
$cluster->{'pid'}= 0; # Assume we are done with it
4157
foreach my $ndbd (@{$cluster->{'ndbds'}})
4160
pid => $ndbd->{'pid'},
4161
pidfile => $ndbd->{'path_pid'},
4163
$ndbd->{'pid'}= 0; # Assume we are done with it
2870
4176
if ( $mysqld->{'pid'} )
2872
$pid= mtr_server_shutdown($mysqld);
2874
$admin_pids{$pid}= 1;
2877
pid => $mysqld->{'pid'},
2878
real_pid => $mysqld->{'real_pid'},
2879
pidfile => $mysqld->{'path_pid'},
2880
sockfile => $mysqld->{'path_sock'},
2881
port => $mysqld->{'port'},
2882
errfile => $mysqld->{'path_myerr'},
2885
$mysqld->{'pid'}= 0; # Assume we are done with it
4178
$pid= mtr_mysqladmin_start($mysqld, "shutdown", 20);
4180
$admin_pids{$pid}= 1;
4183
pid => $mysqld->{'pid'},
4184
real_pid => $mysqld->{'real_pid'},
4185
pidfile => $mysqld->{'path_pid'},
4186
sockfile => $mysqld->{'path_sock'},
4187
port => $mysqld->{'port'},
4188
errfile => $mysqld->{'path_myerr'},
4192
$mysqld->{'pid'}= 0; # Assume we are done with it
4196
# Start shutdown of slave cluster
4197
my $cluster= $clusters->[1];
4198
if ( $cluster->{'pid'} )
4200
$pid= mtr_ndbmgm_start($cluster, "shutdown");
4202
$admin_pids{$pid}= 1;
4205
pid => $cluster->{'pid'},
4206
pidfile => $cluster->{'path_pid'}
4209
$cluster->{'pid'}= 0; # Assume we are done with it
4211
foreach my $ndbd (@{$cluster->{'ndbds'}} )
4214
pid => $ndbd->{'pid'},
4215
pidfile => $ndbd->{'path_pid'},
4217
$ndbd->{'pid'}= 0; # Assume we are done with it
3114
4528
if ( $opt_debug )
3116
mtr_add_arg($args, "--debug=d:t:A,%s/log/drizzletest.trace",
4530
mtr_add_arg($args, "--debug=d:t:A,%s/log/mysqltest.trace",
3117
4531
$path_vardir_trace);
3122
mtr_add_arg($args, "--testdir=%s", $opt_testdir);
3126
# ----------------------------------------------------------------------
3127
# export DRIZZLE_TEST variable containing <path>/drizzletest <args>
3128
# ----------------------------------------------------------------------
3129
$ENV{'DRIZZLE_TEST'}=
3130
mtr_native_path($exe_drizzletest) . " " . join(" ", @$args);
3132
# ----------------------------------------------------------------------
3133
# Add arguments that should not go into the DRIZZLE_TEST env var
3134
# ----------------------------------------------------------------------
3136
if ( $opt_valgrind_drizzletest )
4534
if ( $opt_ssl_supported )
4536
mtr_add_arg($args, "--ssl-ca=%s/std_data/cacert.pem",
4537
$glob_mysql_test_dir);
4538
mtr_add_arg($args, "--ssl-cert=%s/std_data/client-cert.pem",
4539
$glob_mysql_test_dir);
4540
mtr_add_arg($args, "--ssl-key=%s/std_data/client-key.pem",
4541
$glob_mysql_test_dir);
4546
# Turn on SSL for _all_ test cases if option --ssl was used
4547
mtr_add_arg($args, "--ssl");
4549
elsif ( $opt_ssl_supported )
4551
mtr_add_arg($args, "--skip-ssl");
4554
# ----------------------------------------------------------------------
4555
# If embedded server, we create server args to give mysqltest to pass on
4556
# ----------------------------------------------------------------------
4558
if ( $glob_use_embedded_server )
4560
mysqld_arguments($args,$master->[0],$tinfo->{'master_opt'},[]);
4563
# ----------------------------------------------------------------------
4564
# export MYSQL_TEST variable containing <path>/mysqltest <args>
4565
# ----------------------------------------------------------------------
4567
mtr_native_path($exe_mysqltest) . " " . join(" ", @$args);
4569
# ----------------------------------------------------------------------
4570
# Add arguments that should not go into the MYSQL_TEST env var
4571
# ----------------------------------------------------------------------
4573
if ( $opt_valgrind_mysqltest )
3138
4575
# Prefix the Valgrind options to the argument list.
3139
4576
# We do this here, since we do not want to Valgrind the nested invocations
3140
# of drizzletest; that would mess up the stderr output causing test failure.
4577
# of mysqltest; that would mess up the stderr output causing test failure.
3141
4578
my @args_saved = @$args;
3142
4579
mtr_init_args(\$args);
3143
4580
valgrind_arguments($args, \$exe);