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

chenjinbao1989 pushed a commit to branch cbdb-postgres-merge
in repository https://gitbox.apache.org/repos/asf/cloudberry.git


The following commit(s) were added to refs/heads/cbdb-postgres-merge by this 
push:
     new 3954261d472 Fix compile errors for hyperloglog and time in utils
3954261d472 is described below

commit 3954261d47284bae71b049aebced0fe0082840f0
Author: Jinbao Chen <[email protected]>
AuthorDate: Mon Oct 6 23:52:40 2025 +0800

    Fix compile errors for hyperloglog and time in utils
---
 src/backend/utils/hyperloglog/gp_hyperloglog.c |  1 +
 src/backend/utils/time/snapmgr.c               | 24 +++++-------------------
 2 files changed, 6 insertions(+), 19 deletions(-)

diff --git a/src/backend/utils/hyperloglog/gp_hyperloglog.c 
b/src/backend/utils/hyperloglog/gp_hyperloglog.c
index 5567eb0cd56..41663427aa8 100644
--- a/src/backend/utils/hyperloglog/gp_hyperloglog.c
+++ b/src/backend/utils/hyperloglog/gp_hyperloglog.c
@@ -66,6 +66,7 @@
 #include "utils/lsyscache.h"
 #include "lib/stringinfo.h"
 #include "libpq/pqformat.h"
+#include "varatt.h"
 
 #include "utils/hyperloglog/gp_hyperloglog.h"
 
diff --git a/src/backend/utils/time/snapmgr.c b/src/backend/utils/time/snapmgr.c
index 2d77e573839..d4849c404f1 100644
--- a/src/backend/utils/time/snapmgr.c
+++ b/src/backend/utils/time/snapmgr.c
@@ -820,24 +820,10 @@ PushActiveSnapshot(Snapshot snapshot)
  */
 void
 PushActiveSnapshotWithLevel(Snapshot snapshot, int snap_level)
-{
-       PushActiveSnapshotWithLevel(snap, GetCurrentTransactionNestLevel());
-}
-
-/*
- * PushActiveSnapshotWithLevel
- *             Set the given snapshot as the current active snapshot
- *
- * Same as PushActiveSnapshot except that caller can specify the
- * transaction nesting level that "owns" the snapshot.  This level
- * must not be deeper than the current top of the snapshot stack.
- */
-void
-PushActiveSnapshotWithLevel(Snapshot snap, int snap_level)
 {
        ActiveSnapshotElt *newactive;
 
-       Assert(snap != InvalidSnapshot)
+       Assert(snapshot != InvalidSnapshot);
        Assert(ActiveSnapshot == NULL || snap_level >= 
ActiveSnapshot->as_level);
 
        newactive = MemoryContextAlloc(TopTransactionContext, 
sizeof(ActiveSnapshotElt));
@@ -2354,14 +2340,14 @@ EstimateSnapshotSpace(Snapshot snapshot)
                size = add_size(size,
                                                mul_size(snapshot->subxcnt, 
sizeof(TransactionId)));
 
-       if (snap->haveDistribSnapshot && 
snap->distribSnapshotWithLocalMapping.ds.count > 0)
+       if (snapshot->haveDistribSnapshot && 
snapshot->distribSnapshotWithLocalMapping.ds.count > 0)
        {
                size = add_size(size,
-                                               
mul_size(snap->distribSnapshotWithLocalMapping.ds.count, 
sizeof(DistributedTransactionId)));
-               if (snap->distribSnapshotWithLocalMapping.currentLocalXidsCount 
> 0)
+                                               
mul_size(snapshot->distribSnapshotWithLocalMapping.ds.count, 
sizeof(DistributedTransactionId)));
+               if 
(snapshot->distribSnapshotWithLocalMapping.currentLocalXidsCount > 0)
                {
                        size = add_size(size,
-                                                       
mul_size(snap->distribSnapshotWithLocalMapping.currentLocalXidsCount, 
sizeof(TransactionId)));
+                                                       
mul_size(snapshot->distribSnapshotWithLocalMapping.currentLocalXidsCount, 
sizeof(TransactionId)));
                }
        }
 


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

Reply via email to