disable trailing 0 stripping for Informix defaults, as it is unsafe
Rafael Kitover [Sat, 1 May 2010 15:30:17 +0000 (11:30 -0400)]
lib/DBIx/Class/Schema/Loader/DBI/Informix.pm
t/lib/dbixcsl_common_tests.pm

index 0f1c3d7..53b49f1 100644 (file)
@@ -204,7 +204,8 @@ EOF
             $default =~ s/\s+\z// if looks_like_number $default;
 
             # remove trailing 0s in floating point defaults
-            $default =~ s/0+\z// if $default =~ /^\d+\.\d+\z/;
+            # disabled, this is unsafe since it might be a varchar default
+            #$default =~ s/0+\z// if $default =~ /^\d+\.\d+\z/;
 
             $result->{$col}{default_value} = $default;
         }
index 810c8ea..ab6d8cb 100644 (file)
@@ -429,8 +429,8 @@ sub test_schema {
         'constant integer default',
     );
 
-    is(
-        $class35->column_info('a_double')->{default_value}, 10.555,
+    cmp_ok(
+        $class35->column_info('a_double')->{default_value}, '==', 10.555,
         'constant numeric default',
     );