From: Rafael Kitover Date: Mon, 10 May 2010 17:45:25 +0000 (-0400) Subject: Firebird: don't rewrite reals as floats X-Git-Tag: 0.07000~20 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=dbsrgits%2FDBIx-Class-Schema-Loader.git;a=commitdiff_plain;h=8ec0dd691ba3dfebbc9642e56e0157ea3d5408f3 Firebird: don't rewrite reals as floats --- diff --git a/TODO b/TODO index abb7495..a8846e2 100644 --- a/TODO +++ b/TODO @@ -14,8 +14,6 @@ then when/if we get there, break it out as a seperate distribution with a new name. - support for user-defined-types as Schema deploy hooks - - normalize float/real/double data types in a most cross-deployment friendly - fashion, using float(25) as the double boundary where possible - finish data_type tests for all DBs (DB2 and Informix left) - generate a schema accessor which stores which SQLT type it was loaded from - add a settable 'on-behalf-of' version tag (for catalyst model) diff --git a/lib/DBIx/Class/Schema/Loader/DBI/InterBase.pm b/lib/DBIx/Class/Schema/Loader/DBI/InterBase.pm index 3dd27ca..19f332f 100644 --- a/lib/DBIx/Class/Schema/Loader/DBI/InterBase.pm +++ b/lib/DBIx/Class/Schema/Loader/DBI/InterBase.pm @@ -50,8 +50,6 @@ sub _setup { $self->next::method(@_); - $self->schema->storage->sql_maker->name_sep('.'); - if (not defined $self->preserve_case) { warn <<'EOF'; @@ -65,6 +63,8 @@ EOF $self->preserve_case(1); } + $self->schema->storage->sql_maker->name_sep('.'); + if ($self->preserve_case) { $self->schema->storage->sql_maker->quote_char('"'); } @@ -257,9 +257,6 @@ EOF elsif ($info->{data_type} eq 'character') { $info->{data_type} = 'char'; } - elsif ($info->{data_type} eq 'real') { - $info->{data_type} = 'float'; - } elsif ($info->{data_type} eq 'int64' || $info->{data_type} eq '-9581') { # the constant is just in case, the query should pick up the type $info->{data_type} = 'bigint'; diff --git a/t/18firebird_common.t b/t/18firebird_common.t index 5befe43..a4b3ead 100644 --- a/t/18firebird_common.t +++ b/t/18firebird_common.t @@ -59,18 +59,17 @@ my $tester = dbixcsl_common_tests->new( # http://www.ibphoenix.com/downloads/60DataDef.zip # # Numeric types - # XXX rewrite low precision floats to 'real' 'smallint' => { data_type => 'smallint' }, 'int' => { data_type => 'integer' }, 'integer' => { data_type => 'integer' }, 'bigint' => { data_type => 'bigint' }, - 'float' => { data_type => 'float' }, + 'float' => { data_type => 'real' }, 'double precision' => { data_type => 'double precision' }, - 'real' => { data_type => 'float' }, + 'real' => { data_type => 'real' }, - 'float(2)' => { data_type => 'float' }, - 'float(7)' => { data_type => 'float' }, + 'float(2)' => { data_type => 'real' }, + 'float(7)' => { data_type => 'real' }, 'float(8)' => { data_type => 'double precision' }, 'decimal' => { data_type => 'decimal' },