|national\s*character\s*varying))\z/xi);
}
+# Determine if a data_type is some type of a binary type
+sub _is_binary_type {
+ my ($self, $data_type) = @_;
+ $data_type && ($self->_is_binary_lob_type($data_type)
+ || $data_type =~ /(?:var)?(?:binary|bit|graphic)(?:\s*varying)?/i);
+}
+
1;
=head1 USAGE NOTES
our @EXPORT_OK = qw/_normalize_guids _strip_trailing_binary_nulls/;
sub _strip_trailing_binary_nulls {
- my ($select, $col_infos, $data) = @_;
+ my ($select, $col_infos, $data, $storage) = @_;
foreach my $select_idx (0..$#$select) {
or next;
$data->[$select_idx] =~ s/\0+\z//
- if $data_type =~ /binary|image/i;
+ if $storage->_is_binary_type($data_type);
}
}
_normalize_guids($select, $col_infos, \@row, $self);
- _strip_trailing_binary_nulls($select, $col_infos, \@row);
+ _strip_trailing_binary_nulls($select, $col_infos, \@row, $self);
return @row;
}
my $select = $self->args->[1];
_normalize_guids($select, $col_infos, \@row, $storage);
- _strip_trailing_binary_nulls($select, $col_infos, \@row);
+ _strip_trailing_binary_nulls($select, $col_infos, \@row, $storage);
return @row;
}
for (@rows) {
_normalize_guids($select, $col_infos, $_, $storage);
- _strip_trailing_binary_nulls($select, $col_infos, $_);
+ _strip_trailing_binary_nulls($select, $col_infos, $_, $storage);
}
return @rows;
_max_column_bytesize
_is_lob_type
_is_binary_lob_type
+ _is_binary_type
_is_text_lob_type
sth