Skip to content
Snippets Groups Projects
Commit 3ceaa97b authored by Michael Meskes's avatar Michael Meskes
Browse files

Regression test updates and fixes

parent a83437fc
No related branches found
No related tags found
No related merge requests found
Showing
with 90 additions and 365 deletions
...@@ -2065,7 +2065,7 @@ We Aug 2 13:15:25 CEST 2006 ...@@ -2065,7 +2065,7 @@ We Aug 2 13:15:25 CEST 2006
- Applied first version of the regression test patch by Joachim - Applied first version of the regression test patch by Joachim
Wieland <joe@mcknight.de>. Wieland <joe@mcknight.de>.
Th Aug 3 14:45:06 CEST 2006 Fr Aug 4 10:44:30 CEST 2006
- Applied test suite update by Joachim Wieland <joe@mcknight.de>. - Applied test suite update by Joachim Wieland <joe@mcknight.de>.
- Set ecpg library version to 5.2. - Set ecpg library version to 5.2.
......
...@@ -18,5 +18,5 @@ clean distclean maintainer-clean: ...@@ -18,5 +18,5 @@ clean distclean maintainer-clean:
-$(MAKE) -C preproc $@ -$(MAKE) -C preproc $@
-$(MAKE) -C test clean -$(MAKE) -C test clean
check: all check checktcp: all
$(MAKE) -C test $@ $(MAKE) -C test $@
/* dynamic SQL support routines /* dynamic SQL support routines
* *
* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/descriptor.c,v 1.17 2006/07/05 10:49:56 meskes Exp $ * $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/descriptor.c,v 1.18 2006/08/04 08:52:17 meskes Exp $
*/ */
#define POSTGRES_ECPG_INTERNAL #define POSTGRES_ECPG_INTERNAL
...@@ -249,7 +249,7 @@ ECPGget_desc(int lineno, const char *desc_name, int index,...) ...@@ -249,7 +249,7 @@ ECPGget_desc(int lineno, const char *desc_name, int index,...)
data_var.ind_varcharsize = varcharsize; data_var.ind_varcharsize = varcharsize;
data_var.ind_arrsize = arrsize; data_var.ind_arrsize = arrsize;
data_var.ind_offset = offset; data_var.ind_offset = offset;
if ((data_var.ind_arrsize == 0 || data_var.ind_varcharsize == 0) && data_var.ind_pointer != NULL) if (data_var.ind_arrsize == 0 || data_var.ind_varcharsize == 0)
data_var.ind_value = *((void **) (data_var.ind_pointer)); data_var.ind_value = *((void **) (data_var.ind_pointer));
else else
data_var.ind_value = data_var.ind_pointer; data_var.ind_value = data_var.ind_pointer;
......
# $PostgreSQL: pgsql/src/interfaces/ecpg/test/Makefile,v 1.54 2006/08/02 13:43:23 meskes Exp $ # $PostgreSQL: pgsql/src/interfaces/ecpg/test/Makefile,v 1.55 2006/08/04 08:52:17 meskes Exp $
subdir = src/interfaces/ecpg/test subdir = src/interfaces/ecpg/test
top_builddir = ../../../.. top_builddir = ../../../..
include $(top_builddir)/src/Makefile.global include $(top_builddir)/src/Makefile.global
# port number for temp-installation test postmaster # port number for temp-installation test postmaster
# this is also defined in test/connect/Makefile
TEMP_PORT = 5$(DEF_PGPORT) TEMP_PORT = 5$(DEF_PGPORT)
# default encoding # default encoding
...@@ -16,7 +17,7 @@ ifdef NO_LOCALE ...@@ -16,7 +17,7 @@ ifdef NO_LOCALE
NOLOCALE += --no-locale NOLOCALE += --no-locale
endif endif
all clean install installdirs uninstall dep depend distprep: all install installdirs uninstall dep depend distprep:
$(MAKE) -C connect $@ $(MAKE) -C connect $@
$(MAKE) -C sql $@ $(MAKE) -C sql $@
$(MAKE) -C pgtypeslib $@ $(MAKE) -C pgtypeslib $@
...@@ -24,8 +25,20 @@ all clean install installdirs uninstall dep depend distprep: ...@@ -24,8 +25,20 @@ all clean install installdirs uninstall dep depend distprep:
$(MAKE) -C compat_informix $@ $(MAKE) -C compat_informix $@
$(MAKE) -C complex $@ $(MAKE) -C complex $@
$(MAKE) -C thread $@ $(MAKE) -C thread $@
# for some reason I couldn't figure out, ifeq($@,clean) ... does not work
if [ $@ = clean ]; then rm -f results/*.stdout results/*.stderr results/*.c; rm -rf tmp_check/; rm -f log/*.log; rm -f pg_regress.inc.sh regression.diff; fi clean distclean maintainer-clean:
$(MAKE) -C connect $@
$(MAKE) -C connect extraclean
$(MAKE) -C sql $@
$(MAKE) -C pgtypeslib $@
$(MAKE) -C errors $@
$(MAKE) -C compat_informix $@
$(MAKE) -C complex $@
$(MAKE) -C thread $@
rm -f results/*.stdout results/*.stderr results/*.c
rm -rf tmp_check/
rm -f log/*.log
rm -f pg_regress.inc.sh regression.diff
all: pg_regress.sh all: pg_regress.sh
...@@ -43,8 +56,10 @@ pg_regress.inc.sh: pg_regress.inc.sh.in $(top_builddir)/src/Makefile.global ...@@ -43,8 +56,10 @@ pg_regress.inc.sh: pg_regress.inc.sh.in $(top_builddir)/src/Makefile.global
-e 's/@GCC@/$(GCC)/g' \ -e 's/@GCC@/$(GCC)/g' \
$< >$@ $< >$@
test: all pg_regress.inc.sh check: all pg_regress.inc.sh
sh ./pg_regress.sh --dbname=regress1 --debug --temp-install --top-builddir=$(top_builddir) --temp-port=$(TEMP_PORT) --listen-on-tcp --multibyte=$(MULTIBYTE) --load-language=plpgsql $(NOLOCALE) sh ./pg_regress.sh --dbname=regress1 --debug --temp-install --top-builddir=$(top_builddir) --temp-port=$(TEMP_PORT) --multibyte=$(MULTIBYTE) --load-language=plpgsql $(NOLOCALE)
check: all test # the same options, but with --listen-on-tcp
checktcp: all pg_regress.inc.sh
sh ./pg_regress.sh --dbname=regress1 --debug --temp-install --top-builddir=$(top_builddir) --temp-port=$(TEMP_PORT) --multibyte=$(MULTIBYTE) --load-language=plpgsql $(NOLOCALE) --listen-on-tcp
...@@ -91,7 +91,8 @@ main (void) ...@@ -91,7 +91,8 @@ main (void)
EXEC SQL CLOSE B; EXEC SQL CLOSE B;
printf ("name=%s, accs=%d byte=", empl.name, a.accs); /* do not print a.accs because big/little endian will have different outputs here */
printf ("name=%s, byte=", empl.name);
for (i=0; i<20; i++) for (i=0; i<20; i++)
{ {
if (empl.byte[i] == '#') if (empl.byte[i] == '#')
......
...@@ -3,6 +3,14 @@ top_builddir = ../../../../.. ...@@ -3,6 +3,14 @@ top_builddir = ../../../../..
include $(top_builddir)/src/Makefile.global include $(top_builddir)/src/Makefile.global
include ../Makefile.regress include ../Makefile.regress
# port number for temp-installation test postmaster
# this is also defined in ../Makefile
TEMP_PORT = 5$(DEF_PGPORT)
test1.pgc: test1.pgc.in
sed -e 's,@TEMP_PORT@,$(TEMP_PORT),g' \
$< >$@
TESTS = test1 test1.c \ TESTS = test1 test1.c \
test2 test2.c \ test2 test2.c \
test3 test3.c \ test3 test3.c \
...@@ -10,3 +18,5 @@ TESTS = test1 test1.c \ ...@@ -10,3 +18,5 @@ TESTS = test1 test1.c \
all: $(TESTS) all: $(TESTS)
extraclean:
rm -f test1.pgc
...@@ -38,20 +38,20 @@ exec sql end declare section; ...@@ -38,20 +38,20 @@ exec sql end declare section;
exec sql connect to connectdb@localhost as main user connectuser/connectdb; exec sql connect to connectdb@localhost as main user connectuser/connectdb;
exec sql disconnect main; exec sql disconnect main;
exec sql connect to tcp:postgresql://localhost:55432/connectdb user connectuser identified by connectpw; exec sql connect to tcp:postgresql://localhost:@TEMP_PORT@/connectdb user connectuser identified by connectpw;
exec sql disconnect nonexistant; exec sql disconnect nonexistant;
exec sql disconnect; exec sql disconnect;
strcpy(pw, "connectpw"); strcpy(pw, "connectpw");
strcpy(db, "tcp:postgresql://localhost:55432/connectdb"); strcpy(db, "tcp:postgresql://localhost:@TEMP_PORT@/connectdb");
exec sql connect to :db user connectuser using :pw; exec sql connect to :db user connectuser using :pw;
exec sql disconnect; exec sql disconnect;
exec sql connect to unix:postgresql://localhost:55432/connectdb user connectuser using "connectpw"; exec sql connect to unix:postgresql://localhost:@TEMP_PORT@/connectdb user connectuser using "connectpw";
exec sql disconnect; exec sql disconnect;
/* wrong db */ /* wrong db */
exec sql connect to tcp:postgresql://localhost:55432/nonexistant user connectuser identified by connectpw; exec sql connect to tcp:postgresql://localhost:@TEMP_PORT@/nonexistant user connectuser identified by connectpw;
exec sql disconnect; exec sql disconnect;
/* wrong port */ /* wrong port */
...@@ -59,7 +59,7 @@ exec sql end declare section; ...@@ -59,7 +59,7 @@ exec sql end declare section;
/* no disconnect necessary */ /* no disconnect necessary */
/* wrong password */ /* wrong password */
exec sql connect to unix:postgresql://localhost:55432/connectdb user connectuser identified by "wrongpw"; exec sql connect to unix:postgresql://localhost:@TEMP_PORT@/connectdb user connectuser identified by "wrongpw";
/* no disconnect necessary */ /* no disconnect necessary */
/* connect twice */ /* connect twice */
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
/* do not include regression.h */ exec sql include ../regression;
int int
main(void) main(void)
...@@ -22,7 +22,7 @@ exec sql end declare section; ...@@ -22,7 +22,7 @@ exec sql end declare section;
strcpy(id, "first"); strcpy(id, "first");
exec sql connect to connectdb as :id; exec sql connect to connectdb as :id;
exec sql connect to regress1@localhost as second; exec sql connect to REGRESSDB1 as second;
/* this selects from "second" which was opened last */ /* this selects from "second" which was opened last */
exec sql select current_database() into :res; exec sql select current_database() into :res;
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
/* do not include regression.h */ exec sql include ../regression;
int int
main(void) main(void)
...@@ -21,7 +21,7 @@ exec sql end declare section; ...@@ -21,7 +21,7 @@ exec sql end declare section;
strcpy(id, "first"); strcpy(id, "first");
exec sql connect to connectdb as :id; exec sql connect to connectdb as :id;
exec sql connect to regress1@localhost as second; exec sql connect to REGRESSDB1 as second;
/* this selects from "second" which was opened last */ /* this selects from "second" which was opened last */
exec sql select current_database() into :res; exec sql select current_database() into :res;
...@@ -30,11 +30,11 @@ exec sql end declare section; ...@@ -30,11 +30,11 @@ exec sql end declare section;
exec sql disconnect CURRENT; exec sql disconnect CURRENT;
exec sql select current_database() into :res; exec sql select current_database() into :res;
exec sql connect to regress1@localhost as second; exec sql connect to REGRESSDB1 as second;
/* will close "second" */ /* will close "second" */
exec sql disconnect DEFAULT; exec sql disconnect DEFAULT;
exec sql connect to regress1@localhost as second; exec sql connect to REGRESSDB1 as second;
exec sql disconnect ALL; exec sql disconnect ALL;
exec sql disconnect CURRENT; exec sql disconnect CURRENT;
......
...@@ -199,7 +199,8 @@ main (void) ...@@ -199,7 +199,8 @@ main (void)
#line 92 "test5.pgc" #line 92 "test5.pgc"
printf ("name=%s, accs=%d byte=", empl.name, a.accs); /* do not print a.accs because big/little endian will have different outputs here */
printf ("name=%s, byte=", empl.name);
for (i=0; i<20; i++) for (i=0; i<20; i++)
{ {
if (empl.byte[i] == '#') if (empl.byte[i] == '#')
...@@ -208,7 +209,7 @@ main (void) ...@@ -208,7 +209,7 @@ main (void)
} }
printf("\n"); printf("\n");
{ ECPGdisconnect(__LINE__, "CURRENT");} { ECPGdisconnect(__LINE__, "CURRENT");}
#line 102 "test5.pgc" #line 103 "test5.pgc"
exit (0); exit (0);
} }
name=first user , accs=320 byte=\001m\000\212 name=first user , accs=320 byte=\001m\000\212
name=first user , accs=320 byte=\001m\000\212 name=first user , accs=320 byte=\001m\000\212
name=first user , accs=16385 byte=(1)(155)(0)(212) name=first user , byte=(1)(155)(0)(212)
THE PORT NUMBER MIGHT HAVE BEEN CHANGED BY THE REGRESSION SCRIPT
/* Processed by ecpg (4.2.1) */ /* Processed by ecpg (4.2.1) */
/* These include files are added by the preprocessor */ /* These include files are added by the preprocessor */
#include <ecpgtype.h> #include <ecpgtype.h>
......
THE PORT NUMBER MIGHT HAVE BEEN CHANGED BY THE REGRESSION SCRIPT
[NO_PID]: ECPGdebug: set to 1 [NO_PID]: ECPGdebug: set to 1
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGconnect: opening database connectdb on <DEFAULT> port <DEFAULT> [NO_PID]: ECPGconnect: opening database connectdb on <DEFAULT> port <DEFAULT>
......
THE PORT NUMBER MIGHT HAVE BEEN CHANGED BY THE REGRESSION SCRIPT
...@@ -17,7 +17,16 @@ ...@@ -17,7 +17,16 @@
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
/* do not include regression.h */
#line 1 "./../regression.h"
#line 11 "test2.pgc"
int int
main(void) main(void)
...@@ -41,7 +50,7 @@ main(void) ...@@ -41,7 +50,7 @@ main(void)
{ ECPGconnect(__LINE__, 0, "connectdb" , NULL,NULL , id, 0); } { ECPGconnect(__LINE__, 0, "connectdb" , NULL,NULL , id, 0); }
#line 24 "test2.pgc" #line 24 "test2.pgc"
{ ECPGconnect(__LINE__, 0, "regress1@localhost" , NULL,NULL , "second", 0); } { ECPGconnect(__LINE__, 0, "regress1" , NULL,NULL , "second", 0); }
#line 25 "test2.pgc" #line 25 "test2.pgc"
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGconnect: opening database connectdb on <DEFAULT> port <DEFAULT> [NO_PID]: ECPGconnect: opening database connectdb on <DEFAULT> port <DEFAULT>
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGconnect: opening database regress1 on localhost port <DEFAULT> [NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT>
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 28: QUERY: select current_database () on connection second [NO_PID]: ECPGexecute line 28: QUERY: select current_database () on connection second
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
......
...@@ -16,7 +16,16 @@ ...@@ -16,7 +16,16 @@
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
/* do not include regression.h */
#line 1 "./../regression.h"
#line 10 "test3.pgc"
int int
main(void) main(void)
...@@ -40,7 +49,7 @@ main(void) ...@@ -40,7 +49,7 @@ main(void)
{ ECPGconnect(__LINE__, 0, "connectdb" , NULL,NULL , id, 0); } { ECPGconnect(__LINE__, 0, "connectdb" , NULL,NULL , id, 0); }
#line 23 "test3.pgc" #line 23 "test3.pgc"
{ ECPGconnect(__LINE__, 0, "regress1@localhost" , NULL,NULL , "second", 0); } { ECPGconnect(__LINE__, 0, "regress1" , NULL,NULL , "second", 0); }
#line 24 "test3.pgc" #line 24 "test3.pgc"
...@@ -61,7 +70,7 @@ main(void) ...@@ -61,7 +70,7 @@ main(void)
#line 31 "test3.pgc" #line 31 "test3.pgc"
{ ECPGconnect(__LINE__, 0, "regress1@localhost" , NULL,NULL , "second", 0); } { ECPGconnect(__LINE__, 0, "regress1" , NULL,NULL , "second", 0); }
#line 33 "test3.pgc" #line 33 "test3.pgc"
/* will close "second" */ /* will close "second" */
...@@ -69,7 +78,7 @@ main(void) ...@@ -69,7 +78,7 @@ main(void)
#line 35 "test3.pgc" #line 35 "test3.pgc"
{ ECPGconnect(__LINE__, 0, "regress1@localhost" , NULL,NULL , "second", 0); } { ECPGconnect(__LINE__, 0, "regress1" , NULL,NULL , "second", 0); }
#line 37 "test3.pgc" #line 37 "test3.pgc"
{ ECPGdisconnect(__LINE__, "ALL");} { ECPGdisconnect(__LINE__, "ALL");}
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGconnect: opening database connectdb on <DEFAULT> port <DEFAULT> [NO_PID]: ECPGconnect: opening database connectdb on <DEFAULT> port <DEFAULT>
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGconnect: opening database regress1 on localhost port <DEFAULT> [NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT>
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 27: QUERY: select current_database () on connection second [NO_PID]: ECPGexecute line 27: QUERY: select current_database () on connection second
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGget_data line 31: RESULT: connectdb offset: 200 array: Yes [NO_PID]: ECPGget_data line 31: RESULT: connectdb offset: 200 array: Yes
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGconnect: opening database regress1 on localhost port <DEFAULT> [NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT>
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: raising sqlcode -220 in line 35, 'No such connection DEFAULT in line 35.'. [NO_PID]: raising sqlcode -220 in line 35, 'No such connection DEFAULT in line 35.'.
[NO_PID]: sqlca: code: -220, state: 08003 [NO_PID]: sqlca: code: -220, state: 08003
......
/* Processed by ecpg (4.2.1) */
/* These include files are added by the preprocessor */
#include <ecpgtype.h>
#include <ecpglib.h>
#include <ecpgerrno.h>
#include <sqlca.h>
/* End of automatic include section */
#line 1 "test_notice.pgc"
#line 1 "./../../include/sqlca.h"
#ifndef POSTGRES_SQLCA_H
#define POSTGRES_SQLCA_H
#ifndef DLLIMPORT
#if defined(WIN32) || defined(__CYGWIN__)
#define DLLIMPORT __declspec (dllimport)
#else
#define DLLIMPORT
#endif /* __CYGWIN__ */
#endif /* DLLIMPORT */
#define SQLERRMC_LEN 150
#ifdef __cplusplus
extern "C"
{
#endif
struct sqlca_t
{
char sqlcaid[8];
long sqlabc;
long sqlcode;
struct
{
int sqlerrml;
char sqlerrmc[SQLERRMC_LEN];
} sqlerrm;
char sqlerrp[8];
long sqlerrd[6];
/* Element 0: empty */
/* 1: OID of processed tuple if applicable */
/* 2: number of rows processed */
/* after an INSERT, UPDATE or */
/* DELETE statement */
/* 3: empty */
/* 4: empty */
/* 5: empty */
char sqlwarn[8];
/* Element 0: set to 'W' if at least one other is 'W' */
/* 1: if 'W' at least one character string */
/* value was truncated when it was */
/* stored into a host variable. */
/*
* 2: if 'W' a (hopefully) non-fatal notice occurred
*/ /* 3: empty */
/* 4: empty */
/* 5: empty */
/* 6: empty */
/* 7: empty */
char sqlstate[5];
};
struct sqlca_t *ECPGget_sqlca(void);
#ifndef POSTGRES_ECPG_INTERNAL
#define sqlca (*ECPGget_sqlca())
#endif
#ifdef __cplusplus
}
#endif
#endif
#line 1 "test_notice.pgc"
#line 1 "./../regression.h"
#line 2 "test_notice.pgc"
#include <stdio.h>
static void printwarning(void)
{
if (sqlca.sqlwarn[0]) printf("sqlca.sqlwarn: %c",sqlca.sqlwarn[0]);
else return;
if (sqlca.sqlwarn[1]) putchar('1');
if (sqlca.sqlwarn[2]) putchar('2');
putchar('\n');
}
int main(int argc, char **argv)
{
/* exec sql begin declare section */
#line 20 "test_notice.pgc"
int payload ;
/* exec sql end declare section */
#line 21 "test_notice.pgc"
/* actually this will print 'sql error' if a warning occurs */
/* exec sql whenever sql_warning do printwarning ( ) ; */
#line 24 "test_notice.pgc"
ECPGdebug(1, stderr);
{ ECPGconnect(__LINE__, 0, "regress1" , NULL,NULL , NULL, 0);
#line 28 "test_notice.pgc"
if (sqlca.sqlwarn[0] == 'W') printwarning ( );}
#line 28 "test_notice.pgc"
if (sqlca.sqlcode) printf("%d %ld:%s\n",__LINE__,sqlca.sqlcode,sqlca.sqlerrm.sqlerrmc);
{ ECPGdo(__LINE__, 0, 1, NULL, "create table test ( \"index\" numeric ( 3 ) primary key , \"payload\" int4 not null ) ", ECPGt_EOIT, ECPGt_EORT);
#line 33 "test_notice.pgc"
if (sqlca.sqlwarn[0] == 'W') printwarning ( );}
#line 33 "test_notice.pgc"
if (sqlca.sqlcode) printf("%d %ld:%s\n",__LINE__,sqlca.sqlcode,sqlca.sqlerrm.sqlerrmc);
{ ECPGtrans(__LINE__, NULL, "commit");
#line 36 "test_notice.pgc"
if (sqlca.sqlwarn[0] == 'W') printwarning ( );}
#line 36 "test_notice.pgc"
if (sqlca.sqlcode) printf("%d %ld:%s\n",__LINE__,sqlca.sqlcode,sqlca.sqlerrm.sqlerrmc);
/* double BEGIN */
{ ECPGtrans(__LINE__, NULL, "begin transaction ");
#line 41 "test_notice.pgc"
if (sqlca.sqlwarn[0] == 'W') printwarning ( );}
#line 41 "test_notice.pgc"
if (sqlca.sqlcode) printf("%d %ld:%s\n",__LINE__,sqlca.sqlcode,sqlca.sqlerrm.sqlerrmc);
/* BEGIN with already open transaction */
{ ECPGtrans(__LINE__, NULL, "begin transaction ");
#line 45 "test_notice.pgc"
if (sqlca.sqlwarn[0] == 'W') printwarning ( );}
#line 45 "test_notice.pgc"
if (sqlca.sqlcode!=ECPG_WARNING_IN_TRANSACTION) printf("%d %ld:%s\n",__LINE__,sqlca.sqlcode,sqlca.sqlerrm.sqlerrmc);
/* double COMMIT */
{ ECPGtrans(__LINE__, NULL, "commit");
#line 49 "test_notice.pgc"
if (sqlca.sqlwarn[0] == 'W') printwarning ( );}
#line 49 "test_notice.pgc"
if (sqlca.sqlcode) printf("%d %ld:%s\n",__LINE__,sqlca.sqlcode,sqlca.sqlerrm.sqlerrmc);
/* COMMIT without open transaction */
{ ECPGtrans(__LINE__, NULL, "commit");
#line 53 "test_notice.pgc"
if (sqlca.sqlwarn[0] == 'W') printwarning ( );}
#line 53 "test_notice.pgc"
if (sqlca.sqlcode!=ECPG_WARNING_NO_TRANSACTION) printf("%d %ld:%s\n",__LINE__,sqlca.sqlcode,sqlca.sqlerrm.sqlerrmc);
/* ROLLBACK without open transaction */
{ ECPGtrans(__LINE__, NULL, "rollback");
#line 57 "test_notice.pgc"
if (sqlca.sqlwarn[0] == 'W') printwarning ( );}
#line 57 "test_notice.pgc"
if (sqlca.sqlcode!=ECPG_WARNING_NO_TRANSACTION) printf("%d %ld:%s\n",__LINE__,sqlca.sqlcode,sqlca.sqlerrm.sqlerrmc);
sqlca.sqlcode=0;
/* declare x cursor for select * from test */
#line 61 "test_notice.pgc"
if (sqlca.sqlcode) printf("%d %ld:%s\n",__LINE__,sqlca.sqlcode,sqlca.sqlerrm.sqlerrmc);
{ ECPGdo(__LINE__, 0, 1, NULL, "declare x cursor for select * from test ", ECPGt_EOIT, ECPGt_EORT);
#line 64 "test_notice.pgc"
if (sqlca.sqlwarn[0] == 'W') printwarning ( );}
#line 64 "test_notice.pgc"
if (sqlca.sqlcode) printf("%d %ld:%s\n",__LINE__,sqlca.sqlcode,sqlca.sqlerrm.sqlerrmc);
{ ECPGdo(__LINE__, 0, 1, NULL, "declare x cursor for select * from test ", ECPGt_EOIT, ECPGt_EORT);
#line 67 "test_notice.pgc"
if (sqlca.sqlwarn[0] == 'W') printwarning ( );}
#line 67 "test_notice.pgc"
if (sqlca.sqlcode!=ECPG_WARNING_PORTAL_EXISTS) printf("%d %ld:%s\n",__LINE__,sqlca.sqlcode,sqlca.sqlerrm.sqlerrmc);
{ ECPGdo(__LINE__, 0, 1, NULL, "close x", ECPGt_EOIT, ECPGt_EORT);
#line 70 "test_notice.pgc"
if (sqlca.sqlwarn[0] == 'W') printwarning ( );}
#line 70 "test_notice.pgc"
if (sqlca.sqlcode) printf("%d %ld:%s\n",__LINE__,sqlca.sqlcode,sqlca.sqlerrm.sqlerrmc);
{ ECPGtrans(__LINE__, NULL, "rollback");
#line 73 "test_notice.pgc"
if (sqlca.sqlwarn[0] == 'W') printwarning ( );}
#line 73 "test_notice.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, "close x", ECPGt_EOIT, ECPGt_EORT);
#line 75 "test_notice.pgc"
if (sqlca.sqlwarn[0] == 'W') printwarning ( );}
#line 75 "test_notice.pgc"
if (sqlca.sqlcode!=ECPG_WARNING_UNKNOWN_PORTAL) printf("%d %ld:%s\n",__LINE__,sqlca.sqlcode,sqlca.sqlerrm.sqlerrmc);
{ ECPGtrans(__LINE__, NULL, "rollback");
#line 78 "test_notice.pgc"
if (sqlca.sqlwarn[0] == 'W') printwarning ( );}
#line 78 "test_notice.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, "update test set nonexistent = 2 ", ECPGt_EOIT, ECPGt_EORT);
#line 80 "test_notice.pgc"
if (sqlca.sqlwarn[0] == 'W') printwarning ( );}
#line 80 "test_notice.pgc"
if (sqlca.sqlcode!=ECPG_PGSQL) printf("%d %ld:%s\n",__LINE__,sqlca.sqlcode,sqlca.sqlerrm.sqlerrmc);
{ ECPGdo(__LINE__, 0, 1, NULL, "select payload from test where index = 1 ", ECPGt_EOIT,
ECPGt_int,&(payload),(long)1,(long)1,sizeof(int),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
#line 83 "test_notice.pgc"
if (sqlca.sqlwarn[0] == 'W') printwarning ( );}
#line 83 "test_notice.pgc"
if (sqlca.sqlcode!=ECPG_WARNING_QUERY_IGNORED) printf("%d %ld:%s\n",__LINE__,sqlca.sqlcode,sqlca.sqlerrm.sqlerrmc);
{ ECPGtrans(__LINE__, NULL, "rollback");
#line 86 "test_notice.pgc"
if (sqlca.sqlwarn[0] == 'W') printwarning ( );}
#line 86 "test_notice.pgc"
if (sqlca.sqlcode) printf("%d %ld:%s\n",__LINE__,sqlca.sqlcode,sqlca.sqlerrm.sqlerrmc);
/* this will raise a warning */
{ ECPGdo(__LINE__, 0, 1, NULL, "drop table test ", ECPGt_EOIT, ECPGt_EORT);
#line 90 "test_notice.pgc"
if (sqlca.sqlwarn[0] == 'W') printwarning ( );}
#line 90 "test_notice.pgc"
if (sqlca.sqlcode) printf("%d %ld:%s\n",__LINE__,sqlca.sqlcode,sqlca.sqlerrm.sqlerrmc);
{ ECPGtrans(__LINE__, NULL, "commit");
#line 92 "test_notice.pgc"
if (sqlca.sqlwarn[0] == 'W') printwarning ( );}
#line 92 "test_notice.pgc"
if (sqlca.sqlcode) printf("%d %ld:%s\n",__LINE__,sqlca.sqlcode,sqlca.sqlerrm.sqlerrmc);
{ ECPGdisconnect(__LINE__, "CURRENT");
#line 95 "test_notice.pgc"
if (sqlca.sqlwarn[0] == 'W') printwarning ( );}
#line 95 "test_notice.pgc"
if (sqlca.sqlcode) printf("%d %ld:%s\n",__LINE__,sqlca.sqlcode,sqlca.sqlerrm.sqlerrmc);
return 0;
}
[NO_PID]: ECPGdebug: set to 1
[NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT>
[NO_PID]: ECPGexecute line 31: QUERY: create table test ( "index" numeric ( 3 ) primary key , "payload" int4 not null ) on connection regress1
[NO_PID]: ECPGexecute line 31 Ok: CREATE TABLE
[NO_PID]: ECPGtrans line 36 action = commit connection = regress1
[NO_PID]: ECPGtrans line 39 action = begin transaction connection = regress1
[NO_PID]: ECPGtrans line 42 action = begin transaction connection = regress1
[NO_PID]: eine Transaktion ist bereits begonnen[NO_PID]: raising sqlcode -603
[NO_PID]: ECPGtrans line 45 action = commit connection = regress1
[NO_PID]: ECPGtrans line 48 action = commit connection = regress1
[NO_PID]: ECPGtrans line 51 action = rollback connection = regress1
[NO_PID]: ECPGexecute line 58: QUERY: declare x cursor for select * from test on connection regress1
[NO_PID]: ECPGexecute line 58 Ok: DECLARE CURSOR
[NO_PID]: ECPGexecute line 61: QUERY: declare x cursor for select * from test on connection regress1
[NO_PID]: ECPGexecute line 61: Error: FEHLER: Cursor >>x<< existiert bereits
[NO_PID]: raising sqlstate 42P03 in line 61, ''Cursor >>x<< existiert bereits' in line 61.'.
[NO_PID]: ECPGexecute line 64: QUERY: close x on connection regress1
[NO_PID]: ECPGexecute line 64: Error: FEHLER: aktuelle Transaktion wurde abgebrochen, Befehle werden bis zum Ende der Transaktion ignoriert
[NO_PID]: raising sqlstate 25P02 in line 64, ''aktuelle Transaktion wurde abgebrochen, Befehle werden bis zum Ende '.
[NO_PID]: ECPGexecute line 67: QUERY: close x on connection regress1
[NO_PID]: ECPGexecute line 67: Error: FEHLER: aktuelle Transaktion wurde abgebrochen, Befehle werden bis zum Ende der Transaktion ignoriert
[NO_PID]: raising sqlstate 25P02 in line 67, ''aktuelle Transaktion wurde abgebrochen, Befehle werden bis zum Ende '.
[NO_PID]: ECPGexecute line 70: QUERY: update test set nonexistent = 2 on connection regress1
[NO_PID]: ECPGexecute line 70: Error: FEHLER: aktuelle Transaktion wurde abgebrochen, Befehle werden bis zum Ende der Transaktion ignoriert
[NO_PID]: raising sqlstate 25P02 in line 70, ''aktuelle Transaktion wurde abgebrochen, Befehle werden bis zum Ende '.
[NO_PID]: ECPGexecute line 73: QUERY: select payload from test where index = 1 on connection regress1
[NO_PID]: ECPGexecute line 73: Error: FEHLER: aktuelle Transaktion wurde abgebrochen, Befehle werden bis zum Ende der Transaktion ignoriert
[NO_PID]: raising sqlstate 25P02 in line 73, ''aktuelle Transaktion wurde abgebrochen, Befehle werden bis zum Ende '.
[NO_PID]: ECPGtrans line 76 action = rollback connection = regress1
[NO_PID]: ECPGexecute line 80: QUERY: drop table test on connection regress1
[NO_PID]: ECPGexecute line 80 Ok: DROP TABLE
[NO_PID]: ECPGtrans line 82 action = commit connection = regress1
[NO_PID]: ecpg_finish: Connection regress1 closed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment