summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas Vondra2017-08-21 08:17:07 +0000
committerTomas Vondra2017-08-21 09:03:16 +0000
commitd66ec8f444000f861fc3b35e0c65adbd74fd434c (patch)
tree75c4782505a8cfb6b03b42d470ce880130459bd9
parent28147bfd19da345621f209cb5b5065422d8f5926 (diff)
Make sure ExecRemoteQuery is called with (PlanState *) parameter
gcc 6.4.1 is complaining when ExecRemoteQuery(PlanState *) gets called with (RemoteSubqueryState*) parameter. This commit adds explicit cast on a few places to silence the warnings noise. An alternative fix might be to use (RemoteSubqueryState*), but that does not quite work as ResponseCombiner needs to keep a pointer to either ExecRemoteQuery or ExecRemoteSubplan. So the explicit cast seems better.
-rw-r--r--src/backend/commands/analyze.c8
-rw-r--r--src/backend/commands/explain.c4
-rw-r--r--src/backend/commands/vacuum.c4
-rw-r--r--src/backend/utils/adt/dbsize.c4
4 files changed, 10 insertions, 10 deletions
diff --git a/src/backend/commands/analyze.c b/src/backend/commands/analyze.c
index 6ffbbc9202..ca48fca486 100644
--- a/src/backend/commands/analyze.c
+++ b/src/backend/commands/analyze.c
@@ -3114,7 +3114,7 @@ analyze_rel_coordinator(Relation onerel, bool inh, int attr_cnt,
for (i = 0; i < attr_cnt; i++)
numnodes[i] = 0;
- result = ExecRemoteQuery(node);
+ result = ExecRemoteQuery((PlanState *) node);
PopActiveSnapshot();
while (result != NULL && !TupIsNull(result))
{
@@ -3351,7 +3351,7 @@ analyze_rel_coordinator(Relation onerel, bool inh, int attr_cnt,
}
/* fetch next */
- result = ExecRemoteQuery(node);
+ result = ExecRemoteQuery((PlanState *) node);
}
ExecEndRemoteQuery(node);
@@ -3447,7 +3447,7 @@ analyze_rel_coordinator(Relation onerel, bool inh, int attr_cnt,
for (i = 0; i < attr_cnt; i++)
numnodes[i] = 0;
- result = ExecRemoteQuery(node);
+ result = ExecRemoteQuery((PlanState *) node);
PopActiveSnapshot();
/*
@@ -3517,7 +3517,7 @@ analyze_rel_coordinator(Relation onerel, bool inh, int attr_cnt,
}
/* fetch stats from next node */
- result = ExecRemoteQuery(node);
+ result = ExecRemoteQuery((PlanState *) node);
}
ExecEndRemoteQuery(node);
}
diff --git a/src/backend/commands/explain.c b/src/backend/commands/explain.c
index b35a799100..a698e78a47 100644
--- a/src/backend/commands/explain.c
+++ b/src/backend/commands/explain.c
@@ -3767,7 +3767,7 @@ ExplainRemoteQuery(RemoteQuery *plan, PlanState *planstate, List *ancestors, Exp
node = ExecInitRemoteQuery(step, estate, 0);
MemoryContextSwitchTo(oldcontext);
- result = ExecRemoteQuery(node);
+ result = ExecRemoteQuery((PlanState *) node);
while (result != NULL && !TupIsNull(result))
{
Datum value;
@@ -3782,7 +3782,7 @@ ExplainRemoteQuery(RemoteQuery *plan, PlanState *planstate, List *ancestors, Exp
}
/* fetch next */
- result = ExecRemoteQuery(node);
+ result = ExecRemoteQuery((PlanState *) node);
}
ExecEndRemoteQuery(node);
diff --git a/src/backend/commands/vacuum.c b/src/backend/commands/vacuum.c
index 979969bd32..fffae63bcc 100644
--- a/src/backend/commands/vacuum.c
+++ b/src/backend/commands/vacuum.c
@@ -1745,7 +1745,7 @@ get_remote_relstat(char *nspname, char *relname, bool replicated,
validallvisiblepages = 0;
validtuples = 0;
validfrozenxids = 0;
- result = ExecRemoteQuery(node);
+ result = ExecRemoteQuery((PlanState *) node);
while (result != NULL && !TupIsNull(result))
{
Datum value;
@@ -1788,7 +1788,7 @@ get_remote_relstat(char *nspname, char *relname, bool replicated,
}
}
/* fetch next */
- result = ExecRemoteQuery(node);
+ result = ExecRemoteQuery((PlanState *) node);
}
ExecEndRemoteQuery(node);
diff --git a/src/backend/utils/adt/dbsize.c b/src/backend/utils/adt/dbsize.c
index 6c9ab212ae..4e8aacf6c4 100644
--- a/src/backend/utils/adt/dbsize.c
+++ b/src/backend/utils/adt/dbsize.c
@@ -1250,11 +1250,11 @@ pgxc_execute_on_nodes(int numnodes, Oid *nodelist, char *query)
pstate = ExecInitRemoteQuery(plan, estate, 0);
MemoryContextSwitchTo(oldcontext);
- result = ExecRemoteQuery(pstate);
+ result = ExecRemoteQuery((PlanState *) pstate);
while (result != NULL && !TupIsNull(result))
{
datum = slot_getattr(result, 1, &isnull);
- result = ExecRemoteQuery(pstate);
+ result = ExecRemoteQuery((PlanState *) pstate);
/* For single node, don't assume the type of datum. It can be bool also. */
if (numnodes == 1)