Added patch by Joachim to work around OpenBSD bug in regression suite.
-/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/connect.c,v 1.38 2007/01/11 15:47:33 meskes Exp $ */
+/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/connect.c,v 1.39 2007/01/12 10:00:12 meskes Exp $ */
#define POSTGRES_ECPG_INTERNAL
#include "postgres_fe.h"
#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
-/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/data.c,v 1.36 2007/01/11 15:47:33 meskes Exp $ */
+/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/data.c,v 1.37 2007/01/12 10:00:12 meskes Exp $ */
#define POSTGRES_ECPG_INTERNAL
#include "postgres_fe.h"
#include "pgtypes_timestamp.h"
#include "pgtypes_interval.h"
-extern int ecpg_internal_regression_mode;
-
static bool
garbage_left(enum ARRAY_TYPE isarray, char *scan_length, enum COMPAT_MODE compat)
{
-/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/extern.h,v 1.20 2006/10/04 00:30:11 momjian Exp $ */
+/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/extern.h,v 1.21 2007/01/12 10:00:13 meskes Exp $ */
#ifndef _ECPG_LIB_EXTERN_H
#define _ECPG_LIB_EXTERN_H
ECPG_COMPAT_PGSQL = 0, ECPG_COMPAT_INFORMIX, ECPG_COMPAT_INFORMIX_SE
};
+extern bool ecpg_internal_regression_mode;
+
#define INFORMIX_MODE(X) ((X) == ECPG_COMPAT_INFORMIX || (X) == ECPG_COMPAT_INFORMIX_SE)
enum ARRAY_TYPE
-/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/misc.c,v 1.33 2007/01/11 15:47:33 meskes Exp $ */
+/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/misc.c,v 1.34 2007/01/12 10:00:13 meskes Exp $ */
#define POSTGRES_ECPG_INTERNAL
#include "postgres_fe.h"
#endif
#endif
-extern int ecpg_internal_regression_mode;
+bool ecpg_internal_regression_mode = false;
static struct sqlca_t sqlca_init =
{
pthread_mutex_lock(&debug_init_mutex);
#endif
- simple_debug = n;
+ if (n > 100)
+ {
+ ecpg_internal_regression_mode = true;
+ simple_debug = n-100;
+ }
+ else
+ simple_debug = n;
+
debugstream = dbgs;
+
ECPGlog("ECPGdebug: set to %d\n", simple_debug);
#ifdef ENABLE_THREAD_SAFETY
-/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg.c,v 1.95 2007/01/11 15:47:33 meskes Exp $ */
+/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg.c,v 1.96 2007/01/12 10:00:13 meskes Exp $ */
/* New main for ecpg, the PostgreSQL embedded SQL precompiler. */
/* (C) Michael Meskes <meskes@postgresql.org> Feb 5th, 1998 */
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");
fprintf(yyout, "/* End of automatic include section */\n");
}
+ if (regression_mode)
+ fprintf(yyout, "#define ECPGdebug(X,Y) ECPGdebug((X)+100,(Y))\n");
+
output_line_number();
/* and parse the source */
/* 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>
/* Needed for informix compatibility */
#include <ecpg_informix.h>
/* End of automatic include section */
+#define ECPGdebug(X,Y) ECPGdebug((X)+100,(Y))
#line 1 "charfuncs.pgc"
#include <stdio.h>
/* 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>
/* Needed for informix compatibility */
#include <ecpg_informix.h>
/* End of automatic include section */
+#define ECPGdebug(X,Y) ECPGdebug((X)+100,(Y))
#line 1 "dec_test.pgc"
#include <stdio.h>
/* 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>
/* Needed for informix compatibility */
#include <ecpg_informix.h>
/* End of automatic include section */
+#define ECPGdebug(X,Y) ECPGdebug((X)+100,(Y))
#line 1 "rfmtdate.pgc"
#include <stdio.h>
/* 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>
/* Needed for informix compatibility */
#include <ecpg_informix.h>
/* End of automatic include section */
+#define ECPGdebug(X,Y) ECPGdebug((X)+100,(Y))
#line 1 "rfmtlong.pgc"
#include <stdio.h>
/* 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>
/* Needed for informix compatibility */
#include <ecpg_informix.h>
/* End of automatic include section */
+#define ECPGdebug(X,Y) ECPGdebug((X)+100,(Y))
#line 1 "rnull.pgc"
#include "sqltypes.h"
/* 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>
/* Needed for informix compatibility */
#include <ecpg_informix.h>
/* End of automatic include section */
+#define ECPGdebug(X,Y) ECPGdebug((X)+100,(Y))
#line 1 "test_informix.pgc"
#include "sqltypes.h"
/* 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>
/* Needed for informix compatibility */
#include <ecpg_informix.h>
/* End of automatic include section */
+#define ECPGdebug(X,Y) ECPGdebug((X)+100,(Y))
#line 1 "test_informix2.pgc"
#include <stdio.h>
/* 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>
#include <ecpgerrno.h>
#include <sqlca.h>
/* End of automatic include section */
+#define ECPGdebug(X,Y) ECPGdebug((X)+100,(Y))
#line 1 "test1.pgc"
/*
/* 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>
#include <ecpgerrno.h>
#include <sqlca.h>
/* End of automatic include section */
+#define ECPGdebug(X,Y) ECPGdebug((X)+100,(Y))
#line 1 "test2.pgc"
/*
/* 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>
#include <ecpgerrno.h>
#include <sqlca.h>
/* End of automatic include section */
+#define ECPGdebug(X,Y) ECPGdebug((X)+100,(Y))
#line 1 "test3.pgc"
/*
/* 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>
#include <ecpgerrno.h>
#include <sqlca.h>
/* End of automatic include section */
+#define ECPGdebug(X,Y) ECPGdebug((X)+100,(Y))
#line 1 "test4.pgc"
#include <stdlib.h>
/* 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>
#include <ecpgerrno.h>
#include <sqlca.h>
/* End of automatic include section */
+#define ECPGdebug(X,Y) ECPGdebug((X)+100,(Y))
#line 1 "test5.pgc"
/*
/* 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>
#include <ecpgerrno.h>
#include <sqlca.h>
/* End of automatic include section */
+#define ECPGdebug(X,Y) ECPGdebug((X)+100,(Y))
#line 1 "dt_test.pgc"
#include <stdio.h>
/* 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>
#include <ecpgerrno.h>
#include <sqlca.h>
/* End of automatic include section */
+#define ECPGdebug(X,Y) ECPGdebug((X)+100,(Y))
#line 1 "dt_test2.pgc"
#include <stdio.h>
/* 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>
#include <ecpgerrno.h>
#include <sqlca.h>
/* End of automatic include section */
+#define ECPGdebug(X,Y) ECPGdebug((X)+100,(Y))
#line 1 "num_test.pgc"
#include <stdio.h>
/* 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>
#include <ecpgerrno.h>
#include <sqlca.h>
/* End of automatic include section */
+#define ECPGdebug(X,Y) ECPGdebug((X)+100,(Y))
#line 1 "num_test2.pgc"
#include <stdio.h>
/* 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>
#include <ecpgerrno.h>
#include <sqlca.h>
/* End of automatic include section */
+#define ECPGdebug(X,Y) ECPGdebug((X)+100,(Y))
#line 1 "comment.pgc"
#include <stdlib.h>
/* 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>
#include <ecpgerrno.h>
#include <sqlca.h>
/* End of automatic include section */
+#define ECPGdebug(X,Y) ECPGdebug((X)+100,(Y))
#line 1 "define.pgc"
#include <stdlib.h>
/* 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>
#include <ecpgerrno.h>
#include <sqlca.h>
/* End of automatic include section */
+#define ECPGdebug(X,Y) ECPGdebug((X)+100,(Y))
#line 1 "init.pgc"
/* 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>
#include <ecpgerrno.h>
#include <sqlca.h>
/* End of automatic include section */
+#define ECPGdebug(X,Y) ECPGdebug((X)+100,(Y))
#line 1 "type.pgc"
#include <stdio.h>
/* 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>
#include <ecpgerrno.h>
#include <sqlca.h>
/* End of automatic include section */
+#define ECPGdebug(X,Y) ECPGdebug((X)+100,(Y))
#line 1 "variable.pgc"
#include <stdlib.h>
/* 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>
#include <ecpgerrno.h>
#include <sqlca.h>
/* End of automatic include section */
+#define ECPGdebug(X,Y) ECPGdebug((X)+100,(Y))
#line 1 "whenever.pgc"
#include <stdlib.h>
/* 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>
#include <ecpgerrno.h>
#include <sqlca.h>
/* End of automatic include section */
+#define ECPGdebug(X,Y) ECPGdebug((X)+100,(Y))
#line 1 "array.pgc"
#include <locale.h>
/* 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>
#include <ecpgerrno.h>
#include <sqlca.h>
/* End of automatic include section */
+#define ECPGdebug(X,Y) ECPGdebug((X)+100,(Y))
#line 1 "binary.pgc"
#include <stdio.h>
/* 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>
#include <ecpgerrno.h>
#include <sqlca.h>
/* End of automatic include section */
+#define ECPGdebug(X,Y) ECPGdebug((X)+100,(Y))
#line 1 "code100.pgc"
/* 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>
#include <ecpgerrno.h>
#include <sqlca.h>
/* End of automatic include section */
+#define ECPGdebug(X,Y) ECPGdebug((X)+100,(Y))
#line 1 "copystdout.pgc"
#include <stdio.h>
/* 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>
#include <ecpgerrno.h>
#include <sqlca.h>
/* End of automatic include section */
+#define ECPGdebug(X,Y) ECPGdebug((X)+100,(Y))
#line 1 "define.pgc"
/* 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>
#include <ecpgerrno.h>
#include <sqlca.h>
/* End of automatic include section */
+#define ECPGdebug(X,Y) ECPGdebug((X)+100,(Y))
#line 1 "desc.pgc"
/* 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>
#include <ecpgerrno.h>
#include <sqlca.h>
/* End of automatic include section */
+#define ECPGdebug(X,Y) ECPGdebug((X)+100,(Y))
#line 1 "dynalloc.pgc"
#include <stdio.h>
/* 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>
#include <ecpgerrno.h>
#include <sqlca.h>
/* End of automatic include section */
+#define ECPGdebug(X,Y) ECPGdebug((X)+100,(Y))
#line 1 "dynalloc2.pgc"
#include <stdio.h>
/* 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>
#include <ecpgerrno.h>
#include <sqlca.h>
/* End of automatic include section */
+#define ECPGdebug(X,Y) ECPGdebug((X)+100,(Y))
#line 1 "dyntest.pgc"
/* dynamic SQL test program
/* 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>
#include <ecpgerrno.h>
#include <sqlca.h>
/* End of automatic include section */
+#define ECPGdebug(X,Y) ECPGdebug((X)+100,(Y))
#line 1 "execute.pgc"
#include <stdlib.h>
/* 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>
#include <ecpgerrno.h>
#include <sqlca.h>
/* End of automatic include section */
+#define ECPGdebug(X,Y) ECPGdebug((X)+100,(Y))
#line 1 "fetch.pgc"
#include <stdio.h>
/* 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>
#include <ecpgerrno.h>
#include <sqlca.h>
/* End of automatic include section */
+#define ECPGdebug(X,Y) ECPGdebug((X)+100,(Y))
#line 1 "func.pgc"
#include <stdio.h>
/* 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>
#include <ecpgerrno.h>
#include <sqlca.h>
/* End of automatic include section */
+#define ECPGdebug(X,Y) ECPGdebug((X)+100,(Y))
#line 1 "indicators.pgc"
#include <stdio.h>
/* 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>
#include <ecpgerrno.h>
#include <sqlca.h>
/* End of automatic include section */
+#define ECPGdebug(X,Y) ECPGdebug((X)+100,(Y))
#line 1 "quote.pgc"
#include <stdio.h>
/* 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>
#include <ecpgerrno.h>
#include <sqlca.h>
/* End of automatic include section */
+#define ECPGdebug(X,Y) ECPGdebug((X)+100,(Y))
#line 1 "show.pgc"
#include <stdio.h>
/* 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>
#include <ecpgerrno.h>
#include <sqlca.h>
/* End of automatic include section */
+#define ECPGdebug(X,Y) ECPGdebug((X)+100,(Y))
#line 1 "update.pgc"
#include <stdio.h>
/* 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>
#include <ecpgerrno.h>
#include <sqlca.h>
/* End of automatic include section */
+#define ECPGdebug(X,Y) ECPGdebug((X)+100,(Y))
#line 1 "thread.pgc"
/*
/* 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>
#include <ecpgerrno.h>
#include <sqlca.h>
/* End of automatic include section */
+#define ECPGdebug(X,Y) ECPGdebug((X)+100,(Y))
#line 1 "thread_implicit.pgc"
/*
#! /bin/sh
-# $PostgreSQL: pgsql/src/interfaces/ecpg/test/pg_regress.sh,v 1.16 2007/01/11 15:47:33 meskes Exp $
+# $PostgreSQL: pgsql/src/interfaces/ecpg/test/pg_regress.sh,v 1.17 2007/01/12 10:00:13 meskes Exp $
me=`basename $0`
*-*-mingw32*)
PLATFORM_TAG="-MinGW32"
;;
+ *-*-openbsd3.8)
+ # OpenBSD 3.8 is buggy:
+ # http://archives.postgresql.org/pgsql-hackers/2006-09/msg00593.php
+ PLATFORM_TAG="-OpenBSD3.8.broken"
+ ;;
esac
outfile_stderr="$outputdir/$outprg.stderr"
# 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
- # 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
-
mv "$outfile_source" "$outfile_source.tmp"
cat "$outfile_source.tmp" | sed -e 's,^\(#line [0-9]*\) ".*/\([^/]*\)",\1 "\2",' > "$outfile_source"
rm "$outfile_source.tmp"