Fix writing transaction flag is accidentally set at commit or rollback.
authorTatsuo Ishii <ishii@postgresql.org>
Fri, 9 Feb 2018 04:18:50 +0000 (13:18 +0900)
committerTatsuo Ishii <ishii@postgresql.org>
Fri, 9 Feb 2018 04:18:50 +0000 (13:18 +0900)
We set writing transaction flag if it's a write query while processing
an execute message. However, the flag is set even it's a commit or
rollback. This is an oversight. The flag is reset while starting next
transaction anyway, so it's actually harmless but a bug is a bug.

src/protocol/pool_proto_modules.c

index 631fa5d3c63b1b5063435b36d2f03d2c06e9ed9f..359875f3cc69990f6da5f6554c3c1cc6140740ff 100644 (file)
@@ -907,7 +907,8 @@ POOL_STATUS Execute(POOL_CONNECTION *frontend, POOL_CONNECTION_POOL *backend,
                /*
                 * Take care of "writing transaction" flag.
                 */
-               if (!is_select_query(node, query) && !is_start_transaction_query(node))
+               if (!is_select_query(node, query) && !is_start_transaction_query(node) &&
+                       !is_commit_or_rollback_query(node))
                {
                        ereport(DEBUG1,
                                        (errmsg("Execute: TSTATE:%c",