115
120
our $opt_vardir; # A path but set directly on cmd line
116
121
our $path_vardir_trace; # unix formatted opt_vardir for trace files
117
122
our $opt_tmpdir; # A path but set directly on cmd line
120
128
our $default_vardir;
124
our $opt_suites_default= "main,binlog,rpl"; # Default suites to run
132
our $opt_suites_default= "main,jp"; # Default suites to run
125
133
our $opt_script_debug= 0; # Script debugging, enable with --script-debug
126
134
our $opt_verbose= 0; # Verbose output, enable with --verbose
136
our $opt_repeat_test= 1;
128
138
our $exe_master_mysqld;
129
139
our $exe_drizzle;
130
our $exe_drizzleadmin;
131
our $exe_drizzlebinlog;
132
140
our $exe_drizzle_client_test;
133
141
our $exe_bug25714;
134
142
our $exe_drizzled;
135
our $exe_drizzlecheck;
136
143
our $exe_drizzledump;
144
our $exe_drizzleslap;
138
145
our $exe_drizzleimport;
139
146
our $exe_drizzle_fix_system_tables;
140
147
our $exe_drizzletest;
465
474
# Control what test suites or cases to run
466
475
'force' => \$opt_force,
467
'skip-master-binlog' => \$opt_skip_master_binlog,
468
'skip-slave-binlog' => \$opt_skip_slave_binlog,
469
476
'do-test=s' => \$opt_do_test,
470
477
'start-from=s' => \$opt_start_from,
471
478
'suite|suites=s' => \$opt_suites,
472
479
'skip-rpl' => \$opt_skip_rpl,
473
480
'skip-test=s' => \$opt_skip_test,
474
'big-test' => \$opt_big_test,
475
481
'combination=s' => \@opt_combinations,
476
482
'skip-combination' => \$opt_skip_combination,
479
485
'master_port=i' => \$opt_master_myport,
480
486
'slave_port=i' => \$opt_slave_myport,
487
'memc_port=i' => \$opt_memc_myport,
481
488
'mtr-build-thread=i' => \$opt_mtr_build_thread,
483
490
# Test case authoring
488
495
# Extra options used when starting mysqld
489
496
'mysqld=s' => \@opt_extra_mysqld_opt,
497
'engine=s' => \$opt_engine,
491
499
# Run test on running server
492
500
'extern' => \$opt_extern,
503
'subunit' => \$opt_subunit,
495
506
'gdb' => \$opt_gdb,
496
508
'client-gdb' => \$opt_client_gdb,
509
'client-dbx' => \$opt_client_dbx,
497
510
'manual-gdb' => \$opt_manual_gdb,
511
'manual-dbx' => \$opt_manual_dbx,
498
512
'manual-debug' => \$opt_manual_debug,
499
513
'ddd' => \$opt_ddd,
500
514
'client-ddd' => \$opt_client_ddd,
582
604
$opt_mtr_build_thread= $ENV{'MTR_BUILD_THREAD'};
585
# We require that we are in the "mysql-test" directory
586
# to run drizzle-test-run
587
if (! -f $glob_scriptname)
589
mtr_error("Can't find the location for the drizzle-test-run script\n" .
590
"Go to to the mysql-test directory and execute the script " .
591
"as follows:\n./$glob_scriptname");
594
607
if ( -d "../drizzled" )
599
612
# Find the absolute path to the test directory
600
$glob_mysql_test_dir= cwd();
613
if ( ! $opt_testdir )
615
$glob_mysql_test_dir= cwd();
619
$glob_mysql_test_dir= $opt_testdir;
601
621
$default_vardir= "$glob_mysql_test_dir/var";
623
if ( ! $opt_suitepath )
625
$glob_suite_path= "$glob_mysql_test_dir/../plugin";
629
$glob_suite_path= $opt_suitepath;
603
631
# In most cases, the base directory we find everything relative to,
604
632
# is the parent directory of the "mysql-test" directory. For source
605
633
# distributions, TAR binary distributions and some other packages.
634
673
# Look for the client binaries directory
635
$path_client_bindir= mtr_path_exists("$glob_basedir/client",
674
$path_client_bindir= mtr_path_exists("$glob_builddir/client",
675
"$glob_basedir/client",
636
676
"$glob_basedir/bin");
638
# Look for charsetsdir, use same share
639
$path_share= mtr_path_exists("$glob_basedir/share/mysql",
640
"$glob_basedir/drizzled/share",
641
"$glob_basedir/share");
643
$path_charsetsdir= mtr_path_exists("$path_share/charsets");
647
678
if (!$opt_extern)
649
680
$exe_drizzled= mtr_exe_exists ("$glob_basedir/drizzled/drizzled",
650
681
"$path_client_bindir/drizzled",
651
682
"$glob_basedir/libexec/drizzled",
652
683
"$glob_basedir/bin/drizzled",
653
"$glob_basedir/sbin/drizzled");
684
"$glob_basedir/sbin/drizzled",
685
"$glob_builddir/drizzled/drizzled");
655
687
# Use the mysqld found above to find out what features are available
656
688
collect_mysqld_features();
693
730
# --------------------------------------------------------------------------
694
# Find out type of logging that are being used
695
# --------------------------------------------------------------------------
696
if (!$opt_extern && $mysql_version_id >= 50100 )
698
foreach my $arg ( @opt_extra_mysqld_opt )
700
if ( $arg =~ /binlog[-_]format=(\S+)/ )
702
$used_binlog_format= $1;
705
if (defined $used_binlog_format)
707
mtr_report("Using binlog format '$used_binlog_format'");
711
mtr_report("Using dynamic switching of binlog format");
716
# --------------------------------------------------------------------------
717
731
# Find out default storage engine being used(if any)
718
732
# --------------------------------------------------------------------------
719
733
foreach my $arg ( @opt_extra_mysqld_opt )
761
775
$opt_vardir= $default_vardir;
763
elsif ( $mysql_version_id < 50000 and
764
$opt_vardir ne $default_vardir)
766
# Version 4.1 and --vardir was specified
767
# Only supported as a symlink from var/
768
# by setting up $opt_mem that symlink will be created
770
# Only platforms that have native symlinks can use the vardir trick
771
$opt_mem= $opt_vardir;
772
mtr_report("Using 4.1 vardir trick");
775
$opt_vardir= $default_vardir;
778
778
$path_vardir_trace= $opt_vardir;
779
779
# Chop off any "c:", DBUG likes a unix path ex: c:/src/... => /src/...
780
780
$path_vardir_trace=~ s/^\w://;
782
# We make the path absolute, as the server will do a chdir() before usage
783
unless ( $opt_vardir =~ m,^/,)
785
# Make absolute path, relative test dir
786
$opt_vardir= "$glob_mysql_test_dir/$opt_vardir";
782
$opt_vardir= collapse_path($opt_vardir);
789
784
# --------------------------------------------------------------------------
965
961
path_myddir => "$opt_vardir/slave-data",
966
962
path_myerr => "$opt_vardir/log/slave.err",
967
path_pid => "$opt_vardir/run/slave.pid",
968
path_sock => "$sockdir/slave.sock",
969
port => $opt_slave_myport,
963
path_pid => "$opt_vardir/run/slave.pid",
964
path_sock => "$sockdir/slave.sock",
965
port => $opt_slave_myport,
966
mysql_port => $opt_slave_myport + $mysql_port_offset,
970
967
start_timeout => 400,
972
969
cluster => 1, # index in clusters list
981
978
path_myddir => "$opt_vardir/slave1-data",
982
979
path_myerr => "$opt_vardir/log/slave1.err",
983
path_pid => "$opt_vardir/run/slave1.pid",
984
path_sock => "$sockdir/slave1.sock",
985
port => $opt_slave_myport + 1,
980
path_pid => "$opt_vardir/run/slave1.pid",
981
path_sock => "$sockdir/slave1.sock",
982
port => $opt_slave_myport + 1,
983
mysql_port => $opt_slave_myport + 1 + $mysql_port_offset,
986
984
start_timeout => 300,
987
985
cluster => -1, # index in clusters list
988
986
start_opts => [],
996
994
path_myddir => "$opt_vardir/slave2-data",
997
995
path_myerr => "$opt_vardir/log/slave2.err",
998
path_pid => "$opt_vardir/run/slave2.pid",
999
path_sock => "$sockdir/slave2.sock",
1000
port => $opt_slave_myport + 2,
996
path_pid => "$opt_vardir/run/slave2.pid",
997
path_sock => "$sockdir/slave2.sock",
998
port => $opt_slave_myport + 2,
999
mysql_port => $opt_slave_myport + 2 + $mysql_port_offset,
1001
1000
start_timeout => 300,
1002
1001
cluster => -1, # index in clusters list
1003
1002
start_opts => [],
1234
1237
$exe_my_print_defaults=
1235
1238
mtr_exe_exists(
1236
1239
"$path_client_bindir/my_print_defaults",
1237
"$glob_basedir/extra/my_print_defaults");
1240
"$glob_basedir/extra/my_print_defaults",
1241
"$glob_builddir/extra/my_print_defaults");
1239
1243
# Look for perror
1240
1244
$exe_perror= "perror";
1242
1246
# Look for the client binaries
1243
$exe_drizzlecheck= mtr_exe_exists("$path_client_bindir/drizzlecheck");
1244
1247
$exe_drizzledump= mtr_exe_exists("$path_client_bindir/drizzledump");
1245
1248
$exe_drizzleimport= mtr_exe_exists("$path_client_bindir/drizzleimport");
1246
$exe_drizzlebinlog= mtr_exe_exists("$path_client_bindir/drizzlebinlog");
1247
$exe_drizzleadmin= mtr_exe_exists("$path_client_bindir/drizzleadmin");
1248
1249
$exe_drizzle= mtr_exe_exists("$path_client_bindir/drizzle");
1250
1251
if (!$opt_extern)
1252
1253
# Look for SQL scripts directory
1253
if ( $mysql_version_id >= 50100 )
1255
$exe_mysqlslap= mtr_exe_exists("$path_client_bindir/mysqlslap");
1254
if ( $drizzle_version_id >= 50100 )
1256
$exe_drizzleslap= mtr_exe_exists("$path_client_bindir/drizzleslap");
1259
1260
# Look for drizzletest executable
1340
1341
# --------------------------------------------------------------------------
1341
1342
if ( $source_dist )
1343
push(@ld_library_paths, "$glob_basedir/libmysql/.libs/",
1344
"$glob_basedir/libmysql_r/.libs/",
1345
"$glob_basedir/zlib.libs/");
1344
push(@ld_library_paths, "$glob_basedir/libdrizzleclient/.libs/",
1345
"$glob_basedir/mysys/.libs/",
1346
"$glob_basedir/mystrings/.libs/",
1347
"$glob_basedir/drizzled/.libs/",
1369
1372
push(@ld_library_paths, $debug_libraries_path);
1372
$ENV{'LD_LIBRARY_PATH'}= join(":", @ld_library_paths,
1375
$ENV{'LD_LIBRARY_PATH'}= join(":",
1373
1376
$ENV{'LD_LIBRARY_PATH'} ?
1374
split(':', $ENV{'LD_LIBRARY_PATH'}) : ());
1377
split(':', $ENV{'LD_LIBRARY_PATH'}) : (),
1375
1379
mtr_debug("LD_LIBRARY_PATH: $ENV{'LD_LIBRARY_PATH'}");
1377
1381
$ENV{'DYLD_LIBRARY_PATH'}= join(":", @ld_library_paths,
1423
1427
$ENV{'SLAVE_MYPORT'}= $slave->[0]->{'port'};
1424
1428
$ENV{'SLAVE_MYPORT1'}= $slave->[1]->{'port'};
1425
1429
$ENV{'SLAVE_MYPORT2'}= $slave->[2]->{'port'};
1430
$ENV{'MC_PORT'}= $opt_memc_myport;
1426
1431
$ENV{'DRIZZLE_TCP_PORT'}= $mysqld_variables{'port'};
1428
$ENV{MTR_BUILD_THREAD}= $opt_mtr_build_thread;
1433
$ENV{'MTR_BUILD_THREAD'}= $opt_mtr_build_thread;
1430
1435
$ENV{'EXE_MYSQL'}= $exe_drizzle;
1432
# ----------------------------------------------------
1433
# Setup env so childs can execute mysqlcheck
1434
# ----------------------------------------------------
1435
my $cmdline_mysqlcheck=
1436
mtr_native_path($exe_drizzlecheck) .
1437
" --no-defaults --debug-check -uroot " .
1438
"--port=$master->[0]->{'port'} ";
1442
$cmdline_mysqlcheck .=
1443
" --debug=d:t:A,$path_vardir_trace/log/mysqlcheck.trace";
1445
$ENV{'DRIZZLE_CHECK'}= $cmdline_mysqlcheck;
1447
1438
# ----------------------------------------------------
1448
1439
# Setup env to childs can execute myqldump
1449
1440
# ----------------------------------------------------
1450
1441
my $cmdline_mysqldump= generate_cmdline_mysqldump($master->[0]);
1451
1442
my $cmdline_mysqldumpslave= generate_cmdline_mysqldump($slave->[0]);
1443
my $cmdline_mysqldumpmysql= mtr_native_path($exe_drizzledump) .
1444
" --no-defaults -uroot " .
1445
"--mysql --port=$master->[0]->{'mysql_port'} ";
1453
1447
if ( $opt_debug )
1456
1450
" --debug=d:t:A,$path_vardir_trace/log/mysqldump-master.trace";
1457
1451
$cmdline_mysqldumpslave .=
1458
1452
" --debug=d:t:A,$path_vardir_trace/log/mysqldump-slave.trace";
1453
$cmdline_mysqldumpmysql .=
1454
" --debug=d:t:A,$path_vardir_trace/log/mysqldump-mysql.trace";
1460
1456
$ENV{'DRIZZLE_DUMP'}= $cmdline_mysqldump;
1461
1457
$ENV{'DRIZZLE_DUMP_SLAVE'}= $cmdline_mysqldumpslave;
1458
$ENV{'DRIZZLE_DUMP_MYSQL'}= $cmdline_mysqldumpmysql;
1464
1460
# ----------------------------------------------------
1465
1461
# Setup env so childs can execute mysqlslap
1466
1462
# ----------------------------------------------------
1467
if ( $exe_mysqlslap )
1463
if ( $exe_drizzleslap )
1469
my $cmdline_mysqlslap=
1470
mtr_native_path($exe_mysqlslap) .
1465
my $cmdline_drizzleslap=
1466
mtr_native_path($exe_drizzleslap) .
1472
1468
"--port=$master->[0]->{'port'} ";
1469
my $cmdline_drizzleslapmysql=
1470
mtr_native_path($exe_drizzleslap) .
1472
"--mysql --port=$master->[0]->{'mysql_port'} ";
1474
1474
if ( $opt_debug )
1476
$cmdline_mysqlslap .=
1477
" --debug=d:t:A,$path_vardir_trace/log/mysqlslap.trace";
1476
$cmdline_drizzleslap .=
1477
" --debug=d:t:A,$path_vardir_trace/log/drizzleslap.trace";
1478
$cmdline_drizzleslapmysql .=
1479
" --debug=d:t:A,$path_vardir_trace/log/drizzleslap.trace";
1479
$ENV{'DRIZZLE_SLAP'}= $cmdline_mysqlslap;
1481
$ENV{'DRIZZLE_SLAP'}= $cmdline_drizzleslap;
1482
$ENV{'DRIZZLE_SLAP_MYSQL'}= $cmdline_drizzleslapmysql;
1482
1487
# ----------------------------------------------------
1483
1488
# Setup env so childs can execute mysqlimport
1484
1489
# ----------------------------------------------------
1485
1490
my $cmdline_mysqlimport=
1486
1491
mtr_native_path($exe_drizzleimport) .
1487
" -uroot --debug-check " .
1488
1493
"--port=$master->[0]->{'port'} ";
1490
1495
if ( $opt_debug )
1498
1503
# ----------------------------------------------------
1499
# Setup env so childs can execute mysqlbinlog
1500
# ----------------------------------------------------
1501
my $cmdline_mysqlbinlog=
1502
mtr_native_path($exe_drizzlebinlog) .
1503
" --no-defaults --disable-force-if-open --debug-check";
1504
if ( !$opt_extern && $mysql_version_id >= 50000 )
1506
$cmdline_mysqlbinlog .=" --character-sets-dir=$path_charsetsdir";
1511
$cmdline_mysqlbinlog .=
1512
" --debug=d:t:A,$path_vardir_trace/log/mysqlbinlog.trace";
1514
$ENV{'DRIZZLE_BINLOG'}= $cmdline_mysqlbinlog;
1516
# ----------------------------------------------------
1517
1504
# Setup env so childs can execute mysql
1518
1505
# ----------------------------------------------------
1519
1506
my $cmdline_mysql=
1520
1507
mtr_native_path($exe_drizzle) .
1521
" --no-defaults --debug-check --host=localhost --user=root --password= " .
1522
"--port=$master->[0]->{'port'} " .
1523
"--character-sets-dir=$path_charsetsdir";
1508
" --no-defaults --host=localhost --user=root --password= " .
1509
"--port=$master->[0]->{'port'} ";
1510
my $cmdline_drizzlemysql=
1511
mtr_native_path($exe_drizzle) .
1512
" --no-defaults --host=localhost --user=root --password= " .
1513
"--mysql --port=$master->[0]->{'mysql_port'} ";
1525
1515
$ENV{'MYSQL'}= $cmdline_mysql;
1516
$ENV{'DRIZZLE_MYSQL'}= $cmdline_drizzlemysql;
1527
1518
# ----------------------------------------------------
1528
1519
# Setup env so childs can execute bug25714
2092
2089
unlink("$base_file.log");
2093
2090
unlink("$base_file.warnings");
2097
if (defined $tinfo->{binlog_format} and $mysql_version_id > 50100 )
2099
# Dynamically switch binlog format of
2100
# master, slave is always restarted
2101
foreach my $server ( @$master )
2103
next unless ($server->{'pid'});
2105
mtr_init_args(\$args);
2106
mtr_add_arg($args, "--no-defaults");
2107
mtr_add_arg($args, "--user=root");
2108
mtr_add_arg($args, "--port=$server->{'port'}");
2110
my $sql= "include/set_binlog_format_".$tinfo->{binlog_format}.".sql";
2111
mtr_verbose("Setting binlog format:", $tinfo->{binlog_format});
2112
if (mtr_run($exe_drizzle, $args, $sql, "", "", "") != 0)
2114
mtr_error("Failed to switch binlog format");
2121
2094
sub do_after_run_drizzletest($)
2489
2462
mtr_add_arg($args, "%s--no-defaults", $prefix);
2464
$path_my_basedir= collapse_path($path_my_basedir);
2491
2465
mtr_add_arg($args, "%s--basedir=%s", $prefix, $path_my_basedir);
2492
mtr_add_arg($args, "%s--character-sets-dir=%s", $prefix, $path_charsetsdir);
2494
if ( $mysql_version_id >= 50036)
2469
mtr_add_arg($args, "%s--default-storage-engine=%s", $prefix, $opt_engine);
2472
if ( $drizzle_version_id >= 50036)
2496
2474
# By default, prevent the started mysqld to access files outside of vardir
2497
2475
mtr_add_arg($args, "%s--secure-file-priv=%s", $prefix, $opt_vardir);
2500
if ( $mysql_version_id >= 50000 )
2502
mtr_add_arg($args, "%s--log-bin-trust-function-creators", $prefix);
2505
mtr_add_arg($args, "%s--default-character-set=latin1", $prefix);
2506
2478
mtr_add_arg($args, "%s--tmpdir=$opt_tmpdir", $prefix);
2508
2480
# Increase default connect_timeout to avoid intermittent
2509
2481
# disconnects when test servers are put under load
2510
2482
# see BUG#28359
2511
mtr_add_arg($args, "%s--connect-timeout=60", $prefix);
2483
mtr_add_arg($args, "%s--drizzle-protocol-connect-timeout=60", $prefix);
2514
2486
# When mysqld is run by a root user(euid is 0), it will fail
2521
2493
mtr_add_arg($args, "%s--pid-file=%s", $prefix,
2522
2494
$mysqld->{'path_pid'});
2524
mtr_add_arg($args, "%s--port=%d", $prefix,
2496
mtr_add_arg($args, "%s--drizzle-protocol-port=%d", $prefix,
2499
mtr_add_arg($args, "%s--mysql-protocol-port=%d", $prefix,
2500
$mysqld->{'mysql_port'});
2527
2502
mtr_add_arg($args, "%s--datadir=%s", $prefix,
2528
2503
$mysqld->{'path_myddir'});
2530
my $log_base_path= "$opt_vardir/log/$mysqld->{'type'}$sidx";
2531
mtr_add_arg($args, "%s--log=%s.log", $prefix, $log_base_path);
2533
"%s--log-slow-queries=%s-slow.log", $prefix, $log_base_path);
2535
2505
# Check if "extra_opt" contains --skip-log-bin
2536
my $skip_binlog= grep(/^--skip-log-bin/, @$extra_opt, @opt_extra_mysqld_opt);
2537
2506
if ( $mysqld->{'type'} eq 'master' )
2539
if (! ($opt_skip_master_binlog || $skip_binlog) )
2541
mtr_add_arg($args, "%s--log-bin=%s/log/master-bin%s", $prefix,
2542
$opt_vardir, $sidx);
2545
2508
mtr_add_arg($args, "%s--server-id=%d", $prefix,
2546
2509
$idx > 0 ? $idx + 101 : 1);
2548
2511
mtr_add_arg($args, "%s--loose-innodb_data_file_path=ibdata1:10M:autoextend",
2551
mtr_add_arg($args, "%s--local-infile", $prefix);
2514
mtr_add_arg($args, "%s--loose-innodb-lock-wait-timeout=5", $prefix);
2553
if ( $idx > 0 or !$use_innodb)
2555
mtr_add_arg($args, "%s--loose-skip-innodb", $prefix);
2560
2519
mtr_error("unknown mysqld type")
2561
2520
unless $mysqld->{'type'} eq 'slave';
2563
#mtr_add_arg($args, "%s--init-rpl-role=slave", $prefix);
2564
if (! ( $opt_skip_slave_binlog || $skip_binlog ))
2566
mtr_add_arg($args, "%s--log-bin=%s/log/slave%s-bin", $prefix,
2567
$opt_vardir, $sidx); # FIXME use own dir for binlogs
2568
mtr_add_arg($args, "%s--log-slave-updates", $prefix);
2571
mtr_add_arg($args, "%s--master-retry-count=10", $prefix);
2573
mtr_add_arg($args, "%s--relay-log=%s/log/slave%s-relay-bin", $prefix,
2574
$opt_vardir, $sidx);
2575
mtr_add_arg($args, "%s--report-host=127.0.0.1", $prefix);
2576
mtr_add_arg($args, "%s--report-port=%d", $prefix,
2578
# mtr_add_arg($args, "%s--report-user=root", $prefix);
2579
mtr_add_arg($args, "%s--loose-skip-innodb", $prefix);
2580
mtr_add_arg($args, "%s--skip-slave-start", $prefix);
2582
2522
# Directory where slaves find the dumps generated by "load data"
2583
2523
# on the server. The path need to have constant length otherwise
2584
2524
# test results will vary, thus a relative path is used.
2585
2525
my $slave_load_path= "../tmp";
2586
mtr_add_arg($args, "%s--slave-load-tmpdir=%s", $prefix,
2588
mtr_add_arg($args, "%s--set-variable=slave_net_timeout=120", $prefix);
2590
2527
if ( @$slave_master_info )
2936
2862
if ( $mysqld->{'pid'} )
2938
$pid= mtr_mysqladmin_start($mysqld, "shutdown", 20);
2940
$admin_pids{$pid}= 1;
2943
pid => $mysqld->{'pid'},
2944
real_pid => $mysqld->{'real_pid'},
2945
pidfile => $mysqld->{'path_pid'},
2946
sockfile => $mysqld->{'path_sock'},
2947
port => $mysqld->{'port'},
2948
errfile => $mysqld->{'path_myerr'},
2951
$mysqld->{'pid'}= 0; # Assume we are done with it
2864
$pid= mtr_server_shutdown($mysqld);
2866
$admin_pids{$pid}= 1;
2869
pid => $mysqld->{'pid'},
2870
real_pid => $mysqld->{'real_pid'},
2871
pidfile => $mysqld->{'path_pid'},
2872
sockfile => $mysqld->{'path_sock'},
2873
port => $mysqld->{'port'},
2874
errfile => $mysqld->{'path_myerr'},
2877
$mysqld->{'pid'}= 0; # Assume we are done with it
2964
2890
if ( $mysqld->{'pid'} )
2966
$pid= mtr_mysqladmin_start($mysqld, "shutdown", 20);
2968
$admin_pids{$pid}= 1;
2971
pid => $mysqld->{'pid'},
2972
real_pid => $mysqld->{'real_pid'},
2973
pidfile => $mysqld->{'path_pid'},
2974
sockfile => $mysqld->{'path_sock'},
2975
port => $mysqld->{'port'},
2976
errfile => $mysqld->{'path_myerr'},
2980
$mysqld->{'pid'}= 0; # Assume we are done with it
2892
$pid= mtr_server_shutdown($mysqld);
2894
$admin_pids{$pid}= 1;
2897
pid => $mysqld->{'pid'},
2898
real_pid => $mysqld->{'real_pid'},
2899
pidfile => $mysqld->{'path_pid'},
2900
sockfile => $mysqld->{'path_sock'},
2901
port => $mysqld->{'port'},
2902
errfile => $mysqld->{'path_myerr'},
2905
$mysqld->{'pid'}= 0; # Assume we are done with it
3227
# Modify the exe and args so that program is run in gdb in xterm
3234
# Write $args to gdb init file
3235
my $str= join(" ", @$$args);
3236
my $dbx_init_file= "$opt_tmpdir/dbxinit.$type";
3238
# Remove the old gdbinit file
3239
unlink($dbx_init_file);
3240
if ( $type eq "client" )
3242
# write init file for client
3243
mtr_tofile($dbx_init_file,
3249
# write init file for drizzled
3250
mtr_tofile($dbx_init_file,
3251
"stop in mysql_parse\n" .
3257
if ( $opt_manual_dbx )
3259
print "\nTo start dbx for $type, type in another window:\n";
3260
print "dbx -c 'source $dbx_init_file' $$exe\n";
3262
# Indicate the exe should not be started
3268
mtr_add_arg($$args, "-title");
3269
mtr_add_arg($$args, "$type");
3270
mtr_add_arg($$args, "-e");
3272
mtr_add_arg($$args, "dbx");
3273
mtr_add_arg($$args, "-c");
3274
mtr_add_arg($$args, "source $dbx_init_file");
3275
mtr_add_arg($$args, "$$exe");
3294
3281
# Modify the exe and args so that program is run in gdb in xterm
3435
3422
$$exe= $debugger;
3438
elsif ( $debugger eq "dbx" )
3440
# xterm -e dbx -r exe arg1 .. argn
3442
unshift(@$$args, $$exe);
3443
unshift(@$$args, "-r");
3444
unshift(@$$args, $debugger);
3445
unshift(@$$args, "-e");
3425
#elsif ( $debugger eq "dbx" )
3427
# # xterm -e dbx -r exe arg1 .. argn
3429
# unshift(@$$args, $$exe);
3430
# unshift(@$$args, "-r");
3431
# unshift(@$$args, $debugger);
3432
# unshift(@$$args, "-e");
3452
3439
mtr_error("Unknown argument \"$debugger\" passed to --debugger");
3466
3453
mtr_add_arg($args, "--tool=callgrind");
3467
3454
mtr_add_arg($args, "--base=$opt_vardir/log");
3458
mtr_add_arg($args, "--tool=massif");
3471
3462
mtr_add_arg($args, "--tool=memcheck"); # From >= 2.1.2 needs this option
3472
mtr_add_arg($args, "--alignment=8");
3473
3463
mtr_add_arg($args, "--leak-check=yes");
3474
3464
mtr_add_arg($args, "--num-callers=16");
3475
3465
mtr_add_arg($args, "--suppressions=%s/valgrind.supp", $glob_mysql_test_dir)
3504
sub collapse_path ($) {
3506
my $c_path= rel2abs(shift);
3507
my $updir = updir($c_path);
3508
my $curdir = curdir($c_path);
3510
my($vol, $dirs, $file) = splitpath($c_path);
3511
my @dirs = splitdir($dirs);
3514
foreach my $dir (@dirs) {
3515
if( $dir eq $updir and # if we have an updir
3516
@collapsed and # and something to collapse
3517
length $collapsed[-1] and # and its not the rootdir
3518
$collapsed[-1] ne $updir and # nor another updir
3519
$collapsed[-1] ne $curdir # nor the curdir
3522
pop @collapsed; # collapse
3525
push @collapsed, $dir; # just hang onto it
3529
return catpath($vol, catdir(@collapsed), $file);
3515
3532
##############################################################################