isnull.diff

text/x-diff

Filename: isnull.diff
Type: text/x-diff
Part: 0
Message: Re: strange IS NULL behaviour

Patch

Same data as JSON: GET /api/v1/attachments/:id/patch the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes. API reference →
Format: unified
File+
src/backend/optimizer/util/clauses.c 0 0
diff --git a/src/backend/optimizer/util/clauses.c b/src/backend/optimizer/util/clauses.c
new file mode 100644
index 6d5b204..0abf789
*** a/src/backend/optimizer/util/clauses.c
--- b/src/backend/optimizer/util/clauses.c
*************** eval_const_expressions_mutator(Node *nod
*** 3149,3155 ****
  						newntest->arg = (Expr *) relem;
  						newntest->nulltesttype = ntest->nulltesttype;
  						newntest->argisrow = type_is_rowtype(exprType(relem));
! 						newargs = lappend(newargs, newntest);
  					}
  					/* If all the inputs were constants, result is TRUE */
  					if (newargs == NIL)
--- 3149,3160 ----
  						newntest->arg = (Expr *) relem;
  						newntest->nulltesttype = ntest->nulltesttype;
  						newntest->argisrow = type_is_rowtype(exprType(relem));
! 						/* flatten nested ROW(), e.g.  ROW(ROW(ROW(NULL))) IS NULL */
! 						if (IsA(relem, RowExpr))
! 							newargs = lappend(newargs,
! 								eval_const_expressions_mutator((Node *)newntest, context));
! 						else
! 							newargs = lappend(newargs, newntest);
  					}
  					/* If all the inputs were constants, result is TRUE */
  					if (newargs == NIL)