Skip to content

Commit 23438fe

Browse files
committed
Fix #4, add more tests
1 parent bdb00ce commit 23438fe

File tree

6 files changed

+28
-2
lines changed

6 files changed

+28
-2
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ OBJS = pg_wait_sampling.o collector.o
66
EXTENSION = pg_wait_sampling
77
DATA = pg_wait_sampling--1.0.sql
88

9-
REGRESS = load
9+
REGRESS = load queries
1010

1111
EXTRA_REGRESS_OPTS=--temp-config=$(top_srcdir)/$(subdir)/conf.add
1212

collector.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,11 @@ collector_main(Datum main_arg)
399399
send_profile(profile_hash, mqh);
400400
}
401401
}
402+
#if PG_VERSION_NUM >= 100000
403+
shm_mq_detach(mqh);
404+
#else
402405
shm_mq_detach(collector_mq);
406+
#endif
403407
}
404408
else if (request == PROFILE_RESET)
405409
{

expected/load.out

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,13 @@ View "public.pg_wait_sampling_current"
1616
event_type | text |
1717
event | text |
1818

19+
\d pg_wait_sampling_profile
20+
View "public.pg_wait_sampling_profile"
21+
Column | Type | Modifiers
22+
------------+---------+-----------
23+
pid | integer |
24+
event_type | text |
25+
event | text |
26+
count | bigint |
27+
1928
DROP EXTENSION pg_wait_sampling;

expected/load_1.out

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,13 @@ CREATE EXTENSION pg_wait_sampling;
1616
event_type | text | | |
1717
event | text | | |
1818

19+
\d pg_wait_sampling_profile
20+
View "public.pg_wait_sampling_profile"
21+
Column | Type | Collation | Nullable | Default
22+
------------+---------+-----------+----------+---------
23+
pid | integer | | |
24+
event_type | text | | |
25+
event | text | | |
26+
count | bigint | | |
27+
1928
DROP EXTENSION pg_wait_sampling;

pg_wait_sampling.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,11 @@ receive_array(SHMRequest request, Size item_size, Size *count)
482482
ptr += item_size;
483483
}
484484

485+
#if PG_VERSION_NUM >= 100000
486+
shm_mq_detach(mqh);
487+
#else
485488
shm_mq_detach(mq);
489+
#endif
486490

487491
LockRelease(&queueTag, ExclusiveLock, false);
488492

sql/load.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
CREATE EXTENSION pg_wait_sampling;
22

33
\d pg_wait_sampling_current
4-
54
\d pg_wait_sampling_history
5+
\d pg_wait_sampling_profile
66

77
DROP EXTENSION pg_wait_sampling;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy