git.postgresql.org Git - postgresql.git/commit

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: 5f21f52) | patch
Fix logical replication between different encodings
Wed, 5 Apr 2017 14:44:23 +0000 (10:44 -0400)
Thu, 6 Apr 2017 18:41:09 +0000 (14:41 -0400)
commit 6f1b9aaae35bfabe2654a8e44ce226c91e7d8bd9
Fix logical replication between different encodings

When sending a tuple attribute, the previous coding erroneously sent the
length byte before encoding conversion, which would lead to protocol
failures on the receiving side if the length did not match the following
string.

To fix that, use pq_sendcountedtext() for sending tuple attributes,
which takes care of all of that internally. To match the API of
pq_sendcountedtext(), send even text values without a trailing zero byte
and have the receiving end put it in place instead. This matches how
the standard FE/BE protocol behaves.

Reported-by: Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>
doc/src/sgml/protocol.sgml diff | blob | blame | history
src/backend/replication/logical/proto.c diff | blob | blame | history
src/test/subscription/t/005_encoding.pl [new file with mode: 0644] blob
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /