Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit77ba2ca

Browse files
committed
Fix compatibility with new shm_mq_send API introduced in pg15.
Related upstream commit: 46846433a03dff4f2e08c8a161e54a842da360d6
1 parent790ac4e commit77ba2ca

File tree

3 files changed

+21
-5
lines changed

3 files changed

+21
-5
lines changed

‎collector.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ send_history(History *observations, shm_mq_handle *mqh)
220220
else
221221
count=observations->index;
222222

223-
mq_result=shm_mq_send(mqh,sizeof(count),&count, false);
223+
mq_result=shm_mq_send_compat(mqh,sizeof(count),&count, false, true);
224224
if (mq_result==SHM_MQ_DETACHED)
225225
{
226226
ereport(WARNING,
@@ -230,10 +230,11 @@ send_history(History *observations, shm_mq_handle *mqh)
230230
}
231231
for (i=0;i<count;i++)
232232
{
233-
mq_result=shm_mq_send(mqh,
233+
mq_result=shm_mq_send_compat(mqh,
234234
sizeof(HistoryItem),
235235
&observations->items[i],
236-
false);
236+
false,
237+
true);
237238
if (mq_result==SHM_MQ_DETACHED)
238239
{
239240
ereport(WARNING,
@@ -255,7 +256,7 @@ send_profile(HTAB *profile_hash, shm_mq_handle *mqh)
255256
Sizecount=hash_get_num_entries(profile_hash);
256257
shm_mq_resultmq_result;
257258

258-
mq_result=shm_mq_send(mqh,sizeof(count),&count, false);
259+
mq_result=shm_mq_send_compat(mqh,sizeof(count),&count, false, true);
259260
if (mq_result==SHM_MQ_DETACHED)
260261
{
261262
ereport(WARNING,
@@ -266,7 +267,8 @@ send_profile(HTAB *profile_hash, shm_mq_handle *mqh)
266267
hash_seq_init(&scan_status,profile_hash);
267268
while ((item= (ProfileItem*)hash_seq_search(&scan_status))!=NULL)
268269
{
269-
mq_result=shm_mq_send(mqh,sizeof(ProfileItem),item, false);
270+
mq_result=shm_mq_send_compat(mqh,sizeof(ProfileItem),item, false,
271+
true);
270272
if (mq_result==SHM_MQ_DETACHED)
271273
{
272274
hash_seq_term(&scan_status);

‎compat.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,17 @@ shm_mq_detach_compat(shm_mq_handle *mqh, shm_mq *mq)
1313
#endif
1414
}
1515

16+
inlineshm_mq_result
17+
shm_mq_send_compat(shm_mq_handle*mqh,Sizenbytes,constvoid*data,
18+
boolnowait,boolforce_flush)
19+
{
20+
#ifPG_VERSION_NUM >=150000
21+
returnshm_mq_send(mqh,nbytes,data,nowait,force_flush);
22+
#else
23+
returnshm_mq_send(mqh,nbytes,data,nowait);
24+
#endif
25+
}
26+
1627
inlineTupleDesc
1728
CreateTemplateTupleDescCompat(intnattrs,boolhasoid)
1829
{

‎pg_wait_sampling.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ extern void alloc_history(History *, int);
8484
externvoidcollector_main(Datummain_arg);
8585

8686
externvoidshm_mq_detach_compat(shm_mq_handle*mqh,shm_mq*mq);
87+
externshm_mq_resultshm_mq_send_compat(shm_mq_handle*mqh,Sizenbytes,
88+
constvoid*data,boolnowait,
89+
boolforce_flush);
8790
externTupleDescCreateTemplateTupleDescCompat(intnattrs,boolhasoid);
8891

8992
#endif

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp