From: Ben Faga Date: Fri, 10 Nov 2006 21:43:15 +0000 (+0000) Subject: Added a semicolon at the end of the create trigger definition because SQLite seems... X-Git-Tag: v0.11008~392 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=2661d702977d22849f5fcc4f756c649d7170874b;p=dbsrgits%2FSQL-Translator.git Added a semicolon at the end of the create trigger definition because SQLite seems to require it. Modified the test data to reflect this need. --- diff --git a/lib/SQL/Translator/Parser/SQLite.pm b/lib/SQL/Translator/Parser/SQLite.pm index 86e0c0b..10b5a51 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.11 2006-06-22 19:06:35 mwz444 Exp $ +# $Id: SQLite.pm,v 1.12 2006-11-10 21:43:15 mwz444 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.11 $ =~ /(\d+)\.(\d+)/; +$VERSION = sprintf "%d.%02d", q$Revision: 1.12 $ =~ /(\d+)\.(\d+)/; $DEBUG = 0 unless defined $DEBUG; use Data::Dumper; @@ -411,7 +411,7 @@ sort_order : /(ASC|DESC)/i # # Create Trigger -create : CREATE TEMPORARY(?) TRIGGER NAME before_or_after(?) database_event ON table_name trigger_action +create : CREATE TEMPORARY(?) TRIGGER NAME before_or_after(?) database_event ON table_name trigger_action SEMICOLON { my $table_name = $item[8]->{'name'}; push @triggers, { diff --git a/t/data/sqlite/create.sql b/t/data/sqlite/create.sql index f46b719..f5ee2f5 100644 --- a/t/data/sqlite/create.sql +++ b/t/data/sqlite/create.sql @@ -20,8 +20,9 @@ create table pet ( create trigger pet_trig after insert on pet begin - update name=name; + update pet set name=name; end +; create view person_pet as select pr.person_id, pr.name as person_name, pt.name as pet_name diff --git a/t/data/sqlite/create2.sql b/t/data/sqlite/create2.sql index e613fcf..66affdd 100644 --- a/t/data/sqlite/create2.sql +++ b/t/data/sqlite/create2.sql @@ -21,8 +21,9 @@ create table pet ( create trigger after insert on pet begin - update name=name; + update pet set name=name; end +; create view person_pet as select pr.person_id, pr.name as person_name, pt.name as pet_name