From: Rafael Kitover Date: Sat, 6 Jun 2009 02:40:51 +0000 (+0000) Subject: tweaks to sybase types X-Git-Tag: v0.08112~14^2~145 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b88bf40aaa6a37f4d938c53319b724cdc0985351;p=dbsrgits%2FDBIx-Class.git tweaks to sybase types --- diff --git a/lib/DBIx/Class/Storage/DBI/Sybase/NoBindVars.pm b/lib/DBIx/Class/Storage/DBI/Sybase/NoBindVars.pm index c815f67..4ebb8cf 100644 --- a/lib/DBIx/Class/Storage/DBI/Sybase/NoBindVars.pm +++ b/lib/DBIx/Class/Storage/DBI/Sybase/NoBindVars.pm @@ -18,15 +18,17 @@ sub _dbh_last_insert_id { my $number = sub { Scalar::Util::looks_like_number($_[0]) }; +my $decimal = sub { $_[0] =~ /^ [-+]? \d+ (?:\.\d*)? \z/x }; + my %noquote = ( - int => sub { $_[0] =~ /^ -? \d+ \z/x }, + int => sub { $_[0] =~ /^ [-+]? \d+ \z/x }, bit => => sub { $_[0] =~ /^[01]\z/ }, - money => sub { $_[0] =~ /^\$ \d+ (\.\d*)? \z/x }, + money => sub { $_[0] =~ /^\$ \d+ (?:\.\d*)? \z/x }, float => $number, real => $number, double => $number, - decimal => $number, - numeric => $number, + decimal => $decimal, + numeric => $decimal, ); sub should_quote_data_type {