Fix ScanKeyInit RegProcedure and Datum arguments (#7072)

Index scans in PG16 return empty sets because of extra compatibility
enforcement for `ScanKeyInit` arguments.
Could be one of the relevant PG commits:
c8b2ef05f4
This PR fixes all incompatible `RegProcedure` and `Datum` arguments in
all `ScanKeyInit` functions used throughout the codebase.
Helpful for https://github.com/citusdata/citus/pull/6952
pull/7037/head
Naisila Puka 2023-07-21 14:11:10 +03:00 committed by GitHub
parent 87dc88f837
commit a282953274
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 36 additions and 36 deletions

View File

@ -707,9 +707,9 @@ ReadStripeSkipList(RelFileNode relfilenode, uint64 stripe, TupleDesc tupleDescri
Relation columnarChunk = table_open(columnarChunkOid, AccessShareLock); Relation columnarChunk = table_open(columnarChunkOid, AccessShareLock);
ScanKeyInit(&scanKey[0], Anum_columnar_chunk_storageid, ScanKeyInit(&scanKey[0], Anum_columnar_chunk_storageid,
BTEqualStrategyNumber, F_OIDEQ, UInt64GetDatum(storageId)); BTEqualStrategyNumber, F_INT8EQ, Int64GetDatum(storageId));
ScanKeyInit(&scanKey[1], Anum_columnar_chunk_stripe, ScanKeyInit(&scanKey[1], Anum_columnar_chunk_stripe,
BTEqualStrategyNumber, F_OIDEQ, Int32GetDatum(stripe)); BTEqualStrategyNumber, F_INT8EQ, Int64GetDatum(stripe));
Oid indexId = ColumnarChunkIndexRelationId(); Oid indexId = ColumnarChunkIndexRelationId();
bool indexOk = OidIsValid(indexId); bool indexOk = OidIsValid(indexId);
@ -915,7 +915,7 @@ StripeMetadataLookupRowNumber(Relation relation, uint64 rowNumber, Snapshot snap
uint64 storageId = ColumnarStorageGetStorageId(relation, false); uint64 storageId = ColumnarStorageGetStorageId(relation, false);
ScanKeyData scanKey[2]; ScanKeyData scanKey[2];
ScanKeyInit(&scanKey[0], Anum_columnar_stripe_storageid, ScanKeyInit(&scanKey[0], Anum_columnar_stripe_storageid,
BTEqualStrategyNumber, F_OIDEQ, Int32GetDatum(storageId)); BTEqualStrategyNumber, F_INT8EQ, Int64GetDatum(storageId));
StrategyNumber strategyNumber = InvalidStrategy; StrategyNumber strategyNumber = InvalidStrategy;
RegProcedure procedure = InvalidOid; RegProcedure procedure = InvalidOid;
@ -930,7 +930,7 @@ StripeMetadataLookupRowNumber(Relation relation, uint64 rowNumber, Snapshot snap
procedure = F_INT8GT; procedure = F_INT8GT;
} }
ScanKeyInit(&scanKey[1], Anum_columnar_stripe_first_row_number, ScanKeyInit(&scanKey[1], Anum_columnar_stripe_first_row_number,
strategyNumber, procedure, UInt64GetDatum(rowNumber)); strategyNumber, procedure, Int64GetDatum(rowNumber));
Relation columnarStripes = table_open(ColumnarStripeRelationId(), AccessShareLock); Relation columnarStripes = table_open(ColumnarStripeRelationId(), AccessShareLock);
@ -1081,7 +1081,7 @@ FindStripeWithHighestRowNumber(Relation relation, Snapshot snapshot)
uint64 storageId = ColumnarStorageGetStorageId(relation, false); uint64 storageId = ColumnarStorageGetStorageId(relation, false);
ScanKeyData scanKey[1]; ScanKeyData scanKey[1];
ScanKeyInit(&scanKey[0], Anum_columnar_stripe_storageid, ScanKeyInit(&scanKey[0], Anum_columnar_stripe_storageid,
BTEqualStrategyNumber, F_OIDEQ, Int32GetDatum(storageId)); BTEqualStrategyNumber, F_INT8EQ, Int64GetDatum(storageId));
Relation columnarStripes = table_open(ColumnarStripeRelationId(), AccessShareLock); Relation columnarStripes = table_open(ColumnarStripeRelationId(), AccessShareLock);
@ -1143,9 +1143,9 @@ ReadChunkGroupRowCounts(uint64 storageId, uint64 stripe, uint32 chunkGroupCount,
ScanKeyData scanKey[2]; ScanKeyData scanKey[2];
ScanKeyInit(&scanKey[0], Anum_columnar_chunkgroup_storageid, ScanKeyInit(&scanKey[0], Anum_columnar_chunkgroup_storageid,
BTEqualStrategyNumber, F_OIDEQ, UInt64GetDatum(storageId)); BTEqualStrategyNumber, F_INT8EQ, Int64GetDatum(storageId));
ScanKeyInit(&scanKey[1], Anum_columnar_chunkgroup_stripe, ScanKeyInit(&scanKey[1], Anum_columnar_chunkgroup_stripe,
BTEqualStrategyNumber, F_OIDEQ, Int32GetDatum(stripe)); BTEqualStrategyNumber, F_INT8EQ, Int64GetDatum(stripe));
Oid indexId = ColumnarChunkGroupIndexRelationId(); Oid indexId = ColumnarChunkGroupIndexRelationId();
bool indexOk = OidIsValid(indexId); bool indexOk = OidIsValid(indexId);
@ -1372,9 +1372,9 @@ UpdateStripeMetadataRow(uint64 storageId, uint64 stripeId, bool *update,
ScanKeyData scanKey[2]; ScanKeyData scanKey[2];
ScanKeyInit(&scanKey[0], Anum_columnar_stripe_storageid, ScanKeyInit(&scanKey[0], Anum_columnar_stripe_storageid,
BTEqualStrategyNumber, F_OIDEQ, Int32GetDatum(storageId)); BTEqualStrategyNumber, F_INT8EQ, Int64GetDatum(storageId));
ScanKeyInit(&scanKey[1], Anum_columnar_stripe_stripe, ScanKeyInit(&scanKey[1], Anum_columnar_stripe_stripe,
BTEqualStrategyNumber, F_OIDEQ, Int32GetDatum(stripeId)); BTEqualStrategyNumber, F_INT8EQ, Int64GetDatum(stripeId));
Oid columnarStripesOid = ColumnarStripeRelationId(); Oid columnarStripesOid = ColumnarStripeRelationId();
@ -1451,7 +1451,7 @@ ReadDataFileStripeList(uint64 storageId, Snapshot snapshot)
HeapTuple heapTuple; HeapTuple heapTuple;
ScanKeyInit(&scanKey[0], Anum_columnar_stripe_storageid, ScanKeyInit(&scanKey[0], Anum_columnar_stripe_storageid,
BTEqualStrategyNumber, F_OIDEQ, Int32GetDatum(storageId)); BTEqualStrategyNumber, F_INT8EQ, Int64GetDatum(storageId));
Oid columnarStripesOid = ColumnarStripeRelationId(); Oid columnarStripesOid = ColumnarStripeRelationId();
@ -1578,7 +1578,7 @@ DeleteStorageFromColumnarMetadataTable(Oid metadataTableId,
{ {
ScanKeyData scanKey[1]; ScanKeyData scanKey[1];
ScanKeyInit(&scanKey[0], storageIdAtrrNumber, BTEqualStrategyNumber, ScanKeyInit(&scanKey[0], storageIdAtrrNumber, BTEqualStrategyNumber,
F_INT8EQ, UInt64GetDatum(storageId)); F_INT8EQ, Int64GetDatum(storageId));
Relation metadataTable = try_relation_open(metadataTableId, AccessShareLock); Relation metadataTable = try_relation_open(metadataTableId, AccessShareLock);
if (metadataTable == NULL) if (metadataTable == NULL)

View File

@ -892,7 +892,7 @@ GetConstraintNameList(Oid relationId)
Relation pgConstraint = table_open(ConstraintRelationId, AccessShareLock); Relation pgConstraint = table_open(ConstraintRelationId, AccessShareLock);
ScanKeyInit(&scanKey[0], Anum_pg_constraint_conrelid, ScanKeyInit(&scanKey[0], Anum_pg_constraint_conrelid,
BTEqualStrategyNumber, F_OIDEQ, relationId); BTEqualStrategyNumber, F_OIDEQ, ObjectIdGetDatum(relationId));
bool useIndex = true; bool useIndex = true;
SysScanDesc scanDescriptor = systable_beginscan(pgConstraint, SysScanDesc scanDescriptor = systable_beginscan(pgConstraint,

View File

@ -1227,7 +1227,7 @@ GetForeignKeyOids(Oid relationId, int flags)
Relation pgConstraint = table_open(ConstraintRelationId, AccessShareLock); Relation pgConstraint = table_open(ConstraintRelationId, AccessShareLock);
ScanKeyInit(&scanKey[0], pgConstraintTargetAttrNumber, ScanKeyInit(&scanKey[0], pgConstraintTargetAttrNumber,
BTEqualStrategyNumber, F_OIDEQ, relationId); BTEqualStrategyNumber, F_OIDEQ, ObjectIdGetDatum(relationId));
SysScanDesc scanDescriptor = systable_beginscan(pgConstraint, indexOid, useIndex, SysScanDesc scanDescriptor = systable_beginscan(pgConstraint, indexOid, useIndex,
NULL, scanKeyCount, scanKey); NULL, scanKeyCount, scanKey);

View File

@ -780,7 +780,7 @@ UpdateFunctionDistributionInfo(const ObjectAddress *distAddress,
ScanKeyInit(&scanKey[1], Anum_pg_dist_object_objid, BTEqualStrategyNumber, F_OIDEQ, ScanKeyInit(&scanKey[1], Anum_pg_dist_object_objid, BTEqualStrategyNumber, F_OIDEQ,
ObjectIdGetDatum(distAddress->objectId)); ObjectIdGetDatum(distAddress->objectId));
ScanKeyInit(&scanKey[2], Anum_pg_dist_object_objsubid, BTEqualStrategyNumber, ScanKeyInit(&scanKey[2], Anum_pg_dist_object_objsubid, BTEqualStrategyNumber,
F_INT4EQ, ObjectIdGetDatum(distAddress->objectSubId)); F_INT4EQ, Int32GetDatum(distAddress->objectSubId));
SysScanDesc scanDescriptor = systable_beginscan(pgDistObjectRel, SysScanDesc scanDescriptor = systable_beginscan(pgDistObjectRel,
DistObjectPrimaryKeyIndexId(), DistObjectPrimaryKeyIndexId(),

View File

@ -369,7 +369,7 @@ SchemaHasDistributedTableWithFKey(char *schemaName)
Relation pgClass = table_open(RelationRelationId, AccessShareLock); Relation pgClass = table_open(RelationRelationId, AccessShareLock);
ScanKeyInit(&scanKey[0], Anum_pg_class_relnamespace, BTEqualStrategyNumber, ScanKeyInit(&scanKey[0], Anum_pg_class_relnamespace, BTEqualStrategyNumber,
F_OIDEQ, namespaceOid); F_OIDEQ, ObjectIdGetDatum(namespaceOid));
SysScanDesc scanDescriptor = systable_beginscan(pgClass, scanIndexId, useIndex, NULL, SysScanDesc scanDescriptor = systable_beginscan(pgClass, scanIndexId, useIndex, NULL,
scanKeyCount, scanKey); scanKeyCount, scanKey);

View File

@ -249,7 +249,7 @@ GetExplicitTriggerIdList(Oid relationId)
ScanKeyData scanKey[1]; ScanKeyData scanKey[1];
ScanKeyInit(&scanKey[0], Anum_pg_trigger_tgrelid, ScanKeyInit(&scanKey[0], Anum_pg_trigger_tgrelid,
BTEqualStrategyNumber, F_OIDEQ, relationId); BTEqualStrategyNumber, F_OIDEQ, ObjectIdGetDatum(relationId));
bool useIndex = true; bool useIndex = true;
SysScanDesc scanDescriptor = systable_beginscan(pgTrigger, TriggerRelidNameIndexId, SysScanDesc scanDescriptor = systable_beginscan(pgTrigger, TriggerRelidNameIndexId,

View File

@ -1200,7 +1200,7 @@ FirstExtensionWithSchema(Oid schemaId)
ScanKeyData entry[1]; ScanKeyData entry[1];
ScanKeyInit(&entry[0], Anum_pg_extension_extnamespace, BTEqualStrategyNumber, ScanKeyInit(&entry[0], Anum_pg_extension_extnamespace, BTEqualStrategyNumber,
F_INT4EQ, schemaId); F_OIDEQ, ObjectIdGetDatum(schemaId));
SysScanDesc scan = systable_beginscan(relation, InvalidOid, false, NULL, 1, entry); SysScanDesc scan = systable_beginscan(relation, InvalidOid, false, NULL, 1, entry);
HeapTuple extensionTuple = systable_getnext(scan); HeapTuple extensionTuple = systable_getnext(scan);

View File

@ -510,7 +510,7 @@ UpdateDistributedObjectColocationId(uint32 oldColocationId,
/* scan pg_dist_object for colocationId equal to old colocationId */ /* scan pg_dist_object for colocationId equal to old colocationId */
ScanKeyInit(&scanKey[0], Anum_pg_dist_object_colocationid, ScanKeyInit(&scanKey[0], Anum_pg_dist_object_colocationid,
BTEqualStrategyNumber, BTEqualStrategyNumber,
F_INT4EQ, UInt32GetDatum(oldColocationId)); F_INT4EQ, Int32GetDatum(oldColocationId));
SysScanDesc scanDescriptor = systable_beginscan(pgDistObjectRel, SysScanDesc scanDescriptor = systable_beginscan(pgDistObjectRel,
InvalidOid, InvalidOid,

View File

@ -5600,7 +5600,7 @@ role_exists(PG_FUNCTION_ARGS)
* Otherwise, this function returns NULL. * Otherwise, this function returns NULL.
*/ */
char * char *
GetPoolinfoViaCatalog(int64 nodeId) GetPoolinfoViaCatalog(int32 nodeId)
{ {
ScanKeyData scanKey[1]; ScanKeyData scanKey[1];
const int scanKeyCount = 1; const int scanKeyCount = 1;

View File

@ -1757,8 +1757,8 @@ GetFunctionDependenciesForObjects(ObjectAddress *objectAddress)
ObjectIdGetDatum(objectAddress->objectId)); ObjectIdGetDatum(objectAddress->objectId));
ScanKeyInit(&key[2], ScanKeyInit(&key[2],
Anum_pg_depend_objsubid, Anum_pg_depend_objsubid,
BTEqualStrategyNumber, F_OIDEQ, BTEqualStrategyNumber, F_INT4EQ,
ObjectIdGetDatum(objectAddress->objectSubId)); Int32GetDatum(objectAddress->objectSubId));
SysScanDesc scan = systable_beginscan(depRel, DependDependerIndexId, true, SysScanDesc scan = systable_beginscan(depRel, DependDependerIndexId, true,
NULL, 3, key); NULL, 3, key);

View File

@ -3286,11 +3286,11 @@ BackgroundTaskHasUmnetDependencies(int64 jobId, int64 taskId)
/* pg_catalog.pg_dist_background_task_depend.job_id = jobId */ /* pg_catalog.pg_dist_background_task_depend.job_id = jobId */
ScanKeyInit(&scanKey[0], Anum_pg_dist_background_task_depend_job_id, ScanKeyInit(&scanKey[0], Anum_pg_dist_background_task_depend_job_id,
BTEqualStrategyNumber, F_INT8EQ, jobId); BTEqualStrategyNumber, F_INT8EQ, Int64GetDatum(jobId));
/* pg_catalog.pg_dist_background_task_depend.task_id = $taskId */ /* pg_catalog.pg_dist_background_task_depend.task_id = $taskId */
ScanKeyInit(&scanKey[1], Anum_pg_dist_background_task_depend_task_id, ScanKeyInit(&scanKey[1], Anum_pg_dist_background_task_depend_task_id,
BTEqualStrategyNumber, F_INT8EQ, taskId); BTEqualStrategyNumber, F_INT8EQ, Int64GetDatum(taskId));
SysScanDesc scanDescriptor = SysScanDesc scanDescriptor =
systable_beginscan(pgDistBackgroundTasksDepend, systable_beginscan(pgDistBackgroundTasksDepend,

View File

@ -1005,7 +1005,7 @@ ListCleanupRecordsForCurrentOperation(void)
ScanKeyData scanKey[1]; ScanKeyData scanKey[1];
ScanKeyInit(&scanKey[0], Anum_pg_dist_cleanup_operation_id, BTEqualStrategyNumber, ScanKeyInit(&scanKey[0], Anum_pg_dist_cleanup_operation_id, BTEqualStrategyNumber,
F_INT8EQ, UInt64GetDatum(CurrentOperationId)); F_INT8EQ, Int64GetDatum(CurrentOperationId));
int scanKeyCount = 1; int scanKeyCount = 1;
Oid scanIndexId = InvalidOid; Oid scanIndexId = InvalidOid;
@ -1119,7 +1119,7 @@ CleanupRecordExists(uint64 recordId)
bool indexOK = true; bool indexOK = true;
ScanKeyInit(&scanKey[0], Anum_pg_dist_cleanup_record_id, ScanKeyInit(&scanKey[0], Anum_pg_dist_cleanup_record_id,
BTEqualStrategyNumber, F_INT8EQ, UInt64GetDatum(recordId)); BTEqualStrategyNumber, F_INT8EQ, Int64GetDatum(recordId));
SysScanDesc scanDescriptor = systable_beginscan(pgDistCleanup, SysScanDesc scanDescriptor = systable_beginscan(pgDistCleanup,
DistCleanupPrimaryKeyIndexId(), DistCleanupPrimaryKeyIndexId(),
@ -1152,7 +1152,7 @@ DeleteCleanupRecordByRecordId(uint64 recordId)
bool indexOK = true; bool indexOK = true;
ScanKeyInit(&scanKey[0], Anum_pg_dist_cleanup_record_id, ScanKeyInit(&scanKey[0], Anum_pg_dist_cleanup_record_id,
BTEqualStrategyNumber, F_INT8EQ, UInt64GetDatum(recordId)); BTEqualStrategyNumber, F_INT8EQ, Int64GetDatum(recordId));
SysScanDesc scanDescriptor = systable_beginscan(pgDistCleanup, SysScanDesc scanDescriptor = systable_beginscan(pgDistCleanup,
DistCleanupPrimaryKeyIndexId(), DistCleanupPrimaryKeyIndexId(),

View File

@ -532,7 +532,7 @@ ColocationId(int shardCount, int replicationFactor, Oid distributionColumnType,
ScanKeyInit(&scanKey[0], Anum_pg_dist_colocation_distributioncolumntype, ScanKeyInit(&scanKey[0], Anum_pg_dist_colocation_distributioncolumntype,
BTEqualStrategyNumber, F_OIDEQ, ObjectIdGetDatum(distributionColumnType)); BTEqualStrategyNumber, F_OIDEQ, ObjectIdGetDatum(distributionColumnType));
ScanKeyInit(&scanKey[1], Anum_pg_dist_colocation_shardcount, ScanKeyInit(&scanKey[1], Anum_pg_dist_colocation_shardcount,
BTEqualStrategyNumber, F_INT4EQ, UInt32GetDatum(shardCount)); BTEqualStrategyNumber, F_INT4EQ, Int32GetDatum(shardCount));
ScanKeyInit(&scanKey[2], Anum_pg_dist_colocation_replicationfactor, ScanKeyInit(&scanKey[2], Anum_pg_dist_colocation_replicationfactor,
BTEqualStrategyNumber, F_INT4EQ, Int32GetDatum(replicationFactor)); BTEqualStrategyNumber, F_INT4EQ, Int32GetDatum(replicationFactor));
ScanKeyInit(&scanKey[3], Anum_pg_dist_colocation_distributioncolumncollation, ScanKeyInit(&scanKey[3], Anum_pg_dist_colocation_distributioncolumncollation,
@ -989,7 +989,7 @@ ColocationGroupTableList(uint32 colocationId, uint32 count)
} }
ScanKeyInit(&scanKey[0], Anum_pg_dist_partition_colocationid, ScanKeyInit(&scanKey[0], Anum_pg_dist_partition_colocationid,
BTEqualStrategyNumber, F_INT4EQ, UInt32GetDatum(colocationId)); BTEqualStrategyNumber, F_INT4EQ, Int32GetDatum(colocationId));
Relation pgDistPartition = table_open(DistPartitionRelationId(), AccessShareLock); Relation pgDistPartition = table_open(DistPartitionRelationId(), AccessShareLock);
TupleDesc tupleDescriptor = RelationGetDescr(pgDistPartition); TupleDesc tupleDescriptor = RelationGetDescr(pgDistPartition);
@ -1166,7 +1166,7 @@ ColocatedNonPartitionShardIntervalList(ShardInterval *shardInterval)
* guarantee that the table isn't dropped for the remainder of the transaction. * guarantee that the table isn't dropped for the remainder of the transaction.
*/ */
Oid Oid
ColocatedTableId(Oid colocationId) ColocatedTableId(int32 colocationId)
{ {
Oid colocatedTableId = InvalidOid; Oid colocatedTableId = InvalidOid;
bool indexOK = true; bool indexOK = true;
@ -1183,7 +1183,7 @@ ColocatedTableId(Oid colocationId)
} }
ScanKeyInit(&scanKey[0], Anum_pg_dist_partition_colocationid, ScanKeyInit(&scanKey[0], Anum_pg_dist_partition_colocationid,
BTEqualStrategyNumber, F_INT4EQ, ObjectIdGetDatum(colocationId)); BTEqualStrategyNumber, F_INT4EQ, Int32GetDatum(colocationId));
Relation pgDistPartition = table_open(DistPartitionRelationId(), AccessShareLock); Relation pgDistPartition = table_open(DistPartitionRelationId(), AccessShareLock);
TupleDesc tupleDescriptor = RelationGetDescr(pgDistPartition); TupleDesc tupleDescriptor = RelationGetDescr(pgDistPartition);
@ -1292,7 +1292,7 @@ DeleteColocationGroupLocally(uint32 colocationId)
Relation pgDistColocation = table_open(DistColocationRelationId(), RowExclusiveLock); Relation pgDistColocation = table_open(DistColocationRelationId(), RowExclusiveLock);
ScanKeyInit(&scanKey[0], Anum_pg_dist_colocation_colocationid, ScanKeyInit(&scanKey[0], Anum_pg_dist_colocation_colocationid,
BTEqualStrategyNumber, F_INT4EQ, UInt32GetDatum(colocationId)); BTEqualStrategyNumber, F_INT4EQ, Int32GetDatum(colocationId));
SysScanDesc scanDescriptor = systable_beginscan(pgDistColocation, InvalidOid, indexOK, SysScanDesc scanDescriptor = systable_beginscan(pgDistColocation, InvalidOid, indexOK,
NULL, scanKeyCount, scanKey); NULL, scanKeyCount, scanKey);

View File

@ -411,9 +411,9 @@ CheckConstraintNameListForRelation(Oid relationId)
Relation pgConstraint = table_open(ConstraintRelationId, AccessShareLock); Relation pgConstraint = table_open(ConstraintRelationId, AccessShareLock);
ScanKeyInit(&scanKey[0], Anum_pg_constraint_conrelid, ScanKeyInit(&scanKey[0], Anum_pg_constraint_conrelid,
BTEqualStrategyNumber, F_OIDEQ, relationId); BTEqualStrategyNumber, F_OIDEQ, ObjectIdGetDatum(relationId));
ScanKeyInit(&scanKey[1], Anum_pg_constraint_contype, ScanKeyInit(&scanKey[1], Anum_pg_constraint_contype,
BTEqualStrategyNumber, F_CHAREQ, CONSTRAINT_CHECK); BTEqualStrategyNumber, F_CHAREQ, CharGetDatum(CONSTRAINT_CHECK));
bool useIndex = false; bool useIndex = false;
SysScanDesc scanDescriptor = systable_beginscan(pgConstraint, InvalidOid, useIndex, SysScanDesc scanDescriptor = systable_beginscan(pgConstraint, InvalidOid, useIndex,

View File

@ -134,7 +134,7 @@ ColocationIdGetTenantSchemaId(uint32 colocationId)
AccessShareLock); AccessShareLock);
ScanKeyData scanKey[1]; ScanKeyData scanKey[1];
ScanKeyInit(&scanKey[0], Anum_pg_dist_schema_colocationid, ScanKeyInit(&scanKey[0], Anum_pg_dist_schema_colocationid,
BTEqualStrategyNumber, F_INT4EQ, UInt32GetDatum(colocationId)); BTEqualStrategyNumber, F_INT4EQ, Int32GetDatum(colocationId));
bool indexOk = true; bool indexOk = true;
SysScanDesc scanDescriptor = systable_beginscan(pgDistTenantSchema, SysScanDesc scanDescriptor = systable_beginscan(pgDistTenantSchema,

View File

@ -24,7 +24,7 @@ extern bool ShardsColocated(ShardInterval *leftShardInterval,
extern List * ColocatedTableList(Oid distributedTableId); extern List * ColocatedTableList(Oid distributedTableId);
extern List * ColocatedShardIntervalList(ShardInterval *shardInterval); extern List * ColocatedShardIntervalList(ShardInterval *shardInterval);
extern List * ColocatedNonPartitionShardIntervalList(ShardInterval *shardInterval); extern List * ColocatedNonPartitionShardIntervalList(ShardInterval *shardInterval);
extern Oid ColocatedTableId(Oid colocationId); extern Oid ColocatedTableId(int32 colocationId);
extern uint64 ColocatedShardIdInRelation(Oid relationId, int shardIndex); extern uint64 ColocatedShardIdInRelation(Oid relationId, int shardIndex);
uint32 ColocationId(int shardCount, int replicationFactor, Oid distributionColumnType, uint32 ColocationId(int shardCount, int replicationFactor, Oid distributionColumnType,
Oid distributionColumnCollation); Oid distributionColumnCollation);

View File

@ -320,6 +320,6 @@ extern const char * CurrentDatabaseName(void);
/* connection-related functions */ /* connection-related functions */
extern char * GetAuthinfoViaCatalog(const char *roleName, int64 nodeId); extern char * GetAuthinfoViaCatalog(const char *roleName, int64 nodeId);
extern char * GetPoolinfoViaCatalog(int64 nodeId); extern char * GetPoolinfoViaCatalog(int32 nodeId);
#endif /* METADATA_CACHE_H */ #endif /* METADATA_CACHE_H */