[pgpool-committers: 223] pgpool: Fix the case when unable-to-parse query is issued and on memory

Tatsuo Ishii ishii at postgresql.org
Mon May 28 17:48:33 JST 2012


Fix the case when unable-to-parse query is issued and on memory query
cache is enabled. Problem is, when such a query arrives, pgpool
replaces it with a dummy query which uses non-existent table. And
pool_table_name_to_oid() tries to convert non-existent table to oid,
and causes error. Using pgpool_regclass() will supress the error but
the relcache module will cache oid 0 in this case and continues to
return the cache entry even when the table is created
afterward. Solution is add new interface to control relcache not to
cache if register_func returns 0. For this purpose new member
"no_cache_if_zeo" is added to POOL_RELCACHE.

Another problem is new SET TRANSACTION command in 9.2. This hates
other SQL issued before the SET command in the transaction. Since
pgpool-II 3.2 or before does not understand the new SET commmand, it
tries to issue internal SQL to analyze the dummy SQL. Soltion is,
adding new member "is_parse_error" to POOL_QUERY_CONTEXT and avoid
trying to convert dummy table name to oid.

Branch
------
master

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

Modified Files
--------------
pool_proto_modules.c |   10 ++++++----
pool_query_context.h |    3 +++
pool_relcache.c      |   39 ++++++++++++++++++++++-----------------
pool_relcache.h      |    1 +
pool_select_walker.c |   26 +++++++++++++++++++-------
5 files changed, 51 insertions(+), 28 deletions(-)



More information about the pgpool-committers mailing list