Fix per_node_error_log() so that it respects unread parameter.
authorTatsuo Ishii <ishii@sraoss.co.jp>
Wed, 8 Jul 2020 01:25:12 +0000 (10:25 +0900)
committerTatsuo Ishii <ishii@sraoss.co.jp>
Wed, 8 Jul 2020 01:25:12 +0000 (10:25 +0900)
per_node_error_log() unconditionally set the "unread" parameter to
true when it should have respected the unread parameter given by user.
It seems all callers to per_node_error_log() set the unread parameter
to true anyway.  The only exception is pool_do_auth. As far as testing
test 03[0-4] regression tests, the change is ok.

In summary this change will not affect to Pgpool-II but bug is bug.

src/protocol/pool_proto_modules.c

index d2a231225935a4775c2580302c39b6ec93e95805..da9addcbec779f3fa9956dd93c71a351b1b708aa 100644 (file)
@@ -3464,7 +3464,7 @@ per_node_error_log(POOL_CONNECTION_POOL * backend, int node_id, char *query, cha
                return;
        }
 
-       if (pool_extract_error_message(true, CONNECTION(backend, node_id), MAJOR(backend), true, &message) == 1)
+       if (pool_extract_error_message(true, CONNECTION(backend, node_id), MAJOR(backend), unread, &message) == 1)
        {
                ereport(LOG,
                                (errmsg("%s: DB node id: %d backend pid: %d statement: \"%s\" message: \"%s\"",