Skip to content

Commit a6d62a3

Browse files
committed
Add inline function 'table_scan_flags' for table AM to get the scan flags.
1 parent dcbb652 commit a6d62a3

6 files changed

Lines changed: 16 additions & 6 deletions

File tree

src/backend/access/aocs/aocsam_handler.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,7 @@ aoco_getnextslot(TableScanDesc scan, ScanDirection direction, TupleTableSlot *sl
757757
return false;
758758
}
759759

760-
static int
760+
static uint32
761761
aoco_scan_flags(Relation rel)
762762
{
763763
return 0;

src/backend/access/appendonly/appendonlyam.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1799,7 +1799,7 @@ appendonly_getnextslot(TableScanDesc scan, ScanDirection direction, TupleTableSl
17991799
return false;
18001800
}
18011801

1802-
int
1802+
uint32
18031803
appendonly_scan_flags(Relation relation)
18041804
{
18051805
return 0;

src/backend/access/heap/heapam.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1621,7 +1621,7 @@ heap_getnextslot_tidrange(TableScanDesc sscan, ScanDirection direction,
16211621
return true;
16221622
}
16231623

1624-
int
1624+
uint32
16251625
heap_scan_flags(Relation relation)
16261626
{
16271627
return 0;

src/include/access/heapam.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ extern void heap_set_tidrange(TableScanDesc sscan, ItemPointer mintid,
135135
extern bool heap_getnextslot_tidrange(TableScanDesc sscan,
136136
ScanDirection direction,
137137
TupleTableSlot *slot);
138-
extern int heap_scan_flags(Relation relation);
138+
extern uint32 heap_scan_flags(Relation relation);
139139
extern bool heap_fetch(Relation relation, Snapshot snapshot,
140140
HeapTuple tuple, Buffer *userbuf);
141141
extern bool heap_fetch_extended(Relation relation, Snapshot snapshot,

src/include/access/tableam.h

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ typedef struct TableAmRoutine
395395
* AM can support, return the flags represented the supported features of
396396
* scan.
397397
*/
398-
int (*scan_flags) (Relation rel);
398+
uint32 (*scan_flags) (Relation rel);
399399

400400
/* ------------------------------------------------------------------------
401401
* Parallel table scan related functions.
@@ -1245,6 +1245,16 @@ table_scan_getnextslot_tidrange(TableScanDesc sscan, ScanDirection direction,
12451245
slot);
12461246
}
12471247

1248+
/*
1249+
* Return the flags represented the supported features of table AM scan.
1250+
*/
1251+
static inline uint32
1252+
table_scan_flags(Relation rel)
1253+
{
1254+
if (rel->rd_tableam->scan_flags)
1255+
return rel->rd_tableam->scan_flags(rel);
1256+
return 0;
1257+
}
12481258

12491259
/* ----------------------------------------------------------------------------
12501260
* Parallel table scan related functions.

src/include/cdb/cdbappendonlyam.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ extern void appendonly_endscan(TableScanDesc scan);
445445
extern bool appendonly_getnextslot(TableScanDesc scan,
446446
ScanDirection direction,
447447
TupleTableSlot *slot);
448-
extern int appendonly_scan_flags(Relation relation);
448+
extern uint32 appendonly_scan_flags(Relation relation);
449449
extern AppendOnlyFetchDesc appendonly_fetch_init(
450450
Relation relation,
451451
Snapshot snapshot,

0 commit comments

Comments
 (0)