From: Ken Youens-Clark Date: Fri, 8 Aug 2003 22:22:51 +0000 (+0000) Subject: Added "set" rule, remove extra space after comment character. X-Git-Tag: v0.04~346 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=33d0d6d4999d2be937b6bc85fb1e5a63f5c0f31a;p=dbsrgits%2FSQL-Translator.git Added "set" rule, remove extra space after comment character. --- diff --git a/lib/SQL/Translator/Parser/MySQL.pm b/lib/SQL/Translator/Parser/MySQL.pm index 64134fc..c261558 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.28 2003-08-04 15:19:08 kycl4rk Exp $ +# $Id: MySQL.pm,v 1.29 2003-08-08 22:22:51 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.28 $ =~ /(\d+)\.(\d+)/; +$VERSION = sprintf "%d.%02d", q$Revision: 1.29 $ =~ /(\d+)\.(\d+)/; $DEBUG = 0 unless defined $DEBUG; use Data::Dumper; @@ -156,12 +156,15 @@ eofile : /^\Z/ statement : comment | use + | set | drop | create | use : /use/i WORD ';' +set : /set/i /[^;]+/ ';' + drop : /drop/i WORD(s) ';' create : CREATE /database/i WORD ';' @@ -237,7 +240,7 @@ create_definition : constraint comment : /^\s*(?:#|-{2}).*\n/ { my $comment = $item[1]; - $comment =~ s/^\s*(#|-{2})//; + $comment =~ s/^\s*(#|-{2})\s*//; $comment =~ s/\s*$//; $return = $comment; }