From: Ken Youens-Clark Date: Tue, 19 Aug 2003 14:41:05 +0000 (+0000) Subject: Added setting of field size for *text fields. Did I get them right? X-Git-Tag: v0.04~296 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=256d534ad6e7b34ccd1f668ddfaa6395f530c185;p=dbsrgits%2FSQL-Translator.git Added setting of field size for *text fields. Did I get them right? --- diff --git a/lib/SQL/Translator/Parser/MySQL.pm b/lib/SQL/Translator/Parser/MySQL.pm index a8ba229..df1077d 100644 --- a/lib/SQL/Translator/Parser/MySQL.pm +++ b/lib/SQL/Translator/Parser/MySQL.pm @@ -1,7 +1,7 @@ package SQL::Translator::Parser::MySQL; # ------------------------------------------------------------------- -# $Id: MySQL.pm,v 1.33 2003-08-18 15:46:22 kycl4rk Exp $ +# $Id: MySQL.pm,v 1.34 2003-08-19 14:41:05 kycl4rk Exp $ # ------------------------------------------------------------------- # Copyright (C) 2003 Ken Y. Clark , # darren chamberlain , @@ -123,7 +123,7 @@ Here's the word from the MySQL site use strict; use vars qw[ $DEBUG $VERSION $GRAMMAR @EXPORT_OK ]; -$VERSION = sprintf "%d.%02d", q$Revision: 1.33 $ =~ /(\d+)\.(\d+)/; +$VERSION = sprintf "%d.%02d", q$Revision: 1.34 $ =~ /(\d+)\.(\d+)/; $DEBUG = 0 unless defined $DEBUG; use Data::Dumper; @@ -392,6 +392,19 @@ data_type : WORD parens_value_list(s?) type_qualifier(s?) } } + if ( lc $type eq 'tinytext' ) { + $size = [255]; + } + elsif ( lc $type eq 'text' ) { + $size = [65_000]; + } + elsif ( lc $type eq 'mediumtext' ) { + $size = [16_000_000]; + } + elsif ( lc $type eq 'longtext' ) { + $size = [4_000_000_000]; + } + $return = { type => $type, size => $size,