Commit 5b88b85c authored by Michael Meskes's avatar Michael Meskes

Applied Joachim's patch for a --regression option.

Made this option mark the .c files, so the environment variable is no longer needed.
Created a special MinGW file with the special error message.
Do not print port into log file when running regression tests.
parent c0c00ac3
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/connect.c,v 1.37 2006/11/08 10:46:47 meskes Exp $ */ /* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/connect.c,v 1.38 2007/01/11 15:47:33 meskes Exp $ */
#define POSTGRES_ECPG_INTERNAL #define POSTGRES_ECPG_INTERNAL
#include "postgres_fe.h" #include "postgres_fe.h"
...@@ -19,6 +19,7 @@ static pthread_once_t actual_connection_key_once = PTHREAD_ONCE_INIT; ...@@ -19,6 +19,7 @@ static pthread_once_t actual_connection_key_once = PTHREAD_ONCE_INIT;
#endif #endif
static struct connection *actual_connection = NULL; static struct connection *actual_connection = NULL;
static struct connection *all_connections = NULL; static struct connection *all_connections = NULL;
extern int ecpg_internal_regression_mode;
#ifdef ENABLE_THREAD_SAFETY #ifdef ENABLE_THREAD_SAFETY
static void static void
...@@ -464,7 +465,7 @@ ECPGconnect(int lineno, int c, const char *name, const char *user, const char *p ...@@ -464,7 +465,7 @@ ECPGconnect(int lineno, int c, const char *name, const char *user, const char *p
ECPGlog("ECPGconnect: opening database %s on %s port %s %s%s%s%s\n", ECPGlog("ECPGconnect: opening database %s on %s port %s %s%s%s%s\n",
realname ? realname : "<DEFAULT>", realname ? realname : "<DEFAULT>",
host ? host : "<DEFAULT>", host ? host : "<DEFAULT>",
port ? port : "<DEFAULT>", port ? (ecpg_internal_regression_mode ? "<REGRESSION_PORT>" : port) : "<DEFAULT>",
options ? "with options " : "", options ? options : "", options ? "with options " : "", options ? options : "",
user ? "for user " : "", user ? user : ""); user ? "for user " : "", user ? user : "");
...@@ -478,7 +479,7 @@ ECPGconnect(int lineno, int c, const char *name, const char *user, const char *p ...@@ -478,7 +479,7 @@ ECPGconnect(int lineno, int c, const char *name, const char *user, const char *p
ECPGlog("connect: could not open database %s on %s port %s %s%s%s%s in line %d\n\t%s\n", ECPGlog("connect: could not open database %s on %s port %s %s%s%s%s in line %d\n\t%s\n",
db, db,
host ? host : "<DEFAULT>", host ? host : "<DEFAULT>",
port ? port : "<DEFAULT>", port ? (ecpg_internal_regression_mode ? "<REGRESSION_PORT>" : port) : "<DEFAULT>",
options ? "with options " : "", options ? options : "", options ? "with options " : "", options ? options : "",
user ? "for user " : "", user ? user : "", user ? "for user " : "", user ? user : "",
lineno, errmsg); lineno, errmsg);
......
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/data.c,v 1.35 2006/10/04 00:30:11 momjian Exp $ */ /* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/data.c,v 1.36 2007/01/11 15:47:33 meskes Exp $ */
#define POSTGRES_ECPG_INTERNAL #define POSTGRES_ECPG_INTERNAL
#include "postgres_fe.h" #include "postgres_fe.h"
...@@ -16,10 +16,7 @@ ...@@ -16,10 +16,7 @@
#include "pgtypes_timestamp.h" #include "pgtypes_timestamp.h"
#include "pgtypes_interval.h" #include "pgtypes_interval.h"
static enum extern int ecpg_internal_regression_mode;
{
NOT_CHECKED, REGRESS, NORMAL
} ECPG_regression_mode = NOT_CHECKED;
static bool static bool
garbage_left(enum ARRAY_TYPE isarray, char *scan_length, enum COMPAT_MODE compat) garbage_left(enum ARRAY_TYPE isarray, char *scan_length, enum COMPAT_MODE compat)
...@@ -56,24 +53,11 @@ ECPGget_data(const PGresult *results, int act_tuple, int act_field, int lineno, ...@@ -56,24 +53,11 @@ ECPGget_data(const PGresult *results, int act_tuple, int act_field, int lineno,
int value_for_indicator = 0; int value_for_indicator = 0;
long log_offset; long log_offset;
/*
* use a global variable to see if the environment variable
* ECPG_REGRESSION is set or not. Remember the state in order to avoid
* subsequent calls to getenv() for this purpose.
*/
if (ECPG_regression_mode == NOT_CHECKED)
{
if (getenv("ECPG_REGRESSION"))
ECPG_regression_mode = REGRESS;
else
ECPG_regression_mode = NORMAL;
}
/* /*
* If we are running in a regression test, do not log the offset variable, * If we are running in a regression test, do not log the offset variable,
* it depends on the machine's alignment. * it depends on the machine's alignment.
*/ */
if (ECPG_regression_mode == REGRESS) if (ecpg_internal_regression_mode)
log_offset = -1; log_offset = -1;
else else
log_offset = offset; log_offset = offset;
......
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/misc.c,v 1.32 2006/10/04 00:30:11 momjian Exp $ */ /* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/misc.c,v 1.33 2007/01/11 15:47:33 meskes Exp $ */
#define POSTGRES_ECPG_INTERNAL #define POSTGRES_ECPG_INTERNAL
#include "postgres_fe.h" #include "postgres_fe.h"
...@@ -28,6 +28,8 @@ ...@@ -28,6 +28,8 @@
#endif #endif
#endif #endif
extern int ecpg_internal_regression_mode;
static struct sqlca_t sqlca_init = static struct sqlca_t sqlca_init =
{ {
{ {
...@@ -262,7 +264,7 @@ ECPGlog(const char *format,...) ...@@ -262,7 +264,7 @@ ECPGlog(const char *format,...)
* regression tests set this environment variable to get the same * regression tests set this environment variable to get the same
* output for every run. * output for every run.
*/ */
if (getenv("ECPG_REGRESSION")) if (ecpg_internal_regression_mode)
snprintf(f, bufsize, "[NO_PID]: %s", format); snprintf(f, bufsize, "[NO_PID]: %s", format);
else else
snprintf(f, bufsize, "[%d]: %s", (int) getpid(), format); snprintf(f, bufsize, "[%d]: %s", (int) getpid(), format);
...@@ -272,7 +274,7 @@ ECPGlog(const char *format,...) ...@@ -272,7 +274,7 @@ ECPGlog(const char *format,...)
va_end(ap); va_end(ap);
/* dump out internal sqlca variables */ /* dump out internal sqlca variables */
if (getenv("ECPG_REGRESSION")) if (ecpg_internal_regression_mode)
fprintf(debugstream, "[NO_PID]: sqlca: code: %ld, state: %s\n", fprintf(debugstream, "[NO_PID]: sqlca: code: %ld, state: %s\n",
sqlca->sqlcode, sqlca->sqlstate); sqlca->sqlcode, sqlca->sqlstate);
......
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg.c,v 1.94 2006/02/08 09:10:04 meskes Exp $ */ /* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg.c,v 1.95 2007/01/11 15:47:33 meskes Exp $ */
/* New main for ecpg, the PostgreSQL embedded SQL precompiler. */ /* New main for ecpg, the PostgreSQL embedded SQL precompiler. */
/* (C) Michael Meskes <meskes@postgresql.org> Feb 5th, 1998 */ /* (C) Michael Meskes <meskes@postgresql.org> Feb 5th, 1998 */
...@@ -8,12 +8,7 @@ ...@@ -8,12 +8,7 @@
#include <unistd.h> #include <unistd.h>
#include <string.h> #include <string.h>
#ifdef HAVE_GETOPT_H #include "getopt_long.h"
#include <getopt.h>
#endif
extern int optind;
extern char *optarg;
#include "extern.h" #include "extern.h"
...@@ -22,7 +17,8 @@ int ret_value = 0, ...@@ -22,7 +17,8 @@ int ret_value = 0,
auto_create_c = false, auto_create_c = false,
system_includes = false, system_includes = false,
force_indicator = true, force_indicator = true,
header_mode = false; header_mode = false,
regression_mode = false;
enum COMPAT_MODE compat = ECPG_COMPAT_PGSQL; enum COMPAT_MODE compat = ECPG_COMPAT_PGSQL;
...@@ -56,6 +52,7 @@ help(const char *progname) ...@@ -56,6 +52,7 @@ help(const char *progname)
" OPTION may only be \"no_indicator\"\n"); " OPTION may only be \"no_indicator\"\n");
printf(" -t turn on autocommit of transactions\n"); printf(" -t turn on autocommit of transactions\n");
printf(" --help show this help, then exit\n"); printf(" --help show this help, then exit\n");
printf(" --regression run in regression testing mode\n");
printf(" --version output version information, then exit\n"); printf(" --version output version information, then exit\n");
printf("\nIf no output file is specified, the name is formed by adding .c to the\n" printf("\nIf no output file is specified, the name is formed by adding .c to the\n"
"input file name, after stripping off .pgc if present.\n"); "input file name, after stripping off .pgc if present.\n");
...@@ -112,9 +109,19 @@ add_preprocessor_define(char *define) ...@@ -112,9 +109,19 @@ add_preprocessor_define(char *define)
defines->next = pd; defines->next = pd;
} }
#define ECPG_GETOPT_LONG_HELP 1
#define ECPG_GETOPT_LONG_VERSION 2
#define ECPG_GETOPT_LONG_REGRESSION 3
int int
main(int argc, char *const argv[]) main(int argc, char *const argv[])
{ {
static struct option ecpg_options[] = {
{"help", no_argument, NULL, ECPG_GETOPT_LONG_HELP},
{"version", no_argument, NULL, ECPG_GETOPT_LONG_VERSION},
{"regression", no_argument, NULL, ECPG_GETOPT_LONG_REGRESSION},
{ NULL, 0, NULL, 0}
};
int fnr, int fnr,
c, c,
verbose = false, verbose = false,
...@@ -126,27 +133,35 @@ main(int argc, char *const argv[]) ...@@ -126,27 +133,35 @@ main(int argc, char *const argv[])
progname = get_progname(argv[0]); progname = get_progname(argv[0]);
if (argc > 1)
{
if (strcmp(argv[1], "--help") == 0 || strcmp(argv[1], "-?") == 0)
{
help(progname);
exit(0);
}
else if (strcmp(argv[1], "--version") == 0)
{
printf("ecpg (PostgreSQL %s) %d.%d.%d\n", PG_VERSION,
MAJOR_VERSION, MINOR_VERSION, PATCHLEVEL);
exit(0);
}
}
find_my_exec(argv[0], my_exec_path); find_my_exec(argv[0], my_exec_path);
while ((c = getopt(argc, argv, "vcio:I:tD:dC:r:h")) != -1) while ((c = getopt_long(argc, argv, "vcio:I:tD:dC:r:h?", ecpg_options, NULL)) != -1)
{ {
switch (c) switch (c)
{ {
case ECPG_GETOPT_LONG_VERSION:
printf("ecpg (PostgreSQL %s) %d.%d.%d\n", PG_VERSION,
MAJOR_VERSION, MINOR_VERSION, PATCHLEVEL);
exit(0);
case ECPG_GETOPT_LONG_HELP:
help(progname);
exit(0);
/*
* -? is an alternative spelling of --help. However it is also
* returned by getopt_long for unknown options. We can distinguish
* both cases by means of the optopt variable which is set to 0 if
* it was really -? and not an unknown option character.
*/
case '?':
if (optopt == 0)
{
help(progname);
exit(0);
}
break;
case ECPG_GETOPT_LONG_REGRESSION:
regression_mode = true;
break;
case 'o': case 'o':
if (strcmp(optarg, "-") == 0) if (strcmp(optarg, "-") == 0)
yyout = stdout; yyout = stdout;
...@@ -405,8 +420,12 @@ main(int argc, char *const argv[]) ...@@ -405,8 +420,12 @@ main(int argc, char *const argv[])
/* we need several includes */ /* we need several includes */
/* but not if we are in header mode */ /* but not if we are in header mode */
fprintf(yyout, "/* Processed by ecpg (%d.%d.%d) */\n", MAJOR_VERSION, MINOR_VERSION, PATCHLEVEL); if (regression_mode)
fprintf(yyout, "/* Processed by ecpg (regression mode) */\n");
else
fprintf(yyout, "/* Processed by ecpg (%d.%d.%d) */\n", MAJOR_VERSION, MINOR_VERSION, PATCHLEVEL);
fprintf(yyout, "int ecpg_internal_regression_mode = %d;\n", regression_mode);
if (header_mode == false) if (header_mode == false)
{ {
fprintf(yyout, "/* These include files are added by the preprocessor */\n#include <ecpgtype.h>\n#include <ecpglib.h>\n#include <ecpgerrno.h>\n#include <sqlca.h>\n"); fprintf(yyout, "/* These include files are added by the preprocessor */\n#include <ecpgtype.h>\n#include <ecpglib.h>\n#include <ecpgerrno.h>\n#include <sqlca.h>\n");
......
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/extern.h,v 1.63 2006/03/11 04:38:40 momjian Exp $ */ /* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/extern.h,v 1.64 2007/01/11 15:47:33 meskes Exp $ */
#ifndef _ECPG_PREPROC_EXTERN_H #ifndef _ECPG_PREPROC_EXTERN_H
#define _ECPG_PREPROC_EXTERN_H #define _ECPG_PREPROC_EXTERN_H
...@@ -21,7 +21,8 @@ extern int braces_open, ...@@ -21,7 +21,8 @@ extern int braces_open,
force_indicator, force_indicator,
ret_value, ret_value,
struct_level, struct_level,
ecpg_informix_var; ecpg_informix_var,
regression_mode;
extern char *descriptor_index; extern char *descriptor_index;
extern char *descriptor_name; extern char *descriptor_name;
extern char *connection; extern char *connection;
......
...@@ -5,7 +5,7 @@ override CFLAGS += $(PTHREAD_CFLAGS) ...@@ -5,7 +5,7 @@ override CFLAGS += $(PTHREAD_CFLAGS)
override LDFLAGS := -L../../ecpglib -L../../pgtypeslib $(LDFLAGS) override LDFLAGS := -L../../ecpglib -L../../pgtypeslib $(LDFLAGS)
override LIBS := -lecpg -lpgtypes $(libpq) $(LIBS) $(PTHREAD_LIBS) override LIBS := -lecpg -lpgtypes $(libpq) $(LIBS) $(PTHREAD_LIBS)
ECPG = ../../preproc/ecpg -I$(srcdir)/../../include ECPG = ../../preproc/ecpg --regression -I$(srcdir)/../../include
%: %.c %: %.c
$(CC) $(CPPFLAGS) $(CFLAGS) $^ $(LDFLAGS) $(LIBS) -o $@ $(CC) $(CPPFLAGS) $(CFLAGS) $^ $(LDFLAGS) $(LIBS) -o $@
......
/* Processed by ecpg (4.3.1) */ /* Processed by ecpg (regression mode) */
int ecpg_internal_regression_mode = 1;
/* These include files are added by the preprocessor */ /* These include files are added by the preprocessor */
#include <ecpgtype.h> #include <ecpgtype.h>
#include <ecpglib.h> #include <ecpglib.h>
......
/* Processed by ecpg (4.3.1) */ /* Processed by ecpg (regression mode) */
int ecpg_internal_regression_mode = 1;
/* These include files are added by the preprocessor */ /* These include files are added by the preprocessor */
#include <ecpgtype.h> #include <ecpgtype.h>
#include <ecpglib.h> #include <ecpglib.h>
......
/* Processed by ecpg (4.3.1) */ /* Processed by ecpg (regression mode) */
int ecpg_internal_regression_mode = 1;
/* These include files are added by the preprocessor */ /* These include files are added by the preprocessor */
#include <ecpgtype.h> #include <ecpgtype.h>
#include <ecpglib.h> #include <ecpglib.h>
......
/* Processed by ecpg (4.3.1) */ /* Processed by ecpg (regression mode) */
int ecpg_internal_regression_mode = 1;
/* These include files are added by the preprocessor */ /* These include files are added by the preprocessor */
#include <ecpgtype.h> #include <ecpgtype.h>
#include <ecpglib.h> #include <ecpglib.h>
......
/* Processed by ecpg (4.3.1) */ /* Processed by ecpg (regression mode) */
int ecpg_internal_regression_mode = 1;
/* These include files are added by the preprocessor */ /* These include files are added by the preprocessor */
#include <ecpgtype.h> #include <ecpgtype.h>
#include <ecpglib.h> #include <ecpglib.h>
......
/* Processed by ecpg (4.3.1) */ /* Processed by ecpg (regression mode) */
int ecpg_internal_regression_mode = 1;
/* These include files are added by the preprocessor */ /* These include files are added by the preprocessor */
#include <ecpgtype.h> #include <ecpgtype.h>
#include <ecpglib.h> #include <ecpglib.h>
......
/* Processed by ecpg (4.3.1) */ /* Processed by ecpg (regression mode) */
int ecpg_internal_regression_mode = 1;
/* These include files are added by the preprocessor */ /* These include files are added by the preprocessor */
#include <ecpgtype.h> #include <ecpgtype.h>
#include <ecpglib.h> #include <ecpglib.h>
......
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>
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 23: QUERY: alter user connectuser encrypted password 'connectpw' on connection main
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 23 Ok: ALTER ROLE
[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 <DEFAULT>
[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 <DEFAULT> on localhost port <DEFAULT> 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 55432
[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 <DEFAULT> on localhost port 55432 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 <DEFAULT> port 55432
[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 <DEFAULT> on <DEFAULT> port 55432 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 55432 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 55432 for user connectdb
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_finish: Connection closed.
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGconnect: opening database connectdb on localhost port 55432 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 <DEFAULT> port 55432 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 <DEFAULT> port 55432 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 55432 for user connectuser
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: connect: could not open database nonexistant on localhost port 55432 for user connectuser in line 62
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 in line 62, 'Could not connect to database nonexistant in line 62.'.
[NO_PID]: sqlca: code: -402, state: 08001
[NO_PID]: raising sqlcode -220 in line 63, 'No such connection CURRENT in line 63.'.
[NO_PID]: sqlca: code: -220, state: 08003
[NO_PID]: ECPGconnect: opening database connectdb on localhost port 20 for user connectuser
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: connect: could not open database connectdb on localhost port 20 for user connectuser in line 66
could not connect to server: Connection refused (0x0000274D/10061)
Is the server running on host "localhost" and accepting
TCP/IP connections on port 20?
[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 in line 66, 'Could not connect to database connectdb in line 66.'.
[NO_PID]: sqlca: code: -402, state: 08001
[NO_PID]: ECPGconnect: opening database connectdb on <DEFAULT> port 55432 for user connectuser
[NO_PID]: sqlca: code: 0, state: 00000
/* Processed by ecpg (regression mode) */
THE PORT NUMBER MIGHT HAVE BEEN CHANGED BY THE REGRESSION SCRIPT int ecpg_internal_regression_mode = 1;
/* Processed by ecpg (4.3.1) */
/* These include files are added by the preprocessor */ /* These include files are added by the preprocessor */
#include <ecpgtype.h> #include <ecpgtype.h>
#include <ecpglib.h> #include <ecpglib.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>
...@@ -19,45 +16,45 @@ THE PORT NUMBER MIGHT HAVE BEEN CHANGED BY THE REGRESSION SCRIPT ...@@ -19,45 +16,45 @@ THE PORT NUMBER MIGHT HAVE BEEN CHANGED BY THE REGRESSION SCRIPT
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_finish: Connection main closed. [NO_PID]: ecpg_finish: Connection main closed.
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGconnect: opening database connectdb on localhost port 55432 [NO_PID]: ECPGconnect: opening database connectdb on localhost port <REGRESSION_PORT>
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_finish: Connection main closed. [NO_PID]: ecpg_finish: Connection main closed.
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGconnect: opening database <DEFAULT> on localhost port 55432 for user connectdb [NO_PID]: ECPGconnect: opening database <DEFAULT> on localhost port <REGRESSION_PORT> for user connectdb
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_finish: Connection main closed. [NO_PID]: ecpg_finish: Connection main closed.
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGconnect: opening database connectdb on <DEFAULT> port 55432 [NO_PID]: ECPGconnect: opening database connectdb on <DEFAULT> port <REGRESSION_PORT>
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_finish: Connection main closed. [NO_PID]: ecpg_finish: Connection main closed.
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGconnect: opening database <DEFAULT> on <DEFAULT> port 55432 for user connectdb [NO_PID]: ECPGconnect: opening database <DEFAULT> on <DEFAULT> port <REGRESSION_PORT> for user connectdb
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_finish: Connection main closed. [NO_PID]: ecpg_finish: Connection main closed.
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGconnect: opening database connectdb on localhost port 55432 for user connectuser [NO_PID]: ECPGconnect: opening database connectdb on localhost port <REGRESSION_PORT> for user connectuser
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_finish: Connection connectdb closed. [NO_PID]: ecpg_finish: Connection connectdb closed.
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGconnect: opening database on localhost port 55432 for user connectdb [NO_PID]: ECPGconnect: opening database on localhost port <REGRESSION_PORT> for user connectdb
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_finish: Connection closed. [NO_PID]: ecpg_finish: Connection closed.
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGconnect: opening database connectdb on localhost port 55432 for user connectuser [NO_PID]: ECPGconnect: opening database connectdb on localhost port <REGRESSION_PORT> for user connectuser
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_finish: Connection connectdb closed. [NO_PID]: ecpg_finish: Connection connectdb closed.
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGconnect: opening database connectdb on <DEFAULT> port 55432 for user connectuser [NO_PID]: ECPGconnect: opening database connectdb on <DEFAULT> port <REGRESSION_PORT> for user connectuser
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_finish: Connection connectdb closed. [NO_PID]: ecpg_finish: Connection connectdb closed.
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGconnect: opening database connectdb on <DEFAULT> port 55432 for user connectuser [NO_PID]: ECPGconnect: opening database connectdb on <DEFAULT> port <REGRESSION_PORT> for user connectuser
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_finish: Connection connectdb closed. [NO_PID]: ecpg_finish: Connection connectdb closed.
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGconnect: opening database nonexistant on localhost port 55432 for user connectuser [NO_PID]: ECPGconnect: opening database nonexistant on localhost port <REGRESSION_PORT> for user connectuser
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: connect: could not open database nonexistant on localhost port 55432 for user connectuser in line 62 [NO_PID]: connect: could not open database nonexistant on localhost port <REGRESSION_PORT> for user connectuser in line 62
FATAL: database "nonexistant" does not exist FATAL: database "nonexistant" does not exist
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
...@@ -67,9 +64,9 @@ THE PORT NUMBER MIGHT HAVE BEEN CHANGED BY THE REGRESSION SCRIPT ...@@ -67,9 +64,9 @@ THE PORT NUMBER MIGHT HAVE BEEN CHANGED BY THE REGRESSION SCRIPT
[NO_PID]: sqlca: code: -402, state: 08001 [NO_PID]: sqlca: code: -402, state: 08001
[NO_PID]: raising sqlcode -220 in line 63, 'No such connection CURRENT in line 63.'. [NO_PID]: raising sqlcode -220 in line 63, 'No such connection CURRENT in line 63.'.
[NO_PID]: sqlca: code: -220, state: 08003 [NO_PID]: sqlca: code: -220, state: 08003
[NO_PID]: ECPGconnect: opening database connectdb on localhost port 20 for user connectuser [NO_PID]: ECPGconnect: opening database connectdb on localhost port <REGRESSION_PORT> for user connectuser
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: connect: could not open database connectdb on localhost port 20 for user connectuser in line 66 [NO_PID]: connect: could not open database connectdb on localhost port <REGRESSION_PORT> for user connectuser in line 66
could not connect to server: Connection refused could not connect to server: Connection refused
Is the server running on host "localhost" and accepting Is the server running on host "localhost" and accepting
TCP/IP connections on port 20? TCP/IP connections on port 20?
...@@ -79,5 +76,5 @@ THE PORT NUMBER MIGHT HAVE BEEN CHANGED BY THE REGRESSION SCRIPT ...@@ -79,5 +76,5 @@ THE PORT NUMBER MIGHT HAVE BEEN CHANGED BY THE REGRESSION SCRIPT
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: raising sqlcode -402 in line 66, 'Could not connect to database connectdb in line 66.'. [NO_PID]: raising sqlcode -402 in line 66, 'Could not connect to database connectdb in line 66.'.
[NO_PID]: sqlca: code: -402, state: 08001 [NO_PID]: sqlca: code: -402, state: 08001
[NO_PID]: ECPGconnect: opening database connectdb on <DEFAULT> port 55432 for user connectuser [NO_PID]: ECPGconnect: opening database connectdb on <DEFAULT> port <REGRESSION_PORT> for user connectuser
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
THE PORT NUMBER MIGHT HAVE BEEN CHANGED BY THE REGRESSION SCRIPT
/* Processed by ecpg (4.3.1) */ /* Processed by ecpg (regression mode) */
int ecpg_internal_regression_mode = 1;
/* These include files are added by the preprocessor */ /* These include files are added by the preprocessor */
#include <ecpgtype.h> #include <ecpgtype.h>
#include <ecpglib.h> #include <ecpglib.h>
......
/* Processed by ecpg (4.3.1) */ /* Processed by ecpg (regression mode) */
int ecpg_internal_regression_mode = 1;
/* These include files are added by the preprocessor */ /* These include files are added by the preprocessor */
#include <ecpgtype.h> #include <ecpgtype.h>
#include <ecpglib.h> #include <ecpglib.h>
......
/* Processed by ecpg (4.3.1) */ /* Processed by ecpg (regression mode) */
int ecpg_internal_regression_mode = 1;
/* These include files are added by the preprocessor */ /* These include files are added by the preprocessor */
#include <ecpgtype.h> #include <ecpgtype.h>
#include <ecpglib.h> #include <ecpglib.h>
......
/* Processed by ecpg (4.3.1) */ /* Processed by ecpg (regression mode) */
int ecpg_internal_regression_mode = 1;
/* These include files are added by the preprocessor */ /* These include files are added by the preprocessor */
#include <ecpgtype.h> #include <ecpgtype.h>
#include <ecpglib.h> #include <ecpglib.h>
......
/* Processed by ecpg (4.3.1) */ /* Processed by ecpg (regression mode) */
int ecpg_internal_regression_mode = 1;
/* These include files are added by the preprocessor */ /* These include files are added by the preprocessor */
#include <ecpgtype.h> #include <ecpgtype.h>
#include <ecpglib.h> #include <ecpglib.h>
......
/* Processed by ecpg (4.3.1) */ /* Processed by ecpg (regression mode) */
int ecpg_internal_regression_mode = 1;
/* These include files are added by the preprocessor */ /* These include files are added by the preprocessor */
#include <ecpgtype.h> #include <ecpgtype.h>
#include <ecpglib.h> #include <ecpglib.h>
......
/* Processed by ecpg (4.3.1) */ /* Processed by ecpg (regression mode) */
int ecpg_internal_regression_mode = 1;
/* These include files are added by the preprocessor */ /* These include files are added by the preprocessor */
#include <ecpgtype.h> #include <ecpgtype.h>
#include <ecpglib.h> #include <ecpglib.h>
......
/* Processed by ecpg (4.3.1) */ /* Processed by ecpg (regression mode) */
int ecpg_internal_regression_mode = 1;
/* These include files are added by the preprocessor */ /* These include files are added by the preprocessor */
#include <ecpgtype.h> #include <ecpgtype.h>
#include <ecpglib.h> #include <ecpglib.h>
......
/* Processed by ecpg (4.3.1) */ /* Processed by ecpg (regression mode) */
int ecpg_internal_regression_mode = 1;
/* These include files are added by the preprocessor */ /* These include files are added by the preprocessor */
#include <ecpgtype.h> #include <ecpgtype.h>
#include <ecpglib.h> #include <ecpglib.h>
......
/* Processed by ecpg (4.3.1) */ /* Processed by ecpg (regression mode) */
int ecpg_internal_regression_mode = 1;
/* These include files are added by the preprocessor */ /* These include files are added by the preprocessor */
#include <ecpgtype.h> #include <ecpgtype.h>
#include <ecpglib.h> #include <ecpglib.h>
......
/* Processed by ecpg (4.3.1) */ /* Processed by ecpg (regression mode) */
int ecpg_internal_regression_mode = 1;
/* These include files are added by the preprocessor */ /* These include files are added by the preprocessor */
#include <ecpgtype.h> #include <ecpgtype.h>
#include <ecpglib.h> #include <ecpglib.h>
......
/* Processed by ecpg (4.3.1) */ /* Processed by ecpg (regression mode) */
int ecpg_internal_regression_mode = 1;
/* These include files are added by the preprocessor */ /* These include files are added by the preprocessor */
#include <ecpgtype.h> #include <ecpgtype.h>
#include <ecpglib.h> #include <ecpglib.h>
......
/* Processed by ecpg (4.3.1) */ /* Processed by ecpg (regression mode) */
int ecpg_internal_regression_mode = 1;
/* These include files are added by the preprocessor */ /* These include files are added by the preprocessor */
#include <ecpgtype.h> #include <ecpgtype.h>
#include <ecpglib.h> #include <ecpglib.h>
......
/* Processed by ecpg (4.3.1) */ /* Processed by ecpg (regression mode) */
int ecpg_internal_regression_mode = 1;
/* These include files are added by the preprocessor */ /* These include files are added by the preprocessor */
#include <ecpgtype.h> #include <ecpgtype.h>
#include <ecpglib.h> #include <ecpglib.h>
......
/* Processed by ecpg (4.3.1) */ /* Processed by ecpg (regression mode) */
int ecpg_internal_regression_mode = 1;
/* These include files are added by the preprocessor */ /* These include files are added by the preprocessor */
#include <ecpgtype.h> #include <ecpgtype.h>
#include <ecpglib.h> #include <ecpglib.h>
......
/* Processed by ecpg (4.3.1) */ /* Processed by ecpg (regression mode) */
int ecpg_internal_regression_mode = 1;
/* These include files are added by the preprocessor */ /* These include files are added by the preprocessor */
#include <ecpgtype.h> #include <ecpgtype.h>
#include <ecpglib.h> #include <ecpglib.h>
......
/* Processed by ecpg (4.3.1) */ /* Processed by ecpg (regression mode) */
int ecpg_internal_regression_mode = 1;
/* These include files are added by the preprocessor */ /* These include files are added by the preprocessor */
#include <ecpgtype.h> #include <ecpgtype.h>
#include <ecpglib.h> #include <ecpglib.h>
......
/* Processed by ecpg (4.3.1) */ /* Processed by ecpg (regression mode) */
int ecpg_internal_regression_mode = 1;
/* These include files are added by the preprocessor */ /* These include files are added by the preprocessor */
#include <ecpgtype.h> #include <ecpgtype.h>
#include <ecpglib.h> #include <ecpglib.h>
......
/* Processed by ecpg (4.3.1) */ /* Processed by ecpg (regression mode) */
int ecpg_internal_regression_mode = 1;
/* These include files are added by the preprocessor */ /* These include files are added by the preprocessor */
#include <ecpgtype.h> #include <ecpgtype.h>
#include <ecpglib.h> #include <ecpglib.h>
......
/* Processed by ecpg (4.3.1) */ /* Processed by ecpg (regression mode) */
int ecpg_internal_regression_mode = 1;
/* These include files are added by the preprocessor */ /* These include files are added by the preprocessor */
#include <ecpgtype.h> #include <ecpgtype.h>
#include <ecpglib.h> #include <ecpglib.h>
......
/* Processed by ecpg (4.3.1) */ /* Processed by ecpg (regression mode) */
int ecpg_internal_regression_mode = 1;
/* These include files are added by the preprocessor */ /* These include files are added by the preprocessor */
#include <ecpgtype.h> #include <ecpgtype.h>
#include <ecpglib.h> #include <ecpglib.h>
......
/* Processed by ecpg (4.3.1) */ /* Processed by ecpg (regression mode) */
int ecpg_internal_regression_mode = 1;
/* These include files are added by the preprocessor */ /* These include files are added by the preprocessor */
#include <ecpgtype.h> #include <ecpgtype.h>
#include <ecpglib.h> #include <ecpglib.h>
......
/* Processed by ecpg (4.3.1) */ /* Processed by ecpg (regression mode) */
int ecpg_internal_regression_mode = 1;
/* These include files are added by the preprocessor */ /* These include files are added by the preprocessor */
#include <ecpgtype.h> #include <ecpgtype.h>
#include <ecpglib.h> #include <ecpglib.h>
......
/* Processed by ecpg (4.3.1) */ /* Processed by ecpg (regression mode) */
int ecpg_internal_regression_mode = 1;
/* These include files are added by the preprocessor */ /* These include files are added by the preprocessor */
#include <ecpgtype.h> #include <ecpgtype.h>
#include <ecpglib.h> #include <ecpglib.h>
......
/* Processed by ecpg (4.3.1) */ /* Processed by ecpg (regression mode) */
int ecpg_internal_regression_mode = 1;
/* These include files are added by the preprocessor */ /* These include files are added by the preprocessor */
#include <ecpgtype.h> #include <ecpgtype.h>
#include <ecpglib.h> #include <ecpglib.h>
......
/* Processed by ecpg (4.3.1) */ /* Processed by ecpg (regression mode) */
int ecpg_internal_regression_mode = 1;
/* These include files are added by the preprocessor */ /* These include files are added by the preprocessor */
#include <ecpgtype.h> #include <ecpgtype.h>
#include <ecpglib.h> #include <ecpglib.h>
......
/* Processed by ecpg (4.3.1) */ /* Processed by ecpg (regression mode) */
int ecpg_internal_regression_mode = 1;
/* These include files are added by the preprocessor */ /* These include files are added by the preprocessor */
#include <ecpgtype.h> #include <ecpgtype.h>
#include <ecpglib.h> #include <ecpglib.h>
......
/* Processed by ecpg (4.3.1) */ /* Processed by ecpg (regression mode) */
int ecpg_internal_regression_mode = 1;
/* These include files are added by the preprocessor */ /* These include files are added by the preprocessor */
#include <ecpgtype.h> #include <ecpgtype.h>
#include <ecpglib.h> #include <ecpglib.h>
......
/* Processed by ecpg (4.3.1) */ /* Processed by ecpg (regression mode) */
int ecpg_internal_regression_mode = 1;
/* These include files are added by the preprocessor */ /* These include files are added by the preprocessor */
#include <ecpgtype.h> #include <ecpgtype.h>
#include <ecpglib.h> #include <ecpglib.h>
......
/* Processed by ecpg (4.3.1) */ /* Processed by ecpg (regression mode) */
int ecpg_internal_regression_mode = 1;
/* These include files are added by the preprocessor */ /* These include files are added by the preprocessor */
#include <ecpgtype.h> #include <ecpgtype.h>
#include <ecpglib.h> #include <ecpglib.h>
......
/* Processed by ecpg (4.3.1) */ /* Processed by ecpg (regression mode) */
int ecpg_internal_regression_mode = 1;
/* These include files are added by the preprocessor */ /* These include files are added by the preprocessor */
#include <ecpgtype.h> #include <ecpgtype.h>
#include <ecpglib.h> #include <ecpglib.h>
......
/* Processed by ecpg (4.3.1) */ /* Processed by ecpg (regression mode) */
int ecpg_internal_regression_mode = 1;
/* These include files are added by the preprocessor */ /* These include files are added by the preprocessor */
#include <ecpgtype.h> #include <ecpgtype.h>
#include <ecpglib.h> #include <ecpglib.h>
......
#! /bin/sh #! /bin/sh
# $PostgreSQL: pgsql/src/interfaces/ecpg/test/pg_regress.sh,v 1.15 2006/09/26 07:56:56 meskes Exp $ # $PostgreSQL: pgsql/src/interfaces/ecpg/test/pg_regress.sh,v 1.16 2007/01/11 15:47:33 meskes Exp $
me=`basename $0` me=`basename $0`
...@@ -707,7 +707,7 @@ if [ $? -ne 0 ]; then ...@@ -707,7 +707,7 @@ if [ $? -ne 0 ]; then
fi fi
# this variable prevents that the PID gets included in the logfiles # this variable prevents that the PID gets included in the logfiles
ECPG_REGRESSION=1; export ECPG_REGRESSION #ECPG_REGRESSION=1; export ECPG_REGRESSION
LD_LIBRARY_PATH=$libdir:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH LD_LIBRARY_PATH=$libdir:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH
DIFFPRETTYFLAGS="$DIFFFLAGS -C3" DIFFPRETTYFLAGS="$DIFFFLAGS -C3"
...@@ -753,19 +753,19 @@ for i in \ ...@@ -753,19 +753,19 @@ for i in \
# so tweak output files and replace the port number (we put a warning # 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 # 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). # now not only if the port differs from the standard port).
if [ "$i" = "connect/test1.pgc" ]; then #if [ "$i" = "connect/test1.pgc" ]; then
# can we use sed -i on all platforms? # can we use sed -i on all platforms?
for f in "$outfile_stderr" "$outfile_stdout" "$outfile_source"; do # for f in "$outfile_stderr" "$outfile_stdout" "$outfile_source"; do
mv $f $f.tmp # mv $f $f.tmp
echo >> $f # echo >> $f
echo "THE PORT NUMBER MIGHT HAVE BEEN CHANGED BY THE REGRESSION SCRIPT" >> $f # echo "THE PORT NUMBER MIGHT HAVE BEEN CHANGED BY THE REGRESSION SCRIPT" >> $f
echo >> $f # echo >> $f
# MinGW could return such a line: # MinGW could return such a line:
# "could not connect to server: Connection refused (0x0000274D/10061)" # "could not connect to server: Connection refused (0x0000274D/10061)"
cat $f.tmp | sed -e s,$PGPORT,55432,g | sed -e "s,could not connect to server: Connection refused (0x.*/.*),could not connect to server: Connection refused,g" >> $f #cat $f.tmp | sed -e s,$PGPORT,55432,g | sed -e "s,could not connect to server: Connection refused (0x.*/.*),could not connect to server: Connection refused,g" >> $f
rm $f.tmp # rm $f.tmp
done # done
fi #fi
mv "$outfile_source" "$outfile_source.tmp" mv "$outfile_source" "$outfile_source.tmp"
cat "$outfile_source.tmp" | sed -e 's,^\(#line [0-9]*\) ".*/\([^/]*\)",\1 "\2",' > "$outfile_source" cat "$outfile_source.tmp" | sed -e 's,^\(#line [0-9]*\) ".*/\([^/]*\)",\1 "\2",' > "$outfile_source"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment