From: Chris Hilton Date: Thu, 4 May 2006 20:45:58 +0000 (+0000) Subject: Minor refactor to avoid uninitialized value warning X-Git-Tag: v0.11008~448 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4e0de84cc3ca34b874decd22ff70aff8ba3b7b53;p=dbsrgits%2FSQL-Translator.git Minor refactor to avoid uninitialized value warning --- diff --git a/lib/SQL/Translator/Parser/DBI/SQLServer.pm b/lib/SQL/Translator/Parser/DBI/SQLServer.pm index c22160a..47bd5ff 100644 --- a/lib/SQL/Translator/Parser/DBI/SQLServer.pm +++ b/lib/SQL/Translator/Parser/DBI/SQLServer.pm @@ -1,7 +1,7 @@ package SQL::Translator::Parser::DBI::SQLServer; # ------------------------------------------------------------------- -# $Id: SQLServer.pm,v 1.2 2005-07-07 15:20:00 mwz444 Exp $ +# $Id: SQLServer.pm,v 1.3 2006-05-04 20:45:58 duality72 Exp $ # ------------------------------------------------------------------- # Copyright (C) 2002-4 SQLFairy Authors # @@ -40,7 +40,7 @@ use SQL::Translator::Schema; use Data::Dumper; use vars qw[ $DEBUG $VERSION @EXPORT_OK ]; -$VERSION = sprintf "%d.%02d", q$Revision: 1.2 $ =~ /(\d+)\.(\d+)/; +$VERSION = sprintf "%d.%02d", q$Revision: 1.3 $ =~ /(\d+)\.(\d+)/; $DEBUG = 0 unless defined $DEBUG; no strict 'refs'; @@ -224,8 +224,10 @@ $table_info->{TABLE_TYPE}, ) || die $table->error; $f->is_nullable($c->{NULLABLE} == 1); $f->is_auto_increment($is_auto_increment); - $c->{COLUMN_DEF} =~ s#\('?(.*?)'?\)#$1#; - $f->default_value($c->{COLUMN_DEF}) if defined $c->{COLUMN_DEF}; + if ( defined $c->{COLUMN_DEF}) { + $c->{COLUMN_DEF} =~ s#\('?(.*?)'?\)#$1#; + $f->default_value($c->{COLUMN_DEF}); + } } # add in primary key