From ba2a0aec164efb71424c70465dbf46871eeae8a7 Mon Sep 17 00:00:00 2001 From: zhjwpku Date: Fri, 18 Aug 2023 22:50:20 +0800 Subject: [PATCH] fix some obvious typo and reduce usage of magic number (#7130) fix some obvious typo and reduce usage of magic number Signed-off-by: Zhao Junwang --- src/backend/distributed/cdc/cdc_decoder_utils.c | 7 ++++--- src/include/distributed/coordinator_protocol.h | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/backend/distributed/cdc/cdc_decoder_utils.c b/src/backend/distributed/cdc/cdc_decoder_utils.c index d781f171c..f5b23aa12 100644 --- a/src/backend/distributed/cdc/cdc_decoder_utils.c +++ b/src/backend/distributed/cdc/cdc_decoder_utils.c @@ -72,7 +72,7 @@ DistShardRelationId(void) /* - * DistShardRelationId returns the relation id of the pg_dist_shard + * DistShardShardidIndexId returns the relation id of the pg_dist_shard_shardid_index */ static Oid DistShardShardidIndexId(void) @@ -87,7 +87,7 @@ DistShardShardidIndexId(void) /* - * DistShardRelationId returns the relation id of the pg_dist_shard + * DistPartitionRelationId returns the relation id of the pg_dist_partition */ static Oid DistPartitionRelationId(void) @@ -376,7 +376,8 @@ CdcIsReferenceTableViaCatalog(Oid relationId) * A table is a reference table when its partition method is 'none' * and replication model is 'two phase commit' */ - return partitionMethodChar == 'n' && replicationModelChar == 't'; + return partitionMethodChar == DISTRIBUTE_BY_NONE && + replicationModelChar == REPLICATION_MODEL_2PC; } diff --git a/src/include/distributed/coordinator_protocol.h b/src/include/distributed/coordinator_protocol.h index 7f90eadda..e2f1e9c52 100644 --- a/src/include/distributed/coordinator_protocol.h +++ b/src/include/distributed/coordinator_protocol.h @@ -156,7 +156,7 @@ struct TableDDLCommand /* * This union contains one (1) typed field for every implementation for - * TableDDLCommand. A union enforces no overloading of fields but instead requiers at + * TableDDLCommand. A union enforces no overloading of fields but instead requires at * most one of the fields to be used at any time. */ union