mirror of
https://github.com/postgres/postgres.git
synced 2025-07-07 00:36:50 +03:00
Fixes:
This is a patch to prevent an endless loop occuring in the Postgres backend when a 'warning' error condition generates another warning error contition in the handler code. Submitted by: Chris Dunlop, <chris@onthe.net.au>
This commit is contained in:
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.2 1996/07/15 19:22:17 scrappy Exp $
|
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.3 1996/07/19 06:13:42 scrappy Exp $
|
||||||
*
|
*
|
||||||
* NOTES
|
* NOTES
|
||||||
* this is the "main" module of the postgres backend and
|
* this is the "main" module of the postgres backend and
|
||||||
@ -111,6 +111,7 @@ jmp_buf Warn_restart;
|
|||||||
#else
|
#else
|
||||||
sigjmp_buf Warn_restart;
|
sigjmp_buf Warn_restart;
|
||||||
#endif /*defined(WIN32) || defined(PORTNAME_next) */
|
#endif /*defined(WIN32) || defined(PORTNAME_next) */
|
||||||
|
int InWarn;
|
||||||
|
|
||||||
extern int NBuffers;
|
extern int NBuffers;
|
||||||
|
|
||||||
@ -1203,6 +1204,7 @@ PostgresMain(int argc, char *argv[])
|
|||||||
#else
|
#else
|
||||||
if (setjmp(Warn_restart) != 0) {
|
if (setjmp(Warn_restart) != 0) {
|
||||||
#endif /* WIN32 */
|
#endif /* WIN32 */
|
||||||
|
InWarn = 1;
|
||||||
|
|
||||||
time(&tim);
|
time(&tim);
|
||||||
|
|
||||||
@ -1213,6 +1215,7 @@ PostgresMain(int argc, char *argv[])
|
|||||||
|
|
||||||
AbortCurrentTransaction();
|
AbortCurrentTransaction();
|
||||||
}
|
}
|
||||||
|
InWarn = 0;
|
||||||
|
|
||||||
/* ----------------
|
/* ----------------
|
||||||
* POSTGRES main processing loop begins here
|
* POSTGRES main processing loop begins here
|
||||||
@ -1220,7 +1223,7 @@ PostgresMain(int argc, char *argv[])
|
|||||||
*/
|
*/
|
||||||
if (IsUnderPostmaster == false) {
|
if (IsUnderPostmaster == false) {
|
||||||
puts("\nPOSTGRES backend interactive interface");
|
puts("\nPOSTGRES backend interactive interface");
|
||||||
puts("$Revision: 1.2 $ $Date: 1996/07/15 19:22:17 $");
|
puts("$Revision: 1.3 $ $Date: 1996/07/19 06:13:42 $");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ----------------
|
/* ----------------
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/utils/error/elog.c,v 1.2 1996/07/16 07:13:47 scrappy Exp $
|
* $Header: /cvsroot/pgsql/src/backend/utils/error/elog.c,v 1.3 1996/07/19 06:13:58 scrappy Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -150,13 +150,16 @@ elog(int lev, char *fmt, ... )
|
|||||||
#endif /* !PG_STANDALONE */
|
#endif /* !PG_STANDALONE */
|
||||||
|
|
||||||
if (lev == WARN) {
|
if (lev == WARN) {
|
||||||
|
extern int InWarn;
|
||||||
ProcReleaseSpins(NULL); /* get rid of spinlocks we hold */
|
ProcReleaseSpins(NULL); /* get rid of spinlocks we hold */
|
||||||
|
if (!InWarn) {
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
kill(getpid(), 1); /* abort to traffic cop */
|
kill(getpid(), 1); /* abort to traffic cop */
|
||||||
pause();
|
pause();
|
||||||
#else
|
#else
|
||||||
longjmp(Warn_restart, 1);
|
longjmp(Warn_restart, 1);
|
||||||
#endif /* WIN32 */
|
#endif /* WIN32 */
|
||||||
|
}
|
||||||
/*
|
/*
|
||||||
* The pause(3) is just to avoid race conditions where the
|
* The pause(3) is just to avoid race conditions where the
|
||||||
* thread of control on an MP system gets past here (i.e.,
|
* thread of control on an MP system gets past here (i.e.,
|
||||||
|
Reference in New Issue
Block a user