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

Commit18feafc

Browse files
committed
Ensure that a plpgsql LOOP with an empty body still executes at least
one CHECK_FOR_INTERRUPTS() call, so that you can control-C out of theloop. Reported by Merlin Moncure.
1 parent7d3ab8a commit18feafc

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

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

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* procedural language
44
*
55
* IDENTIFICATION
6-
* $PostgreSQL: pgsql/src/pl/plpgsql/src/pl_exec.c,v 1.153 2005/10/15 02:49:49 momjian Exp $
6+
* $PostgreSQL: pgsql/src/pl/plpgsql/src/pl_exec.c,v 1.154 2005/10/24 15:10:22 tgl Exp $
77
*
88
* This software is copyrighted by Jan Wieck - Hamburg.
99
*
@@ -974,6 +974,17 @@ exec_stmts(PLpgSQL_execstate * estate, List *stmts)
974974
{
975975
ListCell*s;
976976

977+
if (stmts==NIL)
978+
{
979+
/*
980+
* Ensure we do a CHECK_FOR_INTERRUPTS() even though there is no
981+
* statement. This prevents hangup in a tight loop if, for instance,
982+
* there is a LOOP construct with an empty body.
983+
*/
984+
CHECK_FOR_INTERRUPTS();
985+
returnPLPGSQL_RC_OK;
986+
}
987+
977988
foreach(s,stmts)
978989
{
979990
PLpgSQL_stmt*stmt= (PLpgSQL_stmt*)lfirst(s);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp