Re: AW: Re: [SQL] behavior of ' = NULL' vs. MySQL vs. Stand ards - Mailing list pgsql-hackers

From Thomas Lockhart
Subject Re: AW: Re: [SQL] behavior of ' = NULL' vs. MySQL vs. Stand ards
Date
Msg-id 3B20FCF9.A8C5505A@fourpalms.org
Whole thread Raw
In response to AW: Re: [SQL] behavior of ' = NULL' vs. MySQL vs. Stand ards  (Zeugswetter Andreas SB <ZeugswetterA@wien.spardat.at>)
List pgsql-hackers
> The way things currently work is that gram.y translates "x IS TRUE" etc
> to "x = true" etc.  This is wrong because it does the wrong thing for
> null input.  Another objection is that it's impossible for ruleutils.c
> to reverse-list the expression tree in its original form.

fyi, in case it helps: we used to have gram.y translate these into
function calls, rather than the operator expression. But that precluded
the optimizer from ever having a shot at optimizing out "const = const"
kinds of expressions and other fluff.

If we go to a specialized node in the parse tree, then the optimizer
could be taught to handle that, which is better than the original
straight function call which would have masked things too much.
                   - Thomas


pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Re: [PATCHES] Fw: Isn't pg_statistic a security hole - Solution Proposal
Next
From: Tom Lane
Date:
Subject: Re: ERROR: Memory exhausted in AllocSetAlloc(909324558)