Content-Length: 268342 | pFad | http://github.com/postgrespro/postgres/commit/34df02d19cf7d0ed8619a68dd15eecace34bef40

A6 Fix number of copying history items. · postgrespro/postgres@34df02d · GitHub
Skip to content

Commit 34df02d

Browse files
akorotkovAlexander Korotkov
authored andcommitted
Fix number of copying history items.
1 parent e1013f9 commit 34df02d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

contrib/pg_stat_wait/collector.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,12 @@ ReallocHistory(History *observations, int count)
148148
newitems = (HistoryItem *) palloc0(sizeof(HistoryItem) * count);
149149

150150
if (observations->wraparound)
151-
copyCount = Min(observations->count, count);
151+
copyCount = observations->count;
152152
else
153153
copyCount = observations->index;
154154

155+
copyCount = Min(copyCount, count);
156+
155157
i = 0;
156158
j = observations->index;
157159
while (i < copyCount)

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres/commit/34df02d19cf7d0ed8619a68dd15eecace34bef40

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy