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

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

commit 7cd776a5ed3b195e5a0d1b78e3425c50e154fed4
Author: Junwang Zhao <[email protected]>
AuthorDate: Fri Aug 5 07:05:29 2022 +0800

    [AOCO] remove the useless if condition
    
    according to the comment, when `GetAllAOCSFileSegInfo_pg_aocsseg_rel`
    was called from `gp_aoseg_history` after an upgrade, the `state` and
    `modcount` might not be set, but no `formatversion`, the if conditon
    should always be true, so just remove it to make the code more clean.
    
    Signed-off-by: Junwang Zhao <[email protected]>
---
 src/backend/access/aocs/aocssegfiles.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/backend/access/aocs/aocssegfiles.c 
b/src/backend/access/aocs/aocssegfiles.c
index e129d43d2e..e9ea524a48 100644
--- a/src/backend/access/aocs/aocssegfiles.c
+++ b/src/backend/access/aocs/aocssegfiles.c
@@ -382,8 +382,7 @@ GetAllAOCSFileSegInfo_pg_aocsseg_rel(int numOfColumns,
                        aocs_seginfo->modcount = 
DatumGetInt64(d[Anum_pg_aocs_modcount - 1]);
 
                Assert(!null[Anum_pg_aocs_formatversion - 1]);
-               if (!null[Anum_pg_aocs_formatversion - 1])
-                       aocs_seginfo->formatversion = 
DatumGetInt16(d[Anum_pg_aocs_formatversion - 1]);
+               aocs_seginfo->formatversion = 
DatumGetInt16(d[Anum_pg_aocs_formatversion - 1]);
 
                Assert(!null[Anum_pg_aocs_state - 1] || snapshot == 
SnapshotAny);
                if (!null[Anum_pg_aocs_state - 1])


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

Reply via email to