pgpool2.git / summary / log / commit / refs
commit 37789502b48542cd57ae257162f0caaeabeac53e
Author: Tatsuo Ishii <ishii@postgresql.org>
Date: Thu Apr 26 06:49:29 2012 +0000
Fix pool_handle_query_cache() to switch memory context to session
memory before calling pool_extract_table_oids_from_select_stmt()
because it ends up with calling nodeToString().
It is possible that global pool_memory is bogus when extended query
is used.
pool_memqcache.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/pool_memqcache.c b/pool_memqcache.c
index 2fbac3aa0..8e17e7f5f 100644
--- a/pool_memqcache.c
+++ b/pool_memqcache.c
@@ -2715,7 +2715,10 @@ void pool_handle_query_cache(POOL_CONNECTION_POOL *backend, char *query, Node *n
if (pool_is_cache_safe())
{
SelectContext ctx;
+ POOL_MEMORY_POOL *old_context;
+ old_context = pool_memory_context_switch_to(session_context->memory_context);
num_oids = pool_extract_table_oids_from_select_stmt(node, &ctx);
+ pool_memory_context_switch_to(old_context);
oids = ctx.table_oids;;
pool_debug("num_oids: %d oid: %d", num_oids, *oids);
[parent: 1a4c15d41f56]