mirror of
https://github.com/postgres/postgres.git
synced 2025-11-06 07:49:08 +03:00
pgindent run before PG 9.1 beta 1.
This commit is contained in:
@@ -2042,7 +2042,7 @@ rowtype_field_matches(Oid rowtypeid, int fieldnum,
|
||||
*
|
||||
* Whenever a function is eliminated from the expression by means of
|
||||
* constant-expression evaluation or inlining, we add the function to
|
||||
* root->glob->invalItems. This ensures the plan is known to depend on
|
||||
* root->glob->invalItems. This ensures the plan is known to depend on
|
||||
* such functions, even though they aren't referenced anymore.
|
||||
*
|
||||
* We assume that the tree has already been type-checked and contains
|
||||
@@ -2437,8 +2437,8 @@ eval_const_expressions_mutator(Node *node,
|
||||
context);
|
||||
|
||||
/*
|
||||
* Use negate_clause() to see if we can simplify away
|
||||
* the NOT.
|
||||
* Use negate_clause() to see if we can simplify away the
|
||||
* NOT.
|
||||
*/
|
||||
return negate_clause(arg);
|
||||
}
|
||||
@@ -2548,9 +2548,9 @@ eval_const_expressions_mutator(Node *node,
|
||||
makeConst(OIDOID, -1, InvalidOid, sizeof(Oid),
|
||||
ObjectIdGetDatum(intypioparam),
|
||||
false, true),
|
||||
makeConst(INT4OID, -1, InvalidOid, sizeof(int32),
|
||||
Int32GetDatum(-1),
|
||||
false, true));
|
||||
makeConst(INT4OID, -1, InvalidOid, sizeof(int32),
|
||||
Int32GetDatum(-1),
|
||||
false, true));
|
||||
|
||||
simple = simplify_function(infunc,
|
||||
expr->resulttype, -1,
|
||||
@@ -2618,9 +2618,9 @@ eval_const_expressions_mutator(Node *node,
|
||||
/*
|
||||
* If we can simplify the input to a constant, then we don't need the
|
||||
* CollateExpr node at all: just change the constcollid field of the
|
||||
* Const node. Otherwise, replace the CollateExpr with a RelabelType.
|
||||
* (We do that so as to improve uniformity of expression representation
|
||||
* and thus simplify comparison of expressions.)
|
||||
* Const node. Otherwise, replace the CollateExpr with a RelabelType.
|
||||
* (We do that so as to improve uniformity of expression
|
||||
* representation and thus simplify comparison of expressions.)
|
||||
*/
|
||||
CollateExpr *collate = (CollateExpr *) node;
|
||||
Node *arg;
|
||||
@@ -2675,7 +2675,7 @@ eval_const_expressions_mutator(Node *node,
|
||||
* placeholder nodes, so that we have the opportunity to reduce
|
||||
* constant test conditions. For example this allows
|
||||
* CASE 0 WHEN 0 THEN 1 ELSE 1/0 END
|
||||
* to reduce to 1 rather than drawing a divide-by-0 error. Note
|
||||
* to reduce to 1 rather than drawing a divide-by-0 error. Note
|
||||
* that when the test expression is constant, we don't have to
|
||||
* include it in the resulting CASE; for example
|
||||
* CASE 0 WHEN x THEN y ELSE z END
|
||||
@@ -2855,9 +2855,9 @@ eval_const_expressions_mutator(Node *node,
|
||||
/*
|
||||
* We can remove null constants from the list. For a non-null
|
||||
* constant, if it has not been preceded by any other
|
||||
* non-null-constant expressions then it is the result. Otherwise,
|
||||
* it's the next argument, but we can drop following arguments
|
||||
* since they will never be reached.
|
||||
* non-null-constant expressions then it is the result.
|
||||
* Otherwise, it's the next argument, but we can drop following
|
||||
* arguments since they will never be reached.
|
||||
*/
|
||||
if (IsA(e, Const))
|
||||
{
|
||||
@@ -3353,12 +3353,12 @@ simplify_boolean_equality(Oid opno, List *args)
|
||||
if (DatumGetBool(((Const *) leftop)->constvalue))
|
||||
return rightop; /* true = foo */
|
||||
else
|
||||
return negate_clause(rightop); /* false = foo */
|
||||
return negate_clause(rightop); /* false = foo */
|
||||
}
|
||||
else
|
||||
{
|
||||
if (DatumGetBool(((Const *) leftop)->constvalue))
|
||||
return negate_clause(rightop); /* true <> foo */
|
||||
return negate_clause(rightop); /* true <> foo */
|
||||
else
|
||||
return rightop; /* false <> foo */
|
||||
}
|
||||
@@ -3902,7 +3902,7 @@ inline_function(Oid funcid, Oid result_type, Oid result_collid,
|
||||
fexpr->funcresulttype = result_type;
|
||||
fexpr->funcretset = false;
|
||||
fexpr->funcformat = COERCE_DONTCARE; /* doesn't matter */
|
||||
fexpr->funccollid = result_collid; /* doesn't matter */
|
||||
fexpr->funccollid = result_collid; /* doesn't matter */
|
||||
fexpr->inputcollid = input_collid;
|
||||
fexpr->args = args;
|
||||
fexpr->location = -1;
|
||||
@@ -4060,18 +4060,18 @@ inline_function(Oid funcid, Oid result_type, Oid result_collid,
|
||||
MemoryContextDelete(mycxt);
|
||||
|
||||
/*
|
||||
* If the result is of a collatable type, force the result to expose
|
||||
* the correct collation. In most cases this does not matter, but
|
||||
* it's possible that the function result is used directly as a sort key
|
||||
* or in other places where we expect exprCollation() to tell the truth.
|
||||
* If the result is of a collatable type, force the result to expose the
|
||||
* correct collation. In most cases this does not matter, but it's
|
||||
* possible that the function result is used directly as a sort key or in
|
||||
* other places where we expect exprCollation() to tell the truth.
|
||||
*/
|
||||
if (OidIsValid(result_collid))
|
||||
{
|
||||
Oid exprcoll = exprCollation(newexpr);
|
||||
Oid exprcoll = exprCollation(newexpr);
|
||||
|
||||
if (OidIsValid(exprcoll) && exprcoll != result_collid)
|
||||
{
|
||||
CollateExpr *newnode = makeNode(CollateExpr);
|
||||
CollateExpr *newnode = makeNode(CollateExpr);
|
||||
|
||||
newnode->arg = (Expr *) newexpr;
|
||||
newnode->collOid = result_collid;
|
||||
@@ -4370,11 +4370,11 @@ inline_set_returning_function(PlannerInfo *root, RangeTblEntry *rte)
|
||||
oldcxt = MemoryContextSwitchTo(mycxt);
|
||||
|
||||
/*
|
||||
* When we call eval_const_expressions below, it might try to add items
|
||||
* to root->glob->invalItems. Since it is running in the temp context,
|
||||
* those items will be in that context, and will need to be copied out
|
||||
* if we're successful. Temporarily reset the list so that we can keep
|
||||
* those items separate from the pre-existing list contents.
|
||||
* When we call eval_const_expressions below, it might try to add items to
|
||||
* root->glob->invalItems. Since it is running in the temp context, those
|
||||
* items will be in that context, and will need to be copied out if we're
|
||||
* successful. Temporarily reset the list so that we can keep those items
|
||||
* separate from the pre-existing list contents.
|
||||
*/
|
||||
saveInvalItems = root->glob->invalItems;
|
||||
root->glob->invalItems = NIL;
|
||||
@@ -4419,8 +4419,8 @@ inline_set_returning_function(PlannerInfo *root, RangeTblEntry *rte)
|
||||
goto fail;
|
||||
|
||||
/*
|
||||
* Set up to handle parameters while parsing the function body. We
|
||||
* can use the FuncExpr just created as the input for
|
||||
* Set up to handle parameters while parsing the function body. We can
|
||||
* use the FuncExpr just created as the input for
|
||||
* prepare_sql_fn_parse_info.
|
||||
*/
|
||||
pinfo = prepare_sql_fn_parse_info(func_tuple,
|
||||
@@ -4438,7 +4438,7 @@ inline_set_returning_function(PlannerInfo *root, RangeTblEntry *rte)
|
||||
|
||||
querytree_list = pg_analyze_and_rewrite_params(linitial(raw_parsetree_list),
|
||||
src,
|
||||
(ParserSetupHook) sql_fn_parser_setup,
|
||||
(ParserSetupHook) sql_fn_parser_setup,
|
||||
pinfo);
|
||||
if (list_length(querytree_list) != 1)
|
||||
goto fail;
|
||||
@@ -4513,8 +4513,8 @@ inline_set_returning_function(PlannerInfo *root, RangeTblEntry *rte)
|
||||
ReleaseSysCache(func_tuple);
|
||||
|
||||
/*
|
||||
* We don't have to fix collations here because the upper query is
|
||||
* already parsed, ie, the collations in the RTE are what count.
|
||||
* We don't have to fix collations here because the upper query is already
|
||||
* parsed, ie, the collations in the RTE are what count.
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user