Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion contrib/extprotocol/gpextprotocol.c
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ DemoUri *ParseDemoUri(const char *uri_str)
/*
* parse protocol
*/
char *post_protocol = strstr(uri_str, "://");
const char *post_protocol = strstr(uri_str, "://");

if(!post_protocol)
{
Expand Down
4 changes: 2 additions & 2 deletions gpcontrib/pg_hint_plan/pg_hint_plan.c
Original file line number Diff line number Diff line change
Expand Up @@ -2003,7 +2003,7 @@ get_hints_from_comment(const char *p)
{
const char *hint_head;
char *head;
char *tail;
const char *tail;
int len;

if (p == NULL)
Expand Down Expand Up @@ -2050,7 +2050,7 @@ get_hints_from_comment(const char *p)
}

/* We don't support nested block comments. */
if ((head = strstr(p, BLOCK_COMMENT_START)) != NULL && head < tail)
if ((head = (char *)strstr(p, BLOCK_COMMENT_START)) != NULL && head < tail)
{
hint_ereport(head, ("Nested block comments are not supported."));
return NULL;
Expand Down
4 changes: 2 additions & 2 deletions src/backend/access/external/url_curl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1473,7 +1473,7 @@ url_curl_fopen(char *url, bool forwrite, extvar_t *ev, CopyFormatOptions *opts)
{
/* use empty message */
CURL_EASY_SETOPT(file->curl->handle, CURLOPT_POSTFIELDS, "");
CURL_EASY_SETOPT(file->curl->handle, CURLOPT_POSTFIELDSIZE, 0);
CURL_EASY_SETOPT(file->curl->handle, CURLOPT_POSTFIELDSIZE, 0L);

/* post away and check response, retry if failed (timeout or * connect error) */
gp_perform_backoff_and_check_response(file, easy_perform_work);
Expand Down Expand Up @@ -1932,7 +1932,7 @@ gp_proto0_write_done(URL_CURL_FILE *file)

/* use empty message */
CURL_EASY_SETOPT(file->curl->handle, CURLOPT_POSTFIELDS, "");
CURL_EASY_SETOPT(file->curl->handle, CURLOPT_POSTFIELDSIZE, 0);
CURL_EASY_SETOPT(file->curl->handle, CURLOPT_POSTFIELDSIZE, 0L);

/* post away! */
gp_perform_backoff_and_check_response(file, easy_perform_work);
Expand Down
2 changes: 1 addition & 1 deletion src/backend/catalog/pg_type.c
Original file line number Diff line number Diff line change
Expand Up @@ -1074,7 +1074,7 @@ char *
makeMultirangeTypeName(const char *rangeTypeName, Oid typeNamespace)
{
char *buf;
char *rangestr;
const char *rangestr;

/*
* If the range type name contains "range" then change that to
Expand Down
44 changes: 34 additions & 10 deletions src/backend/cdb/cdbllize.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ typedef struct
* Forward Declarations
*/
static Node *fix_outer_query_motions_mutator(Node *node, decorate_subplans_with_motions_context *context);
static Node *fix_outer_query_motions_mutator_adapter(Node *node, void *context);
static Plan *fix_subplan_motion(PlannerInfo *root, Plan *subplan, Flow *outer_query_flow);
static bool build_slice_table_walker(Node *node, build_slice_table_context *context);
static void adjust_top_path_for_parallel_retrieve_cursor(Path *path, PlanSlice *slice);
Expand Down Expand Up @@ -852,7 +853,7 @@ fix_outer_query_motions_mutator(Node *node, decorate_subplans_with_motions_conte
/* An expression node might have subtrees containing plans to be mutated. */
if (!is_plan_node(node))
{
node = plan_tree_mutator(node, fix_outer_query_motions_mutator, context, false);
node = plan_tree_mutator(node, fix_outer_query_motions_mutator_adapter, context, false);

/*
* If we see a SubPlan, remember the context where we saw it. We memorize
Expand Down Expand Up @@ -912,7 +913,7 @@ fix_outer_query_motions_mutator(Node *node, decorate_subplans_with_motions_conte
context->sliceDepth++;

plan = (Plan *) plan_tree_mutator((Node *) plan,
fix_outer_query_motions_mutator,
fix_outer_query_motions_mutator_adapter,
context,
false);
motion = (Motion *) plan;
Expand Down Expand Up @@ -991,13 +992,20 @@ fix_outer_query_motions_mutator(Node *node, decorate_subplans_with_motions_conte
saveCurrentPlanFlow = context->currentPlanFlow;
if (plan->flow != NULL && plan->flow->locustype != CdbLocusType_OuterQuery)
context->currentPlanFlow = plan->flow;
newnode = plan_tree_mutator(node, fix_outer_query_motions_mutator, context, false);
newnode = plan_tree_mutator(node, fix_outer_query_motions_mutator_adapter, context, false);
context->currentPlanFlow = saveCurrentPlanFlow;
}

return newnode;
}

static Node *
fix_outer_query_motions_mutator_adapter(Node *node, void *context)
{
return fix_outer_query_motions_mutator(
node, (decorate_subplans_with_motions_context *) context);
}

/*
* Add a Motion node on top of a Plan if needed, to make the result available
* in 'outer_query_flow'. Subroutine of cdbllize_fix_outer_query_motions().
Expand Down Expand Up @@ -1270,6 +1278,14 @@ cdbllize_build_slice_table(PlannerInfo *root, Plan *top_plan,
query->setOperations = NULL;
}

static bool
build_slice_table_walker(Node *node, build_slice_table_context *context);
static bool
build_slice_table_walker_adapter(Node *node, void *context)
{
return build_slice_table_walker(node, (build_slice_table_context *) context);
}

static bool
build_slice_table_walker(Node *node, build_slice_table_context *context)
{
Expand Down Expand Up @@ -1312,9 +1328,9 @@ build_slice_table_walker(Node *node, build_slice_table_context *context)
root->glob->subplan_sliceIds[plan_id - 1] = context->currentSliceIndex;

result = plan_tree_walker(node,
build_slice_table_walker,
context,
true);
build_slice_table_walker_adapter,
context,
true);

context->currentSliceIndex = save_currentSliceIndex;

Expand Down Expand Up @@ -1372,7 +1388,7 @@ build_slice_table_walker(Node *node, build_slice_table_context *context)
}

result = plan_tree_walker((Node *) motion,
build_slice_table_walker,
build_slice_table_walker_adapter,
context,
false);

Expand All @@ -1382,7 +1398,7 @@ build_slice_table_walker(Node *node, build_slice_table_context *context)
}

return plan_tree_walker(node,
build_slice_table_walker,
build_slice_table_walker_adapter,
context,
false);
}
Expand Down Expand Up @@ -1436,6 +1452,14 @@ typedef struct aware_result_t
int nnodes;
} aware_result_t;

static bool
motion_sanity_walker(Node *node, sanity_result_t *result);
static bool
motion_sanity_walker_adapter(Node *node, void *result)
{
return motion_sanity_walker(node, (sanity_result_t *) result);
}

static bool
motion_sanity_walker(Node *node, sanity_result_t *result)
{
Expand Down Expand Up @@ -1542,12 +1566,12 @@ motion_sanity_walker(Node *node, sanity_result_t *result)
case T_Sort:
case T_Material:
case T_ForeignScan:
if (plan_tree_walker(node, motion_sanity_walker, result, true))
if (plan_tree_walker(node, motion_sanity_walker_adapter, result, true))
return true;
break;

case T_Motion:
if (plan_tree_walker(node, motion_sanity_walker, result, true))
if (plan_tree_walker(node, motion_sanity_walker_adapter, result, true))
return true;
result->flags |= SANITY_MOTION;
elog(DEBUG5, " found motion");
Expand Down
40 changes: 36 additions & 4 deletions src/backend/cdb/cdbmutate.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ typedef struct
*/
static Node *pre_dispatch_function_evaluation_mutator(Node *node,
pre_dispatch_function_evaluation_context *context);
static Node *pre_dispatch_function_evaluation_mutator_adapter(Node *node, void *context);
static bool replace_shareinput_targetlists_walker(Node *node, PlannerInfo *root, bool fPop);


Expand Down Expand Up @@ -238,6 +239,14 @@ typedef struct ctid_inventory_context
Index relid;
} ctid_inventory_context;

static bool
ctid_inventory_walker(Node *node, ctid_inventory_context *inv);
static bool
ctid_inventory_walker_adapter(Node *node, void *inv)
{
return ctid_inventory_walker(node, (ctid_inventory_context *) inv);
}

static bool
ctid_inventory_walker(Node *node, ctid_inventory_context *inv)
{
Expand All @@ -259,7 +268,7 @@ ctid_inventory_walker(Node *node, ctid_inventory_context *inv)
}
return false;
}
return plan_tree_walker(node, ctid_inventory_walker, inv, true);
return plan_tree_walker(node, ctid_inventory_walker_adapter, inv, true);
}

void
Expand Down Expand Up @@ -1181,6 +1190,14 @@ typedef struct ParamWalkerContext
Bitmapset *scanrelids; /* Bitmapset for scanrelid */
} ParamWalkerContext;

static bool
param_walker(Node *node, ParamWalkerContext *context);
static bool
param_walker_adapter(Node *node, void *context)
{
return param_walker(node, (ParamWalkerContext *) context);
}

static bool
param_walker(Node *node, ParamWalkerContext *context)
{
Expand Down Expand Up @@ -1277,7 +1294,7 @@ param_walker(Node *node, ParamWalkerContext *context)
break;
}

return plan_tree_walker(node, param_walker, context, false);
return plan_tree_walker(node, param_walker_adapter, context, false);
}

/*
Expand Down Expand Up @@ -1343,6 +1360,14 @@ rte_param_walker(List *rtable, ParamWalkerContext *context)
}
}

static bool
initplan_walker(Node *node, ParamWalkerContext *context);
static bool
initplan_walker_adapter(Node *node, void *context)
{
return initplan_walker(node, (ParamWalkerContext *) context);
}

static bool
initplan_walker(Node *node, ParamWalkerContext *context)
{
Expand Down Expand Up @@ -1406,7 +1431,7 @@ initplan_walker(Node *node, ParamWalkerContext *context)
plan->initPlan = new_initplans;
}

return plan_tree_walker(node, initplan_walker, context, true);
return plan_tree_walker(node, initplan_walker_adapter, context, true);
}

/*
Expand Down Expand Up @@ -1779,13 +1804,20 @@ pre_dispatch_function_evaluation_mutator(Node *node,
* simplify its arguments (if any) using this routine.
*/
new_node = plan_tree_mutator(node,
pre_dispatch_function_evaluation_mutator,
pre_dispatch_function_evaluation_mutator_adapter,
(void *) context,
true);

return new_node;
}

static Node *
pre_dispatch_function_evaluation_mutator_adapter(Node *node, void *context)
{
return pre_dispatch_function_evaluation_mutator(
node, (pre_dispatch_function_evaluation_context *) context);
}

/*
* cdbpathtoplan_create_sri_path
*
Expand Down
14 changes: 7 additions & 7 deletions src/backend/cdb/cdbplan.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
#include "utils/lsyscache.h"


static void mutate_plan_fields(Plan *newplan, Plan *oldplan, Node *(*mutator) (), void *context);
static void mutate_join_fields(Join *newplan, Join *oldplan, Node *(*mutator) (), void *context);
static void mutate_sort_fields(Sort* newplan, Sort* oldplan, Node *(*mutator) (), void *context);
static void mutate_plan_fields(Plan *newplan, Plan *oldplan, Node *(*mutator) (Node *, void *), void *context);
static void mutate_join_fields(Join *newplan, Join *oldplan, Node *(*mutator) (Node *, void *), void *context);
static void mutate_sort_fields(Sort* newplan, Sort* oldplan, Node *(*mutator) (Node *, void *), void *context);



Expand Down Expand Up @@ -107,7 +107,7 @@ static void mutate_sort_fields(Sort* newplan, Sort* oldplan, Node *(*mutator) ()

Node *
plan_tree_mutator(Node *node,
Node *(*mutator) (),
Node *(*mutator) (Node *, void *),
void *context,
bool recurse_into_subplans)
{
Expand Down Expand Up @@ -1101,7 +1101,7 @@ plan_tree_mutator(Node *node,
*
*/
static void
mutate_plan_fields(Plan *newplan, Plan *oldplan, Node *(*mutator) (), void *context)
mutate_plan_fields(Plan *newplan, Plan *oldplan, Node *(*mutator) (Node *, void *), void *context)
{
/*
* Scalar fields startup_cost total_cost plan_rows plan_width nParamExec
Expand All @@ -1128,7 +1128,7 @@ mutate_plan_fields(Plan *newplan, Plan *oldplan, Node *(*mutator) (), void *cont
*
*/
static void
mutate_join_fields(Join *newjoin, Join *oldjoin, Node *(*mutator) (), void *context)
mutate_join_fields(Join *newjoin, Join *oldjoin, Node *(*mutator) (Node *, void *), void *context)
{
/* A Join node is a Plan node. */
mutate_plan_fields((Plan *) newjoin, (Plan *) oldjoin, mutator, context);
Expand All @@ -1146,7 +1146,7 @@ mutate_join_fields(Join *newjoin, Join *oldjoin, Node *(*mutator) (), void *cont
*
*/
static void
mutate_sort_fields(Sort *newsort, Sort *oldsort, Node *(*mutator) (), void *context)
mutate_sort_fields(Sort *newsort, Sort *oldsort, Node *(*mutator) (Node *, void *), void *context)
{
/* A Join node is a Plan node. */
mutate_plan_fields((Plan *) newsort, (Plan *) oldsort, mutator, context);
Expand Down
10 changes: 9 additions & 1 deletion src/backend/cdb/dispatcher/cdbdisp_query.c
Original file line number Diff line number Diff line change
Expand Up @@ -1654,6 +1654,14 @@ getExecParamsToDispatch(PlannedStmt *stmt, ParamExecData *intPrm)
* This list is input to the function findParamType(), which loops over the
* list looking for a specific paramid, and returns its type.
*/
static bool
param_walker(Node *node, ParamWalkerContext *context);
static bool
param_walker_adapter(Node *node, void *context)
{
return param_walker(node, (ParamWalkerContext *) context);
}

static bool
param_walker(Node *node, ParamWalkerContext *context)
{
Expand All @@ -1670,7 +1678,7 @@ param_walker(Node *node, ParamWalkerContext *context)
return false;
}
}
return plan_tree_walker(node, param_walker, context, true);
return plan_tree_walker(node, param_walker_adapter, context, true);
}

/*
Expand Down
6 changes: 3 additions & 3 deletions src/backend/cdb/dispatcher/cdbgang.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ AllocateGang(CdbDispatcherState *ds, GangType type, List *segments)
bool
segment_failure_due_to_recovery(const char *error_message)
{
char *fatal = NULL,
const char *fatal = NULL,
*ptr = NULL;
int fatal_len = 0;

Expand Down Expand Up @@ -210,7 +210,7 @@ segment_failure_due_to_recovery(const char *error_message)
bool
segment_failure_due_to_missing_writer(const char *error_message)
{
char *fatal = NULL,
const char *fatal = NULL,
*ptr = NULL;
int fatal_len = 0;

Expand All @@ -232,7 +232,7 @@ segment_failure_due_to_missing_writer(const char *error_message)
bool
segment_failure_due_to_fault_injector(const char *error_message)
{
char *fatal = NULL,
const char *fatal = NULL,
*ptr = NULL;
int fatal_len = 0;

Expand Down
Loading
Loading