mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-10-02 13:31:19 +02:00
get_relattval() should treat a NULL constant as a non-constant expression,
since it has no way to indicate to its caller that the constant is actually NULL. This prevents coredump in cases like WHERE textfield < null::text;
This commit is contained in:
parent
3e51872a98
commit
8064a49f6f
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/clauses.c,v 1.65 2000/04/12 17:15:24 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/clauses.c,v 1.66 2000/04/16 01:55:45 tgl Exp $
|
||||||
*
|
*
|
||||||
* HISTORY
|
* HISTORY
|
||||||
* AUTHOR DATE MAJOR EVENT
|
* AUTHOR DATE MAJOR EVENT
|
||||||
@ -790,7 +790,8 @@ default_results:
|
|||||||
|
|
||||||
other = (*flag == 0) ? left : right;
|
other = (*flag == 0) ? left : right;
|
||||||
|
|
||||||
if (IsA(other, Const))
|
if (IsA(other, Const) &&
|
||||||
|
!((Const *) other)->constisnull)
|
||||||
{
|
{
|
||||||
*constval = ((Const *) other)->constvalue;
|
*constval = ((Const *) other)->constvalue;
|
||||||
*flag |= SEL_CONSTANT;
|
*flag |= SEL_CONSTANT;
|
||||||
|
Loading…
Reference in New Issue
Block a user