pgpool2.git / summary / log / commit / refs
commit 7df765bfb8074f5f1fb3c8fc393b50e6c432cbbd
Author: Tatsuo Ishii <ishii@postgresql.org>
Date: Sat Jan 25 08:39:46 2014 +0000
Fix query cache bug with extended protocol.
SELECT retrieves outdated cache even DMS was executed in an expilicit
transaction. The bug had been there since in memory query cache was
born. Per [pgpool-general-jp: 1252].
src/protocol/pool_proto_modules.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/protocol/pool_proto_modules.c b/src/protocol/pool_proto_modules.c
index 984c6a865..43ecd2e17 100644
--- a/src/protocol/pool_proto_modules.c
+++ b/src/protocol/pool_proto_modules.c
@@ -676,7 +676,9 @@ POOL_STATUS Execute(POOL_CONNECTION *frontend, POOL_CONNECTION_POOL *backend,
/*
* Fetch memory cache if possible
*/
- if (pool_config->memory_cache_enabled && pool_is_likely_select(query))
+ if (pool_config->memory_cache_enabled && pool_is_likely_select(query) &&
+ !pool_is_writing_transaction() &&
+ (TSTATE(backend, MASTER_SLAVE ? PRIMARY_NODE_ID : REAL_MASTER_NODE_ID) != 'E'))
{
bool foundp;
POOL_STATUS status;
[parent: 87d435c8e52d]