From: Ken Youens-Clark Date: Mon, 9 Jun 2003 02:41:31 +0000 (+0000) Subject: Added rule to catch a default value given just as "null." X-Git-Tag: v0.02~50 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f27085c99ea24234b105650d913ca3f561e45e20;p=dbsrgits%2FSQL-Translator.git Added rule to catch a default value given just as "null." --- diff --git a/lib/SQL/Translator/Parser/PostgreSQL.pm b/lib/SQL/Translator/Parser/PostgreSQL.pm index 0c42367..054aaf9 100644 --- a/lib/SQL/Translator/Parser/PostgreSQL.pm +++ b/lib/SQL/Translator/Parser/PostgreSQL.pm @@ -1,7 +1,7 @@ package SQL::Translator::Parser::PostgreSQL; # ------------------------------------------------------------------- -# $Id: PostgreSQL.pm,v 1.15 2003-06-06 22:27:46 kycl4rk Exp $ +# $Id: PostgreSQL.pm,v 1.16 2003-06-09 02:41:31 kycl4rk Exp $ # ------------------------------------------------------------------- # Copyright (C) 2003 Ken Y. Clark , # Allen Day , @@ -111,7 +111,7 @@ View table: use strict; use vars qw[ $DEBUG $VERSION $GRAMMAR @EXPORT_OK ]; -$VERSION = sprintf "%d.%02d", q$Revision: 1.15 $ =~ /(\d+)\.(\d+)/; +$VERSION = sprintf "%d.%02d", q$Revision: 1.16 $ =~ /(\d+)\.(\d+)/; $DEBUG = 0 unless defined $DEBUG; use Data::Dumper; @@ -621,6 +621,14 @@ default_val : /default/i /(?:')?[\w\d.-]*(?:')?/ value => $val, } } + | /null/i + { + $return = { + supertype => 'constraint', + type => 'default', + value => 'NULL', + } + } name_with_opt_paren : NAME parens_value_list(s?) { $item[2][0] ? "$item[1]($item[2][0][0])" : $item[1] }