Skip to content

Commit 85b587c

Browse files
committed
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).
1 parent 7e40cdc commit 85b587c

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/backend/optimizer/util/clauses.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/optimizer/util/clauses.c,v 1.283 2010/01/02 16:57:48 momjian Exp $
11+
* $PostgreSQL: pgsql/src/backend/optimizer/util/clauses.c,v 1.284 2010/01/19 16:33:33 tgl Exp $
1212
*
1313
* HISTORY
1414
* AUTHOR DATE MAJOR EVENT
@@ -2826,15 +2826,17 @@ eval_const_expressions_mutator(Node *node,
28262826
context);
28272827
if (arg && IsA(arg, RowExpr))
28282828
{
2829-
RowExpr *rarg = (RowExpr *) arg;
2830-
List *newargs = NIL;
2831-
ListCell *l;
2832-
28332829
/*
28342830
* We break ROW(...) IS [NOT] NULL into separate tests on its
28352831
* component fields. This form is usually more efficient to
28362832
* evaluate, as well as being more amenable to optimization.
28372833
*/
2834+
RowExpr *rarg = (RowExpr *) arg;
2835+
List *newargs = NIL;
2836+
ListCell *l;
2837+
2838+
Assert(ntest->argisrow);
2839+
28382840
foreach(l, rarg->args)
28392841
{
28402842
Node *relem = (Node *) lfirst(l);
@@ -2856,7 +2858,7 @@ eval_const_expressions_mutator(Node *node,
28562858
newntest = makeNode(NullTest);
28572859
newntest->arg = (Expr *) relem;
28582860
newntest->nulltesttype = ntest->nulltesttype;
2859-
newntest->argisrow = ntest->argisrow;
2861+
newntest->argisrow = type_is_rowtype(exprType(relem));
28602862
newargs = lappend(newargs, newntest);
28612863
}
28622864
/* If all the inputs were constants, result is TRUE */

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy