aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2010-01-19 16:33:33 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2010-01-19 16:33:33 +0000
commit85b587c259cae5f058019797243e38271ef7158d (patch)
tree9f8b62083258b72479e1375d8bb6f46fa7c966d9 /src
parent7e40cdc07585d5f93dd1f35ce1d402eba55e425b (diff)
downloadpostgresql-85b587c259cae5f058019797243e38271ef7158d.tar.gz
postgresql-85b587c259cae5f058019797243e38271ef7158d.zip
Fix thinko in my recent change to put an explicit argisrow field in NullTest:
when the planner splits apart a ROW(...) IS NULL test, the argisrow values of the component tests have to be determined from the component field types, not copied from the original NullTest (in which argisrow is surely true).
Diffstat (limited to 'src')
-rw-r--r--src/backend/optimizer/util/clauses.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/backend/optimizer/util/clauses.c b/src/backend/optimizer/util/clauses.c
index a66d8391c57..5910246dc9a 100644
--- a/src/backend/optimizer/util/clauses.c
+++ b/src/backend/optimizer/util/clauses.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/optimizer/util/clauses.c,v 1.283 2010/01/02 16:57:48 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/optimizer/util/clauses.c,v 1.284 2010/01/19 16:33:33 tgl Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
@@ -2826,15 +2826,17 @@ eval_const_expressions_mutator(Node *node,
context);
if (arg && IsA(arg, RowExpr))
{
- RowExpr *rarg = (RowExpr *) arg;
- List *newargs = NIL;
- ListCell *l;
-
/*
* We break ROW(...) IS [NOT] NULL into separate tests on its
* component fields. This form is usually more efficient to
* evaluate, as well as being more amenable to optimization.
*/
+ RowExpr *rarg = (RowExpr *) arg;
+ List *newargs = NIL;
+ ListCell *l;
+
+ Assert(ntest->argisrow);
+
foreach(l, rarg->args)
{
Node *relem = (Node *) lfirst(l);
@@ -2856,7 +2858,7 @@ eval_const_expressions_mutator(Node *node,
newntest = makeNode(NullTest);
newntest->arg = (Expr *) relem;
newntest->nulltesttype = ntest->nulltesttype;
- newntest->argisrow = ntest->argisrow;
+ newntest->argisrow = type_is_rowtype(exprType(relem));
newargs = lappend(newargs, newntest);
}
/* If all the inputs were constants, result is TRUE */