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

Commite0ef136

Browse files
committed
Trigger stmt_beg and stmt_end for top-level statement blocks of PL/pgSQL
PL/pgSQL provides a set of callbacks which can be used for extrainstrumentation of functions written in this language called at functionsetup, begin and end, as well as statement begin and end. When callinga routine, a trigger, or an event trigger, statement callbacks are notgetting called for the top-level statement block leading to aninconsistent handling compared to the other statements. Thisinconsistency can potentially complicate extensions doinginstrumentation work on top of PL/pgSQL, so this commit makes sure thatall statement blocks, including the top-level one, go through thecorrect corresponding callbacks.Author: Pavel StehuleReviewed-by: Michael PaquierDiscussion:https://postgr.es/m/CAFj8pRArEANsaUjo5in9_iQt0vKf9ecwDAmsdN_EBwL13ps12A@mail.gmail.com
1 parent4203842 commite0ef136

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

‎src/pl/plpgsql/src/pl_exec.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,7 @@ plpgsql_exec_function(PLpgSQL_function *func, FunctionCallInfo fcinfo,
585585
*/
586586
estate.err_text=NULL;
587587
estate.err_stmt= (PLpgSQL_stmt*) (func->action);
588-
rc=exec_stmt_block(&estate,func->action);
588+
rc=exec_stmt(&estate, (PLpgSQL_stmt*)func->action);
589589
if (rc!=PLPGSQL_RC_RETURN)
590590
{
591591
estate.err_stmt=NULL;
@@ -955,7 +955,7 @@ plpgsql_exec_trigger(PLpgSQL_function *func,
955955
*/
956956
estate.err_text=NULL;
957957
estate.err_stmt= (PLpgSQL_stmt*) (func->action);
958-
rc=exec_stmt_block(&estate,func->action);
958+
rc=exec_stmt(&estate, (PLpgSQL_stmt*)func->action);
959959
if (rc!=PLPGSQL_RC_RETURN)
960960
{
961961
estate.err_stmt=NULL;
@@ -1116,7 +1116,7 @@ plpgsql_exec_event_trigger(PLpgSQL_function *func, EventTriggerData *trigdata)
11161116
*/
11171117
estate.err_text=NULL;
11181118
estate.err_stmt= (PLpgSQL_stmt*) (func->action);
1119-
rc=exec_stmt_block(&estate,func->action);
1119+
rc=exec_stmt(&estate, (PLpgSQL_stmt*)func->action);
11201120
if (rc!=PLPGSQL_RC_RETURN)
11211121
{
11221122
estate.err_stmt=NULL;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp