]> granicus.if.org Git - postgresql/commit
Fix overly tense optimization of PLpgSQL_func_hashkey: we must represent
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 9 Oct 2008 16:35:19 +0000 (16:35 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 9 Oct 2008 16:35:19 +0000 (16:35 +0000)
commit68909e70f757d34cfa53bb5fa315529b1c8c7b58
treeb030c9ce6ee834e5c13d58c05bb46b58cce330a1
parent433ba2dd560141dd3415ab7e2ddedb23b48c2024
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.
src/pl/plpgsql/src/pl_comp.c
src/pl/plpgsql/src/plpgsql.h