23
23
*/
24
24
#include "postgres.h"
25
25
26
- #include "access/heapam.h"
27
26
#include "access/htup_details.h"
28
27
#include "access/nbtree.h"
28
+ #include "access/table.h"
29
29
#include "access/tableam.h"
30
30
#include "access/transam.h"
31
31
#include "access/xact.h"
@@ -142,7 +142,7 @@ static void bt_tuple_present_callback(Relation index, HeapTuple htup,
142
142
Datum * values , bool * isnull ,
143
143
bool tupleIsAlive , void * checkstate );
144
144
static IndexTuple bt_normalize_tuple (BtreeCheckState * state ,
145
- IndexTuple itup );
145
+ IndexTuple itup );
146
146
static bool bt_rootdescend (BtreeCheckState * state , IndexTuple itup );
147
147
static inline bool offset_is_negative_infinity (BTPageOpaque opaque ,
148
148
OffsetNumber offset );
@@ -387,10 +387,10 @@ bt_check_every_level(Relation rel, Relation heaprel, bool heapkeyspace,
387
387
388
388
/*
389
389
* Register our own snapshot in !readonly case, rather than asking
390
- * IndexBuildHeapScan () to do this for us later. This needs to happen
391
- * before index fingerprinting begins, so we can later be certain that
392
- * index fingerprinting should have reached all tuples returned by
393
- * IndexBuildHeapScan ().
390
+ * table_index_build_scan () to do this for us later. This needs to
391
+ * happen before index fingerprinting begins, so we can later be
392
+ * certain that index fingerprinting should have reached all tuples
393
+ * returned by table_index_build_scan ().
394
394
*
395
395
* In readonly case, we also check for problems with missing
396
396
* downlinks. A second Bloom filter is used for this.
@@ -525,18 +525,19 @@ bt_check_every_level(Relation rel, Relation heaprel, bool heapkeyspace,
525
525
}
526
526
527
527
/*
528
- * Create our own scan for IndexBuildHeapScan(), rather than getting
529
- * it to do so for us. This is required so that we can actually use
530
- * the MVCC snapshot registered earlier in !readonly case.
528
+ * Create our own scan for table_index_build_scan(), rather than
529
+ * getting it to do so for us. This is required so that we can
530
+ * actually use the MVCC snapshot registered earlier in !readonly
531
+ * case.
531
532
*
532
- * Note that IndexBuildHeapScan () calls heap_endscan() for us.
533
+ * Note that table_index_build_scan () calls heap_endscan() for us.
533
534
*/
534
- scan = table_beginscan_strat (state -> heaprel , /* relation */
535
+ scan = table_beginscan_strat (state -> heaprel , /* relation */
535
536
snapshot , /* snapshot */
536
- 0 , /* number of keys */
537
+ 0 , /* number of keys */
537
538
NULL , /* scan key */
538
539
true, /* buffer access strategy OK */
539
- true); /* syncscan OK? */
540
+ true); /* syncscan OK? */
540
541
541
542
/*
542
543
* Scan will behave as the first scan of a CREATE INDEX CONCURRENTLY
@@ -565,8 +566,8 @@ bt_check_every_level(Relation rel, Relation heaprel, bool heapkeyspace,
565
566
RelationGetRelationName (state -> rel ),
566
567
RelationGetRelationName (state -> heaprel ));
567
568
568
- IndexBuildHeapScan (state -> heaprel , state -> rel , indexinfo , true,
569
- bt_tuple_present_callback , (void * ) state , scan );
569
+ table_index_build_scan (state -> heaprel , state -> rel , indexinfo , true,
570
+ bt_tuple_present_callback , (void * ) state , scan );
570
571
571
572
ereport (DEBUG1 ,
572
573
(errmsg_internal ("finished verifying presence of " INT64_FORMAT " tuples from table \"%s\" with bitset %.2f%% set" ,
@@ -814,7 +815,7 @@ bt_check_level_from_leftmost(BtreeCheckState *state, BtreeLevel level)
814
815
* (Limited to heapallindexed readonly callers.)
815
816
*
816
817
* This is also where heapallindexed callers use their Bloom filter to
817
- * fingerprint IndexTuples for later IndexBuildHeapScan () verification.
818
+ * fingerprint IndexTuples for later table_index_build_scan () verification.
818
819
*
819
820
* Note: Memory allocated in this routine is expected to be released by caller
820
821
* resetting state->targetcontext.
@@ -1776,7 +1777,7 @@ bt_downlink_missing_check(BtreeCheckState *state)
1776
1777
}
1777
1778
1778
1779
/*
1779
- * Per-tuple callback from IndexBuildHeapScan , used to determine if index has
1780
+ * Per-tuple callback from table_index_build_scan , used to determine if index has
1780
1781
* all the entries that definitely should have been observed in leaf pages of
1781
1782
* the target index (that is, all IndexTuples that were fingerprinted by our
1782
1783
* Bloom filter). All heapallindexed checks occur here.
@@ -1801,7 +1802,7 @@ bt_downlink_missing_check(BtreeCheckState *state)
1801
1802
* verification, just in case it's a cross-page invariant issue, though that
1802
1803
* isn't particularly likely.
1803
1804
*
1804
- * IndexBuildHeapScan () expects to be able to find the root tuple when a
1805
+ * table_index_build_scan () expects to be able to find the root tuple when a
1805
1806
* heap-only tuple (the live tuple at the end of some HOT chain) needs to be
1806
1807
* indexed, in order to replace the actual tuple's TID with the root tuple's
1807
1808
* TID (which is what we're actually passed back here). The index build heap
@@ -1817,7 +1818,7 @@ bt_downlink_missing_check(BtreeCheckState *state)
1817
1818
* setting will probably also leave the index in a corrupt state before too
1818
1819
* long, the problem is nonetheless that there is heap corruption.)
1819
1820
*
1820
- * Heap-only tuple handling within IndexBuildHeapScan () works in a way that
1821
+ * Heap-only tuple handling within table_index_build_scan () works in a way that
1821
1822
* helps us to detect index tuples that contain the wrong values (values that
1822
1823
* don't match the latest tuple in the HOT chain). This can happen when there
1823
1824
* is no superseding index tuple due to a faulty assessment of HOT safety,
0 commit comments