Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 2645cb5

Browse files
committed
Fix the assert_enabled issue properly. This eliminates the former ABI
difference between USE_ASSERT_CHECKING and not: the assert_enabled variable is always there.
1 parent cbf3993 commit 2645cb5

File tree

5 files changed

+8
-17
lines changed

5 files changed

+8
-17
lines changed

contrib/ltree/_ltree_gist.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -546,10 +546,6 @@ _ltree_consistent(PG_FUNCTION_ARGS)
546546
StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
547547
bool res = false;
548548

549-
#ifndef assert_enabled
550-
#define assert_enabled 0
551-
#endif
552-
553549
switch (strategy)
554550
{
555551
case 10:

contrib/ltree/ltree_gist.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -631,10 +631,6 @@ ltree_consistent(PG_FUNCTION_ARGS)
631631
StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
632632
bool res = false;
633633

634-
#ifndef assert_enabled
635-
#define assert_enabled 0
636-
#endif
637-
638634
switch (strategy)
639635
{
640636
case BTLessStrategyNumber:

src/backend/port/ipc_test.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
*
2222
*
2323
* IDENTIFICATION
24-
* $PostgreSQL: pgsql/src/backend/port/ipc_test.c,v 1.18 2005/10/15 02:49:22 momjian Exp $
24+
* $PostgreSQL: pgsql/src/backend/port/ipc_test.c,v 1.19 2006/01/08 21:24:36 tgl Exp $
2525
*
2626
*-------------------------------------------------------------------------
2727
*/
@@ -47,16 +47,13 @@ volatile uint32 InterruptHoldoffCount = 0;
4747
volatile uint32 CritSectionCount = 0;
4848

4949
bool IsUnderPostmaster = false;
50+
bool assert_enabled = true;
5051

5152
int MaxBackends = 32;
5253
int NBuffers = 64;
5354

5455
char *DataDir = ".";
5556

56-
#ifndef assert_enabled
57-
bool assert_enabled = true;
58-
#endif
59-
6057

6158
#define MAX_ON_EXITS 20
6259

src/backend/utils/misc/guc.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* Written by Peter Eisentraut <peter_e@gmx.net>.
1111
*
1212
* IDENTIFICATION
13-
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.307 2006/01/08 20:13:33 tgl Exp $
13+
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.308 2006/01/08 21:24:36 tgl Exp $
1414
*
1515
*--------------------------------------------------------------------
1616
*/
@@ -147,7 +147,11 @@ static const char *show_tcp_keepalives_count(void);
147147
/*
148148
* GUC option variables that are exported from this module
149149
*/
150+
#ifdef USE_ASSERT_CHECKING
150151
bool assert_enabled = true;
152+
#else
153+
bool assert_enabled = false;
154+
#endif
151155
bool log_duration = false;
152156
bool Debug_print_plan = false;
153157
bool Debug_print_parse = false;

src/include/postgres.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
1111
* Portions Copyright (c) 1995, Regents of the University of California
1212
*
13-
* $PostgreSQL: pgsql/src/include/postgres.h,v 1.71 2005/04/14 01:38:21 tgl Exp $
13+
* $PostgreSQL: pgsql/src/include/postgres.h,v 1.72 2006/01/08 21:24:37 tgl Exp $
1414
*
1515
*-------------------------------------------------------------------------
1616
*/
@@ -484,7 +484,6 @@ extern DLLIMPORT bool assert_enabled;
484484
/*
485485
* Trap
486486
* Generates an exception if the given condition is true.
487-
*
488487
*/
489488
#define Trap(condition, errorType) \
490489
do { \
@@ -510,7 +509,6 @@ extern DLLIMPORT bool assert_enabled;
510509
#define AssertMacro(condition) ((void)true)
511510
#define AssertArg(condition)
512511
#define AssertState(condition)
513-
#define assert_enabled 0
514512
#else
515513
#define Assert(condition) \
516514
Trap(!(condition), "FailedAssertion")

0 commit comments

Comments
 (0)