From 005264a4bd1d069160c6df49c233d7f26a2c2f8e Mon Sep 17 00:00:00 2001 From: Michael Paquier Date: Fri, 9 Dec 2022 20:31:41 +0900 Subject: [PATCH] Fix a few whitespaces in the code Issues with the style of the code spotted while applying automatically some checks onto it. This change has no consequence for the code. --- make_join_rel.c | 4 ++-- pg_hint_plan.c | 50 ++++++++++++++++++++++---------------------- pg_stat_statements.c | 2 +- 3 files changed, 28 insertions(+), 28 deletions(-) diff --git a/make_join_rel.c b/make_join_rel.c index eef5666ea2a1..b8418fa29c80 100644 --- a/make_join_rel.c +++ b/make_join_rel.c @@ -196,10 +196,10 @@ make_join_rel(PlannerInfo *root, RelOptInfo *rel1, RelOptInfo *rel2) */ set_joinrel_size_estimates(root, joinrel, rel1, rel2, sjinfo, restrictlist); - + joinrel->rows = adjust_rows(joinrel->rows, domultiply); } - + } } /* !!! END: HERE IS THE PART WHICH IS ADDED FOR PG_HINT_PLAN !!! */ diff --git a/pg_hint_plan.c b/pg_hint_plan.c index 7a2fb102e815..11deccd6a2ed 100644 --- a/pg_hint_plan.c +++ b/pg_hint_plan.c @@ -1803,7 +1803,7 @@ parse_hints(HintState *hstate, Query *parse, const char *str) } -/* +/* * Get hints from table by client-supplied query string and application name. */ static const char * @@ -1835,9 +1835,9 @@ get_hints_from_table(const char *client_query, const char *client_application) PushActiveSnapshot(GetTransactionSnapshot()); snapshot_set = true; } - + SPI_connect(); - + if (plan == NULL) { SPIPlanPtr p; @@ -1845,18 +1845,18 @@ get_hints_from_table(const char *client_query, const char *client_application) plan = SPI_saveplan(p); SPI_freeplan(p); } - + qry = cstring_to_text(client_query); app = cstring_to_text(client_application); values[0] = PointerGetDatum(qry); values[1] = PointerGetDatum(app); - + SPI_execute_plan(plan, values, nulls, true, 1); - + if (SPI_processed > 0) { char *buf; - + hints = SPI_getvalue(SPI_tuptable->vals[0], SPI_tuptable->tupdesc, 1); /* @@ -1869,7 +1869,7 @@ get_hints_from_table(const char *client_query, const char *client_application) strcpy(buf, hints); hints = buf; } - + SPI_finish(); if (snapshot_set) @@ -2361,7 +2361,7 @@ RowsHintParse(RowsHint *hint, HintState *hstate, Query *parse, return str; } - + /* * Transform relation names from list to array to sort them with qsort @@ -2460,7 +2460,7 @@ ParallelHintParse(ParallelHint *hint, HintState *hstate, Query *parse, } hint->relname = linitial(name_list); - + /* The second parameter is number of workers */ hint->nworkers_str = list_nth(name_list, 1); nworkers = strtod(hint->nworkers_str, &end_ptr); @@ -2930,7 +2930,7 @@ get_current_hint_string(Query *query, const char *query_str, normalized_query), errhidestmt(msgqno != qno), errhidecontext(msgqno != qno))); - + msgqno = qno; } @@ -3003,7 +3003,7 @@ pg_hint_plan_planner(Query *parse, const char *query_string, int cursorOptions, const char *prev_hint_str = NULL; /* - * Use standard planner if pg_hint_plan is disabled or current nesting + * Use standard planner if pg_hint_plan is disabled or current nesting * depth is nesting depth of SPI calls. Other hook functions try to change * plan with current_hint_state if any, so set it to NULL. */ @@ -3062,10 +3062,10 @@ pg_hint_plan_planner(Query *parse, const char *query_string, int cursorOptions, pfree((void *)current_hint_str); current_hint_str = NULL; } - + goto standard_planner_proc; } - + /* * Push new hint struct to the hint stack to disable previous hint context. */ @@ -3078,7 +3078,7 @@ pg_hint_plan_planner(Query *parse, const char *query_string, int cursorOptions, setup_guc_enforcement(current_hint_state->set_hints, current_hint_state->num_hints[HINT_TYPE_SET], current_hint_state->context); - + current_hint_state->init_scan_mask = get_current_scan_mask(); current_hint_state->init_join_mask = get_current_join_mask(); current_hint_state->init_min_para_tablescan_size = @@ -3101,7 +3101,7 @@ pg_hint_plan_planner(Query *parse, const char *query_string, int cursorOptions, { ereport(pg_hint_plan_debug_message_level, (errhidestmt(msgqno != qno), - errmsg("pg_hint_plan%s: planner", qnostr))); + errmsg("pg_hint_plan%s: planner", qnostr))); msgqno = qno; } @@ -3113,7 +3113,7 @@ pg_hint_plan_planner(Query *parse, const char *query_string, int cursorOptions, recurse_level++; prev_hint_str = current_hint_str; current_hint_str = NULL; - + /* * Use PG_TRY mechanism to recover GUC parameters and current_hint_state to * the state when this planner started when error occurred in planner. @@ -3286,7 +3286,7 @@ find_parallel_hint(PlannerInfo *root, Index relid) /* * Parallel planning is appliable only on base relation, which has - * RelOptInfo. + * RelOptInfo. */ if (!rel) return NULL; @@ -3483,7 +3483,7 @@ restrict_indexes(PlannerInfo *root, ScanMethodHint *hint, RelOptInfo *rel, p_info->indcollation[i] != info->indexcollations[i] || p_info->opclass[i] != info->opcintype[i]) break; - + /* * Compare index ordering if this index is ordered. * @@ -3594,7 +3594,7 @@ restrict_indexes(PlannerInfo *root, ScanMethodHint *hint, RelOptInfo *rel, if (!use_index) rel->indexlist = foreach_delete_current(rel->indexlist, cell); - + pfree(indexname); } @@ -3611,7 +3611,7 @@ restrict_indexes(PlannerInfo *root, ScanMethodHint *hint, RelOptInfo *rel, disprelname = get_rel_name(rte->relid); else disprelname = hint->relname; - + initStringInfo(&rel_buf); quote_value(&rel_buf, disprelname); @@ -3626,7 +3626,7 @@ restrict_indexes(PlannerInfo *root, ScanMethodHint *hint, RelOptInfo *rel, } } -/* +/* * Return information of index definition. */ static ParentIndexInfo * @@ -3796,7 +3796,7 @@ setup_hint_enforcement(PlannerInfo *root, RelOptInfo *rel, * redundant setup cost. */ current_hint_state->parent_relid = new_parent_relid; - + /* Find hints for the parent */ current_hint_state->parent_scan_hint = find_scan_hint(root, current_hint_state->parent_relid); @@ -4428,7 +4428,7 @@ make_join_rel_wrapper(PlannerInfo *root, RelOptInfo *rel1, RelOptInfo *rel2) /* reject non-matching hints */ if (join_hint && join_hint->inner_nrels != 0) join_hint = NULL; - + if (memoize_hint && memoize_hint->inner_nrels != 0) memoize_hint = NULL; @@ -4620,7 +4620,7 @@ pg_hint_plan_join_search(PlannerInfo *root, int levels_needed, { ListCell *lc; int nworkers = 0; - + foreach (lc, initial_rels) { ListCell *lcp; diff --git a/pg_stat_statements.c b/pg_stat_statements.c index a1a92c3f2471..65e4e2ece144 100644 --- a/pg_stat_statements.c +++ b/pg_stat_statements.c @@ -1,7 +1,7 @@ /*------------------------------------------------------------------------- * * pg_stat_statements.c - * + * * Part of pg_stat_statements.c in PostgreSQL 10. * * Copyright (c) 2008-2020, PostgreSQL Global Development Group