| 1 | package Protocol::Database::PostgreSQL::Backend::NoticeResponse; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 4 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 4 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||
| 6 | 4 | our $VERSION = '2.000'; # VERSION | |||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||
| 8 | 4 | ▶ | use parent qw(Protocol::Database::PostgreSQL::Backend); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||
| 10 | =head1 NAME | ||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | Protocol::Database::PostgreSQL::Backend::NoticeResponse | ||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||
| 14 | =head1 DESCRIPTION | ||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||
| 16 | =cut | ||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||
| 18 | 0 | ▶ | sub type { 'notice_response' } | ||||||||||||||||||||||||||
|
Subroutine
type: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||
| 20 | sub new_from_message { | ||||||||||||||||||||||||||||
| 21 | 0 | ▶ | my ($class, $msg) = @_; | ||||||||||||||||||||||||||
|
Subroutine
new_from_message: not called CC=5 SCAR=34.0
Pod
documented
| |||||||||||||||||||||||||||||
| 22 | 0 | (undef, my $size) = unpack('C1N1', $msg); | |||||||||||||||||||||||||||
| 23 | 0 | substr $msg, 0, 5, ''; | |||||||||||||||||||||||||||
| 24 | 0 | my %notice; | |||||||||||||||||||||||||||
| 25 | FIELD: | ||||||||||||||||||||||||||||
| 26 | 0 | ▶ | while(length($msg)) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 27 | 0 | my ($code, $str) = unpack('A1Z*', $msg); | |||||||||||||||||||||||||||
| 28 | 0 | ▶ | last FIELD unless $code && $code ne "\0"; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$code and $code ne "\0"
MC/DC0%0/2
$code and $code ne "\0"
$code
$code ne "\0"
Truth table0%0/3
A and B
A= $codeB= $code ne "\0"
| |||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||
| 30 | 0 | ▶ | die "Unknown NOTICE code [$code]" unless exists $Protocol::Database::PostgreSQL::NOTICE_CODE{$code}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 31 | 0 | $notice{$Protocol::Database::PostgreSQL::NOTICE_CODE{$code}} = $str; | |||||||||||||||||||||||||||
| 32 | 0 | substr $msg, 0, 2+length($str), ''; | |||||||||||||||||||||||||||
| 33 | } | ||||||||||||||||||||||||||||
| 34 | 0 | return $class->new( | |||||||||||||||||||||||||||
| 35 | %notice | ||||||||||||||||||||||||||||
| 36 | ); | ||||||||||||||||||||||||||||
| 37 | } | ||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||
| 39 | 4 | 1; | |||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||
| 41 | =head1 AUTHOR | ||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||
| 43 | Tom Molesworth <TEAM@cpan.org> | ||||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||
| 45 | =head1 LICENSE | ||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||
| 47 | Copyright Tom Molesworth 2010-2019. Licensed under the same terms as Perl itself. | ||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||