]> granicus.if.org Git - postgresql/commit
Fix calculation of maximum statistics-message size.
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 3 Jan 2014 02:45:47 +0000 (21:45 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 3 Jan 2014 02:45:51 +0000 (21:45 -0500)
commita7ef273e1cebb913cd4a524fcf3b42caa41bd431
tree5c5459eda0f14ceb7888110991401fd92df7b1d5
parent638cf09e76d70dd83d8123e7079be6c0532102d2
Fix calculation of maximum statistics-message size.

The PGSTAT_NUM_TABENTRIES macro should have been updated when new fields
were added to struct PgStat_MsgTabstat in commit 644828908, but it wasn't.
Fix that.

Also, add a static assertion that we didn't overrun the intended size limit
on stats messages.  This will not necessarily catch every mistake in
computing the maximum array size for stats messages, but it will catch ones
that have practical consequences.  (The assertion in fact doesn't complain
about the aforementioned error in PGSTAT_NUM_TABENTRIES, because that was
not big enough to cause the array length to increase.)

No back-patch, as there's no actual bug in existing releases; this is just
in the nature of future-proofing.

Mark Dilger and Tom Lane
src/backend/postmaster/pgstat.c
src/include/pgstat.h