Commit f3a8f73e authored by Amit Kapila's avatar Amit Kapila

Use Enums for logical replication message types at more places.

Commit 644f0d7c added logical replication message type enums to use
instead of character literals but some char substitutions were overlooked.

Author: Peter Smith
Reviewed-by: Amit Kapila
Discussion: https://postgr.es/m/CAHut+PsTG=Vrv8hgrvOnAvCNR21jhqMdPk2n0a1uJPoW0p+UfQ@mail.gmail.com
parent c98763bf
...@@ -304,7 +304,7 @@ ensure_transaction(void) ...@@ -304,7 +304,7 @@ ensure_transaction(void)
* Returns true for streamed transactions, false otherwise (regular mode). * Returns true for streamed transactions, false otherwise (regular mode).
*/ */
static bool static bool
handle_streamed_transaction(const char action, StringInfo s) handle_streamed_transaction(LogicalRepMsgType action, StringInfo s)
{ {
TransactionId xid; TransactionId xid;
...@@ -1090,7 +1090,7 @@ apply_handle_relation(StringInfo s) ...@@ -1090,7 +1090,7 @@ apply_handle_relation(StringInfo s)
{ {
LogicalRepRelation *rel; LogicalRepRelation *rel;
if (handle_streamed_transaction('R', s)) if (handle_streamed_transaction(LOGICAL_REP_MSG_RELATION, s))
return; return;
rel = logicalrep_read_rel(s); rel = logicalrep_read_rel(s);
...@@ -1108,7 +1108,7 @@ apply_handle_type(StringInfo s) ...@@ -1108,7 +1108,7 @@ apply_handle_type(StringInfo s)
{ {
LogicalRepTyp typ; LogicalRepTyp typ;
if (handle_streamed_transaction('Y', s)) if (handle_streamed_transaction(LOGICAL_REP_MSG_TYPE, s))
return; return;
logicalrep_read_typ(s, &typ); logicalrep_read_typ(s, &typ);
...@@ -1148,7 +1148,7 @@ apply_handle_insert(StringInfo s) ...@@ -1148,7 +1148,7 @@ apply_handle_insert(StringInfo s)
TupleTableSlot *remoteslot; TupleTableSlot *remoteslot;
MemoryContext oldctx; MemoryContext oldctx;
if (handle_streamed_transaction('I', s)) if (handle_streamed_transaction(LOGICAL_REP_MSG_INSERT, s))
return; return;
ensure_transaction(); ensure_transaction();
...@@ -1269,7 +1269,7 @@ apply_handle_update(StringInfo s) ...@@ -1269,7 +1269,7 @@ apply_handle_update(StringInfo s)
RangeTblEntry *target_rte; RangeTblEntry *target_rte;
MemoryContext oldctx; MemoryContext oldctx;
if (handle_streamed_transaction('U', s)) if (handle_streamed_transaction(LOGICAL_REP_MSG_UPDATE, s))
return; return;
ensure_transaction(); ensure_transaction();
...@@ -1426,7 +1426,7 @@ apply_handle_delete(StringInfo s) ...@@ -1426,7 +1426,7 @@ apply_handle_delete(StringInfo s)
TupleTableSlot *remoteslot; TupleTableSlot *remoteslot;
MemoryContext oldctx; MemoryContext oldctx;
if (handle_streamed_transaction('D', s)) if (handle_streamed_transaction(LOGICAL_REP_MSG_DELETE, s))
return; return;
ensure_transaction(); ensure_transaction();
...@@ -1795,7 +1795,7 @@ apply_handle_truncate(StringInfo s) ...@@ -1795,7 +1795,7 @@ apply_handle_truncate(StringInfo s)
List *relids_logged = NIL; List *relids_logged = NIL;
ListCell *lc; ListCell *lc;
if (handle_streamed_transaction('T', s)) if (handle_streamed_transaction(LOGICAL_REP_MSG_TRUNCATE, s))
return; return;
ensure_transaction(); ensure_transaction();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment