pgsql: Fix overly tense optimization of PLpgSQL_func_hashkey: we must - Mailing list pgsql-committers

From tgl@postgresql.org (Tom Lane)
Subject pgsql: Fix overly tense optimization of PLpgSQL_func_hashkey: we must
Date
Msg-id 20081009163513.1C6667545A4@cvs.postgresql.org
Whole thread Raw
List 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_3_STABLE

Modified Files:
--------------
    pgsql/src/pl/plpgsql/src:
        pl_comp.c (r1.121 -> r1.121.2.1)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/pl/plpgsql/src/pl_comp.c?r1=1.121&r2=1.121.2.1)
        plpgsql.h (r1.95 -> r1.95.2.1)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/pl/plpgsql/src/plpgsql.h?r1=1.95&r2=1.95.2.1)

pgsql-committers by date:

Previous
From: tgl@postgresql.org (Tom Lane)
Date:
Subject: pgsql: Fix overly tense optimization of PLpgSQL_func_hashkey: we must
Next
From: tgl@postgresql.org (Tom Lane)
Date:
Subject: pgsql: Fix overly tense optimization of PLpgSQL_func_hashkey: we must