Thu Jun 1 01:33:04 PDT 2006
- Next message: [Slony1-commit] By dpage: Do not redirect psql output on Windows as more.exe will stop
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Log Message: ----------- On Windows the line endings cause the cmp test to fail. Add win32 specific expected results files to handle this. Modified Files: -------------- slony1-engine/src/parsestatements: Makefile (r1.3 -> r1.4) Added Files: ----------- slony1-engine/src/parsestatements: emptytestresult.expected.win32 (r1.1) test_sql.expected.win32 (r1.1) -------------- next part -------------- --- /dev/null +++ src/parsestatements/emptytestresult.expected.win32 @@ -0,0 +1 @@ +Input: Index: Makefile =================================================================== RCS file: /usr/local/cvsroot/slony1/slony1-engine/src/parsestatements/Makefile,v retrieving revision 1.3 retrieving revision 1.4 diff -Lsrc/parsestatements/Makefile -Lsrc/parsestatements/Makefile -u -w -r1.3 -r1.4 --- src/parsestatements/Makefile +++ src/parsestatements/Makefile @@ -1,6 +1,14 @@ +slony_subdir = src/parsestatements +slony_top_builddir = ../.. +include $(slony_top_builddir)/Makefile.global + PROG=test-scanner FLEX=flex +ifeq ($(PORTNAME), win32) +SUFFIX=.win32 +endif + all: $(PROG) test scanner.o: scanner.c scanner.h @@ -12,9 +20,9 @@ test: test-scanner ./test-scanner < /dev/null > emptytestresult.log - cmp ./emptytestresult.log emptytestresult.expected + cmp ./emptytestresult.log emptytestresult.expected$(SUFFIX) ./test-scanner < ./test_sql.sql > test_sql.log - cmp ./test_sql.log ./test_sql.expected + cmp ./test_sql.log ./test_sql.expected$(SUFFIX) install: --- /dev/null +++ src/parsestatements/test_sql.expected.win32 @@ -0,0 +1,117 @@ +Input: select * from foo; select * from bar; select * from frobozz; +alter table foo add column c integer; +alter table foo alter column c set not null; + +-- Comment line that should hide a whole bunch of quoting... ;; $$ +-- '"''"; "\"\"\"$$ ;"\""" + +-- Here is an old-style pl/pgsql function using heavy quoting +create function foo (text) returns integer as ' + declare + rc record; + begin + select * into rc from foo where name = ''Some Favored name''; + return NULL; + end;' language plpgsql; + +select * from foo; select * from bar; select * from frobozz; + +create or replace function foo (text) returns integer as $$ + begin + select * into rc from foo where name = 'Some Favored name'; + return NULL; + end; +$$ language plpgsql; + +select * from foo; select * from bar; select * from frobozz; + +-- This isn't actually a particularly well-framed stored function +-- but it abuses $$dollar quoting$$ quite nicely... +create or replace function foo (text) returns integer as $$ + begin + select * into rc from foo where name = $23$Some Favored name$23$; + -- Use a secondary bit of quoting to make sure that nesting works... + select $24$ -- another " " thing ' ' \\\'\$ $24$; + return NULL; + end; +$$ language plpgsql; + + +statement 0 +------------------------------------------- +select * from foo; +statement 1 +------------------------------------------- + select * from bar; +statement 2 +------------------------------------------- + select * from frobozz; +statement 3 +------------------------------------------- + +alter table foo add column c integer; +statement 4 +------------------------------------------- + +alter table foo alter column c set not null; +statement 5 +------------------------------------------- + + +-- Comment line that should hide a whole bunch of quoting... ;; $$ +-- '"''"; "\"\"\"$$ ;"\""" + +-- Here is an old-style pl/pgsql function using heavy quoting +create function foo (text) returns integer as ' + declare + rc record; + begin + select * into rc from foo where name = ''Some Favored name''; + return NULL; + end;' language plpgsql; +statement 6 +------------------------------------------- + + +select * from foo; +statement 7 +------------------------------------------- + select * from bar; +statement 8 +------------------------------------------- + select * from frobozz; +statement 9 +------------------------------------------- + + +create or replace function foo (text) returns integer as $$ + begin + select * into rc from foo where name = 'Some Favored name'; + return NULL; + end; +$$ language plpgsql; +statement 10 +------------------------------------------- + + +select * from foo; +statement 11 +------------------------------------------- + select * from bar; +statement 12 +------------------------------------------- + select * from frobozz; +statement 13 +------------------------------------------- + + +-- This isn't actually a particularly well-framed stored function +-- but it abuses $$dollar quoting$$ quite nicely... +create or replace function foo (text) returns integer as $$ + begin + select * into rc from foo where name = $23$Some Favored name$23$; + -- Use a secondary bit of quoting to make sure that nesting works... + select $24$ -- another " " thing ' ' \\\'\$ $24$; + return NULL; + end; +$$ language plpgsql; \ No newline at end of file
- Next message: [Slony1-commit] By dpage: Do not redirect psql output on Windows as more.exe will stop
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Slony1-commit mailing list