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

Commit1a8558c

Browse files
committed
[refer #PGPRO-4197] Allow pg_query_state only for nomal backends
1 parent267c6ce commit1a8558c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎pg_query_state.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ pg_query_state(PG_FUNCTION_ARGS)
494494
errmsg("attempt to extract state of current process")));
495495

496496
proc=BackendPidGetProc(pid);
497-
if (!proc||proc->backendId==InvalidBackendId)
497+
if (!proc||proc->backendId==InvalidBackendId||proc->databaseId==InvalidOid||proc->roleId==InvalidOid)
498498
ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
499499
errmsg("backend with pid=%d not found",pid)));
500500

@@ -885,7 +885,7 @@ GetRemoteBackendWorkers(PGPROC *proc)
885885

886886
mqh=shm_mq_attach(mq,NULL,NULL);
887887
mq_receive_result=shm_mq_receive(mqh,&msg_len, (void**)&msg, false);
888-
if (mq_receive_result!=SHM_MQ_SUCCESS)
888+
if (mq_receive_result!=SHM_MQ_SUCCESS||msg==NULL||msg_len!=sizeof(int)+msg->number*sizeof(pid_t))
889889
gotomq_error;
890890

891891
for (i=0;i<msg->number;i++)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp