Skip to content

Commit b8f611c

Browse files
author
Michael Meskes
committed
Simplified regression handling
Added patch by Joachim to work around OpenBSD bug in regression suite.
1 parent 97903c3 commit b8f611c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+66
-70
lines changed

src/interfaces/ecpg/ecpglib/connect.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/connect.c,v 1.38 2007/01/11 15:47:33 meskes Exp $ */
1+
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/connect.c,v 1.39 2007/01/12 10:00:12 meskes Exp $ */
22

33
#define POSTGRES_ECPG_INTERNAL
44
#include "postgres_fe.h"
@@ -19,7 +19,6 @@ static pthread_once_t actual_connection_key_once = PTHREAD_ONCE_INIT;
1919
#endif
2020
static struct connection *actual_connection = NULL;
2121
static struct connection *all_connections = NULL;
22-
extern int ecpg_internal_regression_mode;
2322

2423
#ifdef ENABLE_THREAD_SAFETY
2524
static void

src/interfaces/ecpg/ecpglib/data.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/data.c,v 1.36 2007/01/11 15:47:33 meskes Exp $ */
1+
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/data.c,v 1.37 2007/01/12 10:00:12 meskes Exp $ */
22

33
#define POSTGRES_ECPG_INTERNAL
44
#include "postgres_fe.h"
@@ -16,8 +16,6 @@
1616
#include "pgtypes_timestamp.h"
1717
#include "pgtypes_interval.h"
1818

19-
extern int ecpg_internal_regression_mode;
20-
2119
static bool
2220
garbage_left(enum ARRAY_TYPE isarray, char *scan_length, enum COMPAT_MODE compat)
2321
{

src/interfaces/ecpg/ecpglib/extern.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/extern.h,v 1.20 2006/10/04 00:30:11 momjian Exp $ */
1+
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/extern.h,v 1.21 2007/01/12 10:00:13 meskes Exp $ */
22

33
#ifndef _ECPG_LIB_EXTERN_H
44
#define _ECPG_LIB_EXTERN_H
@@ -12,6 +12,8 @@ enum COMPAT_MODE
1212
ECPG_COMPAT_PGSQL = 0, ECPG_COMPAT_INFORMIX, ECPG_COMPAT_INFORMIX_SE
1313
};
1414

15+
extern bool ecpg_internal_regression_mode;
16+
1517
#define INFORMIX_MODE(X) ((X) == ECPG_COMPAT_INFORMIX || (X) == ECPG_COMPAT_INFORMIX_SE)
1618

1719
enum ARRAY_TYPE

src/interfaces/ecpg/ecpglib/misc.c

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/misc.c,v 1.33 2007/01/11 15:47:33 meskes Exp $ */
1+
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/misc.c,v 1.34 2007/01/12 10:00:13 meskes Exp $ */
22

33
#define POSTGRES_ECPG_INTERNAL
44
#include "postgres_fe.h"
@@ -28,7 +28,7 @@
2828
#endif
2929
#endif
3030

31-
extern int ecpg_internal_regression_mode;
31+
bool ecpg_internal_regression_mode = false;
3232

3333
static struct sqlca_t sqlca_init =
3434
{
@@ -228,8 +228,16 @@ ECPGdebug(int n, FILE *dbgs)
228228
pthread_mutex_lock(&debug_init_mutex);
229229
#endif
230230

231-
simple_debug = n;
231+
if (n > 100)
232+
{
233+
ecpg_internal_regression_mode = true;
234+
simple_debug = n-100;
235+
}
236+
else
237+
simple_debug = n;
238+
232239
debugstream = dbgs;
240+
233241
ECPGlog("ECPGdebug: set to %d\n", simple_debug);
234242

235243
#ifdef ENABLE_THREAD_SAFETY

src/interfaces/ecpg/preproc/ecpg.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg.c,v 1.95 2007/01/11 15:47:33 meskes Exp $ */
1+
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg.c,v 1.96 2007/01/12 10:00:13 meskes Exp $ */
22

33
/* New main for ecpg, the PostgreSQL embedded SQL precompiler. */
44
/* (C) Michael Meskes <meskes@postgresql.org> Feb 5th, 1998 */
@@ -425,7 +425,6 @@ main(int argc, char *const argv[])
425425
else
426426
fprintf(yyout, "/* Processed by ecpg (%d.%d.%d) */\n", MAJOR_VERSION, MINOR_VERSION, PATCHLEVEL);
427427

428-
fprintf(yyout, "int ecpg_internal_regression_mode = %d;\n", regression_mode);
429428
if (header_mode == false)
430429
{
431430
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");
@@ -437,6 +436,9 @@ main(int argc, char *const argv[])
437436
fprintf(yyout, "/* End of automatic include section */\n");
438437
}
439438

439+
if (regression_mode)
440+
fprintf(yyout, "#define ECPGdebug(X,Y) ECPGdebug((X)+100,(Y))\n");
441+
440442
output_line_number();
441443

442444
/* and parse the source */

src/interfaces/ecpg/test/expected/compat_informix-charfuncs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
/* Processed by ecpg (regression mode) */
2-
int ecpg_internal_regression_mode = 1;
32
/* These include files are added by the preprocessor */
43
#include <ecpgtype.h>
54
#include <ecpglib.h>
@@ -8,6 +7,7 @@ int ecpg_internal_regression_mode = 1;
87
/* Needed for informix compatibility */
98
#include <ecpg_informix.h>
109
/* End of automatic include section */
10+
#define ECPGdebug(X,Y) ECPGdebug((X)+100,(Y))
1111

1212
#line 1 "charfuncs.pgc"
1313
#include <stdio.h>

src/interfaces/ecpg/test/expected/compat_informix-dec_test.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
/* Processed by ecpg (regression mode) */
2-
int ecpg_internal_regression_mode = 1;
32
/* These include files are added by the preprocessor */
43
#include <ecpgtype.h>
54
#include <ecpglib.h>
@@ -8,6 +7,7 @@ int ecpg_internal_regression_mode = 1;
87
/* Needed for informix compatibility */
98
#include <ecpg_informix.h>
109
/* End of automatic include section */
10+
#define ECPGdebug(X,Y) ECPGdebug((X)+100,(Y))
1111

1212
#line 1 "dec_test.pgc"
1313
#include <stdio.h>

src/interfaces/ecpg/test/expected/compat_informix-rfmtdate.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
/* Processed by ecpg (regression mode) */
2-
int ecpg_internal_regression_mode = 1;
32
/* These include files are added by the preprocessor */
43
#include <ecpgtype.h>
54
#include <ecpglib.h>
@@ -8,6 +7,7 @@ int ecpg_internal_regression_mode = 1;
87
/* Needed for informix compatibility */
98
#include <ecpg_informix.h>
109
/* End of automatic include section */
10+
#define ECPGdebug(X,Y) ECPGdebug((X)+100,(Y))
1111

1212
#line 1 "rfmtdate.pgc"
1313
#include <stdio.h>

src/interfaces/ecpg/test/expected/compat_informix-rfmtlong.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
/* Processed by ecpg (regression mode) */
2-
int ecpg_internal_regression_mode = 1;
32
/* These include files are added by the preprocessor */
43
#include <ecpgtype.h>
54
#include <ecpglib.h>
@@ -8,6 +7,7 @@ int ecpg_internal_regression_mode = 1;
87
/* Needed for informix compatibility */
98
#include <ecpg_informix.h>
109
/* End of automatic include section */
10+
#define ECPGdebug(X,Y) ECPGdebug((X)+100,(Y))
1111

1212
#line 1 "rfmtlong.pgc"
1313
#include <stdio.h>

src/interfaces/ecpg/test/expected/compat_informix-rnull.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
/* Processed by ecpg (regression mode) */
2-
int ecpg_internal_regression_mode = 1;
32
/* These include files are added by the preprocessor */
43
#include <ecpgtype.h>
54
#include <ecpglib.h>
@@ -8,6 +7,7 @@ int ecpg_internal_regression_mode = 1;
87
/* Needed for informix compatibility */
98
#include <ecpg_informix.h>
109
/* End of automatic include section */
10+
#define ECPGdebug(X,Y) ECPGdebug((X)+100,(Y))
1111

1212
#line 1 "rnull.pgc"
1313
#include "sqltypes.h"

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy