From: Ken Youens-Clark Date: Wed, 4 Jun 2003 22:04:53 +0000 (+0000) Subject: Added rules to catch common (but useless) statements. X-Git-Tag: v0.02~100 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=dcb4fa0660c0d2982c1bf0caa8c34e6fe3a5afae;p=dbsrgits%2FSQL-Translator.git Added rules to catch common (but useless) statements. --- diff --git a/lib/SQL/Translator/Parser/MySQL.pm b/lib/SQL/Translator/Parser/MySQL.pm index 3ebb7c8..7368887 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.21 2003-06-03 22:42:10 kycl4rk Exp $ +# $Id: MySQL.pm,v 1.22 2003-06-04 22:04:53 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.21 $ =~ /(\d+)\.(\d+)/; +$VERSION = sprintf "%d.%02d", q$Revision: 1.22 $ =~ /(\d+)\.(\d+)/; $DEBUG = 0 unless defined $DEBUG; use Data::Dumper; @@ -155,12 +155,17 @@ startrule : statement(s) eofile { \%tables } eofile : /^\Z/ statement : comment + | use | drop | create | +use : /use/i WORD ';' + drop : /drop/i WORD(s) ';' +create : CREATE /database/i WORD ';' + create : CREATE TEMPORARY(?) TABLE opt_if_not_exists(?) table_name '(' create_definition(s /,/) ')' table_option(s?) ';' { my $table_name = $item{'table_name'};