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

Commite0d010f

Browse files
committed
Revert "Fix bug in checking of IDENTIFY_SYSTEM result."
This reverts commit083d29c.The commit changed the code so that it causes an errors whenIDENTIFY_SYSTEM returns three columns. But which prevents usfrom using the replication-related utilities against the serverwith older version. This is not what we want. For thatcompatibility, we allow the utilities to receive three columnsas the result of IDENTIFY_SYSTEM eventhough it actually returnsfour columns in 9.4 or later.Pointed out by Andres Freund.
1 parentc41996b commite0d010f

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ libpqrcv_identify_system(TimeLineID *primary_tli)
131131
"the primary server: %s",
132132
PQerrorMessage(streamConn))));
133133
}
134-
if (PQnfields(res)<4||PQntuples(res)!=1)
134+
if (PQnfields(res)<3||PQntuples(res)!=1)
135135
{
136136
intntuples=PQntuples(res);
137137
intnfields=PQnfields(res);
@@ -140,7 +140,7 @@ libpqrcv_identify_system(TimeLineID *primary_tli)
140140
ereport(ERROR,
141141
(errmsg("invalid response from primary server"),
142142
errdetail("Could not identify system: got %d rows and %d fields, expected %d rows and %d or more fields.",
143-
ntuples,nfields,4,1)));
143+
ntuples,nfields,3,1)));
144144
}
145145
primary_sysid=PQgetvalue(res,0,0);
146146
*primary_tli=pg_atoi(PQgetvalue(res,0,1),4,0);

‎src/bin/pg_basebackup/pg_basebackup.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1644,11 +1644,11 @@ BaseBackup(void)
16441644
progname,"IDENTIFY_SYSTEM",PQerrorMessage(conn));
16451645
disconnect_and_exit(1);
16461646
}
1647-
if (PQntuples(res)!=1||PQnfields(res)<4)
1647+
if (PQntuples(res)!=1||PQnfields(res)<3)
16481648
{
16491649
fprintf(stderr,
16501650
_("%s: could not identify system: got %d rows and %d fields, expected %d rows and %d or more fields\n"),
1651-
progname,PQntuples(res),PQnfields(res),1,4);
1651+
progname,PQntuples(res),PQnfields(res),1,3);
16521652
disconnect_and_exit(1);
16531653
}
16541654
sysidentifier=pg_strdup(PQgetvalue(res,0,0));

‎src/bin/pg_basebackup/pg_receivexlog.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,11 +287,11 @@ StreamLog(void)
287287
progname,"IDENTIFY_SYSTEM",PQerrorMessage(conn));
288288
disconnect_and_exit(1);
289289
}
290-
if (PQntuples(res)!=1||PQnfields(res)<4)
290+
if (PQntuples(res)!=1||PQnfields(res)<3)
291291
{
292292
fprintf(stderr,
293293
_("%s: could not identify system: got %d rows and %d fields, expected %d rows and %d or more fields\n"),
294-
progname,PQntuples(res),PQnfields(res),1,4);
294+
progname,PQntuples(res),PQnfields(res),1,3);
295295
disconnect_and_exit(1);
296296
}
297297
servertli=atoi(PQgetvalue(res,0,1));

‎src/bin/pg_basebackup/receivelog.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -472,11 +472,11 @@ ReceiveXlogStream(PGconn *conn, XLogRecPtr startpos, uint32 timeline,
472472
PQclear(res);
473473
return false;
474474
}
475-
if (PQntuples(res)!=1||PQnfields(res)<4)
475+
if (PQntuples(res)!=1||PQnfields(res)<3)
476476
{
477477
fprintf(stderr,
478478
_("%s: could not identify system: got %d rows and %d fields, expected %d rows and %d or more fields\n"),
479-
progname,PQntuples(res),PQnfields(res),1,4);
479+
progname,PQntuples(res),PQnfields(res),1,3);
480480
PQclear(res);
481481
return false;
482482
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp