From: Ken Youens-Clark Date: Thu, 29 Jun 2006 19:24:14 +0000 (+0000) Subject: Fixed handling of NULLs. X-Git-Tag: v0.11008~421 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=3294d6246de4e31881b46edf9529b930f19499ea;p=dbsrgits%2FSQL-Translator.git Fixed handling of NULLs. --- diff --git a/lib/SQL/Translator/Parser/Oracle.pm b/lib/SQL/Translator/Parser/Oracle.pm index ea2cf9d..150489a 100644 --- a/lib/SQL/Translator/Parser/Oracle.pm +++ b/lib/SQL/Translator/Parser/Oracle.pm @@ -1,7 +1,7 @@ package SQL::Translator::Parser::Oracle; # ------------------------------------------------------------------- -# $Id: Oracle.pm,v 1.25 2006-05-24 18:10:30 duality72 Exp $ +# $Id: Oracle.pm,v 1.26 2006-06-29 19:24:14 kycl4rk Exp $ # ------------------------------------------------------------------- # Copyright (C) 2002-4 SQLFairy Authors # @@ -97,7 +97,7 @@ was altered to better handle the syntax created by DDL::Oracle. use strict; use vars qw[ $DEBUG $VERSION $GRAMMAR @EXPORT_OK ]; -$VERSION = sprintf "%d.%02d", q$Revision: 1.25 $ =~ /(\d+)\.(\d+)/; +$VERSION = sprintf "%d.%02d", q$Revision: 1.26 $ =~ /(\d+)\.(\d+)/; $DEBUG = 0 unless defined $DEBUG; use Data::Dumper; @@ -373,9 +373,7 @@ column_constraint : constraint_name(?) column_constraint_type constraint_state(s constraint_name : /constraint/i NAME { $item[2] } column_constraint_type : /not\s+null/i { $return = { type => 'not_null' } } - | /null/ - { $return = { type => 'null' } } - | /unique/ + | /unique/i { $return = { type => 'unique' } } | /primary\s+key/i { $return = { type => 'primary_key' } } @@ -449,6 +447,14 @@ default_val : /default/i /(?:')?[\w\d.-]*(?:')?/ value => $val, } } + | /null/i + { + $return = { + supertype => 'constraint', + type => 'default', + value => 'NULL', + } + } create_table : /create/i global_temporary(?) /table/i