Commit 9a83afec authored by Alvaro Herrera's avatar Alvaro Herrera

Widen tuple counter variables from long to int64

Mistake in ab0dfc96; 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
parent 3dbb317d
...@@ -118,7 +118,7 @@ void ...@@ -118,7 +118,7 @@ void
_h_indexbuild(HSpool *hspool, Relation heapRel) _h_indexbuild(HSpool *hspool, Relation heapRel)
{ {
IndexTuple itup; IndexTuple itup;
long tups_done = 0; int64 tups_done = 0;
#ifdef USE_ASSERT_CHECKING #ifdef USE_ASSERT_CHECKING
uint32 hashkey = 0; uint32 hashkey = 0;
#endif #endif
......
...@@ -1130,7 +1130,7 @@ _bt_load(BTWriteState *wstate, BTSpool *btspool, BTSpool *btspool2) ...@@ -1130,7 +1130,7 @@ _bt_load(BTWriteState *wstate, BTSpool *btspool, BTSpool *btspool2)
int i, int i,
keysz = IndexRelationGetNumberOfKeyAttributes(wstate->index); keysz = IndexRelationGetNumberOfKeyAttributes(wstate->index);
SortSupport sortKeys; SortSupport sortKeys;
long tuples_done = 0; int64 tuples_done = 0;
if (merge) if (merge)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment