Minor code correction on query cancel
authorSimon Riggs <[email protected]>
Sat, 26 Sep 2009 09:42:46 +0000 (10:42 +0100)
committerSimon Riggs <[email protected]>
Sat, 26 Sep 2009 09:42:46 +0000 (10:42 +0100)
src/backend/tcop/postgres.c

index ac60d0b480054e85537982df7bd9c6307b640d3a..a0b0546c93733a222c150d73fbc811b8f529cf6a 100644 (file)
@@ -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: