From: Peter Rabbitson Date: Sun, 7 Jun 2009 08:18:16 +0000 (+0000) Subject: Add parenthesis into the VIEW definition to make sure the pg parser still can deal... X-Git-Tag: v0.11008~163^2~4 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=3910f24828cc4aade90168adc7a99b284211b0aa;p=dbsrgits%2FSQL-Translator.git Add parenthesis into the VIEW definition to make sure the pg parser still can deal with them --- diff --git a/t/16xml-parser.t b/t/16xml-parser.t index c962846..53180eb 100644 --- a/t/16xml-parser.t +++ b/t/16xml-parser.t @@ -206,7 +206,7 @@ schema_ok( $scma, { views => [ { name => 'email_list', - sql => "SELECT email FROM Basic WHERE email IS NOT NULL", + sql => "SELECT email FROM Basic WHERE (email IS NOT NULL)", fields => ['email'], extra => { foo => "bar", diff --git a/t/43xml-to-db2.t b/t/43xml-to-db2.t index 5933be0..02a7bfd 100644 --- a/t/43xml-to-db2.t +++ b/t/43xml-to-db2.t @@ -61,7 +61,7 @@ ALTER TABLE Basic ADD FOREIGN KEY (another_id) REFERENCES Another(id); CREATE INDEX titleindex ON Basic ( title ); CREATE VIEW email_list AS -SELECT email FROM Basic WHERE email IS NOT NULL; +SELECT email FROM Basic WHERE (email IS NOT NULL); CREATE TRIGGER foo_trigger after insert ON Basic REFERENCING OLD AS oldrow NEW AS newrow FOR EACH ROW MODE DB2SQL update modified=timestamp(); diff --git a/t/44-xml-to-db2-array.t b/t/44-xml-to-db2-array.t index 931b7e4..c09d850 100644 --- a/t/44-xml-to-db2-array.t +++ b/t/44-xml-to-db2-array.t @@ -59,7 +59,7 @@ q|CREATE TABLE Another ( 'CREATE INDEX titleindex ON Basic ( title );', 'CREATE VIEW email_list AS -SELECT email FROM Basic WHERE email IS NOT NULL;', +SELECT email FROM Basic WHERE (email IS NOT NULL);', 'CREATE TRIGGER foo_trigger after insert ON Basic REFERENCING OLD AS oldrow NEW AS newrow FOR EACH ROW MODE DB2SQL update modified=timestamp();', diff --git a/t/46xml-to-pg.t b/t/46xml-to-pg.t index 87469dc..44ef2ad 100644 --- a/t/46xml-to-pg.t +++ b/t/46xml-to-pg.t @@ -59,7 +59,7 @@ CREATE TABLE "Another" ( DROP VIEW "email_list"; CREATE VIEW "email_list" ( "email" ) AS ( - SELECT email FROM Basic WHERE email IS NOT NULL + SELECT email FROM Basic WHERE (email IS NOT NULL) ); ALTER TABLE "Basic" ADD FOREIGN KEY ("another_id") diff --git a/t/48xml-to-sqlite.t b/t/48xml-to-sqlite.t index 2beef04..61b049d 100644 --- a/t/48xml-to-sqlite.t +++ b/t/48xml-to-sqlite.t @@ -65,7 +65,7 @@ CREATE TABLE Another ( DROP VIEW IF EXISTS email_list; CREATE VIEW email_list AS - SELECT email FROM Basic WHERE email IS NOT NULL; + SELECT email FROM Basic WHERE (email IS NOT NULL); DROP TRIGGER IF EXISTS foo_trigger; @@ -113,7 +113,7 @@ eq_or_diff(\@sql, )', 'DROP VIEW IF EXISTS email_list; CREATE VIEW email_list AS - SELECT email FROM Basic WHERE email IS NOT NULL', + SELECT email FROM Basic WHERE (email IS NOT NULL)', 'DROP TRIGGER IF EXISTS foo_trigger', 'CREATE TRIGGER foo_trigger after insert on Basic BEGIN update modified=timestamp(); END', 'DROP TRIGGER IF EXISTS bar_trigger_insert', diff --git a/t/51-xml-to-oracle.t b/t/51-xml-to-oracle.t index 5d01ae1..ec115b1 100644 --- a/t/51-xml-to-oracle.t +++ b/t/51-xml-to-oracle.t @@ -62,7 +62,7 @@ my $want = [ PRIMARY KEY (id) )', 'CREATE VIEW email_list AS -SELECT email FROM Basic WHERE email IS NOT NULL', +SELECT email FROM Basic WHERE (email IS NOT NULL)', 'ALTER TABLE Basic ADD CONSTRAINT Basic_another_id_fk FOREIGN KEY (another_id) REFERENCES Another (id)', 'CREATE OR REPLACE TRIGGER ai_Basic_id BEFORE INSERT ON Basic @@ -129,7 +129,7 @@ CREATE TABLE Another ( ); CREATE VIEW email_list AS -SELECT email FROM Basic WHERE email IS NOT NULL; +SELECT email FROM Basic WHERE (email IS NOT NULL); ALTER TABLE Basic ADD CONSTRAINT Basic_another_id_fk01 FOREIGN KEY (another_id) REFERENCES Another (id); diff --git a/t/data/xml/schema.xml b/t/data/xml/schema.xml index 8601891..9949637 100644 --- a/t/data/xml/schema.xml +++ b/t/data/xml/schema.xml @@ -86,7 +86,7 @@ Created on Fri Aug 15 15:08:18 2003 - SELECT email FROM Basic WHERE email IS NOT NULL + SELECT email FROM Basic WHERE (email IS NOT NULL)