mirror of
https://github.com/postgres/postgres.git
synced 2025-06-07 11:02:12 +03:00
Pass Size as a 2nd argument for snprintf() in tablesync.c.
Previously the following snprintf() wrappers: * ReplicationSlotNameForTablesync() * ReplicationOriginNameForTablesync() ... used int as a second argument of snprintf() while the actual type of it is size_t. Although it doesn't fail at present better replace it with Size for consistency with the rest of the system. Author: Aleksander Alekseev Reviewed-By: Peter Smith Discussion: https://postgr.es/m/CAHut%2BPsa8hhfSE6ozUK-ih7GkQziAVAf4f3bqiXEj2nQiu-43g%40mail.gmail.com
This commit is contained in:
parent
6971a839cc
commit
a932824dfe
@ -1187,7 +1187,7 @@ copy_table(Relation rel)
|
|||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
ReplicationSlotNameForTablesync(Oid suboid, Oid relid,
|
ReplicationSlotNameForTablesync(Oid suboid, Oid relid,
|
||||||
char *syncslotname, int szslot)
|
char *syncslotname, Size szslot)
|
||||||
{
|
{
|
||||||
snprintf(syncslotname, szslot, "pg_%u_sync_%u_" UINT64_FORMAT, suboid,
|
snprintf(syncslotname, szslot, "pg_%u_sync_%u_" UINT64_FORMAT, suboid,
|
||||||
relid, GetSystemIdentifier());
|
relid, GetSystemIdentifier());
|
||||||
@ -1200,7 +1200,7 @@ ReplicationSlotNameForTablesync(Oid suboid, Oid relid,
|
|||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
ReplicationOriginNameForTablesync(Oid suboid, Oid relid,
|
ReplicationOriginNameForTablesync(Oid suboid, Oid relid,
|
||||||
char *originname, int szorgname)
|
char *originname, Size szorgname)
|
||||||
{
|
{
|
||||||
snprintf(originname, szorgname, "pg_%u_%u", suboid, relid);
|
snprintf(originname, szorgname, "pg_%u_%u", suboid, relid);
|
||||||
}
|
}
|
||||||
|
@ -218,7 +218,7 @@ extern void ReplicationSlotsDropDBSlots(Oid dboid);
|
|||||||
extern bool InvalidateObsoleteReplicationSlots(XLogSegNo oldestSegno);
|
extern bool InvalidateObsoleteReplicationSlots(XLogSegNo oldestSegno);
|
||||||
extern ReplicationSlot *SearchNamedReplicationSlot(const char *name, bool need_lock);
|
extern ReplicationSlot *SearchNamedReplicationSlot(const char *name, bool need_lock);
|
||||||
extern int ReplicationSlotIndex(ReplicationSlot *slot);
|
extern int ReplicationSlotIndex(ReplicationSlot *slot);
|
||||||
extern void ReplicationSlotNameForTablesync(Oid suboid, Oid relid, char *syncslotname, int szslot);
|
extern void ReplicationSlotNameForTablesync(Oid suboid, Oid relid, char *syncslotname, Size szslot);
|
||||||
extern void ReplicationSlotDropAtPubNode(WalReceiverConn *wrconn, char *slotname, bool missing_ok);
|
extern void ReplicationSlotDropAtPubNode(WalReceiverConn *wrconn, char *slotname, bool missing_ok);
|
||||||
|
|
||||||
extern void StartupReplicationSlots(void);
|
extern void StartupReplicationSlots(void);
|
||||||
|
@ -93,7 +93,7 @@ extern void logicalrep_worker_wakeup_ptr(LogicalRepWorker *worker);
|
|||||||
extern int logicalrep_sync_worker_count(Oid subid);
|
extern int logicalrep_sync_worker_count(Oid subid);
|
||||||
|
|
||||||
extern void ReplicationOriginNameForTablesync(Oid suboid, Oid relid,
|
extern void ReplicationOriginNameForTablesync(Oid suboid, Oid relid,
|
||||||
char *originname, int szorgname);
|
char *originname, Size szorgname);
|
||||||
extern char *LogicalRepSyncTableStart(XLogRecPtr *origin_startpos);
|
extern char *LogicalRepSyncTableStart(XLogRecPtr *origin_startpos);
|
||||||
|
|
||||||
extern bool AllTablesyncsReady(void);
|
extern bool AllTablesyncsReady(void);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user