1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-12 21:01:52 +03:00

Add parse location fields to NullTest and BooleanTest structs.

We did not need a location tag on NullTest or BooleanTest before, because
no error messages referred directly to their locations.  That's planned
to change though, so add these fields in a separate housekeeping commit.

Catversion bump because stored rules may change.
This commit is contained in:
Tom Lane
2015-02-22 14:40:27 -05:00
parent 6a75562ed1
commit c063da1769
14 changed files with 44 additions and 5 deletions

View File

@ -449,6 +449,7 @@ build_minmax_path(PlannerInfo *root, MinMaxAggInfo *mminfo,
ntest->arg = copyObject(mminfo->target);
/* we checked it wasn't a rowtype in find_minmax_aggs_walker */
ntest->argisrow = false;
ntest->location = -1;
/* User might have had that in WHERE already */
if (!list_member((List *) parse->jointree->quals, ntest))

View File

@ -212,6 +212,7 @@ negate_clause(Node *node)
newexpr->nulltesttype = (expr->nulltesttype == IS_NULL ?
IS_NOT_NULL : IS_NULL);
newexpr->argisrow = expr->argisrow;
newexpr->location = expr->location;
return (Node *) newexpr;
}
}
@ -247,6 +248,7 @@ negate_clause(Node *node)
(int) expr->booltesttype);
break;
}
newexpr->location = expr->location;
return (Node *) newexpr;
}
break;

View File

@ -3305,6 +3305,7 @@ eval_const_expressions_mutator(Node *node,
newntest->arg = (Expr *) relem;
newntest->nulltesttype = ntest->nulltesttype;
newntest->argisrow = type_is_rowtype(exprType(relem));
newntest->location = ntest->location;
newargs = lappend(newargs, newntest);
}
/* If all the inputs were constants, result is TRUE */
@ -3343,6 +3344,7 @@ eval_const_expressions_mutator(Node *node,
newntest->arg = (Expr *) arg;
newntest->nulltesttype = ntest->nulltesttype;
newntest->argisrow = ntest->argisrow;
newntest->location = ntest->location;
return (Node *) newntest;
}
case T_BooleanTest:
@ -3395,6 +3397,7 @@ eval_const_expressions_mutator(Node *node,
newbtest = makeNode(BooleanTest);
newbtest->arg = (Expr *) arg;
newbtest->booltesttype = btest->booltesttype;
newbtest->location = btest->location;
return (Node *) newbtest;
}
case T_PlaceHolderVar:

View File

@ -720,6 +720,7 @@ get_relation_constraints(PlannerInfo *root,
0);
ntest->nulltesttype = IS_NOT_NULL;
ntest->argisrow = type_is_rowtype(att->atttypid);
ntest->location = -1;
result = lappend(result, ntest);
}
}