1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-18 17:42:25 +03:00

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.
This commit is contained in:
Michael Meskes
2007-01-11 15:47:34 +00:00
parent c0c00ac3b7
commit 5b88b85cad
50 changed files with 249 additions and 128 deletions

View 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"
@ -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)
@ -56,24 +53,11 @@ ECPGget_data(const PGresult *results, int act_tuple, int act_field, int lineno,
int value_for_indicator = 0;
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;