pgsql: Fix overly tense optimization of PLpgSQL_func_hashkey: we must

From: tgl(at)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix overly tense optimization of PLpgSQL_func_hashkey: we must
Date: 2008-10-09 16:35:33
Message-ID: 20081009163533.187257545A4@cvs.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Log Message:
-----------
Fix overly tense optimization of PLpgSQL_func_hashkey: we must represent
the isTrigger state explicitly, not rely on nonzero-ness of trigrelOid
to indicate trigger-hood, because trigrelOid will be left zero when compiling
for validation. The (useless) function hash entry built by the validator
was able to match an ordinary non-trigger call later in the same session,
thereby bypassing the check that is supposed to prevent such a call.
Per report from Alvaro.

It might be worth suppressing the useless hash entry altogether, but
that's a bigger change than I want to consider back-patching.

Back-patch to 8.0. 7.4 doesn't have the problem because it doesn't
have validation mode.

Tags:
----
REL8_0_STABLE

Modified Files:
--------------
pgsql/src/pl/plpgsql/src:
pl_comp.c (r1.83.4.1 -> r1.83.4.2)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/pl/plpgsql/src/pl_comp.c?r1=1.83.4.1&r2=1.83.4.2)
plpgsql.h (r1.56 -> r1.56.4.1)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/pl/plpgsql/src/plpgsql.h?r1=1.56&r2=1.56.4.1)

Browse pgsql-committers by date

  From Date Subject
Next Message Alvaro Herrera 2008-10-09 17:24:06 pgsql: Improve translatability of error messages for external modules by
Previous Message Tom Lane 2008-10-09 16:35:25 pgsql: Fix overly tense optimization of PLpgSQL_func_hashkey: we must