1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-17 17:02:08 +03:00

Code review for IS DISTINCT FROM patch. Fix incorrect constant-folding

logic, dissuade planner from thinking that 'x IS DISTINCT FROM 42' may
be optimized into 'x = 42' (!!), cause dependency on = operator to be
recorded correctly, minor other improvements.
This commit is contained in:
Tom Lane
2002-11-30 21:25:08 +00:00
parent 36c356e799
commit 2b7ec402c4
7 changed files with 70 additions and 115 deletions

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/parse_expr.c,v 1.131 2002/11/26 03:01:58 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/parse_expr.c,v 1.132 2002/11/30 21:25:05 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -277,6 +277,8 @@ transformExpr(ParseState *pstate, Node *expr, ConstraintTestValue *domVal)
result = (Node *) make_op(a->name,
lexpr,
rexpr);
if (((Expr *) result)->typeOid != BOOLOID)
elog(ERROR, "IS DISTINCT FROM requires = operator to yield boolean");
((Expr *) result)->opType = DISTINCT_EXPR;
}
break;