git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8bf58c0)
pg_rewind: Fix busted sanity check.
2017年7月21日 16:48:22 +0000 (12:48 -0400)
2017年7月21日 16:59:22 +0000 (12:59 -0400)
As written, the code would only fail the sanity check if none of the
columns returned by the server were of the expected type, but we want
it to fail if even one column is not of the expected type.

Discussion: http://postgr.es/m/CA+TgmoYuY5zW7JEs+1hSS1D=V5K8h1SQuESrq=bMNeo0B71Sfw@mail.gmail.com


diff --git a/src/bin/pg_rewind/libpq_fetch.c b/src/bin/pg_rewind/libpq_fetch.c
index c25367fc49a197a51481196fab2fce0dcfecd5d0..cf3f64c3aa0919634ca74e5b536be362dd445f7d 100644 (file)
--- a/src/bin/pg_rewind/libpq_fetch.c
+++ b/src/bin/pg_rewind/libpq_fetch.c
@@ -269,8 +269,8 @@ receiveFileChunks(const char *sql)
if (PQnfields(res) != 3 || PQntuples(res) != 1)
pg_fatal("unexpected result set size while fetching remote files\n");
- if (PQftype(res, 0) != TEXTOID &&
- PQftype(res, 1) != INT4OID &&
+ if (PQftype(res, 0) != TEXTOID ||
+ PQftype(res, 1) != INT4OID ||
PQftype(res, 2) != BYTEAOID)
{
pg_fatal("unexpected data types in result set while fetching remote files: %u %u %u\n",
This is the main PostgreSQL git repository.
RSS Atom

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