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

Commit9bffaad

Browse files
committed
Fixes:
This is a patch to prevent an endless loop occuring in the Postgres backendwhen a 'warning' error condition generates another warning error contitionin the handler code.Submitted by: Chris Dunlop, <chris@onthe.net.au>
1 parent64bfa04 commit9bffaad

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

‎src/backend/tcop/postgres.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.2 1996/07/15 19:22:17 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.3 1996/07/19 06:13:42 scrappy Exp $
1111
*
1212
* NOTES
1313
* this is the "main" module of the postgres backend and
@@ -111,6 +111,7 @@ jmp_buf Warn_restart;
111111
#else
112112
sigjmp_bufWarn_restart;
113113
#endif/*defined(WIN32) || defined(PORTNAME_next) */
114+
intInWarn;
114115

115116
externintNBuffers;
116117

@@ -1203,6 +1204,7 @@ PostgresMain(int argc, char *argv[])
12031204
#else
12041205
if (setjmp(Warn_restart)!=0) {
12051206
#endif/* WIN32 */
1207+
InWarn=1;
12061208

12071209
time(&tim);
12081210

@@ -1213,14 +1215,15 @@ PostgresMain(int argc, char *argv[])
12131215

12141216
AbortCurrentTransaction();
12151217
}
1218+
InWarn=0;
12161219

12171220
/* ----------------
12181221
*POSTGRES main processing loop begins here
12191222
* ----------------
12201223
*/
12211224
if (IsUnderPostmaster== false) {
12221225
puts("\nPOSTGRES backend interactive interface");
1223-
puts("$Revision: 1.2 $ $Date: 1996/07/15 19:22:17 $");
1226+
puts("$Revision: 1.3 $ $Date: 1996/07/19 06:13:42 $");
12241227
}
12251228

12261229
/* ----------------

‎src/backend/utils/error/elog.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/utils/error/elog.c,v 1.2 1996/07/16 07:13:47 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/utils/error/elog.c,v 1.3 1996/07/19 06:13:58 scrappy Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -150,13 +150,16 @@ elog(int lev, char *fmt, ... )
150150
#endif/* !PG_STANDALONE */
151151

152152
if (lev==WARN) {
153+
externintInWarn;
153154
ProcReleaseSpins(NULL);/* get rid of spinlocks we hold */
155+
if (!InWarn) {
154156
#ifndefWIN32
155-
kill(getpid(),1);/* abort to traffic cop */
156-
pause();
157+
kill(getpid(),1);/* abort to traffic cop */
158+
pause();
157159
#else
158-
longjmp(Warn_restart,1);
160+
longjmp(Warn_restart,1);
159161
#endif/* WIN32 */
162+
}
160163
/*
161164
* The pause(3) is just to avoid race conditions where the
162165
* thread of control on an MP system gets past here (i.e.,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp