aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/ecpg/ecpglib/data.c
diff options
context:
space:
mode:
authorMichael Meskes <meskes@postgresql.org>2007-01-11 15:47:34 +0000
committerMichael Meskes <meskes@postgresql.org>2007-01-11 15:47:34 +0000
commit5b88b85cad70478b607591458e9983b20541e582 (patch)
treef913df259b22a64b4f09426719e8a21a99a716ff /src/interfaces/ecpg/ecpglib/data.c
parentc0c00ac3b7dd6db1ec4e0f3d13eb447e36359f63 (diff)
downloadpostgresql-5b88b85cad70478b607591458e9983b20541e582.tar.gz
postgresql-5b88b85cad70478b607591458e9983b20541e582.zip
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.
Diffstat (limited to 'src/interfaces/ecpg/ecpglib/data.c')
-rw-r--r--src/interfaces/ecpg/ecpglib/data.c22
1 files changed, 3 insertions, 19 deletions
diff --git a/src/interfaces/ecpg/ecpglib/data.c b/src/interfaces/ecpg/ecpglib/data.c
index ab1f2554ce5..6b2bbfa64be 100644
--- a/src/interfaces/ecpg/ecpglib/data.c
+++ b/src/interfaces/ecpg/ecpglib/data.c
@@ -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"
@@ -16,10 +16,7 @@
#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;