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

Commit1e4a7c4

Browse files
committed
Prevent show_session_authorization from crashing when session_authorization
hasn't been set.The only known case where this can happen is when show_session_authorizationis invoked in an autovacuum process, which is possible if an index functioncalls it, as for example in bug #5669 from Andrew Geery. We could perhapstry to return a sensible value, such as the name of the cluster-owningsuperuser; but that seems like much more trouble than the case is worth,and in any case it could create new possible failure modes. Simplyreturning an empty string seems like the most appropriate fix.Back-patch to all supported versions, even those before autovacuum, justin case there's another way to provoke this crash.
1 parent767ae95 commit1e4a7c4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

‎src/backend/commands/variable.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -830,6 +830,10 @@ show_session_authorization(void)
830830
AclIdsavedsysid;
831831
char*endptr;
832832

833+
/* If session_authorization hasn't been set in this process, return "" */
834+
if (value==NULL||value[0]=='\0')
835+
return"";
836+
833837
Assert(strspn(value,"x")==NAMEDATALEN&&
834838
(value[NAMEDATALEN]=='T'||value[NAMEDATALEN]=='F'));
835839

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp