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

Commit98e675e

Browse files
Fix incorrect error message for IDENTIFY_SYSTEM
Commit5a991ef accidentally reversed the order of the tuplesand fields parameters, making the error message incorrectly referto 3 tuples with 1 field when IDENTIFY_SYSTEM returns 1 tuple and3 or 4 fields. Fix by changing the order of the parameters. Thisalso adds a comment describing why we check for < 3 when postgressince 9.4 has been sending 4 fields.Backpatch all the way since the bug is almost a decade old.Author: Tomonari Katsumata <t.katsumata1122@gmail.com>Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>Bug: #18224Backpatch-through: v12
1 parentb8ba734 commit98e675e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

‎src/backend/replication/libpqwalreceiver/libpqwalreceiver.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,10 @@ libpqrcv_identify_system(WalReceiverConn *conn, TimeLineID *primary_tli)
381381
"the primary server: %s",
382382
pchomp(PQerrorMessage(conn->streamConn)))));
383383
}
384+
/*
385+
* IDENTIFY_SERVER returns 3 columns in 9.3 and earlier, and 4 columns in
386+
* 9.4 and onwards.
387+
*/
384388
if (PQnfields(res)<3||PQntuples(res)!=1)
385389
{
386390
intntuples=PQntuples(res);
@@ -391,7 +395,7 @@ libpqrcv_identify_system(WalReceiverConn *conn, TimeLineID *primary_tli)
391395
(errcode(ERRCODE_PROTOCOL_VIOLATION),
392396
errmsg("invalid response from primary server"),
393397
errdetail("Could not identify system: got %d rows and %d fields, expected %d rows and %d or more fields.",
394-
ntuples,nfields,3,1)));
398+
ntuples,nfields,1,3)));
395399
}
396400
primary_sysid=pstrdup(PQgetvalue(res,0,0));
397401
*primary_tli=pg_strtoint32(PQgetvalue(res,0,1));

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp