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

Commitc41996b

Browse files
committed
Fix bug in checking of IDENTIFY_SYSTEM result.
5a991ef added new column intothe result of IDENTIFY_SYSTEM command. But it was not reflected intoseveral codes checking that result. Specifically though the number ofcolumns in the result was increased to 4, it was still compared with 3in some replication codes.Back-patch to 9.4 where the number of columns in IDENTIFY_SYSTEMresult was increased.Report from Michael Paquier
1 parent151ce45 commitc41996b

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)<3||PQntuples(res)!=1)
134+
if (PQnfields(res)<4||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,3,1)));
143+
ntuples,nfields,4,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)<3)
1647+
if (PQntuples(res)!=1||PQnfields(res)<4)
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,3);
1651+
progname,PQntuples(res),PQnfields(res),1,4);
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)<3)
290+
if (PQntuples(res)!=1||PQnfields(res)<4)
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,3);
294+
progname,PQntuples(res),PQnfields(res),1,4);
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)<3)
475+
if (PQntuples(res)!=1||PQnfields(res)<4)
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,3);
479+
progname,PQntuples(res),PQnfields(res),1,4);
480480
PQclear(res);
481481
return false;
482482
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp