OSDN Git Service

Applied Joachim's patch for a --regression option.
authorMichael Meskes <meskes@postgresql.org>
Thu, 11 Jan 2007 15:47:34 +0000 (15:47 +0000)
committerMichael Meskes <meskes@postgresql.org>
Thu, 11 Jan 2007 15:47:34 +0000 (15:47 +0000)
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.

50 files changed:
src/interfaces/ecpg/ecpglib/connect.c
src/interfaces/ecpg/ecpglib/data.c
src/interfaces/ecpg/ecpglib/misc.c
src/interfaces/ecpg/preproc/ecpg.c
src/interfaces/ecpg/preproc/extern.h
src/interfaces/ecpg/test/Makefile.regress
src/interfaces/ecpg/test/expected/compat_informix-charfuncs.c
src/interfaces/ecpg/test/expected/compat_informix-dec_test.c
src/interfaces/ecpg/test/expected/compat_informix-rfmtdate.c
src/interfaces/ecpg/test/expected/compat_informix-rfmtlong.c
src/interfaces/ecpg/test/expected/compat_informix-rnull.c
src/interfaces/ecpg/test/expected/compat_informix-test_informix.c
src/interfaces/ecpg/test/expected/compat_informix-test_informix2.c
src/interfaces/ecpg/test/expected/connect-test1-minGW32.stderr [new file with mode: 0644]
src/interfaces/ecpg/test/expected/connect-test1.c
src/interfaces/ecpg/test/expected/connect-test1.stderr
src/interfaces/ecpg/test/expected/connect-test1.stdout
src/interfaces/ecpg/test/expected/connect-test2.c
src/interfaces/ecpg/test/expected/connect-test3.c
src/interfaces/ecpg/test/expected/connect-test4.c
src/interfaces/ecpg/test/expected/connect-test5.c
src/interfaces/ecpg/test/expected/pgtypeslib-dt_test.c
src/interfaces/ecpg/test/expected/pgtypeslib-dt_test2.c
src/interfaces/ecpg/test/expected/pgtypeslib-num_test.c
src/interfaces/ecpg/test/expected/pgtypeslib-num_test2.c
src/interfaces/ecpg/test/expected/preproc-comment.c
src/interfaces/ecpg/test/expected/preproc-define.c
src/interfaces/ecpg/test/expected/preproc-init.c
src/interfaces/ecpg/test/expected/preproc-type.c
src/interfaces/ecpg/test/expected/preproc-variable.c
src/interfaces/ecpg/test/expected/preproc-whenever.c
src/interfaces/ecpg/test/expected/sql-array.c
src/interfaces/ecpg/test/expected/sql-binary.c
src/interfaces/ecpg/test/expected/sql-code100.c
src/interfaces/ecpg/test/expected/sql-copystdout.c
src/interfaces/ecpg/test/expected/sql-define.c
src/interfaces/ecpg/test/expected/sql-desc.c
src/interfaces/ecpg/test/expected/sql-dynalloc.c
src/interfaces/ecpg/test/expected/sql-dynalloc2.c
src/interfaces/ecpg/test/expected/sql-dyntest.c
src/interfaces/ecpg/test/expected/sql-execute.c
src/interfaces/ecpg/test/expected/sql-fetch.c
src/interfaces/ecpg/test/expected/sql-func.c
src/interfaces/ecpg/test/expected/sql-indicators.c
src/interfaces/ecpg/test/expected/sql-quote.c
src/interfaces/ecpg/test/expected/sql-show.c
src/interfaces/ecpg/test/expected/sql-update.c
src/interfaces/ecpg/test/expected/thread-thread.c
src/interfaces/ecpg/test/expected/thread-thread_implicit.c
src/interfaces/ecpg/test/pg_regress.sh

index 374264c..b3cfd80 100644 (file)
@@ -1,4 +1,4 @@
-/* $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
 #include "postgres_fe.h"
@@ -19,6 +19,7 @@ static pthread_once_t actual_connection_key_once = PTHREAD_ONCE_INIT;
 #endif
 static struct connection *actual_connection = NULL;
 static struct connection *all_connections = NULL;
+extern int ecpg_internal_regression_mode;
 
 #ifdef ENABLE_THREAD_SAFETY
 static void
@@ -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",
                        realname ? realname : "<DEFAULT>",
                        host ? host : "<DEFAULT>",
-                       port ? port : "<DEFAULT>",
+                       port ? (ecpg_internal_regression_mode ? "<REGRESSION_PORT>" : port) : "<DEFAULT>",
                        options ? "with options " : "", options ? options : "",
                        user ? "for user " : "", user ? user : "");
 
@@ -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",
                                db,
                                host ? host : "<DEFAULT>",
-                               port ? port : "<DEFAULT>",
+                               port ? (ecpg_internal_regression_mode ? "<REGRESSION_PORT>" : port) : "<DEFAULT>",
                                options ? "with options " : "", options ? options : "",
                                user ? "for user " : "", user ? user : "",
                                lineno, errmsg);
index ab1f255..6b2bbfa 100644 (file)
@@ -1,4 +1,4 @@
-/* $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
 #include "postgres_fe.h"
 #include "pgtypes_timestamp.h"
 #include "pgtypes_interval.h"
 
-static enum
-{
-       NOT_CHECKED, REGRESS, NORMAL
-}      ECPG_regression_mode = NOT_CHECKED;
+extern int ecpg_internal_regression_mode;
 
 static bool
 garbage_left(enum ARRAY_TYPE isarray, char *scan_length, enum COMPAT_MODE compat)
@@ -57,23 +54,10 @@ ECPGget_data(const PGresult *results, int act_tuple, int act_field, int lineno,
        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,
         * it depends on the machine's alignment.
         */
-       if (ECPG_regression_mode == REGRESS)
+       if (ecpg_internal_regression_mode)
                log_offset = -1;
        else
                log_offset = offset;
index 0bd850d..122c7d6 100644 (file)
@@ -1,4 +1,4 @@
-/* $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
 #include "postgres_fe.h"
@@ -28,6 +28,8 @@
 #endif
 #endif
 
+extern int ecpg_internal_regression_mode;
+
 static struct sqlca_t sqlca_init =
 {
        {
@@ -262,7 +264,7 @@ ECPGlog(const char *format,...)
                 * regression tests set this environment variable to get the same
                 * output for every run.
                 */
-               if (getenv("ECPG_REGRESSION"))
+               if (ecpg_internal_regression_mode)
                        snprintf(f, bufsize, "[NO_PID]: %s", format);
                else
                        snprintf(f, bufsize, "[%d]: %s", (int) getpid(), format);
@@ -272,7 +274,7 @@ ECPGlog(const char *format,...)
                va_end(ap);
 
                /* dump out internal sqlca variables */
-               if (getenv("ECPG_REGRESSION"))
+               if (ecpg_internal_regression_mode)
                        fprintf(debugstream, "[NO_PID]: sqlca: code: %ld, state: %s\n",
                                        sqlca->sqlcode, sqlca->sqlstate);
 
index c06075a..66b4138 100644 (file)
@@ -1,4 +1,4 @@
-/* $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. */
 /* (C) Michael Meskes <meskes@postgresql.org> Feb 5th, 1998 */
@@ -8,12 +8,7 @@
 
 #include <unistd.h>
 #include <string.h>
-#ifdef HAVE_GETOPT_H
-#include <getopt.h>
-#endif
-
-extern int     optind;
-extern char *optarg;
+#include "getopt_long.h"
 
 #include "extern.h"
 
@@ -22,7 +17,8 @@ int                   ret_value = 0,
                        auto_create_c = false,
                        system_includes = false,
                        force_indicator = true,
-                       header_mode = false;
+                       header_mode = false,
+                       regression_mode = false;
 
 enum COMPAT_MODE compat = ECPG_COMPAT_PGSQL;
 
@@ -56,6 +52,7 @@ help(const char *progname)
                   "                 OPTION may only be \"no_indicator\"\n");
        printf("  -t             turn on autocommit of transactions\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("\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");
@@ -112,9 +109,19 @@ add_preprocessor_define(char *define)
        defines->next = pd;
 }
 
+#define ECPG_GETOPT_LONG_HELP                  1
+#define ECPG_GETOPT_LONG_VERSION               2
+#define ECPG_GETOPT_LONG_REGRESSION            3
 int
 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,
                                c,
                                verbose = false,
@@ -126,27 +133,35 @@ main(int argc, char *const argv[])
 
        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);
 
-       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)
                {
+                       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':
                                if (strcmp(optarg, "-") == 0)
                                        yyout = stdout;
@@ -405,8 +420,12 @@ main(int argc, char *const argv[])
 
                                /* we need several includes */
                                /* 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)
                                {
                                        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");
index 3581b35..d80b05b 100644 (file)
@@ -1,4 +1,4 @@
-/* $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
 #define _ECPG_PREPROC_EXTERN_H
@@ -21,7 +21,8 @@ extern int    braces_open,
                        force_indicator,
                        ret_value,
                        struct_level,
-                       ecpg_informix_var;
+                       ecpg_informix_var,
+                       regression_mode;
 extern char *descriptor_index;
 extern char *descriptor_name;
 extern char *connection;
index c5e017e..06ac585 100644 (file)
@@ -5,7 +5,7 @@ override CFLAGS += $(PTHREAD_CFLAGS)
 override LDFLAGS := -L../../ecpglib -L../../pgtypeslib $(LDFLAGS)
 override LIBS := -lecpg -lpgtypes $(libpq) $(LIBS) $(PTHREAD_LIBS)
 
-ECPG = ../../preproc/ecpg -I$(srcdir)/../../include
+ECPG = ../../preproc/ecpg --regression -I$(srcdir)/../../include
 
 %: %.c
        $(CC) $(CPPFLAGS) $(CFLAGS) $^ $(LDFLAGS) $(LIBS) -o $@
index fdb04ef..f0090cc 100644 (file)
@@ -1,4 +1,5 @@
-/* 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 */
 #include <ecpgtype.h>
 #include <ecpglib.h>
index deb914d..323e208 100644 (file)
@@ -1,4 +1,5 @@
-/* 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 */
 #include <ecpgtype.h>
 #include <ecpglib.h>
index 96be750..6ec7847 100644 (file)
@@ -1,4 +1,5 @@
-/* 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 */
 #include <ecpgtype.h>
 #include <ecpglib.h>
index 5bb8dd3..2c96cc0 100644 (file)
@@ -1,4 +1,5 @@
-/* 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 */
 #include <ecpgtype.h>
 #include <ecpglib.h>
index a59d2fc..9a6df4d 100644 (file)
@@ -1,4 +1,5 @@
-/* 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 */
 #include <ecpgtype.h>
 #include <ecpglib.h>
index db077e0..8aab843 100644 (file)
@@ -1,4 +1,5 @@
-/* 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 */
 #include <ecpgtype.h>
 #include <ecpglib.h>
index 84ae29f..8b0495d 100644 (file)
@@ -1,4 +1,5 @@
-/* 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 */
 #include <ecpgtype.h>
 #include <ecpglib.h>
diff --git a/src/interfaces/ecpg/test/expected/connect-test1-minGW32.stderr b/src/interfaces/ecpg/test/expected/connect-test1-minGW32.stderr
new file mode 100644 (file)
index 0000000..4930c27
--- /dev/null
@@ -0,0 +1,83 @@
+
+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
index 46c37d7..2f1cdbe 100644 (file)
@@ -1,7 +1,5 @@
-
-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 */
 #include <ecpgtype.h>
 #include <ecpglib.h>
index 9b06f8a..18911ce 100644 (file)
@@ -1,6 +1,3 @@
-
-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> 
@@ -19,45 +16,45 @@ THE PORT NUMBER MIGHT HAVE BEEN CHANGED BY THE REGRESSION SCRIPT
 [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]: ECPGconnect: opening database connectdb on localhost port <REGRESSION_PORT> 
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_finish: Connection main closed.
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: opening database <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]: ecpg_finish: Connection main closed.
 [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]: 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]: ECPGconnect: opening database <DEFAULT> on <DEFAULT> port <REGRESSION_PORT> for user connectdb
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_finish: Connection main closed.
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: opening database connectdb on localhost port 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]: 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]: ECPGconnect: opening database  on localhost port <REGRESSION_PORT> 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]: ECPGconnect: opening database connectdb on localhost port <REGRESSION_PORT> for user connectuser
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_finish: Connection connectdb closed.
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: opening database connectdb on <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]: 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]: ECPGconnect: opening database connectdb on <DEFAULT> port <REGRESSION_PORT> for user connectuser
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_finish: Connection connectdb closed.
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: opening database 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]: 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
 
 [NO_PID]: sqlca: code: 0, state: 00000
@@ -67,9 +64,9 @@ THE PORT NUMBER MIGHT HAVE BEEN CHANGED BY THE REGRESSION SCRIPT
 [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]: ECPGconnect: opening database connectdb on localhost port <REGRESSION_PORT> 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
+[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
        Is the server running on host "localhost" and accepting
        TCP/IP connections on port 20?
@@ -79,5 +76,5 @@ THE PORT NUMBER MIGHT HAVE BEEN CHANGED BY THE REGRESSION SCRIPT
 [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]: ECPGconnect: opening database connectdb on <DEFAULT> port <REGRESSION_PORT> for user connectuser
 [NO_PID]: sqlca: code: 0, state: 00000
index 3ada4a6..2a59186 100644 (file)
@@ -1,4 +1,5 @@
-/* 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 */
 #include <ecpgtype.h>
 #include <ecpglib.h>
index edef734..ba0cc55 100644 (file)
@@ -1,4 +1,5 @@
-/* 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 */
 #include <ecpgtype.h>
 #include <ecpglib.h>
index 89f2769..5ebee62 100644 (file)
@@ -1,4 +1,5 @@
-/* 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 */
 #include <ecpgtype.h>
 #include <ecpglib.h>
index aa32683..1335a91 100644 (file)
@@ -1,4 +1,5 @@
-/* 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 */
 #include <ecpgtype.h>
 #include <ecpglib.h>
index a18399e..d6bf060 100644 (file)
@@ -1,4 +1,5 @@
-/* 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 */
 #include <ecpgtype.h>
 #include <ecpglib.h>
index a0e11f7..8d9e180 100644 (file)
@@ -1,4 +1,5 @@
-/* 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 */
 #include <ecpgtype.h>
 #include <ecpglib.h>
index 05c4f84..3d06dfd 100644 (file)
@@ -1,4 +1,5 @@
-/* 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 */
 #include <ecpgtype.h>
 #include <ecpglib.h>
index df5b241..ec8477f 100644 (file)
@@ -1,4 +1,5 @@
-/* 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 */
 #include <ecpgtype.h>
 #include <ecpglib.h>
index d27ea49..6bbc775 100644 (file)
@@ -1,4 +1,5 @@
-/* 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 */
 #include <ecpgtype.h>
 #include <ecpglib.h>
index eb49e1b..a2d1489 100644 (file)
@@ -1,4 +1,5 @@
-/* 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 */
 #include <ecpgtype.h>
 #include <ecpglib.h>
index 031604c..052a4af 100644 (file)
@@ -1,4 +1,5 @@
-/* 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 */
 #include <ecpgtype.h>
 #include <ecpglib.h>
index 714530b..0347878 100644 (file)
@@ -1,4 +1,5 @@
-/* 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 */
 #include <ecpgtype.h>
 #include <ecpglib.h>
index 370b782..0913ecd 100644 (file)
@@ -1,4 +1,5 @@
-/* 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 */
 #include <ecpgtype.h>
 #include <ecpglib.h>
index a4ac8ca..446541e 100644 (file)
@@ -1,4 +1,5 @@
-/* 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 */
 #include <ecpgtype.h>
 #include <ecpglib.h>
index 95f0e71..7b996b3 100644 (file)
@@ -1,4 +1,5 @@
-/* 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 */
 #include <ecpgtype.h>
 #include <ecpglib.h>
index 68dfcd6..418605b 100644 (file)
@@ -1,4 +1,5 @@
-/* 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 */
 #include <ecpgtype.h>
 #include <ecpglib.h>
index b7c4be7..2368b21 100644 (file)
@@ -1,4 +1,5 @@
-/* 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 */
 #include <ecpgtype.h>
 #include <ecpglib.h>
index cbe309b..4ae3e9d 100644 (file)
@@ -1,4 +1,5 @@
-/* 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 */
 #include <ecpgtype.h>
 #include <ecpglib.h>
index 56e7c0e..e66aa19 100644 (file)
@@ -1,4 +1,5 @@
-/* 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 */
 #include <ecpgtype.h>
 #include <ecpglib.h>
index 6bfa8fb..c735f27 100644 (file)
@@ -1,4 +1,5 @@
-/* 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 */
 #include <ecpgtype.h>
 #include <ecpglib.h>
index 5713d3b..5fe0584 100644 (file)
@@ -1,4 +1,5 @@
-/* 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 */
 #include <ecpgtype.h>
 #include <ecpglib.h>
index 349411c..7d38c01 100644 (file)
@@ -1,4 +1,5 @@
-/* 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 */
 #include <ecpgtype.h>
 #include <ecpglib.h>
index e081529..94d84e7 100644 (file)
@@ -1,4 +1,5 @@
-/* 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 */
 #include <ecpgtype.h>
 #include <ecpglib.h>
index b3e66c4..0fcc012 100644 (file)
@@ -1,4 +1,5 @@
-/* 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 */
 #include <ecpgtype.h>
 #include <ecpglib.h>
index 8f68dd3..b39ac3f 100644 (file)
@@ -1,4 +1,5 @@
-/* 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 */
 #include <ecpgtype.h>
 #include <ecpglib.h>
index 791200c..881c2a6 100644 (file)
@@ -1,4 +1,5 @@
-/* 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 */
 #include <ecpgtype.h>
 #include <ecpglib.h>
index 8ff6598..ca3fc39 100644 (file)
@@ -1,4 +1,5 @@
-/* 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 */
 #include <ecpgtype.h>
 #include <ecpglib.h>
index d4a37f3..5fbf964 100644 (file)
@@ -1,4 +1,5 @@
-/* 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 */
 #include <ecpgtype.h>
 #include <ecpglib.h>
index 3f28af5..79ff09f 100644 (file)
@@ -1,4 +1,5 @@
-/* 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 */
 #include <ecpgtype.h>
 #include <ecpglib.h>
index e52cc40..69052ef 100644 (file)
@@ -1,4 +1,5 @@
-/* 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 */
 #include <ecpgtype.h>
 #include <ecpglib.h>
index f676b85..890276c 100644 (file)
@@ -1,4 +1,5 @@
-/* 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 */
 #include <ecpgtype.h>
 #include <ecpglib.h>
index ca9bcfe..21cf8e3 100644 (file)
@@ -1,4 +1,5 @@
-/* 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 */
 #include <ecpgtype.h>
 #include <ecpglib.h>
index 9670ca9..108f414 100644 (file)
@@ -1,5 +1,5 @@
 #! /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`
 
@@ -707,7 +707,7 @@ if [ $? -ne 0 ]; then
 fi
 
 # 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
 
 DIFFPRETTYFLAGS="$DIFFFLAGS -C3"
@@ -753,19 +753,19 @@ for i in \
        # 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
+       #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
+       #       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
                        # MinGW could return such a line:
                        # "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
-                       rm $f.tmp
-               done
-       fi
+                       #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
+       #       done
+       #fi
 
        mv "$outfile_source" "$outfile_source.tmp"
        cat "$outfile_source.tmp" | sed -e 's,^\(#line [0-9]*\) ".*/\([^/]*\)",\1 "\2",' > "$outfile_source"