mirror of
https://github.com/postgres/postgres.git
synced 2025-08-31 17:02:12 +03:00
Regression test updates and fixes
This commit is contained in:
@@ -2065,7 +2065,7 @@ We Aug 2 13:15:25 CEST 2006
|
||||
- Applied first version of the regression test patch by Joachim
|
||||
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>.
|
||||
- Set ecpg library version to 5.2.
|
||||
|
@@ -18,5 +18,5 @@ clean distclean maintainer-clean:
|
||||
-$(MAKE) -C preproc $@
|
||||
-$(MAKE) -C test clean
|
||||
|
||||
check: all
|
||||
check checktcp: all
|
||||
$(MAKE) -C test $@
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/* 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
|
||||
@@ -249,7 +249,7 @@ ECPGget_desc(int lineno, const char *desc_name, int index,...)
|
||||
data_var.ind_varcharsize = varcharsize;
|
||||
data_var.ind_arrsize = arrsize;
|
||||
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));
|
||||
else
|
||||
data_var.ind_value = data_var.ind_pointer;
|
||||
|
@@ -1,10 +1,11 @@
|
||||
# $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
|
||||
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 = 5$(DEF_PGPORT)
|
||||
|
||||
# default encoding
|
||||
@@ -16,7 +17,7 @@ ifdef NO_LOCALE
|
||||
NOLOCALE += --no-locale
|
||||
endif
|
||||
|
||||
all clean install installdirs uninstall dep depend distprep:
|
||||
all install installdirs uninstall dep depend distprep:
|
||||
$(MAKE) -C connect $@
|
||||
$(MAKE) -C sql $@
|
||||
$(MAKE) -C pgtypeslib $@
|
||||
@@ -24,8 +25,20 @@ all clean install installdirs uninstall dep depend distprep:
|
||||
$(MAKE) -C compat_informix $@
|
||||
$(MAKE) -C complex $@
|
||||
$(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
|
||||
|
||||
@@ -43,8 +56,10 @@ pg_regress.inc.sh: pg_regress.inc.sh.in $(top_builddir)/src/Makefile.global
|
||||
-e 's/@GCC@/$(GCC)/g' \
|
||||
$< >$@
|
||||
|
||||
test: 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)
|
||||
check: 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)
|
||||
|
||||
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)
|
||||
|
||||
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++)
|
||||
{
|
||||
if (empl.byte[i] == '#')
|
||||
|
@@ -3,6 +3,14 @@ top_builddir = ../../../../..
|
||||
include $(top_builddir)/src/Makefile.global
|
||||
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 \
|
||||
test2 test2.c \
|
||||
test3 test3.c \
|
||||
@@ -10,3 +18,5 @@ TESTS = test1 test1.c \
|
||||
|
||||
all: $(TESTS)
|
||||
|
||||
extraclean:
|
||||
rm -f test1.pgc
|
||||
|
@@ -38,20 +38,20 @@ exec sql end declare section;
|
||||
exec sql connect to connectdb@localhost as main user connectuser/connectdb;
|
||||
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;
|
||||
|
||||
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 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;
|
||||
|
||||
/* 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;
|
||||
|
||||
/* wrong port */
|
||||
@@ -59,7 +59,7 @@ exec sql end declare section;
|
||||
/* no disconnect necessary */
|
||||
|
||||
/* 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 */
|
||||
|
||||
/* connect twice */
|
@@ -8,7 +8,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
/* do not include regression.h */
|
||||
exec sql include ../regression;
|
||||
|
||||
int
|
||||
main(void)
|
||||
@@ -22,7 +22,7 @@ exec sql end declare section;
|
||||
|
||||
strcpy(id, "first");
|
||||
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 */
|
||||
exec sql select current_database() into :res;
|
||||
|
@@ -7,7 +7,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
/* do not include regression.h */
|
||||
exec sql include ../regression;
|
||||
|
||||
int
|
||||
main(void)
|
||||
@@ -21,7 +21,7 @@ exec sql end declare section;
|
||||
|
||||
strcpy(id, "first");
|
||||
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 */
|
||||
exec sql select current_database() into :res;
|
||||
@@ -30,11 +30,11 @@ exec sql end declare section;
|
||||
exec sql disconnect CURRENT;
|
||||
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" */
|
||||
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 CURRENT;
|
||||
|
@@ -199,7 +199,8 @@ main (void)
|
||||
#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++)
|
||||
{
|
||||
if (empl.byte[i] == '#')
|
||||
@@ -208,7 +209,7 @@ main (void)
|
||||
}
|
||||
printf("\n");
|
||||
{ ECPGdisconnect(__LINE__, "CURRENT");}
|
||||
#line 102 "test5.pgc"
|
||||
#line 103 "test5.pgc"
|
||||
|
||||
exit (0);
|
||||
}
|
||||
|
@@ -1,3 +1,3 @@
|
||||
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)
|
||||
|
@@ -1,3 +1,6 @@
|
||||
|
||||
THE PORT NUMBER MIGHT HAVE BEEN CHANGED BY THE REGRESSION SCRIPT
|
||||
|
||||
/* Processed by ecpg (4.2.1) */
|
||||
/* These include files are added by the preprocessor */
|
||||
#include <ecpgtype.h>
|
||||
|
@@ -1,3 +1,6 @@
|
||||
|
||||
THE PORT NUMBER MIGHT HAVE BEEN CHANGED BY THE REGRESSION SCRIPT
|
||||
|
||||
[NO_PID]: ECPGdebug: set to 1
|
||||
[NO_PID]: sqlca: code: 0, state: 00000
|
||||
[NO_PID]: ECPGconnect: opening database connectdb on <DEFAULT> port <DEFAULT>
|
||||
|
@@ -0,0 +1,3 @@
|
||||
|
||||
THE PORT NUMBER MIGHT HAVE BEEN CHANGED BY THE REGRESSION SCRIPT
|
||||
|
||||
|
@@ -17,7 +17,16 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
/* do not include regression.h */
|
||||
|
||||
#line 1 "./../regression.h"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#line 11 "test2.pgc"
|
||||
|
||||
|
||||
int
|
||||
main(void)
|
||||
@@ -41,7 +50,7 @@ main(void)
|
||||
{ ECPGconnect(__LINE__, 0, "connectdb" , NULL,NULL , id, 0); }
|
||||
#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"
|
||||
|
||||
|
||||
|
@@ -2,7 +2,7 @@
|
||||
[NO_PID]: sqlca: code: 0, state: 00000
|
||||
[NO_PID]: ECPGconnect: opening database connectdb on <DEFAULT> port <DEFAULT>
|
||||
[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]: ECPGexecute line 28: QUERY: select current_database () on connection second
|
||||
[NO_PID]: sqlca: code: 0, state: 00000
|
||||
|
@@ -16,7 +16,16 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
/* do not include regression.h */
|
||||
|
||||
#line 1 "./../regression.h"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#line 10 "test3.pgc"
|
||||
|
||||
|
||||
int
|
||||
main(void)
|
||||
@@ -40,7 +49,7 @@ main(void)
|
||||
{ ECPGconnect(__LINE__, 0, "connectdb" , NULL,NULL , id, 0); }
|
||||
#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"
|
||||
|
||||
|
||||
@@ -61,7 +70,7 @@ main(void)
|
||||
#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"
|
||||
|
||||
/* will close "second" */
|
||||
@@ -69,7 +78,7 @@ main(void)
|
||||
#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"
|
||||
|
||||
{ ECPGdisconnect(__LINE__, "ALL");}
|
||||
|
@@ -2,7 +2,7 @@
|
||||
[NO_PID]: sqlca: code: 0, state: 00000
|
||||
[NO_PID]: ECPGconnect: opening database connectdb on <DEFAULT> port <DEFAULT>
|
||||
[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]: ECPGexecute line 27: QUERY: select current_database () on connection second
|
||||
[NO_PID]: sqlca: code: 0, state: 00000
|
||||
@@ -18,7 +18,7 @@
|
||||
[NO_PID]: sqlca: code: 0, state: 00000
|
||||
[NO_PID]: ECPGget_data line 31: RESULT: connectdb offset: 200 array: Yes
|
||||
[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]: raising sqlcode -220 in line 35, 'No such connection DEFAULT in line 35.'.
|
||||
[NO_PID]: sqlca: code: -220, state: 08003
|
||||
|
@@ -1,296 +0,0 @@
|
||||
/* 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;
|
||||
}
|
@@ -1,33 +0,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.
|
@@ -1,7 +0,0 @@
|
||||
sqlca.sqlwarn: W2
|
||||
49 0:
|
||||
52 0:
|
||||
62 -400:'Cursor >>x<< existiert bereits' in line 61.
|
||||
65 -400:'aktuelle Transaktion wurde abgebrochen, Befehle werden bis zum Ende
|
||||
68 -400:'aktuelle Transaktion wurde abgebrochen, Befehle werden bis zum Ende
|
||||
74 -400:'aktuelle Transaktion wurde abgebrochen, Befehle werden bis zum Ende
|
@@ -180,7 +180,7 @@ int main(int argc,char **argv)
|
||||
bool BOOLVAR ;
|
||||
|
||||
#line 24 "dyntest.pgc"
|
||||
int TYPE , LENGTH , OCTET_LENGTH , PRECISION , SCALE , NULLABLE , RETURNED_OCTET_LENGTH ;
|
||||
int TYPE , LENGTH , OCTET_LENGTH , PRECISION , SCALE , RETURNED_OCTET_LENGTH ;
|
||||
|
||||
#line 25 "dyntest.pgc"
|
||||
int DATETIME_INTERVAL_CODE ;
|
||||
@@ -270,10 +270,9 @@ if (sqlca.sqlcode < 0) error ( );}
|
||||
printf("%d Columns\n",COUNT);
|
||||
for (INDEX=1;INDEX<=COUNT;++INDEX)
|
||||
{
|
||||
{ ECPGget_desc(__LINE__, "MYDESC", INDEX,ECPGd_ret_octet,
|
||||
/* :NULLABLE=nullable, */{ ECPGget_desc(__LINE__, "MYDESC", INDEX,ECPGd_ret_octet,
|
||||
ECPGt_int,&(RETURNED_OCTET_LENGTH),(long)1,(long)1,sizeof(int), ECPGd_name,
|
||||
ECPGt_char,(NAME),(long)120,(long)1,(120)*sizeof(char), ECPGd_nullable,
|
||||
ECPGt_int,&(NULLABLE),(long)1,(long)1,sizeof(int), ECPGd_scale,
|
||||
ECPGt_char,(NAME),(long)120,(long)1,(120)*sizeof(char), ECPGd_scale,
|
||||
ECPGt_int,&(SCALE),(long)1,(long)1,sizeof(int), ECPGd_precision,
|
||||
ECPGt_int,&(PRECISION),(long)1,(long)1,sizeof(int), ECPGd_octet,
|
||||
ECPGt_int,&(OCTET_LENGTH),(long)1,(long)1,sizeof(int), ECPGd_length,
|
||||
@@ -350,7 +349,7 @@ if (sqlca.sqlcode < 0) error ( );}
|
||||
break;
|
||||
}
|
||||
/* nullable is not yet implemented in ecpg */
|
||||
if (!NULLABLE) printf("not null ");
|
||||
/* if (!NULLABLE) printf("not null "); */
|
||||
if (OCTET_LENGTH>0) printf("[%d bytes]",OCTET_LENGTH);
|
||||
putchar('\n');
|
||||
}
|
||||
|
@@ -177,7 +177,7 @@ int main(int argc,char **argv)
|
||||
int INDICATOR ;
|
||||
|
||||
#line 24 "dyntest2.pgc"
|
||||
int TYPE , LENGTH , OCTET_LENGTH , PRECISION , SCALE , NULLABLE , RETURNED_OCTET_LENGTH ;
|
||||
int TYPE , LENGTH , OCTET_LENGTH , PRECISION , SCALE , RETURNED_OCTET_LENGTH ;
|
||||
|
||||
#line 25 "dyntest2.pgc"
|
||||
int DATETIME_INTERVAL_CODE ;
|
||||
@@ -207,7 +207,7 @@ int main(int argc,char **argv)
|
||||
|
||||
ECPGdebug(1, stderr);
|
||||
|
||||
QUERY="select rulename, ev_class, ev_attr, ev_type, is_instead, ev_qual from pg_rewrite";
|
||||
QUERY="select rulename, ev_class, ev_attr, ev_type, is_instead, ev_qual from pg_rewrite order by rulename limit 2";
|
||||
|
||||
/* exec sql whenever sqlerror do error ( ) ; */
|
||||
#line 40 "dyntest2.pgc"
|
||||
@@ -274,10 +274,9 @@ if (sqlca.sqlcode < 0) error ( );}
|
||||
|
||||
for (INDEX=1;INDEX<=COUNT;++INDEX)
|
||||
{
|
||||
{ ECPGget_desc(__LINE__, "MYDESC", INDEX,ECPGd_indicator,
|
||||
/* :NULLABLE=nullable, */{ ECPGget_desc(__LINE__, "MYDESC", INDEX,ECPGd_indicator,
|
||||
ECPGt_int,&(INDICATOR),(long)1,(long)1,sizeof(int), ECPGd_name,
|
||||
ECPGt_char,(NAME),(long)120,(long)1,(120)*sizeof(char), ECPGd_nullable,
|
||||
ECPGt_int,&(NULLABLE),(long)1,(long)1,sizeof(int), ECPGd_scale,
|
||||
ECPGt_char,(NAME),(long)120,(long)1,(120)*sizeof(char), ECPGd_scale,
|
||||
ECPGt_int,&(SCALE),(long)1,(long)1,sizeof(int), ECPGd_precision,
|
||||
ECPGt_int,&(PRECISION),(long)1,(long)1,sizeof(int), ECPGd_ret_octet,
|
||||
ECPGt_int,&(RETURNED_OCTET_LENGTH),(long)1,(long)1,sizeof(int), ECPGd_octet,
|
||||
@@ -291,9 +290,9 @@ if (sqlca.sqlcode < 0) error ( );}
|
||||
#line 72 "dyntest2.pgc"
|
||||
|
||||
printf("%2d\t%s (type: %d length: %d precision: %d scale: %d\n"
|
||||
"\toctet_length: %d returned_octet_length: %d nullable: %d)\n\t= "
|
||||
"\toctet_length: %d returned_octet_length: %d)\n\t= "
|
||||
,INDEX,NAME,TYPE,LENGTH,PRECISION,SCALE
|
||||
,OCTET_LENGTH,RETURNED_OCTET_LENGTH,NULLABLE);
|
||||
,OCTET_LENGTH,RETURNED_OCTET_LENGTH /* ,NULLABLE */);
|
||||
if (INDICATOR==-1) printf("NULL\n");
|
||||
else switch (TYPE)
|
||||
{
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,5 @@
|
||||
#! /bin/sh
|
||||
# $PostgreSQL: pgsql/src/interfaces/ecpg/test/pg_regress.sh,v 1.3 2006/08/03 14:50:11 meskes Exp $
|
||||
# $PostgreSQL: pgsql/src/interfaces/ecpg/test/pg_regress.sh,v 1.4 2006/08/04 08:52:17 meskes Exp $
|
||||
|
||||
me=`basename $0`
|
||||
|
||||
@@ -86,6 +86,9 @@ export ECPG_DONT_LOG_PID=1
|
||||
export PGPORT=$temp_port
|
||||
export LD_LIBRARY_PATH=$libdir
|
||||
|
||||
DIFFFLAGS="$DIFFFLAGS -C3"
|
||||
FAILNUM=0
|
||||
|
||||
for i in \
|
||||
connect/*.pgc \
|
||||
compat_informix/*.pgc \
|
||||
@@ -98,31 +101,58 @@ for i in \
|
||||
formatted=`echo $i | awk '{printf "%-38.38s", $1;}'`
|
||||
$ECHO_N "testing $formatted ... $ECHO_C"
|
||||
|
||||
# connect/test1.pgc uses tcp to connect to the server. We run this test
|
||||
# only if called with --listen-on-tcp
|
||||
if [ $listen_on_tcp = no ] && [ "$i" = "connect/test1.pgc" ]; then
|
||||
echo skipped
|
||||
continue;
|
||||
fi
|
||||
|
||||
runprg=${i%.pgc}
|
||||
outprg=`echo $runprg | sed -e's/\//-/'`
|
||||
outfile_stderr=$outputdir/$outprg.stderr
|
||||
outfile_stdout=$outputdir/$outprg.stdout
|
||||
cp $runprg.c "$outputdir/$outprg.c"
|
||||
outfile_stderr="$outputdir/$outprg.stderr"
|
||||
outfile_stdout="$outputdir/$outprg.stdout"
|
||||
outfile_source="$outputdir/$outprg.c"
|
||||
cp $runprg.c "$outfile_source"
|
||||
# echo "$runprg > $outfile_stdout 2> $outfile_stderr"
|
||||
$runprg > "$outfile_stdout" 2> "$outfile_stderr"
|
||||
|
||||
# If we don't run on the default port we'll get different output
|
||||
# so tweak output files and replace the port number (we put a warning
|
||||
# but the price to pay is that we have to tweak the files every time
|
||||
# now not only if the port differs from the standard port).
|
||||
if [ "$i" = "connect/test1.pgc" ]; then
|
||||
# can we use sed -i on all platforms?
|
||||
for f in "$outfile_stderr" "$outfile_stdout" "$outfile_source"; do
|
||||
mv $f $f.tmp
|
||||
echo >> $f
|
||||
echo "THE PORT NUMBER MIGHT HAVE BEEN CHANGED BY THE REGRESSION SCRIPT" >> $f
|
||||
echo >> $f
|
||||
cat $f.tmp | sed -e s,$PGPORT,55432,g >> $f
|
||||
rm $f.tmp
|
||||
done
|
||||
fi
|
||||
|
||||
DIFFER=""
|
||||
diff -C3 expected/$outprg.stderr "$outputdir"/$outprg.stderr >/dev/null 2>&1 || DIFFER="$DIFFER, log"
|
||||
diff -C3 expected/$outprg.stdout "$outputdir"/$outprg.stdout >/dev/null 2>&1 || DIFFER="$DIFFER, output"
|
||||
diff -C3 expected/$outprg.c "$outputdir"/$outprg.c >/dev/null 2>&1 || DIFFER="$DIFFER, source"
|
||||
diff $DIFFFLAGS expected/$outprg.stderr "$outfile_stderr" >> regression.diff 2>&1 || DIFFER="$DIFFER, log"
|
||||
diff $DIFFFLAGS expected/$outprg.stdout "$outfile_stdout" >> regression.diff 2>&1 || DIFFER="$DIFFER, output"
|
||||
diff $DIFFFLAGS expected/$outprg.c "$outputdir"/$outprg.c >> regression.diff 2>&1 || DIFFER="$DIFFER, source"
|
||||
|
||||
DIFFER=${DIFFER#, }
|
||||
if [ "x$DIFFER" = "x" ]; then
|
||||
echo ok
|
||||
else
|
||||
echo "FAILED ($DIFFER)"
|
||||
FAILNUM=$((FAILNUM+1))
|
||||
fi
|
||||
done
|
||||
|
||||
diff -C3 -r expected/ $outputdir > regression.diff && rm regression.diff
|
||||
|
||||
[ $? -ne 0 ] && exit
|
||||
if [ $FAILNUM -eq 0 ]; then
|
||||
rm regression.diff
|
||||
fi
|
||||
|
||||
postmaster_shutdown
|
||||
evaluate
|
||||
|
||||
(exit $result); exit
|
||||
[ $FAILNUM -eq 0 ] && exit
|
||||
[ $FAILNUM -ne 0 ] && (exit 1); exit
|
||||
|
||||
|
@@ -21,7 +21,7 @@ int main(int argc,char **argv)
|
||||
int INDEX;
|
||||
int INDICATOR;
|
||||
bool BOOLVAR;
|
||||
int TYPE,LENGTH,OCTET_LENGTH,PRECISION,SCALE,NULLABLE,RETURNED_OCTET_LENGTH;
|
||||
int TYPE,LENGTH,OCTET_LENGTH,PRECISION,SCALE,RETURNED_OCTET_LENGTH;
|
||||
int DATETIME_INTERVAL_CODE;
|
||||
char NAME[120];
|
||||
char STRINGVAR[1024];
|
||||
@@ -62,7 +62,7 @@ int main(int argc,char **argv)
|
||||
:TYPE = type,
|
||||
:LENGTH = length, :OCTET_LENGTH=octet_length,
|
||||
:PRECISION = precision, :SCALE=scale,
|
||||
:NULLABLE=nullable, :NAME=name,
|
||||
/* :NULLABLE=nullable, */ :NAME=name,
|
||||
:RETURNED_OCTET_LENGTH=returned_octet_length;
|
||||
printf("%s ",NAME);
|
||||
switch (TYPE)
|
||||
@@ -123,7 +123,7 @@ int main(int argc,char **argv)
|
||||
break;
|
||||
}
|
||||
/* nullable is not yet implemented in ecpg */
|
||||
if (!NULLABLE) printf("not null ");
|
||||
/* if (!NULLABLE) printf("not null "); */
|
||||
if (OCTET_LENGTH>0) printf("[%d bytes]",OCTET_LENGTH);
|
||||
putchar('\n');
|
||||
}
|
||||
|
@@ -21,7 +21,7 @@ exec sql begin declare section;
|
||||
int INTVAR, BOOLVAR;
|
||||
int INDEX;
|
||||
int INDICATOR;
|
||||
int TYPE,LENGTH,OCTET_LENGTH,PRECISION,SCALE,NULLABLE,RETURNED_OCTET_LENGTH;
|
||||
int TYPE,LENGTH,OCTET_LENGTH,PRECISION,SCALE,RETURNED_OCTET_LENGTH;
|
||||
int DATETIME_INTERVAL_CODE;
|
||||
char NAME[120];
|
||||
char STRINGVAR[1024];
|
||||
@@ -35,7 +35,7 @@ exec sql end declare section;
|
||||
|
||||
ECPGdebug(1, stderr);
|
||||
|
||||
QUERY="select rulename, ev_class, ev_attr, ev_type, is_instead, ev_qual from pg_rewrite";
|
||||
QUERY="select rulename, ev_class, ev_attr, ev_type, is_instead, ev_qual from pg_rewrite order by rulename limit 2";
|
||||
|
||||
exec sql whenever sqlerror do error();
|
||||
|
||||
@@ -68,12 +68,12 @@ exec sql end declare section;
|
||||
:LENGTH = length, :OCTET_LENGTH=octet_length,
|
||||
:RETURNED_OCTET_LENGTH=returned_octet_length,
|
||||
:PRECISION = precision, :SCALE=scale,
|
||||
:NULLABLE=nullable, :NAME=name,
|
||||
/* :NULLABLE=nullable, */ :NAME=name,
|
||||
:INDICATOR=indicator;
|
||||
printf("%2d\t%s (type: %d length: %d precision: %d scale: %d\n"
|
||||
"\toctet_length: %d returned_octet_length: %d nullable: %d)\n\t= "
|
||||
"\toctet_length: %d returned_octet_length: %d)\n\t= "
|
||||
,INDEX,NAME,TYPE,LENGTH,PRECISION,SCALE
|
||||
,OCTET_LENGTH,RETURNED_OCTET_LENGTH,NULLABLE);
|
||||
,OCTET_LENGTH,RETURNED_OCTET_LENGTH /* ,NULLABLE */);
|
||||
if (INDICATOR==-1) printf("NULL\n");
|
||||
else switch (TYPE)
|
||||
{
|
||||
|
Reference in New Issue
Block a user