Re: Why does contain_leaked_vars believe MinMaxExpr is safe?

From: Noah Misch <noah(at)leadboat(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Why does contain_leaked_vars believe MinMaxExpr is safe?
Date: 2015-05-14 04:13:38
Message-ID: 20150514041338.GA3710871@tornado.leadboat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, May 13, 2015 at 09:34:53AM -0400, Robert Haas wrote:
> On Tue, May 12, 2015 at 7:22 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> > MinMaxExpr is an implicit invocation of a btree comparison function.
> > Are we supposing that all of those are necessarily leakproof?
>
> I suspect it's an oversight, because the comment gives no hint that
> any such intention was present. It's been more than three years since
> I committed that code (under a different function name) so my memory
> is a little fuzzy, but I believe it just didn't occur to me that
> MinMaxExpr could include a function call.
>
> I suspect it's safe in practice, but in theory it's probably a bug.

Agreed; it is formally a bug. We considered[1] special trust of operator
class members and decided against it. Since almost every btree opfamily
member is leakproof in practice, I doubt the bug has harmed anyone.

[1] http://www.postgresql.org/message-id/flat/20110707223526(dot)GJ1840(at)tornado(dot)leadboat(dot)com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2015-05-14 05:50:31 Re: Final Patch for GROUPING SETS
Previous Message Amit Kapila 2015-05-14 04:12:48 Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file