mirror of
https://github.com/postgres/postgres.git
synced 2026-10-23 13:29:09 +03:00
pg_upgrade: Read nextMultiOffset as a 64-bit value.
Commit bd8d9c9bdf widened MultiXactOffset to 64 bits and widened
ControlData.chkpnt_nxtmxoff accordingly, but get_control_data() still
read the "Latest checkpoint's NextMultiOffset" line with str2uint(),
which returns unsigned int.
This commit adds str2uint64(), mirroring the str2uint() helper used
for the other control file fields, and reads the offset with it.
Backpatch to v19, where MultiXactOffset was widened.
Reviewed-by: Heikki Linnakangas <hlinnaka@iki.fi>
Reviewed-by: Chao Li <li.evan.chao@gmail.com>
Discussion: https://postgr.es/m/CAD21AoCvzerscfU8o4ARQ793yAGHpQ72r2x5apeC_W2-k=SLCQ@mail.gmail.com
Backpatch-through: 19
This commit is contained in:
@@ -352,7 +352,7 @@ get_control_data(ClusterInfo *cluster)
|
||||
pg_fatal("%d: controldata retrieval problem", __LINE__);
|
||||
|
||||
p++; /* remove ':' char */
|
||||
cluster->controldata.chkpnt_nxtmxoff = str2uint(p);
|
||||
cluster->controldata.chkpnt_nxtmxoff = str2uint64(p);
|
||||
got_mxoff = true;
|
||||
}
|
||||
else if ((p = strstr(bufin, "First log segment after reset:")) != NULL)
|
||||
|
||||
@@ -496,6 +496,7 @@ void cleanup_output_dirs(void);
|
||||
void prep_status(const char *fmt, ...) pg_attribute_printf(1, 2);
|
||||
void prep_status_progress(const char *fmt, ...) pg_attribute_printf(1, 2);
|
||||
unsigned int str2uint(const char *str);
|
||||
uint64 str2uint64(const char *str);
|
||||
|
||||
|
||||
/* version.c */
|
||||
|
||||
@@ -353,3 +353,14 @@ str2uint(const char *str)
|
||||
{
|
||||
return strtoul(str, NULL, 10);
|
||||
}
|
||||
|
||||
/*
|
||||
* str2uint64()
|
||||
*
|
||||
* convert string to uint64
|
||||
*/
|
||||
uint64
|
||||
str2uint64(const char *str)
|
||||
{
|
||||
return strtou64(str, NULL, 10);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user