*
* Copyright (c) 2001, PostgreSQL Global Development Group
*
- * $Header: /cvsroot/pgsql/src/backend/postmaster/pgstat.c,v 1.14 2001/10/25 05:49:40 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/postmaster/pgstat.c,v 1.15 2001/11/26 22:31:08 tgl Exp $
* ----------
*/
#include "postgres.h"
for (i = 0; i < pgStatTabstatUsed; i++)
{
n = pgStatTabstatMessages[i]->m_nentries;
- len = offsetof(PgStat_MsgTabstat, m_entry[n]);
+ len = offsetof(PgStat_MsgTabstat, m_entry[0]) +
+ n * sizeof(PgStat_TableEntry);
pgStatTabstatMessages[i]->m_xact_commit = pgStatXactCommit;
pgStatTabstatMessages[i]->m_xact_rollback = pgStatXactRollback;
*/
if (msg.m_nentries >= PGSTAT_NUM_TABPURGE)
{
- len = offsetof(PgStat_MsgTabpurge, m_tableid[msg.m_nentries]);
+ len = offsetof(PgStat_MsgTabpurge, m_tableid[0])
+ + msg.m_nentries * sizeof(Oid);
pgstat_setheader(&msg.m_hdr, PGSTAT_MTYPE_TABPURGE);
pgstat_send(&msg, len);
*/
if (msg.m_nentries > 0)
{
- len = offsetof(PgStat_MsgTabpurge, m_tableid[msg.m_nentries]);
+ len = offsetof(PgStat_MsgTabpurge, m_tableid[0])
+ + msg.m_nentries * sizeof(Oid);
pgstat_setheader(&msg.m_hdr, PGSTAT_MTYPE_TABPURGE);
pgstat_send(&msg, len);