Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9effa55

Browse files
author
Amit Kapila
committed
Deduplicate handling of binary and text modes in logicalrep_read_tuple().
Author: Bharath RupireddyReviewed-by: Peter SmithDiscussion:https://postgr.es/m/CALj2ACXdbq7kW_+bRrSGMsR6nefCvwbHBJ5J51mr3gFf7QysTA@mail.gmail.com
1 parentce340e5 commit9effa55

File tree

1 file changed

+6
-12
lines changed
  • src/backend/replication/logical

1 file changed

+6
-12
lines changed

‎src/backend/replication/logical/proto.c

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -895,25 +895,19 @@ logicalrep_read_tuple(StringInfo in, LogicalRepTupleData *tuple)
895895
/* we don't receive the value of an unchanged column */
896896
break;
897897
caseLOGICALREP_COLUMN_TEXT:
898-
len=pq_getmsgint(in,4);/* read length */
899-
900-
/* and data */
901-
value->data=palloc(len+1);
902-
pq_copymsgbytes(in,value->data,len);
903-
value->data[len]='\0';
904-
/* make StringInfo fully valid */
905-
value->len=len;
906-
value->cursor=0;
907-
value->maxlen=len;
908-
break;
909898
caseLOGICALREP_COLUMN_BINARY:
910899
len=pq_getmsgint(in,4);/* read length */
911900

912901
/* and data */
913902
value->data=palloc(len+1);
914903
pq_copymsgbytes(in,value->data,len);
915-
/* not strictly necessary but per StringInfo practice */
904+
905+
/*
906+
* Not strictly necessary for LOGICALREP_COLUMN_BINARY, but
907+
* per StringInfo practice.
908+
*/
916909
value->data[len]='\0';
910+
917911
/* make StringInfo fully valid */
918912
value->len=len;
919913
value->cursor=0;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp