From aaf069aa345231823464f65b33c479a0958fe147 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Tue, 21 Apr 2020 19:57:33 +0200 Subject: [PATCH] Remove HEAPDEBUGALL This has been broken since PostgreSQL 12 and was probably never really used. PostgreSQL 12 added an analogous HEAPAMSLOTDEBUGALL, which still works right now, but it's also not very useful, so remove that as well. Discussion: https://www.postgresql.org/message-id/flat/645c0646-4218-d4c3-409a-a7003a0c108d%402ndquadrant.com --- src/backend/access/heap/heapam.c | 39 -------------------------------- src/include/pg_config_manual.h | 1 - 2 files changed, 40 deletions(-) diff --git a/src/backend/access/heap/heapam.c b/src/backend/access/heap/heapam.c index c4a5aa616a3..0d4ed602d76 100644 --- a/src/backend/access/heap/heapam.c +++ b/src/backend/access/heap/heapam.c @@ -1271,21 +1271,6 @@ heap_endscan(TableScanDesc sscan) pfree(scan); } -#ifdef HEAPDEBUGALL -#define HEAPDEBUG_1 \ - elog(DEBUG2, "heap_getnext([%s,nkeys=%d],dir=%d) called", \ - RelationGetRelationName(scan->rs_rd), scan->rs_nkeys, (int) direction) -#define HEAPDEBUG_2 \ - elog(DEBUG2, "heap_getnext returning EOS") -#define HEAPDEBUG_3 \ - elog(DEBUG2, "heap_getnext returning tuple") -#else -#define HEAPDEBUG_1 -#define HEAPDEBUG_2 -#define HEAPDEBUG_3 -#endif /* !defined(HEAPDEBUGALL) */ - - HeapTuple heap_getnext(TableScanDesc sscan, ScanDirection direction) { @@ -1305,8 +1290,6 @@ heap_getnext(TableScanDesc sscan, ScanDirection direction) /* Note: no locking manipulations needed */ - HEAPDEBUG_1; /* heap_getnext( info ) */ - if (scan->rs_base.rs_flags & SO_ALLOW_PAGEMODE) heapgettup_pagemode(scan, direction, scan->rs_base.rs_nkeys, scan->rs_base.rs_key); @@ -1315,36 +1298,18 @@ heap_getnext(TableScanDesc sscan, ScanDirection direction) scan->rs_base.rs_nkeys, scan->rs_base.rs_key); if (scan->rs_ctup.t_data == NULL) - { - HEAPDEBUG_2; /* heap_getnext returning EOS */ return NULL; - } /* * if we get here it means we have a new current scan tuple, so point to * the proper return buffer and return the tuple. */ - HEAPDEBUG_3; /* heap_getnext returning tuple */ pgstat_count_heap_getnext(scan->rs_base.rs_rd); return &scan->rs_ctup; } -#ifdef HEAPAMSLOTDEBUGALL -#define HEAPAMSLOTDEBUG_1 \ - elog(DEBUG2, "heapam_getnextslot([%s,nkeys=%d],dir=%d) called", \ - RelationGetRelationName(scan->rs_base.rs_rd), scan->rs_base.rs_nkeys, (int) direction) -#define HEAPAMSLOTDEBUG_2 \ - elog(DEBUG2, "heapam_getnextslot returning EOS") -#define HEAPAMSLOTDEBUG_3 \ - elog(DEBUG2, "heapam_getnextslot returning tuple") -#else -#define HEAPAMSLOTDEBUG_1 -#define HEAPAMSLOTDEBUG_2 -#define HEAPAMSLOTDEBUG_3 -#endif - bool heap_getnextslot(TableScanDesc sscan, ScanDirection direction, TupleTableSlot *slot) { @@ -1352,8 +1317,6 @@ heap_getnextslot(TableScanDesc sscan, ScanDirection direction, TupleTableSlot *s /* Note: no locking manipulations needed */ - HEAPAMSLOTDEBUG_1; /* heap_getnextslot( info ) */ - if (sscan->rs_flags & SO_ALLOW_PAGEMODE) heapgettup_pagemode(scan, direction, sscan->rs_nkeys, sscan->rs_key); else @@ -1361,7 +1324,6 @@ heap_getnextslot(TableScanDesc sscan, ScanDirection direction, TupleTableSlot *s if (scan->rs_ctup.t_data == NULL) { - HEAPAMSLOTDEBUG_2; /* heap_getnextslot returning EOS */ ExecClearTuple(slot); return false; } @@ -1370,7 +1332,6 @@ heap_getnextslot(TableScanDesc sscan, ScanDirection direction, TupleTableSlot *s * if we get here it means we have a new current scan tuple, so point to * the proper return buffer and return the tuple. */ - HEAPAMSLOTDEBUG_3; /* heap_getnextslot returning tuple */ pgstat_count_heap_getnext(scan->rs_base.rs_rd); diff --git a/src/include/pg_config_manual.h b/src/include/pg_config_manual.h index 32f739706d5..35d8215a929 100644 --- a/src/include/pg_config_manual.h +++ b/src/include/pg_config_manual.h @@ -352,5 +352,4 @@ /* * Other debug #defines (documentation, anyone?) */ -/* #define HEAPDEBUGALL */ /* #define ACLDEBUG */ -- 2.39.5