[pgpool-committers: 710] pgpool: Fix bug with query cache returning incorrect data in some cases

Tatsuo Ishii ishii at postgresql.org
Sat Nov 17 19:28:52 JST 2012


Fix bug with query cache returning incorrect data in some cases when a
persistent table and temp table have same name.

Here is a sequence to trigger the bug:
1) CREATE TABLE t1(i int);	-- create a persistent table
2) INSERT INTO t1 VALUES(1);
3) SELECT * FROM t1;		-- query cache entry created
4) CREATE TEMP TABLE t1(i int);	-- create a temp table
5) SELECT * FROM t1;		-- query cache entry mistakenly created!

Problem is #3 creates relcache entry for t1, and #5 incorrecly uses it
and believes that temp table t1 is not a temp table. To solve the
problem, new function discard_temp_table_relcache() added and it gets
called in ReadyforQuery if CREATE TEMP TABLE executed to discard
relcache for temp table info.

Branch
------
V3_2_STABLE

Details
-------
http://git.postgresql.org/gitweb?p=pgpool2.git;a=commitdiff;h=9fadee2a4f30f427d892a5fce442e59207a7a51f

Modified Files
--------------
pool_proto_modules.c |   31 +++++++++++++++++++++++--------
pool_select_walker.c |   27 ++++++++++++++++++++-------
pool_select_walker.h |    1 +
3 files changed, 44 insertions(+), 15 deletions(-)



More information about the pgpool-committers mailing list