pgsql: Fix calculation of maximum statistics-message size.

Поиск
Список
Период
Сортировка
От Tom Lane
Тема pgsql: Fix calculation of maximum statistics-message size.
Дата
Msg-id E1Vyum9-0003DI-U4@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
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

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/a7ef273e1cebb913cd4a524fcf3b42caa41bd431

Modified Files
--------------
src/backend/postmaster/pgstat.c |   10 ++++++++++
src/include/pgstat.h            |   10 ++++++----
2 files changed, 16 insertions(+), 4 deletions(-)


В списке pgsql-committers по дате отправления:

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: pgsql: Wrap multixact/members correctly during extension
Следующее
От: Tom Lane
Дата:
Сообщение: pgsql: Ooops, should use double not single quotes in StaticAssertStmt()