pgsql: Fix pg_plan_queries() to restore the previous setting of

From: tgl(at)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix pg_plan_queries() to restore the previous setting of
Date: 2008-03-12 23:58:35
Message-ID: 20080312235835.8251C753336@cvs.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Log Message:
-----------
Fix pg_plan_queries() to restore the previous setting of ActiveSnapshot
(probably NULL) before exiting. Up to now it's just left the variable as it
set it, which means that after we're done processing the current client
message, ActiveSnapshot is probably pointing at garbage (because this function
is typically run in MessageContext which will get reset). There doesn't seem
to have been any code path in which that mattered before 8.3, but now the
plancache module might try to use the stale value if the next client message
is a Bind for a prepared statement that is in need of replanning. Per report
from Alex Hunsaker.

Tags:
----
REL8_3_STABLE

Modified Files:
--------------
pgsql/src/backend/tcop:
postgres.c (r1.542 -> r1.542.2.1)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/tcop/postgres.c?r1=1.542&r2=1.542.2.1)

Browse pgsql-committers by date

  From Date Subject
Next Message Bruce Momjian 2008-03-13 01:56:47 pgsql: Add URL for: * Do async I/O for faster random read-ahead of data
Previous Message Tom Lane 2008-03-12 23:58:28 pgsql: Fix pg_plan_queries() to restore the previous setting of