mirror of
https://github.com/postgres/postgres.git
synced 2025-06-11 20:28:21 +03:00
Change cancel while waiting-for-lock stuff.
This commit is contained in:
@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.145 2000/02/21 02:42:35 inoue Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.146 2000/02/22 09:55:18 inoue Exp $
|
||||
*
|
||||
* NOTES
|
||||
* this is the "main" module of the postgres backend and
|
||||
@ -809,22 +809,12 @@ FloatExceptionHandler(SIGNAL_ARGS)
|
||||
" or was a divide by zero");
|
||||
}
|
||||
|
||||
|
||||
static bool lockWaiting = false;
|
||||
void SetLockWaiting(bool waiting)
|
||||
{
|
||||
lockWaiting = waiting;
|
||||
}
|
||||
/* signal handler for query cancel signal from postmaster */
|
||||
static void
|
||||
QueryCancelHandler(SIGNAL_ARGS)
|
||||
{
|
||||
QueryCancel = true;
|
||||
if (lockWaiting)
|
||||
{
|
||||
lockWaiting = false;
|
||||
elog(ERROR, "Query Cancel requested while waiting lock");
|
||||
}
|
||||
LockWaitCancel();
|
||||
}
|
||||
|
||||
void
|
||||
@ -1513,7 +1503,7 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[])
|
||||
if (!IsUnderPostmaster)
|
||||
{
|
||||
puts("\nPOSTGRES backend interactive interface ");
|
||||
puts("$Revision: 1.145 $ $Date: 2000/02/21 02:42:35 $\n");
|
||||
puts("$Revision: 1.146 $ $Date: 2000/02/22 09:55:18 $\n");
|
||||
}
|
||||
|
||||
/*
|
||||
@ -1573,6 +1563,7 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[])
|
||||
* ----------------
|
||||
*/
|
||||
QueryCancel = false; /* forget any earlier CANCEL signal */
|
||||
SetWaitingForLock(false);
|
||||
|
||||
EnableNotifyInterrupt();
|
||||
|
||||
@ -1583,7 +1574,6 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[])
|
||||
firstchar = ReadCommand(parser_input);
|
||||
|
||||
QueryCancel = false; /* forget any earlier CANCEL signal */
|
||||
lockWaiting = false;
|
||||
|
||||
/* ----------------
|
||||
* (4) disable async.c's signal handler.
|
||||
|
Reference in New Issue
Block a user