package SQL::Translator::Parser::xSV;
# -------------------------------------------------------------------
-# $Id: xSV.pm,v 1.13 2003-10-10 15:59:03 kycl4rk Exp $
+# $Id: xSV.pm,v 1.14 2003-11-05 22:26:02 kycl4rk Exp $
# -------------------------------------------------------------------
# Copyright (C) 2003 Ken Y. Clark <kclark@cpan.org>,
# darren chamberlain <darren@cpan.org>
use strict;
use vars qw($VERSION @EXPORT);
-$VERSION = sprintf "%d.%02d", q$Revision: 1.13 $ =~ /(\d+)\.(\d+)/;
+$VERSION = sprintf "%d.%02d", q$Revision: 1.14 $ =~ /(\d+)\.(\d+)/;
use Exporter;
use Text::ParseWords qw(quotewords);
$data =~ /^-?\.\d+$/
) {
$type = 'float';
- my ( $w, $d ) = map { s/,//g; $_ } split( /\./, $data );
- $size = [ length $w + length $d, length $d ];
+ my ( $w, $d ) =
+ map { s/,//g; length $_ || 1 } split( /\./, $data );
+ $size = [ $w + $d, $d ];
}
else {
$type = 'char';
for my $field ( keys %field_info ) {
my $size = $field_info{ $field }{'size'};
my $data_type =
- $field_info{ $field }{'char'} ? 'char' :
- $field_info{ $field }{'float'} ? 'float' : 'integer';
+ $field_info{ $field }{'char'} ? 'char' :
+ $field_info{ $field }{'float'} ? 'float' :
+ $field_info{ $field }{'integer'} ? 'integer' : 'char';
my $field = $table->get_field( $field );
$field->size( $size );