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

Commit7715a3c

Browse files
committed
Prevent clobbering of utility statements in SQL function caches.
This is an oversight in commit7c337b6: I apparently didn't thinkabout the possibility of a SQL function being executed multipletimes within a query. In that case, functions.c's primitive cachingmechanism allows the same utility parse tree to be presented forexecution more than once. We have to tell ProcessUtility to makea working copy of the parse tree, or bad things happen.Normally I'd add a regression test, but I think the reported crasheris dependent on some rather random implementation choices that arenowhere near functions.c, so its usefulness as a long-lived testfeels questionable. In any case, this fix is clearly correct giventhe design choices of7c337b6.Per bug #17702 from Xin Wen. Thanks to Daniel Gustafsson foranalysis. Back-patch to v14 where the faulty commit came in(before that, the responsibility for copying scribble-ableutility parse trees lay elsewhere).Discussion:https://postgr.es/m/17702-ad24fdcdd1e9047a@postgresql.org
1 parent0224646 commit7715a3c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎src/backend/executor/functions.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -886,7 +886,7 @@ postquel_getnext(execution_state *es, SQLFunctionCachePtr fcache)
886886
{
887887
ProcessUtility(es->qd->plannedstmt,
888888
fcache->src,
889-
false,
889+
true,/* protect function cache's parsetree */
890890
PROCESS_UTILITY_QUERY,
891891
es->qd->params,
892892
es->qd->queryEnv,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp