1 package # hide from PAUSE
2 DBIx::Class::Storage::DBI::ADO::CursorUtils;
8 our @EXPORT_OK = qw/_normalize_guids _strip_trailing_binary_nulls/;
10 sub _strip_trailing_binary_nulls {
11 my ($select, $col_infos, $data) = @_;
13 foreach my $select_idx (0..$#$select) {
15 next unless defined $data->[$select_idx];
17 my $data_type = $col_infos->{$select->[$select_idx]}{data_type}
20 $data->[$select_idx] =~ s/\0+\z//
21 if $data_type =~ /binary|image/i;
25 sub _normalize_guids {
26 my ($select, $col_infos, $data, $storage) = @_;
28 foreach my $select_idx (0..$#$select) {
30 next unless defined $data->[$select_idx];
32 my $data_type = $col_infos->{$select->[$select_idx]}{data_type}
35 $data->[$select_idx] =~ s/\A \{ (.+) \} \z/$1/xs
36 if $storage->_is_guid_type($data_type);