1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-14 18:42:34 +03:00

Pass collation to makeConst() instead of looking it up internally.

In nearly all cases, the caller already knows the correct collation, and
in a number of places, the value the caller has handy is more correct than
the default for the type would be.  (In particular, this patch makes it
significantly less likely that eval_const_expressions will result in
changing the exposed collation of an expression.)  So an internal lookup
is both expensive and wrong.
This commit is contained in:
Tom Lane
2011-03-25 20:10:42 -04:00
parent c8e993503d
commit bfa4440ca5
18 changed files with 165 additions and 56 deletions

View File

@ -4653,7 +4653,7 @@ ExecInitExpr(Expr *node, PlanState *parent)
* don't really care what type of NULL it is, so
* always make an int4 NULL.
*/
e = (Expr *) makeNullConst(INT4OID, -1);
e = (Expr *) makeNullConst(INT4OID, -1, InvalidOid);
}
estate = ExecInitExpr(e, parent);
outlist = lappend(outlist, estate);