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

Commitaaf4f80

Browse files
committed
Port extension to PG10 and PGPRO10
1 parent5a630b6 commitaaf4f80

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

‎README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@ To install `pg_query_state`, please apply patches `custom_signal.patch`, `execut
1717
Correspondence branch names to PostgreSQL version numbers:
1818
-_PG9_5_ --- PostgreSQL 9.5
1919
-_PGPRO9_5_ --- PostgresPro 9.5
20-
-_PGPRO9_6_ --- PostgresPro 9.6
21-
-_master_ --- development version for PostgreSQL 10devel
20+
-_PGPRO9_6_ --- PostgreSQL 9.6 and PostgresPro 9.6
21+
-_PGPRO10_ --- PostgreSQL 10 and PostgresPro 10
22+
-_master_ --- development version for the newest version PostgreSQL
2223

2324
Then execute this in the module's directory:
2425
```

‎pg_query_state.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ void_PG_fini(void);
5858

5959
/* hooks defined in this module */
6060
staticvoidqs_ExecutorStart(QueryDesc*queryDesc,inteflags);
61-
staticvoidqs_ExecutorRun(QueryDesc*queryDesc,ScanDirectiondirection,uint64count);
61+
staticvoidqs_ExecutorRun(QueryDesc*queryDesc,ScanDirectiondirection,
62+
uint64count,boolexecute_once);
6263
staticvoidqs_ExecutorFinish(QueryDesc*queryDesc);
6364
staticvoidqs_ExecutorEnd(QueryDesc*queryDesc);
6465

@@ -305,14 +306,15 @@ qs_ExecutorStart(QueryDesc *queryDesc, int eflags)
305306
* Catch any fatal signals
306307
*/
307308
staticvoid
308-
qs_ExecutorRun(QueryDesc*queryDesc,ScanDirectiondirection,uint64count)
309+
qs_ExecutorRun(QueryDesc*queryDesc,ScanDirectiondirection,uint64count,
310+
boolexecute_once)
309311
{
310312
PG_TRY();
311313
{
312314
if (prev_ExecutorRun)
313-
prev_ExecutorRun(queryDesc,direction,count);
315+
prev_ExecutorRun(queryDesc,direction,count,execute_once);
314316
else
315-
standard_ExecutorRun(queryDesc,direction,count);
317+
standard_ExecutorRun(queryDesc,direction,count,execute_once);
316318
}
317319
PG_CATCH();
318320
{
@@ -707,7 +709,7 @@ GetRemoteBackendUserId(PGPROC *proc)
707709
if (result!=InvalidOid)
708710
break;
709711

710-
WaitLatch(MyLatch,WL_LATCH_SET,0);
712+
WaitLatch(MyLatch,WL_LATCH_SET,0,PG_WAIT_EXTENSION);
711713
CHECK_FOR_INTERRUPTS();
712714
ResetLatch(MyLatch);
713715
}
@@ -744,7 +746,8 @@ shm_mq_receive_with_timeout(shm_mq_handle *mqh,
744746
if (rc&WL_TIMEOUT||delay <=0)
745747
returnSHM_MQ_WOULD_BLOCK;
746748

747-
rc=WaitLatch(MyLatch,WL_LATCH_SET |WL_TIMEOUT,delay);
749+
rc=WaitLatch(MyLatch,WL_LATCH_SET |WL_TIMEOUT,delay,
750+
PG_WAIT_EXTENSION);
748751

749752
INSTR_TIME_SET_CURRENT(cur_time);
750753
INSTR_TIME_SUBTRACT(cur_time,start_time);

‎signal_handler.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
#include"commands/explain.h"
1414
#include"miscadmin.h"
15+
#include"pgstat.h"
1516
#include"utils/builtins.h"
1617
#include"utils/memutils.h"
1718

@@ -161,7 +162,7 @@ SendQueryState(void)
161162
if (shm_mq_get_sender(mq)==MyProc)
162163
break;
163164

164-
WaitLatch(MyLatch,WL_LATCH_SET,0);
165+
WaitLatch(MyLatch,WL_LATCH_SET,0,PG_WAIT_IPC);
165166
CHECK_FOR_INTERRUPTS();
166167
ResetLatch(MyLatch);
167168
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp