diff options
Diffstat (limited to 'contrib/pg_upgrade/controldata.c')
-rw-r--r-- | contrib/pg_upgrade/controldata.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/contrib/pg_upgrade/controldata.c b/contrib/pg_upgrade/controldata.c index cce44ba7837..9282b8e88e6 100644 --- a/contrib/pg_upgrade/controldata.c +++ b/contrib/pg_upgrade/controldata.c @@ -209,16 +209,20 @@ get_control_data(ClusterInfo *cluster, bool live_check) } else if ((p = strstr(bufin, "Latest checkpoint's NextXID:")) != NULL) { - char *op = strchr(p, '/'); + p = strchr(p, ':'); + + if (p == NULL || strlen(p) <= 1) + pg_fatal("%d: controldata retrieval problem\n", __LINE__); - if (op == NULL) - op = strchr(p, ':'); + p++; /* removing ':' char */ + cluster->controldata.chkpnt_nxtepoch = str2uint(p); - if (op == NULL || strlen(op) <= 1) + p = strchr(p, '/'); + if (p == NULL || strlen(p) <= 1) pg_fatal("%d: controldata retrieval problem\n", __LINE__); - op++; /* removing ':' char */ - cluster->controldata.chkpnt_nxtxid = str2uint(op); + p++; /* removing '/' char */ + cluster->controldata.chkpnt_nxtxid = str2uint(p); got_xid = true; } else if ((p = strstr(bufin, "Latest checkpoint's NextOID:")) != NULL) |