From: Jess Robinson <castaway@desert-island.me.uk>
Date: Wed, 7 Jun 2006 16:08:45 +0000 (+0000)
Subject: Recognise & skip DROP statements when parsing
X-Git-Tag: v0.11008~431
X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ac9c4e2e21a26f3c05d033a658d0eff4a5a359b3;p=dbsrgits%2FSQL-Translator.git

Recognise & skip DROP statements when parsing
Recognise CURRENT_TIMESTAMP (SQLite v3+)
---

diff --git a/lib/SQL/Translator/Parser/SQLite.pm b/lib/SQL/Translator/Parser/SQLite.pm
index 0ffc472..996935a 100644
--- a/lib/SQL/Translator/Parser/SQLite.pm
+++ b/lib/SQL/Translator/Parser/SQLite.pm
@@ -1,7 +1,7 @@
 package SQL::Translator::Parser::SQLite;
 
 # -------------------------------------------------------------------
-# $Id: SQLite.pm,v 1.7 2005-06-28 16:39:41 mwz444 Exp $
+# $Id: SQLite.pm,v 1.8 2006-06-07 16:08:45 schiffbruechige Exp $
 # -------------------------------------------------------------------
 # Copyright (C) 2002-4 SQLFairy Authors
 #
@@ -152,7 +152,7 @@ like-op::=
 
 use strict;
 use vars qw[ $DEBUG $VERSION $GRAMMAR @EXPORT_OK ];
-$VERSION = sprintf "%d.%02d", q$Revision: 1.7 $ =~ /(\d+)\.(\d+)/;
+$VERSION = sprintf "%d.%02d", q$Revision: 1.8 $ =~ /(\d+)\.(\d+)/;
 $DEBUG   = 0 unless defined $DEBUG;
 
 use Data::Dumper;
@@ -191,6 +191,7 @@ eofile : /^\Z/
 
 statement : begin_transaction
     | commit
+    | drop
     | comment
     | create
     | <error>
@@ -199,6 +200,8 @@ begin_transaction : /begin transaction/i SEMICOLON
 
 commit : /commit/i SEMICOLON
 
+drop : /drop/i TABLE <commit> table_name SEMICOLON
+
 comment : /^\s*(?:#|-{2}).*\n/
     {
         my $comment =  $item[1];
@@ -533,6 +536,8 @@ VALUE : /[-+]?\.?\d+(?:[eE]\d+)?/
     }
     | /NULL/
     { 'NULL' }
+    | /CURRENT_TIMESTAMP/i
+    { 'CURRENT_TIMESTAMP' }
 
 !;