mirror of
https://github.com/postgres/postgres.git
synced 2025-06-16 06:01:02 +03:00
Run pgindent with new pg_bsd_indent version 2.1.1.
Thomas Munro fixed a longstanding annoyance in pg_bsd_indent, that it would misformat lines containing IsA() macros on the assumption that the IsA() call should be treated like a cast. This improves some other cases involving field/variable names that match typedefs, too. The only places that get worse are a couple of uses of the OpenSSL macro STACK_OF(); we'll gladly take that trade-off. Discussion: https://postgr.es/m/20200114221814.GA19630@alvherre.pgsql
This commit is contained in:
@ -221,7 +221,7 @@ transformOptionalSelectInto(ParseState *pstate, Node *parseTree)
|
||||
/* If it's a set-operation tree, drill down to leftmost SelectStmt */
|
||||
while (stmt && stmt->op != SETOP_NONE)
|
||||
stmt = stmt->larg;
|
||||
Assert(stmt && IsA(stmt, SelectStmt) &&stmt->larg == NULL);
|
||||
Assert(stmt && IsA(stmt, SelectStmt) && stmt->larg == NULL);
|
||||
|
||||
if (stmt->intoClause)
|
||||
{
|
||||
@ -641,7 +641,7 @@ transformInsertStmt(ParseState *pstate, InsertStmt *stmt)
|
||||
if (tle->resjunk)
|
||||
continue;
|
||||
if (tle->expr &&
|
||||
(IsA(tle->expr, Const) ||IsA(tle->expr, Param)) &&
|
||||
(IsA(tle->expr, Const) || IsA(tle->expr, Param)) &&
|
||||
exprType((Node *) tle->expr) == UNKNOWNOID)
|
||||
expr = tle->expr;
|
||||
else
|
||||
|
@ -750,8 +750,8 @@ check_agg_arguments_walker(Node *node,
|
||||
*/
|
||||
if (context->sublevels_up == 0)
|
||||
{
|
||||
if ((IsA(node, FuncExpr) &&((FuncExpr *) node)->funcretset) ||
|
||||
(IsA(node, OpExpr) &&((OpExpr *) node)->opretset))
|
||||
if ((IsA(node, FuncExpr) && ((FuncExpr *) node)->funcretset) ||
|
||||
(IsA(node, OpExpr) && ((OpExpr *) node)->opretset))
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
||||
errmsg("aggregate function calls cannot contain set-returning function calls"),
|
||||
|
@ -1767,7 +1767,7 @@ transformLimitClause(ParseState *pstate, Node *clause,
|
||||
* unadorned NULL that's not accepted back by the grammar.
|
||||
*/
|
||||
if (exprKind == EXPR_KIND_LIMIT && limitOption == LIMIT_OPTION_WITH_TIES &&
|
||||
IsA(clause, A_Const) &&((A_Const *) clause)->val.type == T_Null)
|
||||
IsA(clause, A_Const) && ((A_Const *) clause)->val.type == T_Null)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INVALID_ROW_COUNT_IN_LIMIT_CLAUSE),
|
||||
errmsg("row count cannot be NULL in FETCH FIRST ... WITH TIES clause")));
|
||||
|
@ -961,7 +961,7 @@ transformAExprOp(ParseState *pstate, A_Expr *a)
|
||||
list_length(a->name) == 1 &&
|
||||
strcmp(strVal(linitial(a->name)), "=") == 0 &&
|
||||
(exprIsNullConstant(lexpr) || exprIsNullConstant(rexpr)) &&
|
||||
(!IsA(lexpr, CaseTestExpr) &&!IsA(rexpr, CaseTestExpr)))
|
||||
(!IsA(lexpr, CaseTestExpr) && !IsA(rexpr, CaseTestExpr)))
|
||||
{
|
||||
NullTest *n = makeNode(NullTest);
|
||||
|
||||
|
Reference in New Issue
Block a user