From bcb22ac5362ccf8a46228c4399a976701a6328c3 Mon Sep 17 00:00:00 2001 From: Jeevan Chalke Date: Thu, 1 Dec 2022 19:56:29 +0530 Subject: [PATCH] Run pgindent. Vaibhav Dalvi. --- deparse.c | 8 ++++---- mongo_fdw.c | 24 +++++++++++++----------- mongo_query.c | 15 ++++++++------- mongo_query.h | 8 ++++---- 4 files changed, 29 insertions(+), 26 deletions(-) diff --git a/deparse.c b/deparse.c index f1deb2e..26a5c79 100644 --- a/deparse.c +++ b/deparse.c @@ -534,8 +534,8 @@ mongo_append_op_expr(OpExpr *node, BSON *child_doc, pipeline_cxt *context) &expr); else bsonAppendStartObject(child_doc, - psprintf("%d", context->arrayIndex++), - &expr); + psprintf("%d", context->arrayIndex++), + &expr); mongo_add_null_check(var, &expr, context); if (context->isBoolExpr) @@ -638,8 +638,8 @@ mongo_is_foreign_pathkey(PlannerInfo *root, RelOptInfo *baserel, Expr *em_expr; /* - * mongo_is_foreign_expr would detect volatile expressions as well, - * but checking ec_has_volatile here saves some cycles. + * mongo_is_foreign_expr would detect volatile expressions as well, but + * checking ec_has_volatile here saves some cycles. */ if (pathkey_ec->ec_has_volatile) return false; diff --git a/mongo_fdw.c b/mongo_fdw.c index 6100c4a..1336846 100644 --- a/mongo_fdw.c +++ b/mongo_fdw.c @@ -492,10 +492,11 @@ mongoGetForeignRelSize(PlannerInfo *root, fpinfo->options = options; #ifdef META_DRIVER + /* * Store aggregation enable/disable option in the fpinfo directly for - * further use. This flag can be useful when options are not accessible in - * the recursive cases. + * further use. This flag can be useful when options are not accessible + * in the recursive cases. */ fpinfo->is_agg_scanrel_pushable = options->enable_aggregate_pushdown; #endif @@ -650,7 +651,7 @@ mongoGetForeignPlan(PlannerInfo *root, bool has_final_sort = false; bool has_limit = false; int64 limit_value; - int64 offset_value; + int64 offset_value; /* * Get FDW private data created by mongoGetForeignUpperPaths(), if any. @@ -859,6 +860,7 @@ mongoGetForeignPlan(PlannerInfo *root, mongofdwreltype = BASE_REL; #ifdef META_DRIVER + /* * We use MongoRelQualInfo to pass various information related to joining * quals and grouping target to fdw_private which is used to form @@ -4520,8 +4522,8 @@ mongo_add_foreign_final_paths(PlannerInfo *root, RelOptInfo *input_rel, /* * We do not support LIMIT with FOR UPDATE/SHARE. Also, if there is no - * FOR UPDATE/SHARE clause and there is no LIMIT, don't need to add Foreign - * final path. + * FOR UPDATE/SHARE clause and there is no LIMIT, don't need to add + * Foreign final path. */ if (parse->rowMarks || !extra->limit_needed) return; @@ -4668,7 +4670,7 @@ mongo_add_foreign_final_paths(PlannerInfo *root, RelOptInfo *input_rel, if (!((Const *) node)->constisnull && (DatumGetInt64(((Const *) node)->constvalue) < 0)) - return; + return; } if (parse->limitOffset) { @@ -4680,7 +4682,7 @@ mongo_add_foreign_final_paths(PlannerInfo *root, RelOptInfo *input_rel, if (!((Const *) node)->constisnull && (DatumGetInt64(((Const *) node)->constvalue) < 0)) - return; + return; } /* Safe to push down */ @@ -4810,13 +4812,13 @@ mongo_is_default_sort_operator(EquivalenceMember *em, PathKey *pathkey) pathkey->pk_strategy); if (!OidIsValid(oprid)) elog(ERROR, "missing operator %d(%u,%u) in opfamily %u", - pathkey->pk_strategy, em->em_datatype, em->em_datatype, - pathkey->pk_opfamily); + pathkey->pk_strategy, em->em_datatype, em->em_datatype, + pathkey->pk_opfamily); /* Can't push down the sort if the operator is not shippable. */ oprname = get_opname(oprid); if (!((strncmp(oprname, "<", NAMEDATALEN) == 0) || - (strncmp(oprname, ">", NAMEDATALEN) == 0))) + (strncmp(oprname, ">", NAMEDATALEN) == 0))) return false; /* @@ -4824,7 +4826,7 @@ mongo_is_default_sort_operator(EquivalenceMember *em, PathKey *pathkey) * Here we need to use the expression's actual type to discover whether * the desired operator will be the default or not. */ - typentry = lookup_type_cache(exprType((Node *)em->em_expr), + typentry = lookup_type_cache(exprType((Node *) em->em_expr), TYPECACHE_LT_OPR | TYPECACHE_GT_OPR); if (oprid == typentry->lt_opr || oprid == typentry->gt_opr) return true; diff --git a/mongo_query.c b/mongo_query.c index 1c9bc51..28b2e80 100644 --- a/mongo_query.c +++ b/mongo_query.c @@ -97,7 +97,7 @@ static List *prepare_var_list_for_baserel(Oid relid, Index varno, static HTAB *column_info_hash(List *colname_list, List *colnum_list, List *rti_list, List *isouter_list); static void mongo_prepare_pipeline(List *clause, BSON *inner_pipeline, - pipeline_cxt *context); + pipeline_cxt *context); static void mongo_append_clauses_to_pipeline(List *clause, BSON *child_doc, pipeline_cxt *context); #endif @@ -772,14 +772,14 @@ mongo_query_document(ForeignScanState *scanStateNode) } } bsonAppendFinishObject(&sort_stage, &sort); - bsonAppendFinishObject(&root_pipeline, &sort_stage); /* End sort */ + bsonAppendFinishObject(&root_pipeline, &sort_stage); /* End sort */ } /* Add LIMIT/SKIP stage */ if (has_limit) { int64 limit_value; - int64 offset_value; + int64 offset_value; /* * Add skip stage for OFFSET clause. However, don't add the same if @@ -1422,6 +1422,7 @@ foreign_expr_walker(Node *node, foreign_glob_cxt *glob_cxt, /* Increment the Var count */ glob_cxt->varcount++; #endif + /* * If the Var is from the foreign table, we consider its * collation (if any) safe to use. If it is from another @@ -1521,15 +1522,15 @@ foreign_expr_walker(Node *node, foreign_glob_cxt *glob_cxt, /* * Recurse to input subexpressions. * - * We support same operators as joinclause for WHERE conditions - * of simple as well as join relation. + * We support same operators as joinclause for WHERE + * conditions of simple as well as join relation. */ if (!foreign_expr_walker((Node *) oe->args, glob_cxt, &inner_cxt) #ifndef META_DRIVER || (glob_cxt->opexprcount > 1) #endif - ) + ) return false; /* @@ -1602,7 +1603,7 @@ foreign_expr_walker(Node *node, foreign_glob_cxt *glob_cxt, #ifndef META_DRIVER || (glob_cxt->varcount > 1) #endif - ) + ) return false; } diff --git a/mongo_query.h b/mongo_query.h index 67ba0af..0bf0b0a 100644 --- a/mongo_query.h +++ b/mongo_query.h @@ -26,10 +26,10 @@ typedef struct pipeline_cxt unsigned int arrayIndex; /* Index of the various arrays in the * pipeline, starting from zero */ bool isBoolExpr; /* is join expression boolean? */ - bool isJoinClause; /* is join clause? This is to add null check - only in case of join clause */ - uint32 opExprCount; /* count death of the expression */ - ForeignScanState *scanStateNode; /* To evaluate param expression */ + bool isJoinClause; /* is join clause? This is to add null check + * only in case of join clause */ + uint32 opExprCount; /* count death of the expression */ + ForeignScanState *scanStateNode; /* To evaluate param expression */ } pipeline_cxt; /*