| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package EV::MariaDB; |
|
2
|
15
|
|
|
15
|
|
2443181
|
use strict; |
|
|
15
|
|
|
|
|
31
|
|
|
|
15
|
|
|
|
|
646
|
|
|
3
|
15
|
|
|
15
|
|
93
|
use warnings; |
|
|
15
|
|
|
|
|
57
|
|
|
|
15
|
|
|
|
|
1115
|
|
|
4
|
15
|
|
|
15
|
|
130
|
use Carp 'croak'; |
|
|
15
|
|
|
|
|
45
|
|
|
|
15
|
|
|
|
|
1103
|
|
|
5
|
|
|
|
|
|
|
|
|
6
|
15
|
|
|
15
|
|
1949
|
use EV; |
|
|
15
|
|
|
|
|
2238
|
|
|
|
15
|
|
|
|
|
990
|
|
|
7
|
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
BEGIN { |
|
9
|
15
|
|
|
15
|
|
40
|
our $VERSION = '0.03'; |
|
10
|
15
|
|
|
15
|
|
90
|
use XSLoader; |
|
|
15
|
|
|
|
|
28
|
|
|
|
15
|
|
|
|
|
522
|
|
|
11
|
15
|
|
|
|
|
54063
|
XSLoader::load __PACKAGE__, $VERSION; |
|
12
|
|
|
|
|
|
|
} |
|
13
|
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
*q = \&query; |
|
15
|
|
|
|
|
|
|
*prep = \&prepare; |
|
16
|
|
|
|
|
|
|
*reconnect = \&reset; |
|
17
|
|
|
|
|
|
|
*disconnect = \&finish; |
|
18
|
|
|
|
|
|
|
*errstr = \&error_message; |
|
19
|
|
|
|
|
|
|
*errno = \&error_number; |
|
20
|
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
my @OPTION_KEYS = qw( |
|
22
|
|
|
|
|
|
|
connect_timeout read_timeout write_timeout |
|
23
|
|
|
|
|
|
|
compress multi_statements charset init_command |
|
24
|
|
|
|
|
|
|
ssl_key ssl_cert ssl_ca ssl_capath ssl_cipher ssl_verify_server_cert |
|
25
|
|
|
|
|
|
|
utf8 found_rows |
|
26
|
|
|
|
|
|
|
); |
|
27
|
|
|
|
|
|
|
|
|
28
|
0
|
|
|
0
|
|
0
|
sub CLONE_SKIP { 1 } |
|
29
|
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub new { |
|
31
|
2
|
|
|
2
|
1
|
477442
|
my ($class, %args) = @_; |
|
32
|
|
|
|
|
|
|
|
|
33
|
2
|
|
33
|
|
|
38
|
my $loop = delete $args{loop} || EV::default_loop; |
|
34
|
2
|
|
|
|
|
88
|
my $self = $class->_new($loop); |
|
35
|
|
|
|
|
|
|
|
|
36
|
2
|
|
33
|
0
|
|
46
|
$self->on_error(delete $args{on_error} || sub { die @_ }); |
|
|
0
|
|
|
|
|
|
|
|
37
|
2
|
50
|
|
|
|
10
|
if (my $cb = delete $args{on_connect}) { |
|
38
|
0
|
|
|
|
|
0
|
$self->on_connect($cb); |
|
39
|
|
|
|
|
|
|
} |
|
40
|
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
# set connection options before connect |
|
42
|
2
|
|
|
|
|
8
|
for my $key (@OPTION_KEYS) { |
|
43
|
30
|
50
|
|
|
|
78
|
if (defined(my $val = delete $args{$key})) { |
|
44
|
0
|
|
|
|
|
0
|
$self->_set_option($key, $val); |
|
45
|
|
|
|
|
|
|
} |
|
46
|
|
|
|
|
|
|
} |
|
47
|
|
|
|
|
|
|
|
|
48
|
2
|
|
|
|
|
6
|
my $host = delete $args{host}; |
|
49
|
2
|
|
|
|
|
5
|
my $user = delete $args{user}; |
|
50
|
2
|
|
|
|
|
5
|
my $password = delete $args{password}; |
|
51
|
2
|
|
33
|
|
|
29
|
my $database = delete $args{database} // delete $args{db}; |
|
52
|
2
|
|
50
|
|
|
13
|
my $port = delete $args{port} // 3306; |
|
53
|
2
|
|
|
|
|
5
|
my $socket = delete $args{unix_socket}; |
|
54
|
|
|
|
|
|
|
|
|
55
|
2
|
50
|
|
|
|
12
|
if (my @unknown = keys %args) { |
|
56
|
0
|
|
|
|
|
0
|
croak "unknown argument(s) to new(): " . join(', ', sort @unknown); |
|
57
|
|
|
|
|
|
|
} |
|
58
|
|
|
|
|
|
|
|
|
59
|
2
|
50
|
33
|
|
|
14
|
if (defined $host || defined $user) { |
|
60
|
0
|
|
0
|
|
|
0
|
$self->connect( |
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
61
|
|
|
|
|
|
|
$host // 'localhost', |
|
62
|
|
|
|
|
|
|
$user // '', |
|
63
|
|
|
|
|
|
|
$password // '', |
|
64
|
|
|
|
|
|
|
$database // '', |
|
65
|
|
|
|
|
|
|
$port, |
|
66
|
|
|
|
|
|
|
$socket, |
|
67
|
|
|
|
|
|
|
); |
|
68
|
|
|
|
|
|
|
} |
|
69
|
|
|
|
|
|
|
|
|
70
|
2
|
|
|
|
|
11
|
$self; |
|
71
|
|
|
|
|
|
|
} |
|
72
|
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
1; |
|
74
|
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
__END__ |