mirror of https://github.com/citusdata/citus.git
Use CMDTAG_SELECT_COMPAT
CMDTAG_SELECT exists in PG12 hence defining a MACRO such as CMDTAG_SELECT -> "SELECT" is not possible. I chose CMDTAG_SELECT_COMPAT because with the COMPAT suffix it is explicit that it maps to different things in different versions and also has a less chance of mapping something irrevelant. For example if we used SELECT as a macro, then it would map every SELECT to whatever it is mapping to, which might have unexpected/undesired behaviour.pull/3900/head
parent
d68bfc5687
commit
b641f63bfd
|
@ -628,9 +628,10 @@ ExecutePlanIntoDestReceiver(PlannedStmt *queryPlan, ParamListInfo params,
|
||||||
/* don't display the portal in pg_cursors, it is for internal use only */
|
/* don't display the portal in pg_cursors, it is for internal use only */
|
||||||
portal->visible = false;
|
portal->visible = false;
|
||||||
|
|
||||||
PortalDefineQuerySelectCompat(portal,
|
PortalDefineQuery(portal,
|
||||||
NULL,
|
NULL,
|
||||||
"",
|
"",
|
||||||
|
CMDTAG_SELECT_COMPAT,
|
||||||
list_make1(queryPlan),
|
list_make1(queryPlan),
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
|
|
|
@ -266,7 +266,8 @@ StartPortalForQueryExecution(const char *queryString)
|
||||||
/* don't display the portal in pg_cursors, it is for internal use only */
|
/* don't display the portal in pg_cursors, it is for internal use only */
|
||||||
portal->visible = false;
|
portal->visible = false;
|
||||||
|
|
||||||
PortalDefineQuerySelectCompat(portal, NULL, queryString, list_make1(queryPlan), NULL);
|
PortalDefineQuery(portal, NULL, queryString, CMDTAG_SELECT_COMPAT, list_make1(
|
||||||
|
queryPlan), NULL);
|
||||||
int eflags = 0;
|
int eflags = 0;
|
||||||
PortalStart(portal, NULL, eflags, GetActiveSnapshot());
|
PortalStart(portal, NULL, eflags, GetActiveSnapshot());
|
||||||
|
|
||||||
|
|
|
@ -95,7 +95,8 @@ LogTransactionRecord(int32 groupId, char *transactionName)
|
||||||
values[Anum_pg_dist_transaction_gid - 1] = CStringGetTextDatum(transactionName);
|
values[Anum_pg_dist_transaction_gid - 1] = CStringGetTextDatum(transactionName);
|
||||||
|
|
||||||
/* open transaction relation and insert new tuple */
|
/* open transaction relation and insert new tuple */
|
||||||
Relation pgDistTransaction = table_open(DistTransactionRelationId(), RowExclusiveLock);
|
Relation pgDistTransaction = table_open(DistTransactionRelationId(),
|
||||||
|
RowExclusiveLock);
|
||||||
|
|
||||||
TupleDesc tupleDescriptor = RelationGetDescr(pgDistTransaction);
|
TupleDesc tupleDescriptor = RelationGetDescr(pgDistTransaction);
|
||||||
HeapTuple heapTuple = heap_form_tuple(tupleDescriptor, values, isNulls);
|
HeapTuple heapTuple = heap_form_tuple(tupleDescriptor, values, isNulls);
|
||||||
|
|
|
@ -34,10 +34,8 @@
|
||||||
#define pg_plan_query_compat(p, q, c, b) pg_plan_query(p, q, c, b)
|
#define pg_plan_query_compat(p, q, c, b) pg_plan_query(p, q, c, b)
|
||||||
#define planner_compat(p, c, b) planner(p, NULL, c, b)
|
#define planner_compat(p, c, b) planner(p, NULL, c, b)
|
||||||
#define standard_planner_compat(a, c, d) standard_planner(a, NULL, c, d)
|
#define standard_planner_compat(a, c, d) standard_planner(a, NULL, c, d)
|
||||||
#define PortalDefineQuerySelectCompat(a, b, c, d, e) PortalDefineQuery(a, b, c, \
|
|
||||||
CMDTAG_SELECT, d, \
|
|
||||||
e)
|
|
||||||
#define getOwnedSequencesCompat(a, b) getOwnedSequences(a)
|
#define getOwnedSequencesCompat(a, b) getOwnedSequences(a)
|
||||||
|
#define CMDTAG_SELECT_COMPAT CMDTAG_SELECT
|
||||||
#define ExplainOnePlanCompat(a, b, c, d, e, f, g) ExplainOnePlan(a, b, c, d, e, f, g, \
|
#define ExplainOnePlanCompat(a, b, c, d, e, f, g) ExplainOnePlan(a, b, c, d, e, f, g, \
|
||||||
NULL)
|
NULL)
|
||||||
#define varoattno varattnosyn
|
#define varoattno varattnosyn
|
||||||
|
@ -51,8 +49,7 @@
|
||||||
#define pg_plan_query_compat(p, q, c, b) pg_plan_query(p, c, b)
|
#define pg_plan_query_compat(p, q, c, b) pg_plan_query(p, c, b)
|
||||||
#define planner_compat(p, c, b) planner(p, c, b)
|
#define planner_compat(p, c, b) planner(p, c, b)
|
||||||
#define standard_planner_compat(a, c, d) standard_planner(a, c, d)
|
#define standard_planner_compat(a, c, d) standard_planner(a, c, d)
|
||||||
#define PortalDefineQuerySelectCompat(a, b, c, d, e) PortalDefineQuery(a, b, c, "SELECT", \
|
#define CMDTAG_SELECT_COMPAT "SELECT"
|
||||||
d, e)
|
|
||||||
#define getOwnedSequencesCompat(a, b) getOwnedSequences(a, b)
|
#define getOwnedSequencesCompat(a, b) getOwnedSequences(a, b)
|
||||||
#define ExplainOnePlanCompat(a, b, c, d, e, f, g) ExplainOnePlan(a, b, c, d, e, f, g)
|
#define ExplainOnePlanCompat(a, b, c, d, e, f, g) ExplainOnePlan(a, b, c, d, e, f, g)
|
||||||
#define Set_ptr_value(a, b) ((a)->data.ptr_value = (b))
|
#define Set_ptr_value(a, b) ((a)->data.ptr_value = (b))
|
||||||
|
|
Loading…
Reference in New Issue