~giuseppe-maxia/mysql-sandbox/mysql-sandbox-3

« back to all changes in this revision

Viewing changes to bin/low_level_make_sandbox

  • Committer: g.maxia at gmail
  • Date: 2015-08-22 13:59:35 UTC
  • Revision ID: g.maxia@gmail.com-20150822135935-1sh6tz6sr2i0jjm0
Last commit. This repo has migrated to GitHub

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
use English qw( -no_match_vars ); 
23
23
use Data::Dumper;
24
24
use Getopt::Long qw(:config no_ignore_case );
25
 
use MySQL::Sandbox qw( find_safe_port_and_directory exists_in_path runs_as_root use_env sbinstr);
 
25
use MySQL::Sandbox qw( find_safe_port_and_directory exists_in_path runs_as_root use_env sbinstr fix_server_uuid);
26
26
use MySQL::Sandbox::Scripts;
27
27
 
28
28
my $DEBUG = $MySQL::Sandbox::DEBUG;
252
252
    _BIND_ADDRESS_      => 'bind_address',
253
253
    _MSB_VERSION_       =>  'msb_version',
254
254
    _LOWER_CASE_TABLE_NAMES_ => 'lower_case_table_names',
 
255
    _HISTORY_DIR_       => 'history_dir',
255
256
);
256
257
 
257
258
$msb->{options}{msb_version} = $MySQL::Sandbox::VERSION;
354
355
    $msb->{options}{'more_options'} .= qq(#\n# additional options passed through 'my_clause' \n#\n);
355
356
    for my $clause ( @{ $msb->{options}{'my_clause'} }) {
356
357
        $msb->{options}{'more_options'} .= $clause . "\n";
 
358
        if ($clause =~ /server.id=(\d+)/)
 
359
        {
 
360
            my $sid=$1;
 
361
            $msb->{options}{fix_server_uuid} = [ $sid,  
 
362
                $msb->{options}{install_version}, 
 
363
                $msb->{options}{sandbox_port}, 
 
364
                "$msb->{options}{upper_directory}/$msb->{options}{sandbox_directory}"];
 
365
        }
357
366
    }
358
367
}
359
368
 
780
789
    die "unrecognized value for option 'datadir_from' ($msb->{options}{datadir_from})\n";
781
790
}
782
791
 
 
792
if ($msb->{options}{fix_server_uuid} && ( ! $msb->{options}{keep_uuid})) {
 
793
    print Dumper $msb->{options}{fix_server_uuid};
 
794
    fix_server_uuid( @{ $msb->{options}{fix_server_uuid} } );
 
795
}
783
796
if ($msb->{options}{load_grants}) {
784
797
    print "loading grants\n";
785
798
    system "$sandbox_directory/start"