From: Ken Youens-Clark Date: Thu, 1 Apr 2004 16:18:55 +0000 (+0000) Subject: Massaging of Oracle varchar2 field if larger than 255. X-Git-Tag: v0.06~98 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=49758c5d9220fc3c9c5ac97f59e728ead36335b5;p=dbsrgits%2FSQL-Translator.git Massaging of Oracle varchar2 field if larger than 255. --- diff --git a/lib/SQL/Translator/Producer/MySQL.pm b/lib/SQL/Translator/Producer/MySQL.pm index 85beb78..b0e787f 100644 --- a/lib/SQL/Translator/Producer/MySQL.pm +++ b/lib/SQL/Translator/Producer/MySQL.pm @@ -1,7 +1,7 @@ package SQL::Translator::Producer::MySQL; # ------------------------------------------------------------------- -# $Id: MySQL.pm,v 1.31 2004-02-09 23:02:15 kycl4rk Exp $ +# $Id: MySQL.pm,v 1.32 2004-04-01 16:18:55 kycl4rk Exp $ # ------------------------------------------------------------------- # Copyright (C) 2002-4 SQLFairy Authors # @@ -44,7 +44,7 @@ for fields, etc.). use strict; use vars qw[ $VERSION $DEBUG ]; -$VERSION = sprintf "%d.%02d", q$Revision: 1.31 $ =~ /(\d+)\.(\d+)/; +$VERSION = sprintf "%d.%02d", q$Revision: 1.32 $ =~ /(\d+)\.(\d+)/; $DEBUG = 0 unless defined $DEBUG; use Data::Dumper; @@ -132,6 +132,13 @@ sub produce { $data_type = 'int'; } } + # + # Convert a large Oracle varchar to "text" + # + elsif ( lc $data_type eq 'varchar2' && $size[0] > 255 ) { + $data_type = 'text'; + @size = (); + } elsif ( exists $translate{ lc $data_type } ) { $data_type = $translate{ lc $data_type }; }