| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package DBIx::QuickDB::Driver::MariaDB; |
|
2
|
7
|
|
|
7
|
|
241356
|
use strict; |
|
|
7
|
|
|
|
|
16
|
|
|
|
7
|
|
|
|
|
307
|
|
|
3
|
7
|
|
|
7
|
|
39
|
use warnings; |
|
|
7
|
|
|
|
|
12
|
|
|
|
7
|
|
|
|
|
675
|
|
|
4
|
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION = '0.000039'; |
|
6
|
|
|
|
|
|
|
|
|
7
|
7
|
|
|
7
|
|
2365
|
use IPC::Cmd qw/can_run/; |
|
|
7
|
|
|
|
|
225066
|
|
|
|
7
|
|
|
|
|
563
|
|
|
8
|
7
|
|
|
7
|
|
2311
|
use Capture::Tiny qw/capture/; |
|
|
7
|
|
|
|
|
39034
|
|
|
|
7
|
|
|
|
|
540
|
|
|
9
|
|
|
|
|
|
|
|
|
10
|
7
|
|
|
7
|
|
52
|
use parent 'DBIx::QuickDB::Driver::MySQL'; |
|
|
7
|
|
|
|
|
16
|
|
|
|
7
|
|
|
|
|
62
|
|
|
11
|
7
|
|
|
7
|
|
560
|
use DBIx::QuickDB::Util::HashBase; |
|
|
7
|
|
|
|
|
17
|
|
|
|
7
|
|
|
|
|
55
|
|
|
12
|
|
|
|
|
|
|
|
|
13
|
13
|
|
|
13
|
0
|
46
|
sub provider { 'MariaDB' } |
|
14
|
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub verify_provider { |
|
16
|
0
|
|
|
0
|
0
|
0
|
my $class = shift; |
|
17
|
0
|
|
|
|
|
0
|
my ($bin, $provider) = @_; |
|
18
|
|
|
|
|
|
|
|
|
19
|
0
|
|
0
|
|
|
0
|
$provider //= $class->provider; |
|
20
|
|
|
|
|
|
|
|
|
21
|
0
|
|
|
0
|
|
0
|
my ($v) = capture { system($bin, '-V') }; |
|
|
0
|
|
|
|
|
0
|
|
|
22
|
0
|
0
|
|
|
|
0
|
return 1 if $v =~ m/$provider/i; |
|
23
|
0
|
|
|
|
|
0
|
return 0; |
|
24
|
|
|
|
|
|
|
} |
|
25
|
|
|
|
|
|
|
|
|
26
|
7
|
|
|
7
|
0
|
29
|
sub server_bin_list { qw/mariadbd mysqld/ } |
|
27
|
0
|
|
|
0
|
0
|
0
|
sub client_bin_list { qw/mariadb mysql/ } |
|
28
|
0
|
|
|
0
|
0
|
0
|
sub install_bin_list { qw/mariadb-install-db mysql_install_db/ } |
|
29
|
|
|
|
|
|
|
|
|
30
|
13
|
|
|
13
|
0
|
26
|
sub dbd_driver_order { my $class = shift; $class->SUPER::dbd_driver_order($ENV{QDB_MARIADB_DBD}, $ENV{QDB_MYSQLD_DBD}) } |
|
|
13
|
|
|
|
|
245
|
|
|
31
|
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub list_env_vars { |
|
33
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
|
34
|
|
|
|
|
|
|
|
|
35
|
0
|
|
|
|
|
0
|
my @list = $self->SUPER::list_env_vars(); |
|
36
|
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
return ( |
|
38
|
|
|
|
|
|
|
@list, |
|
39
|
0
|
|
|
|
|
0
|
map { my $x = "$_"; $x =~ s/MYSQL/MARIADB/g; $x } @list, |
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
40
|
|
|
|
|
|
|
); |
|
41
|
|
|
|
|
|
|
} |
|
42
|
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub _default_config { |
|
44
|
0
|
|
|
0
|
|
0
|
my $self = shift; |
|
45
|
|
|
|
|
|
|
|
|
46
|
0
|
|
|
|
|
0
|
my %config = $self->SUPER::_default_config(@_); |
|
47
|
|
|
|
|
|
|
|
|
48
|
0
|
0
|
|
|
|
0
|
if (defined($ENV{QDB_MARIADB_SSL_FIPS})) { |
|
49
|
0
|
|
|
|
|
0
|
$config{mysqld}->{'ssl_fips_mode'} = "$ENV{QDB_MARIADB_SSL_FIPS}"; |
|
50
|
|
|
|
|
|
|
} |
|
51
|
|
|
|
|
|
|
|
|
52
|
0
|
|
|
|
|
0
|
$config{mysqld}->{'query_cache_limit'} = '1M'; |
|
53
|
0
|
|
|
|
|
0
|
$config{mysqld}->{'query_cache_size'} = '20M'; |
|
54
|
|
|
|
|
|
|
|
|
55
|
0
|
|
|
|
|
0
|
$config{mariadbd} = $config{mysqld}; |
|
56
|
0
|
|
|
|
|
0
|
$config{mariadb} = $config{mysql}; |
|
57
|
0
|
|
|
|
|
0
|
$config{mariadb_safe} = $config{mysql_safe}; |
|
58
|
|
|
|
|
|
|
|
|
59
|
0
|
|
|
|
|
0
|
return %config; |
|
60
|
|
|
|
|
|
|
} |
|
61
|
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
sub viable { |
|
63
|
13
|
|
|
13
|
1
|
31
|
my $this = shift; |
|
64
|
13
|
|
|
|
|
34
|
my ($spec) = @_; |
|
65
|
|
|
|
|
|
|
|
|
66
|
13
|
50
|
|
|
|
111
|
my %check = (ref($this) ? %$this : (), $this->_default_paths, %$spec); |
|
67
|
|
|
|
|
|
|
|
|
68
|
13
|
|
|
|
|
110
|
my @bad; |
|
69
|
|
|
|
|
|
|
|
|
70
|
13
|
50
|
|
|
|
95
|
push @bad => "Could not load either 'DBD::MariaDB' or 'DBD::mysql', needed for everything" |
|
71
|
|
|
|
|
|
|
unless $this->dbd_driver; |
|
72
|
|
|
|
|
|
|
|
|
73
|
13
|
50
|
|
|
|
25
|
if (!keys %{$this->provider_info}) { |
|
|
13
|
|
|
|
|
54
|
|
|
74
|
13
|
|
|
|
|
63
|
push @bad => "Installed MySQL is not " . $this->provider; |
|
75
|
|
|
|
|
|
|
} |
|
76
|
|
|
|
|
|
|
else { |
|
77
|
0
|
0
|
|
|
|
0
|
if ($spec->{bootstrap}) { |
|
|
|
0
|
|
|
|
|
|
|
78
|
0
|
0
|
0
|
|
|
0
|
push @bad => "'mysqld' and 'mariadbd' commands are missing, needed for bootstrap" unless $check{server} && -x $check{server}; |
|
79
|
|
|
|
|
|
|
} |
|
80
|
|
|
|
|
|
|
elsif ($spec->{autostart}) { |
|
81
|
0
|
0
|
0
|
|
|
0
|
push @bad => "'mysqld' and 'mariadbd' commands are missing, needed for autostart" unless $check{server} && -x $check{server}; |
|
82
|
|
|
|
|
|
|
} |
|
83
|
|
|
|
|
|
|
|
|
84
|
0
|
0
|
|
|
|
0
|
if ($spec->{load_sql}) { |
|
85
|
0
|
0
|
0
|
|
|
0
|
push @bad => "'mysql' and 'mariadb' commands are missing, needed for load_sql" unless $check{client} && -x $check{client}; |
|
86
|
|
|
|
|
|
|
} |
|
87
|
|
|
|
|
|
|
} |
|
88
|
|
|
|
|
|
|
|
|
89
|
13
|
50
|
|
|
|
40
|
return (1, undef) unless @bad; |
|
90
|
13
|
|
|
|
|
99
|
return (0, join "\n" => @bad); |
|
91
|
|
|
|
|
|
|
} |
|
92
|
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
sub bootstrap { |
|
94
|
0
|
|
|
0
|
|
|
my $self = shift; |
|
95
|
|
|
|
|
|
|
|
|
96
|
0
|
|
|
|
|
|
my $init_file = $self->SUPER::bootstrap(@_); |
|
97
|
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
# Bootstrap is much faster without InnoDB, we will turn InnoDB back on later, and things will use it. |
|
99
|
0
|
|
|
|
|
|
$self->write_config( |
|
100
|
|
|
|
|
|
|
mariadbd => { |
|
101
|
|
|
|
|
|
|
skip => qr/innodb/i, |
|
102
|
|
|
|
|
|
|
add => {'default-storage-engine' => 'MyISAM'} |
|
103
|
|
|
|
|
|
|
}, |
|
104
|
|
|
|
|
|
|
mysqld => { |
|
105
|
|
|
|
|
|
|
skip => qr/innodb/i, |
|
106
|
|
|
|
|
|
|
add => {'default-storage-engine' => 'MyISAM'} |
|
107
|
|
|
|
|
|
|
} |
|
108
|
|
|
|
|
|
|
); |
|
109
|
0
|
|
|
|
|
|
$self->run_command([$self->start_command, '--bootstrap'], {stdin => $init_file}); |
|
110
|
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
# Turn InnoDB back on |
|
112
|
0
|
|
|
|
|
|
$self->write_config(); |
|
113
|
|
|
|
|
|
|
|
|
114
|
0
|
|
|
|
|
|
return; |
|
115
|
|
|
|
|
|
|
} |
|
116
|
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
1; |
|
118
|
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
__END__ |