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

Commitf46edf4

Browse files
committed
Fix pg_get_functiondef() to print a function's LEAKPROOF property.
Seems to have been an oversight in the original leakproofness patch.Per report and patch from Jeevan Chalke.In passing, prettify some awkward leakproof-related code in AlterFunction.
1 parentaa9eac4 commitf46edf4

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

‎src/backend/commands/functioncmds.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1190,11 +1190,11 @@ AlterFunction(AlterFunctionStmt *stmt)
11901190
procForm->prosecdef=intVal(security_def_item->arg);
11911191
if (leakproof_item)
11921192
{
1193-
if (intVal(leakproof_item->arg)&& !superuser())
1193+
procForm->proleakproof=intVal(leakproof_item->arg);
1194+
if (procForm->proleakproof&& !superuser())
11941195
ereport(ERROR,
11951196
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
11961197
errmsg("only superuser can define a leakproof function")));
1197-
procForm->proleakproof=intVal(leakproof_item->arg);
11981198
}
11991199
if (cost_item)
12001200
{

‎src/backend/utils/adt/ruleutils.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1985,6 +1985,8 @@ pg_get_functiondef(PG_FUNCTION_ARGS)
19851985
appendStringInfoString(&buf," STRICT");
19861986
if (proc->prosecdef)
19871987
appendStringInfoString(&buf," SECURITY DEFINER");
1988+
if (proc->proleakproof)
1989+
appendStringInfoString(&buf," LEAKPROOF");
19881990

19891991
/* This code for the default cost and rows should match functioncmds.c */
19901992
if (proc->prolang==INTERNALlanguageId||

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp