Heray-Was-Here
Server : Apache
System : Linux vps103298.mylogin.co 4.18.0-513.11.1.el8_9.x86_64 #1 SMP Wed Jan 17 02:00:40 EST 2024 x86_64
User : calvet ( 273824)
PHP Version : 7.4.33
Disable Function : NONE
Directory :  /proc/self/root/usr/share/perl5/vendor_perl/DBIx/Class/Storage/DBI/ADO/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/self/root/usr/share/perl5/vendor_perl/DBIx/Class/Storage/DBI/ADO/CursorUtils.pm
package # hide from PAUSE
    DBIx::Class::Storage::DBI::ADO::CursorUtils;

use strict;
use warnings;
use base 'Exporter';

our @EXPORT_OK = qw/_normalize_guids _strip_trailing_binary_nulls/;

sub _strip_trailing_binary_nulls {
  my ($select, $col_infos, $data, $storage) = @_;

  foreach my $select_idx (0..$#$select) {

    next unless defined $data->[$select_idx];

    my $data_type = $col_infos->{$select->[$select_idx]}{data_type}
      or next;

    $data->[$select_idx] =~ s/\0+\z//
      if $storage->_is_binary_type($data_type);
  }
}

sub _normalize_guids {
  my ($select, $col_infos, $data, $storage) = @_;

  foreach my $select_idx (0..$#$select) {

    next unless defined $data->[$select_idx];

    my $data_type = $col_infos->{$select->[$select_idx]}{data_type}
      or next;

    $data->[$select_idx] =~ s/\A \{ (.+) \} \z/$1/xs
      if $storage->_is_guid_type($data_type);
  }
}

1;

# vim:sts=2 sw=2:

Hry