mirror of
https://github.com/postgres/postgres.git
synced 2025-08-27 07:42:10 +03:00
Initial pgindent and pgperltidy run for v14.
Also "make reformat-dat-files". The only change worthy of note is that pgindent messed up the formatting of launcher.c's struct LogicalRepWorkerId, which led me to notice that that struct wasn't used at all anymore, so I just took it out.
This commit is contained in:
@@ -1907,11 +1907,11 @@ create_gather_merge_plan(PlannerInfo *root, GatherMergePath *best_path)
|
||||
|
||||
|
||||
/*
|
||||
* All gather merge paths should have already guaranteed the necessary sort
|
||||
* order either by adding an explicit sort node or by using presorted input.
|
||||
* We can't simply add a sort here on additional pathkeys, because we can't
|
||||
* guarantee the sort would be safe. For example, expressions may be
|
||||
* volatile or otherwise parallel unsafe.
|
||||
* All gather merge paths should have already guaranteed the necessary
|
||||
* sort order either by adding an explicit sort node or by using presorted
|
||||
* input. We can't simply add a sort here on additional pathkeys, because
|
||||
* we can't guarantee the sort would be safe. For example, expressions may
|
||||
* be volatile or otherwise parallel unsafe.
|
||||
*/
|
||||
if (!pathkeys_contained_in(pathkeys, best_path->subpath->pathkeys))
|
||||
elog(ERROR, "gather merge input not sufficiently sorted");
|
||||
|
@@ -350,34 +350,34 @@ expand_insert_targetlist(List *tlist, Relation rel)
|
||||
Oid attcollation = att_tup->attcollation;
|
||||
Node *new_expr;
|
||||
|
||||
if (!att_tup->attisdropped)
|
||||
{
|
||||
new_expr = (Node *) makeConst(atttype,
|
||||
-1,
|
||||
attcollation,
|
||||
att_tup->attlen,
|
||||
(Datum) 0,
|
||||
true, /* isnull */
|
||||
att_tup->attbyval);
|
||||
new_expr = coerce_to_domain(new_expr,
|
||||
InvalidOid, -1,
|
||||
atttype,
|
||||
COERCION_IMPLICIT,
|
||||
COERCE_IMPLICIT_CAST,
|
||||
-1,
|
||||
false);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Insert NULL for dropped column */
|
||||
new_expr = (Node *) makeConst(INT4OID,
|
||||
-1,
|
||||
InvalidOid,
|
||||
sizeof(int32),
|
||||
(Datum) 0,
|
||||
true, /* isnull */
|
||||
true /* byval */ );
|
||||
}
|
||||
if (!att_tup->attisdropped)
|
||||
{
|
||||
new_expr = (Node *) makeConst(atttype,
|
||||
-1,
|
||||
attcollation,
|
||||
att_tup->attlen,
|
||||
(Datum) 0,
|
||||
true, /* isnull */
|
||||
att_tup->attbyval);
|
||||
new_expr = coerce_to_domain(new_expr,
|
||||
InvalidOid, -1,
|
||||
atttype,
|
||||
COERCION_IMPLICIT,
|
||||
COERCE_IMPLICIT_CAST,
|
||||
-1,
|
||||
false);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Insert NULL for dropped column */
|
||||
new_expr = (Node *) makeConst(INT4OID,
|
||||
-1,
|
||||
InvalidOid,
|
||||
sizeof(int32),
|
||||
(Datum) 0,
|
||||
true, /* isnull */
|
||||
true /* byval */ );
|
||||
}
|
||||
|
||||
new_tle = makeTargetEntry((Expr *) new_expr,
|
||||
attrno,
|
||||
|
@@ -2563,9 +2563,9 @@ eval_const_expressions_mutator(Node *node,
|
||||
}
|
||||
case T_NullIfExpr:
|
||||
{
|
||||
NullIfExpr *expr;
|
||||
ListCell *arg;
|
||||
bool has_nonconst_input = false;
|
||||
NullIfExpr *expr;
|
||||
ListCell *arg;
|
||||
bool has_nonconst_input = false;
|
||||
|
||||
/* Copy the node and const-simplify its arguments */
|
||||
expr = (NullIfExpr *) ece_generic_processing(node);
|
||||
@@ -4359,49 +4359,49 @@ inline_function(Oid funcid, Oid result_type, Oid result_collid,
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Set up to handle parameters while parsing the function body. We need a
|
||||
* dummy FuncExpr node containing the already-simplified arguments to pass
|
||||
* to prepare_sql_fn_parse_info. (In some cases we don't really need
|
||||
* that, but for simplicity we always build it.)
|
||||
*/
|
||||
fexpr = makeNode(FuncExpr);
|
||||
fexpr->funcid = funcid;
|
||||
fexpr->funcresulttype = result_type;
|
||||
fexpr->funcretset = false;
|
||||
fexpr->funcvariadic = funcvariadic;
|
||||
fexpr->funcformat = COERCE_EXPLICIT_CALL; /* doesn't matter */
|
||||
fexpr->funccollid = result_collid; /* doesn't matter */
|
||||
fexpr->inputcollid = input_collid;
|
||||
fexpr->args = args;
|
||||
fexpr->location = -1;
|
||||
/*
|
||||
* Set up to handle parameters while parsing the function body. We
|
||||
* need a dummy FuncExpr node containing the already-simplified
|
||||
* arguments to pass to prepare_sql_fn_parse_info. (In some cases we
|
||||
* don't really need that, but for simplicity we always build it.)
|
||||
*/
|
||||
fexpr = makeNode(FuncExpr);
|
||||
fexpr->funcid = funcid;
|
||||
fexpr->funcresulttype = result_type;
|
||||
fexpr->funcretset = false;
|
||||
fexpr->funcvariadic = funcvariadic;
|
||||
fexpr->funcformat = COERCE_EXPLICIT_CALL; /* doesn't matter */
|
||||
fexpr->funccollid = result_collid; /* doesn't matter */
|
||||
fexpr->inputcollid = input_collid;
|
||||
fexpr->args = args;
|
||||
fexpr->location = -1;
|
||||
|
||||
pinfo = prepare_sql_fn_parse_info(func_tuple,
|
||||
(Node *) fexpr,
|
||||
input_collid);
|
||||
pinfo = prepare_sql_fn_parse_info(func_tuple,
|
||||
(Node *) fexpr,
|
||||
input_collid);
|
||||
|
||||
/* fexpr also provides a convenient way to resolve a composite result */
|
||||
(void) get_expr_result_type((Node *) fexpr,
|
||||
NULL,
|
||||
&rettupdesc);
|
||||
/* fexpr also provides a convenient way to resolve a composite result */
|
||||
(void) get_expr_result_type((Node *) fexpr,
|
||||
NULL,
|
||||
&rettupdesc);
|
||||
|
||||
/*
|
||||
* We just do parsing and parse analysis, not rewriting, because rewriting
|
||||
* will not affect table-free-SELECT-only queries, which is all that we
|
||||
* care about. Also, we can punt as soon as we detect more than one
|
||||
* command in the function body.
|
||||
*/
|
||||
raw_parsetree_list = pg_parse_query(src);
|
||||
if (list_length(raw_parsetree_list) != 1)
|
||||
goto fail;
|
||||
/*
|
||||
* We just do parsing and parse analysis, not rewriting, because
|
||||
* rewriting will not affect table-free-SELECT-only queries, which is
|
||||
* all that we care about. Also, we can punt as soon as we detect
|
||||
* more than one command in the function body.
|
||||
*/
|
||||
raw_parsetree_list = pg_parse_query(src);
|
||||
if (list_length(raw_parsetree_list) != 1)
|
||||
goto fail;
|
||||
|
||||
pstate = make_parsestate(NULL);
|
||||
pstate->p_sourcetext = src;
|
||||
sql_fn_parser_setup(pstate, pinfo);
|
||||
pstate = make_parsestate(NULL);
|
||||
pstate->p_sourcetext = src;
|
||||
sql_fn_parser_setup(pstate, pinfo);
|
||||
|
||||
querytree = transformTopLevelStmt(pstate, linitial(raw_parsetree_list));
|
||||
querytree = transformTopLevelStmt(pstate, linitial(raw_parsetree_list));
|
||||
|
||||
free_parsestate(pstate);
|
||||
free_parsestate(pstate);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -4931,31 +4931,31 @@ inline_set_returning_function(PlannerInfo *root, RangeTblEntry *rte)
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* 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,
|
||||
(Node *) fexpr,
|
||||
fexpr->inputcollid);
|
||||
/*
|
||||
* 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,
|
||||
(Node *) fexpr,
|
||||
fexpr->inputcollid);
|
||||
|
||||
/*
|
||||
* Parse, analyze, and rewrite (unlike inline_function(), we can't skip
|
||||
* rewriting here). We can fail as soon as we find more than one query,
|
||||
* though.
|
||||
*/
|
||||
raw_parsetree_list = pg_parse_query(src);
|
||||
if (list_length(raw_parsetree_list) != 1)
|
||||
goto fail;
|
||||
/*
|
||||
* Parse, analyze, and rewrite (unlike inline_function(), we can't
|
||||
* skip rewriting here). We can fail as soon as we find more than one
|
||||
* query, though.
|
||||
*/
|
||||
raw_parsetree_list = pg_parse_query(src);
|
||||
if (list_length(raw_parsetree_list) != 1)
|
||||
goto fail;
|
||||
|
||||
querytree_list = pg_analyze_and_rewrite_params(linitial(raw_parsetree_list),
|
||||
src,
|
||||
(ParserSetupHook) sql_fn_parser_setup,
|
||||
pinfo, NULL);
|
||||
if (list_length(querytree_list) != 1)
|
||||
goto fail;
|
||||
querytree = linitial(querytree_list);
|
||||
querytree_list = pg_analyze_and_rewrite_params(linitial(raw_parsetree_list),
|
||||
src,
|
||||
(ParserSetupHook) sql_fn_parser_setup,
|
||||
pinfo, NULL);
|
||||
if (list_length(querytree_list) != 1)
|
||||
goto fail;
|
||||
querytree = linitial(querytree_list);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user