postgrespro / pg_wait_sampling

Sampling based statistics of wait events
Other
147 stars 35 forks source link

Fix build due to changes in PostgreSQL 16 #64

Closed MarinaPolyakova closed 1 year ago

MarinaPolyakova commented 1 year ago
  1. See the commit 3057465acfbea2f3dd7a914a1478064022c6eecd (Replace the sorted array of GUC variables with a hash table.) in PostgreSQL 16.

  2. See the commit 0fe954c28584169938e5c0738cfaa9930ce77577 (Add -Wshadow=compatible-local to the standard compilation flags) in PostgreSQL 16.

pg_wait_sampling.c: In function ‘pg_wait_sampling_get_current’:
pg_wait_sampling.c:454:42: warning: declaration of ‘params’ shadows a previous
local [-Wshadow=compatible-local]
  454 |                 WaitCurrentContext      *params;
      |                                          ^~~~~~
pg_wait_sampling.c:446:34: note: shadowed declaration is here
  446 |         WaitCurrentContext      *params;
      |                                  ^~~~~~
MarinaPolyakova commented 1 year ago

pg_wait_sampling is PostgreSQL extension which requires PostgreSQL 9.6 or higher.

I checked that:

  1. AssertState is almost the same as Assert in REL9_6_STABLE (c.h):
    
    #ifndef USE_ASSERT_CHECKING

define Assert(condition) ((void)true)

define AssertState(condition) ((void)true)

elif defined(FRONTEND)

define Assert(p) assert(p)

define AssertState(condition) assert(condition)

else / USE_ASSERT_CHECKING && !FRONTEND /

define Assert(condition) \

    Trap(!(condition), "FailedAssertion")

define AssertState(condition) \

    Trap(!(condition), "BadState")

endif / USE_ASSERT_CHECKING && !FRONTEND /



2. Build and tests (= make installcheck after adding conf.add to $PGDATA/postgresql.conf) passed with USE_PGXS=1 with [REL9_6_STABLE](https://github.com/postgres/postgres/commits/7298b904b88598cee50e1b7649ba530811040706) and [master](https://github.com/postgres/postgres/commits/56d0ed3b756b2e3799a7bbc0ac89bc7657ca2c33).

Thank you!