From: Rafael Kitover Date: Sat, 1 May 2010 15:30:17 +0000 (-0400) Subject: disable trailing 0 stripping for Informix defaults, as it is unsafe X-Git-Tag: 0.07000~42 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a60e0f45aec9bb5f08951f73f0082f6e526bb1ef;p=dbsrgits%2FDBIx-Class-Schema-Loader.git disable trailing 0 stripping for Informix defaults, as it is unsafe --- diff --git a/lib/DBIx/Class/Schema/Loader/DBI/Informix.pm b/lib/DBIx/Class/Schema/Loader/DBI/Informix.pm index 0f1c3d7..53b49f1 100644 --- a/lib/DBIx/Class/Schema/Loader/DBI/Informix.pm +++ b/lib/DBIx/Class/Schema/Loader/DBI/Informix.pm @@ -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; } diff --git a/t/lib/dbixcsl_common_tests.pm b/t/lib/dbixcsl_common_tests.pm index 810c8ea..ab6d8cb 100644 --- a/t/lib/dbixcsl_common_tests.pm +++ b/t/lib/dbixcsl_common_tests.pm @@ -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', );