diff --git a/src/interfaces/ecpg/test/Makefile b/src/interfaces/ecpg/test/Makefile index 21289a27ed..8ba244941a 100644 --- a/src/interfaces/ecpg/test/Makefile +++ b/src/interfaces/ecpg/test/Makefile @@ -1,13 +1,9 @@ -# $PostgreSQL: pgsql/src/interfaces/ecpg/test/Makefile,v 1.74 2008/11/28 23:47:51 tgl Exp $ +# $PostgreSQL: pgsql/src/interfaces/ecpg/test/Makefile,v 1.75 2008/12/01 11:37:37 meskes Exp $ subdir = src/interfaces/ecpg/test top_builddir = ../../../.. include $(top_builddir)/src/Makefile.global -# port number for temp-installation test postmaster -# this is also defined in test/connect/Makefile -TEMP_PORT = 4$(DEF_PGPORT) - # where to find psql for testing an existing installation PSQLDIR = $(bindir) @@ -37,7 +33,6 @@ REGRESSDRIVER = "$(top_builddir)/src/test/regress/pg_regress.o" all install installdirs uninstall distprep: $(MAKE) -C connect $@ - $(MAKE) -C expected $@ $(MAKE) -C sql $@ $(MAKE) -C pgtypeslib $@ $(MAKE) -C preproc $@ @@ -46,8 +41,6 @@ all install installdirs uninstall distprep: clean distclean maintainer-clean: $(MAKE) -C connect $@ - $(MAKE) -C connect extraclean - $(MAKE) -C expected extraclean $(MAKE) -C sql $@ $(MAKE) -C pgtypeslib $@ $(MAKE) -C preproc $@ @@ -88,11 +81,11 @@ endif check: all - ./pg_regress --dbname=regress1,connectdb --top-builddir=$(top_builddir) --temp-install=./tmp_check --port=$(TEMP_PORT) --multibyte=$(MULTIBYTE) --load-language=plpgsql $(NOLOCALE) $(THREAD) --schedule=$(srcdir)/ecpg_schedule --create-role=connectuser,connectdb + ./pg_regress --dbname=regress1,connectdb --top-builddir=$(top_builddir) --temp-install=./tmp_check --multibyte=$(MULTIBYTE) --load-language=plpgsql $(NOLOCALE) $(THREAD) --schedule=$(srcdir)/ecpg_schedule --create-role=connectuser,connectdb # the same options, but with --listen-on-tcp checktcp: all - ./pg_regress --dbname=regress1,connectdb --top-builddir=$(top_builddir) --temp-install=./tmp_check --port=$(TEMP_PORT) --multibyte=$(MULTIBYTE) --load-language=plpgsql $(NOLOCALE) $(THREAD) --schedule=$(srcdir)/ecpg_schedule_tcp --create-role=connectuser,connectdb --host=localhost + ./pg_regress --dbname=regress1,connectdb --top-builddir=$(top_builddir) --temp-install=./tmp_check --multibyte=$(MULTIBYTE) --load-language=plpgsql $(NOLOCALE) $(THREAD) --schedule=$(srcdir)/ecpg_schedule_tcp --create-role=connectuser,connectdb --host=localhost installcheck: all ./pg_regress --psqldir=$(PSQLDIR) --dbname=regress1,connectdb --top-builddir=$(top_builddir) --multibyte=$(MULTIBYTE) --load-language=plpgsql $(NOLOCALE) $(THREAD) --schedule=$(srcdir)/ecpg_schedule --create-role=connectuser,connectdb diff --git a/src/interfaces/ecpg/test/connect/Makefile b/src/interfaces/ecpg/test/connect/Makefile index 7df06cfd2b..77016c897d 100644 --- a/src/interfaces/ecpg/test/connect/Makefile +++ b/src/interfaces/ecpg/test/connect/Makefile @@ -3,16 +3,6 @@ top_builddir = ../../../../.. include $(top_builddir)/src/Makefile.global include $(top_srcdir)/$(subdir)/../Makefile.regress -# port number for temp-installation test postmaster -# this is also defined in ../Makefile -TEMP_PORT = 4$(DEF_PGPORT) - -test1.pgc: test1.pgc.in - sed -e 's,@TEMP_PORT@,$(TEMP_PORT),g' \ - $< >$@ - sed -e 's,@TEMP_PORT@,$(TEMP_PORT),g' \ - $(top_srcdir)/$(subdir)/../expected/connect-test1.c.in >../expected/connect-test1.c - TESTS = test1 test1.c \ test2 test2.c \ test3 test3.c \ @@ -21,5 +11,3 @@ TESTS = test1 test1.c \ all: $(TESTS) -extraclean: - rm -f test1.pgc diff --git a/src/interfaces/ecpg/test/connect/test1.pgc.in b/src/interfaces/ecpg/test/connect/test1.pgc similarity index 51% rename from src/interfaces/ecpg/test/connect/test1.pgc.in rename to src/interfaces/ecpg/test/connect/test1.pgc index 2eb764e18d..3b478ba647 100644 --- a/src/interfaces/ecpg/test/connect/test1.pgc.in +++ b/src/interfaces/ecpg/test/connect/test1.pgc @@ -29,37 +29,28 @@ exec sql end declare section; exec sql connect to @localhost as main user connectdb; exec sql disconnect main; - exec sql connect to connectdb@localhost:@TEMP_PORT@ as main; - exec sql disconnect main; + /* exec sql connect to :@TEMP_PORT@ as main user connectdb; + exec sql disconnect main; */ - exec sql connect to @localhost:@TEMP_PORT@ as main user connectdb; - exec sql disconnect main; - - exec sql connect to connectdb:@TEMP_PORT@ as main; - exec sql disconnect main; - - exec sql connect to :@TEMP_PORT@ as main user connectdb; - exec sql disconnect main; - - exec sql connect to tcp:postgresql://localhost:@TEMP_PORT@/connectdb user connectuser identified by connectpw; + exec sql connect to tcp:postgresql://localhost/connectdb user connectuser identified by connectpw; exec sql disconnect; - exec sql connect to tcp:postgresql://localhost:@TEMP_PORT@/ user connectdb; + exec sql connect to tcp:postgresql://localhost/ user connectdb; exec sql disconnect; strcpy(pw, "connectpw"); - strcpy(db, "tcp:postgresql://localhost:@TEMP_PORT@/connectdb"); + strcpy(db, "tcp:postgresql://localhost/connectdb"); exec sql connect to :db user connectuser using :pw; exec sql disconnect; - exec sql connect to unix:postgresql://localhost:@TEMP_PORT@/connectdb user connectuser using "connectpw"; + exec sql connect to unix:postgresql://localhost/connectdb user connectuser using "connectpw"; exec sql disconnect; - exec sql connect to unix:postgresql://localhost:@TEMP_PORT@/connectdb?connect_timeout=14 user connectuser; + exec sql connect to unix:postgresql://localhost/connectdb?connect_timeout=14 user connectuser; exec sql disconnect; /* wrong db */ - exec sql connect to tcp:postgresql://localhost:@TEMP_PORT@/nonexistant user connectuser identified by connectpw; + exec sql connect to tcp:postgresql://localhost/nonexistant user connectuser identified by connectpw; exec sql disconnect; /* wrong port */ @@ -67,7 +58,7 @@ exec sql end declare section; /* no disconnect necessary */ /* wrong password */ - exec sql connect to unix:postgresql://localhost:@TEMP_PORT@/connectdb user connectuser identified by "wrongpw"; + exec sql connect to unix:postgresql://localhost/connectdb user connectuser identified by "wrongpw"; /* no disconnect necessary */ return (0); diff --git a/src/interfaces/ecpg/test/expected/Makefile b/src/interfaces/ecpg/test/expected/Makefile deleted file mode 100644 index 2f8a4d833a..0000000000 --- a/src/interfaces/ecpg/test/expected/Makefile +++ /dev/null @@ -1,18 +0,0 @@ -subdir = src/interfaces/ecpg/test/expected -top_builddir = ../../../../.. -include $(top_builddir)/src/Makefile.global -include $(top_srcdir)/$(subdir)/../Makefile.regress - -# port number for temp-installation test postmaster -# this is also defined in ../Makefile -TEMP_PORT = 5$(DEF_PGPORT) - -connect-test1.c: connect-test1.c.in - sed -e 's,@TEMP_PORT@,$(TEMP_PORT),g' \ - $< >$@ - -all: connect-test1.c - -extraclean: - rm -f connect-test1.c - diff --git a/src/interfaces/ecpg/test/expected/connect-test1.c.in b/src/interfaces/ecpg/test/expected/connect-test1.c similarity index 56% rename from src/interfaces/ecpg/test/expected/connect-test1.c.in rename to src/interfaces/ecpg/test/expected/connect-test1.c index 08e10f6019..8b6a94fb72 100644 --- a/src/interfaces/ecpg/test/expected/connect-test1.c.in +++ b/src/interfaces/ecpg/test/expected/connect-test1.c @@ -60,88 +60,63 @@ main(void) #line 30 "test1.pgc" - { ECPGconnect(__LINE__, 0, "connectdb@localhost:@TEMP_PORT@" , NULL, NULL , "main", 0); } -#line 32 "test1.pgc" + /* exec sql connect to :@TEMP_PORT@ as main user connectdb; + exec sql disconnect main; */ - { ECPGdisconnect(__LINE__, "main");} -#line 33 "test1.pgc" - - - { ECPGconnect(__LINE__, 0, "@localhost:@TEMP_PORT@" , "connectdb" , NULL , "main", 0); } + { ECPGconnect(__LINE__, 0, "tcp:postgresql://localhost/connectdb" , "connectuser" , "connectpw" , NULL, 0); } #line 35 "test1.pgc" - { ECPGdisconnect(__LINE__, "main");} + { ECPGdisconnect(__LINE__, "CURRENT");} #line 36 "test1.pgc" - { ECPGconnect(__LINE__, 0, "connectdb:@TEMP_PORT@" , NULL, NULL , "main", 0); } + { ECPGconnect(__LINE__, 0, "tcp:postgresql://localhost/" , "connectdb" , NULL , NULL, 0); } #line 38 "test1.pgc" - { ECPGdisconnect(__LINE__, "main");} + { ECPGdisconnect(__LINE__, "CURRENT");} #line 39 "test1.pgc" - { ECPGconnect(__LINE__, 0, ":@TEMP_PORT@" , "connectdb" , NULL , "main", 0); } -#line 41 "test1.pgc" + strcpy(pw, "connectpw"); + strcpy(db, "tcp:postgresql://localhost/connectdb"); + { ECPGconnect(__LINE__, 0, db , "connectuser" , pw , NULL, 0); } +#line 43 "test1.pgc" - { ECPGdisconnect(__LINE__, "main");} -#line 42 "test1.pgc" - - - { ECPGconnect(__LINE__, 0, "tcp:postgresql://localhost:@TEMP_PORT@/connectdb" , "connectuser" , "connectpw" , NULL, 0); } + { ECPGdisconnect(__LINE__, "CURRENT");} #line 44 "test1.pgc" + + { ECPGconnect(__LINE__, 0, "unix:postgresql://localhost/connectdb" , "connectuser" , "connectpw" , NULL, 0); } +#line 46 "test1.pgc" + { ECPGdisconnect(__LINE__, "CURRENT");} -#line 45 "test1.pgc" - - - { ECPGconnect(__LINE__, 0, "tcp:postgresql://localhost:@TEMP_PORT@/" , "connectdb" , NULL , NULL, 0); } #line 47 "test1.pgc" - { ECPGdisconnect(__LINE__, "CURRENT");} -#line 48 "test1.pgc" - - strcpy(pw, "connectpw"); - strcpy(db, "tcp:postgresql://localhost:@TEMP_PORT@/connectdb"); - { ECPGconnect(__LINE__, 0, db , "connectuser" , pw , NULL, 0); } -#line 52 "test1.pgc" + { ECPGconnect(__LINE__, 0, "unix:postgresql://localhost/connectdb?connect_timeout=14" , "connectuser" , NULL , NULL, 0); } +#line 49 "test1.pgc" { ECPGdisconnect(__LINE__, "CURRENT");} -#line 53 "test1.pgc" - - - { ECPGconnect(__LINE__, 0, "unix:postgresql://localhost:@TEMP_PORT@/connectdb" , "connectuser" , "connectpw" , NULL, 0); } -#line 55 "test1.pgc" - - { ECPGdisconnect(__LINE__, "CURRENT");} -#line 56 "test1.pgc" - - - { ECPGconnect(__LINE__, 0, "unix:postgresql://localhost:@TEMP_PORT@/connectdb?connect_timeout=14" , "connectuser" , NULL , NULL, 0); } -#line 58 "test1.pgc" - - { ECPGdisconnect(__LINE__, "CURRENT");} -#line 59 "test1.pgc" +#line 50 "test1.pgc" /* wrong db */ - { ECPGconnect(__LINE__, 0, "tcp:postgresql://localhost:@TEMP_PORT@/nonexistant" , "connectuser" , "connectpw" , NULL, 0); } -#line 62 "test1.pgc" + { ECPGconnect(__LINE__, 0, "tcp:postgresql://localhost/nonexistant" , "connectuser" , "connectpw" , NULL, 0); } +#line 53 "test1.pgc" { ECPGdisconnect(__LINE__, "CURRENT");} -#line 63 "test1.pgc" +#line 54 "test1.pgc" /* wrong port */ { ECPGconnect(__LINE__, 0, "tcp:postgresql://localhost:20/connectdb" , "connectuser" , "connectpw" , NULL, 0); } -#line 66 "test1.pgc" +#line 57 "test1.pgc" /* no disconnect necessary */ /* wrong password */ - { ECPGconnect(__LINE__, 0, "unix:postgresql://localhost:@TEMP_PORT@/connectdb" , "connectuser" , "wrongpw" , NULL, 0); } -#line 70 "test1.pgc" + { ECPGconnect(__LINE__, 0, "unix:postgresql://localhost/connectdb" , "connectuser" , "wrongpw" , NULL, 0); } +#line 61 "test1.pgc" /* no disconnect necessary */ diff --git a/src/interfaces/ecpg/test/expected/connect-test1.stderr b/src/interfaces/ecpg/test/expected/connect-test1.stderr index f5fe12725f..afa9e92b94 100644 --- a/src/interfaces/ecpg/test/expected/connect-test1.stderr +++ b/src/interfaces/ecpg/test/expected/connect-test1.stderr @@ -18,52 +18,36 @@ [NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: ecpg_finish: connection main closed [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGconnect: opening database connectdb on localhost port -[NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ecpg_finish: connection main closed -[NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGconnect: opening database on localhost port for user connectdb -[NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ecpg_finish: connection main closed -[NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGconnect: opening database connectdb on port -[NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ecpg_finish: connection main closed -[NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGconnect: opening database on port for user connectdb -[NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ecpg_finish: connection main closed -[NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGconnect: opening database connectdb on localhost port for user connectuser +[NO_PID]: ECPGconnect: opening database connectdb on localhost port for user connectuser [NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: ecpg_finish: connection connectdb closed [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGconnect: opening database on localhost port for user connectdb +[NO_PID]: ECPGconnect: opening database on localhost port for user connectdb [NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: ecpg_finish: connection (null) closed [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGconnect: opening database connectdb on localhost port for user connectuser +[NO_PID]: ECPGconnect: opening database connectdb on localhost port for user connectuser [NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: ecpg_finish: connection connectdb closed [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGconnect: opening database connectdb on port for user connectuser +[NO_PID]: ECPGconnect: opening database connectdb on port for user connectuser [NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: ecpg_finish: connection connectdb closed [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGconnect: opening database connectdb on port with options connect_timeout=14 for user connectuser +[NO_PID]: ECPGconnect: opening database connectdb on port with options connect_timeout=14 for user connectuser [NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: ecpg_finish: connection connectdb closed [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGconnect: opening database nonexistant on localhost port for user connectuser +[NO_PID]: ECPGconnect: opening database nonexistant on localhost port for user connectuser [NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: ECPGconnect: could not open database: FATAL: database "nonexistant" does not exist [NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: ecpg_finish: connection nonexistant closed [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: raising sqlcode -402 on line 62: could not connect to database "nonexistant" on line 62 +[NO_PID]: raising sqlcode -402 on line 53: could not connect to database "nonexistant" on line 53 [NO_PID]: sqlca: code: -402, state: 08001 -[NO_PID]: raising sqlcode -220 on line 63: no such connection CURRENT on line 63 +[NO_PID]: raising sqlcode -220 on line 54: no such connection CURRENT on line 54 [NO_PID]: sqlca: code: -220, state: 08003 [NO_PID]: ECPGconnect: opening database connectdb on localhost port for user connectuser [NO_PID]: sqlca: code: 0, state: 00000 @@ -74,7 +58,7 @@ [NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: ecpg_finish: connection connectdb closed [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: raising sqlcode -402 on line 66: could not connect to database "connectdb" on line 66 +[NO_PID]: raising sqlcode -402 on line 57: could not connect to database "connectdb" on line 57 [NO_PID]: sqlca: code: -402, state: 08001 -[NO_PID]: ECPGconnect: opening database connectdb on port for user connectuser +[NO_PID]: ECPGconnect: opening database connectdb on port for user connectuser [NO_PID]: sqlca: code: 0, state: 00000