| 1 | package # hide from PAUSE | ||||||||||
| 2 | DBIx::Class::Storage::DBI::ADO::CursorUtils; | ||||||||||
| 3 | |||||||||||
| 4 | 2 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 2 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 2 | ▶ | use base 'Exporter'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | 2 | our @EXPORT_OK = qw/_normalize_guids _strip_trailing_binary_nulls/; | |||||||||
| 9 | |||||||||||
| 10 | 0 | ▶ | sub _strip_trailing_binary_nulls { | ||||||||
|
Subroutine
_strip_trailing_binary_nulls: not called CC=5 SCAR=34.0
| |||||||||||
| 11 | 0 | my ($select, $col_infos, $data, $storage) = @_; | |||||||||
| 12 | |||||||||||
| 13 | 0 | foreach my $select_idx (0..$#$select) { | |||||||||
| 14 | |||||||||||
| 15 | 0 | ▶ | next unless defined $data->[$select_idx]; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 16 | |||||||||||
| 17 | my $data_type = $col_infos->{$select->[$select_idx]}{data_type} | ||||||||||
| 18 | 0 | ▶ | or next; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 19 | |||||||||||
| 20 | 0 | ▶ | $data->[$select_idx] =~ s/\0+\z// | ||||||||
|
Branch: 1 branch
| |||||||||||
| 21 | if $storage->_is_binary_type($data_type); | ||||||||||
| 22 | } | ||||||||||
| 23 | } | ||||||||||
| 24 | |||||||||||
| 25 | 0 | ▶ | sub _normalize_guids { | ||||||||
|
Subroutine
_normalize_guids: not called CC=5 SCAR=34.0
| |||||||||||
| 26 | 0 | my ($select, $col_infos, $data, $storage) = @_; | |||||||||
| 27 | |||||||||||
| 28 | 0 | foreach my $select_idx (0..$#$select) { | |||||||||
| 29 | |||||||||||
| 30 | 0 | ▶ | next unless defined $data->[$select_idx]; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 31 | |||||||||||
| 32 | my $data_type = $col_infos->{$select->[$select_idx]}{data_type} | ||||||||||
| 33 | 0 | ▶ | or next; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 34 | |||||||||||
| 35 | 0 | ▶ | $data->[$select_idx] =~ s/\A \{ (.+) \} \z/$1/xs | ||||||||
|
Branch: 1 branch
| |||||||||||
| 36 | if $storage->_is_guid_type($data_type); | ||||||||||
| 37 | } | ||||||||||
| 38 | } | ||||||||||
| 39 | |||||||||||
| 40 | 2 | 1; | |||||||||
| 41 | |||||||||||
| 42 | # vim:sts=2 sw=2: | ||||||||||