[Bast-commits] r7949 - branches/DBIx-Class-Schema-Loader/current/lib/DBIx/Class/Schema/Loader/DBI

caelum at dev.catalyst.perl.org caelum at dev.catalyst.perl.org
Tue Nov 24 13:11:03 GMT 2009


Author: caelum
Date: 2009-11-24 13:11:02 +0000 (Tue, 24 Nov 2009)
New Revision: 7949

Modified:
   branches/DBIx-Class-Schema-Loader/current/lib/DBIx/Class/Schema/Loader/DBI/MSSQL.pm
Log:
handle un-parenthesized default numeric/integer values for some versions of MSSQL as well

Modified: branches/DBIx-Class-Schema-Loader/current/lib/DBIx/Class/Schema/Loader/DBI/MSSQL.pm
===================================================================
--- branches/DBIx-Class-Schema-Loader/current/lib/DBIx/Class/Schema/Loader/DBI/MSSQL.pm	2009-11-24 12:57:25 UTC (rev 7948)
+++ branches/DBIx-Class-Schema-Loader/current/lib/DBIx/Class/Schema/Loader/DBI/MSSQL.pm	2009-11-24 13:11:02 UTC (rev 7949)
@@ -143,10 +143,11 @@
         # strip parens
         $default =~ s/^\( (.*) \)\z/$1/x;
 
-        # Literal strings are in ''s, numbers are in ()s, everything else is a
-        # function.
+        # Literal strings are in ''s, numbers are in ()s (in some versions of
+        # MSSQL, in others they are unquoted) everything else is a function.
         $extra_info{default_value} =
-            $default =~ /^['(] (.*) [)']\z/x ? $1 : \$default;
+            $default =~ /^['(] (.*) [)']\z/x ? $1 :
+                $default =~ /^\d/ ? $default : \$default;
     }
 
     return \%extra_info;




More information about the Bast-commits mailing list