pgpool2.git / summary / log / commit / refs
commit f40b58442e62685fefd87f15f97e55c85a874892
Author: Tatsuo Ishii <ishii@sraoss.co.jp>
Date: Fri Aug 09 05:50:56 2019 +0000
Create PostgreSQL version cache as early as possible.
Since once error query is issued, the query to create version cache
(SELECT version()) is ignored and it leads to failure in creating
version cache. Fix is, to create version cache after query context is
created and before user query is sent in SimpleQuery() and Parse().
src/protocol/pool_proto_modules.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/src/protocol/pool_proto_modules.c b/src/protocol/pool_proto_modules.c
index bc2538060..fb779486d 100644
--- a/src/protocol/pool_proto_modules.c
+++ b/src/protocol/pool_proto_modules.c
@@ -298,6 +298,13 @@ SimpleQuery(POOL_CONNECTION * frontend,
*/
pool_start_query(query_context, contents, len, node);
+ /*
+ * Create PostgreSQL version cache. Since the provided query might
+ * cause a syntax error, we want to issue "SELECT version()" which is
+ * called inside Pgversion() here.
+ */
+ Pgversion(backend);
+
/*
* If the query is DROP DATABASE, after executing it, cache files
* directory must be discarded. So we have to get the DB's oid before
@@ -1097,6 +1104,13 @@ Parse(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend,
*/
pool_start_query(query_context, pstrdup(stmt), strlen(stmt) + 1, node);
+ /*
+ * Create PostgreSQL version cache. Since the provided query might
+ * cause a syntax error, we want to issue "SELECT version()" which is
+ * called inside Pgversion() here.
+ */
+ Pgversion(backend);
+
msg = pool_create_sent_message('P', len, contents, 0, name, query_context);
session_context->uncompleted_message = msg;
[parent: 838d56e30cdf]