Widen tuple counter variables from long to int64
authorAlvaro Herrera <alvherre@alvh.no-ip.org>
Mon, 29 Apr 2019 18:15:19 +0000 (14:15 -0400)
committerAlvaro Herrera <alvherre@alvh.no-ip.org>
Tue, 30 Apr 2019 14:27:38 +0000 (10:27 -0400)
Mistake in ab0dfc961b6a; progress reporting would have wrapped around
for indexes created with more than 2^31 tuples.

Reported-by: Peter Geoghegan
Discussion: https://postgr.es/m/CAH2-Wz=WbNxc5ob5NJ9yqo2RMJ0q4HXDS30GVCobeCvC9A1L9A@mail.gmail.com

src/backend/access/hash/hashsort.c
src/backend/access/nbtree/nbtsort.c

index 00a57470a772700533c0d489229a6a0541db4113..293f80fe24cf27e957c46b46931cb19abb7f2226 100644 (file)
@@ -118,7 +118,7 @@ void
 _h_indexbuild(HSpool *hspool, Relation heapRel)
 {
    IndexTuple  itup;
-   long        tups_done = 0;
+   int64       tups_done = 0;
 #ifdef USE_ASSERT_CHECKING
    uint32      hashkey = 0;
 #endif
index 9ac4c1e1c081479fe4b79d08fe29f196a1ad4e93..e662eee236070009f73e9f4452d3789ba48f35ba 100644 (file)
@@ -1130,7 +1130,7 @@ _bt_load(BTWriteState *wstate, BTSpool *btspool, BTSpool *btspool2)
    int         i,
                keysz = IndexRelationGetNumberOfKeyAttributes(wstate->index);
    SortSupport sortKeys;
-   long        tuples_done = 0;
+   int64       tuples_done = 0;
 
    if (merge)
    {