summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlvaro Herrera2019-04-29 18:15:19 +0000
committerAlvaro Herrera2019-04-30 14:27:38 +0000
commit9a83afecb7ec6e828b7dbef3133f3dd8b0b4dddb (patch)
tree71ab1b46fdcd76968fc401683576942576e81fbc
parent3dbb317d32f4f084ef7badaed8ef36f5c9b85fe6 (diff)
Widen tuple counter variables from long to int64
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
-rw-r--r--src/backend/access/hash/hashsort.c2
-rw-r--r--src/backend/access/nbtree/nbtsort.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/access/hash/hashsort.c b/src/backend/access/hash/hashsort.c
index 00a57470a7..293f80fe24 100644
--- a/src/backend/access/hash/hashsort.c
+++ b/src/backend/access/hash/hashsort.c
@@ -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
diff --git a/src/backend/access/nbtree/nbtsort.c b/src/backend/access/nbtree/nbtsort.c
index 9ac4c1e1c0..e662eee236 100644
--- a/src/backend/access/nbtree/nbtsort.c
+++ b/src/backend/access/nbtree/nbtsort.c
@@ -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)
{