Skip to content

Commit c78f583

Browse files
yjhjstzmy-ship-it
authored andcommitted
Fix incorrect usage of gp_versionstr in pg_upgrade version check
Previously, the Cloudberry-specific version string was incorrectly written into `versionstr` instead of `gp_versionstr`, breaking the fallback comparison logic in `check_exec()`. This caused version checks to fail when the program output matched the expected Apache Cloudberry format.
1 parent 41f32d9 commit c78f583

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/backend/access/rmgrdesc/nbtdesc.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ out_insert(StringInfo buf, uint8 info, XLogReaderState *record)
2626
char *ptr;
2727
xl_btree_insert *xlrec = (xl_btree_insert *) rec;
2828
xl_btree_metadata *md;
29-
BlockNumber blkno;
29+
BlockNumber blkno = InvalidBlockNumber;
3030
bool fullpage;
31-
Size datalen;
31+
Size datalen = 0;
3232

3333
fullpage = XLogRecHasBlockImage(record, 0);
3434
XLogRecGetBlockTag(record, 0, NULL, NULL, &blkno);

src/bin/pg_upgrade/exec.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ check_exec(const char *dir, const char *program, bool check_version)
457457
pg_strip_crlf(line);
458458

459459
snprintf(versionstr, sizeof(versionstr), "%s (PostgreSQL) " PG_VERSION, program);
460-
snprintf(versionstr, sizeof(versionstr), "%s (Apache Cloudberry) " PG_VERSION, program);
460+
snprintf(gp_versionstr, sizeof(versionstr), "%s (Apache Cloudberry) " PG_VERSION, program);
461461

462462
if (strcmp(line, versionstr) != 0 && strcmp(line, gp_versionstr) != 0)
463463
pg_fatal("check for \"%s\" failed: incorrect version: found \"%s\", expected \"%s\" or \"%s\"\n",

0 commit comments

Comments
 (0)