X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FStorage%2FDBI%2FSybase.pm;h=0a2617337322e7cff3ded3dc15ad75a931a7ea31;hb=5432c6ae1a31569775574edd42cb3e3f6f79cfff;hp=cb7408bac00237c84376830ba6b2ae28b75f40a7;hpb=f340505818aff7213d79ca814c73381832e14185;p=dbsrgits%2FDBIx-Class-Historic.git diff --git a/lib/DBIx/Class/Storage/DBI/Sybase.pm b/lib/DBIx/Class/Storage/DBI/Sybase.pm index cb7408b..0a26173 100644 --- a/lib/DBIx/Class/Storage/DBI/Sybase.pm +++ b/lib/DBIx/Class/Storage/DBI/Sybase.pm @@ -5,12 +5,23 @@ use warnings; use base qw/DBIx::Class::Storage::DBI::NoBindVars/; -my %noquote = map { $_ => 1 } qw(int integer); +my $noquote = { + int => qr/^ \-? \d+ $/x, + integer => qr/^ \-? \d+ $/x, + + # TODO maybe need to add float/real/etc +}; sub should_quote_data_type { my $self = shift; - my ($type) = @_; - return 0 if $noquote{$type}; + my ($type, $value) = @_; + + return $self->next::method(@_) if not defined $value; + + if (my $re = $noquote->{$type}) { + return 0 if $value =~ $re; + } + return $self->next::method(@_); }