From 13a0bd62e9bb4e180654526f82bc8ec556ec1b13 Mon Sep 17 00:00:00 2001 From: Simon Riggs Date: Sat, 26 Sep 2009 10:42:46 +0100 Subject: [PATCH] Minor code correction on query cancel --- src/backend/tcop/postgres.c | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index ac60d0b480..a0b0546c93 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c @@ -2690,27 +2690,24 @@ ProcessInterrupts(void) { switch (cancelMode) { + /* + * XXXHS: We don't yet have a clean way to cancel an + * idle-in-transaction session, so make it FATAL instead. + */ + case CONFLICT_MODE_ERROR: + cancelMode = CONFLICT_MODE_FATAL; + break; + case CONFLICT_MODE_ERROR_IF_NOT_IDLE: /* * If we still have a snapshot then we must * cancel, else we are free to go. - * As above, cancel means FATAL, for now. + * XXXHS: As above, cancel means FATAL, for now. */ if (MyProc->xmin == 0) - { cancelMode = CONFLICT_MODE_NOT_SET; - break; - } else - cancelMode = CONFLICT_MODE_ERROR; - /* drop through */ - - /* - * XXXHS: We don't yet have a clean way to cancel an - * idle-in-transaction session, so make it FATAL instead. - */ - case CONFLICT_MODE_ERROR: - cancelMode = CONFLICT_MODE_FATAL; + cancelMode = CONFLICT_MODE_FATAL; break; default: -- 2.39.5