This is an automated email from the ASF dual-hosted git repository.

reshke pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudberry.git


The following commit(s) were added to refs/heads/main by this push:
     new d8d3b34ecf6 Fix check for database version inside pg_upgrade.
d8d3b34ecf6 is described below

commit d8d3b34ecf693ae849db88701365abffa1ae8613
Author: reshke <[email protected]>
AuthorDate: Fri Jul 18 21:11:35 2025 +0500

    Fix check for database version inside pg_upgrade.
    
    Due to recent project renaming, gpupgrade now failing to upgarde greenplum 
6 to cloudberry. The issue is with check-database-version logic. Fix is kinda 
straightforward, the only issue is with dbstring2 variable name, as i cannot 
came up with anything better.
---
 src/bin/pg_upgrade/exec.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/bin/pg_upgrade/exec.c b/src/bin/pg_upgrade/exec.c
index f8c064786e7..09faaf8d096 100644
--- a/src/bin/pg_upgrade/exec.c
+++ b/src/bin/pg_upgrade/exec.c
@@ -36,7 +36,8 @@ get_bin_version(ClusterInfo *cluster)
 {
        char            cmd[MAXPGPATH],
                                cmd_output[MAX_STRING],
-                               dbstring[MAX_STRING];
+                               dbstring[MAX_STRING],
+                               dbstring2[MAX_STRING];
 
        FILE       *output;
        int                     v1 = 0,
@@ -51,11 +52,12 @@ get_bin_version(ClusterInfo *cluster)
 
        pclose(output);
 
-       if (sscanf(cmd_output, "%*s (%s Database) %d.%d", dbstring, &v1, &v2) < 
1)
+       if (sscanf(cmd_output, "%*s (%s %s) %d.%d", dbstring, dbstring2, &v1, 
&v2) < 1)
                pg_fatal("could not get pg_ctl version output from %s\n", cmd);
 
-       if (strcmp("Greenplum", dbstring) && strcmp("Cloudberry", dbstring))
-               pg_fatal("could not upgrade from non Greenplum/Cloudberry 
version: %s\n", dbstring);
+       if ((strcmp("Greenplum", dbstring) == 0 && strcmp("Database", 
dbstring2) == 0) \
+                               || (strcmp("Apache", dbstring2) == 0 && 
strcmp("Cloudberry", dbstring2) == 0))
+               pg_fatal("could not upgrade from non Greenplum/Cloudberry 
version: %s %s\n", dbstring, dbstring2);
 
        if (v1 < 10)
        {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to