Skip to content

Commit

Permalink
Run pgindent.
Browse files Browse the repository at this point in the history
FDW-450, Vaibhav Dalvi.
  • Loading branch information
jeevanchalke committed May 18, 2022
1 parent 206f0b5 commit c8b6cce
Show file tree
Hide file tree
Showing 10 changed files with 242 additions and 228 deletions.
8 changes: 4 additions & 4 deletions connection.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ typedef struct ConnCacheEntry
MONGO_CONN *conn; /* connection to foreign server, or NULL */
bool invalidated; /* true if reconnect is pending */
uint32 server_hashvalue; /* hash value of foreign server OID */
uint32 mapping_hashvalue; /* hash value of user mapping OID */
uint32 mapping_hashvalue; /* hash value of user mapping OID */
} ConnCacheEntry;

/*
Expand Down Expand Up @@ -141,11 +141,11 @@ mongo_get_connection(ForeignServer *server, UserMapping *user,
if (entry->conn != NULL)
{
bson_error_t error;
bool retval;
bson_t *command;
bool retval;
bson_t *command;

/* Ping the database using "ping" command */
command = BCON_NEW("ping", BCON_INT32 (1));
command = BCON_NEW("ping", BCON_INT32(1));
retval = mongoc_client_command_simple(entry->conn, opt->svr_database,
command, NULL, NULL, &error);
if (!retval)
Expand Down
23 changes: 12 additions & 11 deletions deparse.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,12 @@ mongo_check_qual(Expr *node, MongoRelQualInfo *qual_info)
mongo_check_qual(((RelabelType *) node)->arg, qual_info);
break;
case T_BoolExpr:
mongo_check_qual((Expr *)((BoolExpr *) node)->args, qual_info);
mongo_check_qual((Expr *) ((BoolExpr *) node)->args, qual_info);
break;
case T_Aggref:
{
ListCell *lc;
char *func_name = get_func_name(((Aggref *) node)->aggfnoid);
char *func_name = get_func_name(((Aggref *) node)->aggfnoid);

/* Save aggregation operation name */
qual_info->aggTypeList = lappend(qual_info->aggTypeList,
Expand All @@ -118,7 +118,7 @@ mongo_check_qual(Expr *node, MongoRelQualInfo *qual_info)
* For aggregation over the column, add required information
* into the column information lists.
*/
if (((Aggref *)node)->aggstar)
if (((Aggref *) node)->aggstar)
{
qual_info->colNameList = lappend(qual_info->colNameList,
makeString("*"));
Expand Down Expand Up @@ -225,7 +225,7 @@ mongo_check_var(Var *column, MongoRelQualInfo *qual_info)

if (!(bms_is_member(column->varno, qual_info->foreignRel->relids) &&
column->varlevelsup == 0))
return; /* Var does not belong to foreign table */
return; /* Var does not belong to foreign table */

Assert(!IS_SPECIAL_VARNO(column->varno));

Expand All @@ -247,7 +247,7 @@ mongo_check_var(Var *column, MongoRelQualInfo *qual_info)
key.varno = column->varno;
key.varattno = column->varattno;

hash_search(qual_info->exprColHash, (void *)&key, HASH_ENTER, &found);
hash_search(qual_info->exprColHash, (void *) &key, HASH_ENTER, &found);

/*
* Add aggregated column in the aggColList even if it's already available
Expand Down Expand Up @@ -390,7 +390,7 @@ mongo_append_bool_expr(BoolExpr *node, BSON *child_doc, pipeline_cxt *context)
/* Reset to zero to be used for nested arrays */
context->arrayIndex = reset_index;

/* Save join expression type boolean "TRUE" */
/* Save join expression type boolean "TRUE" */
context->isBoolExpr = true;

foreach(lc, node->args)
Expand Down Expand Up @@ -436,9 +436,9 @@ mongo_append_op_expr(OpExpr *node, BSON *child_doc, pipeline_cxt *context)
char *mongo_operator;
int saved_array_index;
int reset_index = 0;
int and_index = 0;
BSON and_op;
BSON and_obj;
int and_index = 0;
BSON and_op;
BSON and_obj;

/* Retrieve information about the operator from the system catalog. */
tuple = SearchSysCache1(OPEROID, ObjectIdGetDatum(node->opno));
Expand Down Expand Up @@ -501,7 +501,8 @@ mongo_append_op_expr(OpExpr *node, BSON *child_doc, pipeline_cxt *context)
bsonAppendFinishObject(child_doc, &expr);

/*
* Add equality check for null values for columns involved in join-clauses.
* Add equality check for null values for columns involved in
* join-clauses.
*/
foreach(arg, node->args)
{
Expand Down Expand Up @@ -574,7 +575,7 @@ mongo_append_column_name(Var *column, BSON *child_doc, pipeline_cxt *context)
static void
mongo_add_null_check(Var *column, BSON *expr, pipeline_cxt *context)
{
BSON ne_expr;
BSON ne_expr;
bool found = false;
ColInfoHashKey key;
ColInfoHashEntry *columnInfo;
Expand Down
Loading

0 comments on commit c8b6cce

Please sign in to comment.