mirror of https://github.com/citusdata/citus.git
Update MakeSingleTupleTableSlotCompat to take 2nd param
This gets us past CREATE EXTENSION, but citus--5.0 uses WITH OIDSread_write_etc
parent
8c67ed352c
commit
5fd79ff82b
|
@ -1237,7 +1237,7 @@ CopyLocalDataIntoShards(Oid distributedRelationId)
|
|||
|
||||
/* get the table columns */
|
||||
tupleDescriptor = RelationGetDescr(distributedRelation);
|
||||
slot = MakeSingleTupleTableSlotCompat(tupleDescriptor);
|
||||
slot = MakeSingleTupleTableSlotCompat(tupleDescriptor, &TTSOpsHeapTuple);
|
||||
columnNameList = TupleDescColumnNameList(tupleDescriptor);
|
||||
|
||||
/* determine the partition column in the tuple descriptor */
|
||||
|
|
|
@ -463,7 +463,7 @@ CopyToExistingShards(CopyStmt *copyStatement, char *completionTag)
|
|||
columnNulls = palloc0(columnCount * sizeof(bool));
|
||||
|
||||
/* set up a virtual tuple table slot */
|
||||
tupleTableSlot = MakeSingleTupleTableSlotCompat(tupleDescriptor);
|
||||
tupleTableSlot = MakeSingleTupleTableSlotCompat(tupleDescriptor, &TTSOpsVirtual);
|
||||
tupleTableSlot->tts_nvalid = columnCount;
|
||||
tupleTableSlot->tts_values = columnValues;
|
||||
tupleTableSlot->tts_isnull = columnNulls;
|
||||
|
|
|
@ -704,7 +704,8 @@ SortTupleStore(CitusScanState *scanState)
|
|||
/* iterate over all the sorted tuples, add them to original tuplestore */
|
||||
while (true)
|
||||
{
|
||||
TupleTableSlot *newSlot = MakeSingleTupleTableSlotCompat(tupleDescriptor);
|
||||
TupleTableSlot *newSlot = MakeSingleTupleTableSlotCompat(tupleDescriptor,
|
||||
&TTSOpsMinimalTuple);
|
||||
bool found = tuplesort_gettupleslot(tuplesortstate, true, false, newSlot, NULL);
|
||||
|
||||
if (!found)
|
||||
|
|
|
@ -202,7 +202,7 @@ UpdateRelationToShardNames(Node *node, List *relationShardList)
|
|||
if (IsA(node, Query))
|
||||
{
|
||||
return query_tree_walker((Query *) node, UpdateRelationToShardNames,
|
||||
relationShardList, QTW_EXAMINE_RTES);
|
||||
relationShardList, QTW_EXAMINE_RTES_BEFORE);
|
||||
}
|
||||
|
||||
if (!IsA(node, RangeTblEntry))
|
||||
|
|
|
@ -150,7 +150,7 @@ MultiLogicalPlanCreate(Query *originalQuery, Query *queryTree,
|
|||
* FindNodeCheck finds a node for which the check function returns true.
|
||||
*
|
||||
* To call this function directly with an RTE, use:
|
||||
* range_table_walker(rte, FindNodeCheck, check, QTW_EXAMINE_RTES)
|
||||
* range_table_walker(rte, FindNodeCheck, check, QTW_EXAMINE_RTES_BEFORE)
|
||||
*/
|
||||
bool
|
||||
FindNodeCheck(Node *node, bool (*check)(Node *))
|
||||
|
@ -172,7 +172,8 @@ FindNodeCheck(Node *node, bool (*check)(Node *))
|
|||
}
|
||||
else if (IsA(node, Query))
|
||||
{
|
||||
return query_tree_walker((Query *) node, FindNodeCheck, check, QTW_EXAMINE_RTES);
|
||||
return query_tree_walker((Query *) node, FindNodeCheck, check,
|
||||
QTW_EXAMINE_RTES_BEFORE);
|
||||
}
|
||||
|
||||
return expression_tree_walker(node, FindNodeCheck, check);
|
||||
|
@ -380,7 +381,7 @@ AllTargetExpressionsAreColumnReferences(List *targetEntryList)
|
|||
bool
|
||||
FindNodeCheckInRangeTableList(List *rtable, bool (*check)(Node *))
|
||||
{
|
||||
return range_table_walker(rtable, FindNodeCheck, check, QTW_EXAMINE_RTES);
|
||||
return range_table_walker(rtable, FindNodeCheck, check, QTW_EXAMINE_RTES_BEFORE);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1992,7 +1993,8 @@ ExtractRangeTableRelationWalker(Node *node, List **rangeTableRelationList)
|
|||
{
|
||||
walkIsComplete = query_tree_walker((Query *) node,
|
||||
ExtractRangeTableRelationWalker,
|
||||
rangeTableRelationList, QTW_EXAMINE_RTES);
|
||||
rangeTableRelationList,
|
||||
QTW_EXAMINE_RTES_BEFORE);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -2040,7 +2042,7 @@ ExtractRangeTableEntryWalker(Node *node, List **rangeTableList)
|
|||
walkIsComplete = query_tree_walker((Query *) node,
|
||||
ExtractRangeTableEntryWalker,
|
||||
rangeTableList,
|
||||
QTW_EXAMINE_RTES);
|
||||
QTW_EXAMINE_RTES_BEFORE);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -2048,7 +2050,7 @@ ExtractRangeTableEntryWalker(Node *node, List **rangeTableList)
|
|||
walkIsComplete = range_table_walker(query->rtable,
|
||||
ExtractRangeTableEntryWalker,
|
||||
rangeTableList,
|
||||
QTW_EXAMINE_RTES);
|
||||
QTW_EXAMINE_RTES_BEFORE);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
@ -1336,7 +1336,7 @@ static bool
|
|||
IsRecurringRangeTable(List *rangeTable, RecurringTuplesType *recurType)
|
||||
{
|
||||
return range_table_walker(rangeTable, HasRecurringTuples, recurType,
|
||||
QTW_EXAMINE_RTES);
|
||||
QTW_EXAMINE_RTES_BEFORE);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1411,7 +1411,7 @@ HasRecurringTuples(Node *node, RecurringTuplesType *recurType)
|
|||
}
|
||||
|
||||
return query_tree_walker((Query *) node, HasRecurringTuples,
|
||||
recurType, QTW_EXAMINE_RTES);
|
||||
recurType, QTW_EXAMINE_RTES_BEFORE);
|
||||
}
|
||||
|
||||
return expression_tree_walker(node, HasRecurringTuples, recurType);
|
||||
|
|
|
@ -1218,7 +1218,8 @@ CteReferenceListWalker(Node *node, CteReferenceWalkerContext *context)
|
|||
Query *query = (Query *) node;
|
||||
|
||||
context->level += 1;
|
||||
query_tree_walker(query, CteReferenceListWalker, context, QTW_EXAMINE_RTES);
|
||||
query_tree_walker(query, CteReferenceListWalker, context,
|
||||
QTW_EXAMINE_RTES_BEFORE);
|
||||
context->level -= 1;
|
||||
|
||||
return false;
|
||||
|
|
|
@ -156,7 +156,8 @@ ProgressMonitorList(uint64 commandTypeMagicNumber, List **attachedDSMSegments)
|
|||
getProgressInfoFunctionOid,
|
||||
commandTypeDatum);
|
||||
|
||||
tupleTableSlot = MakeSingleTupleTableSlotCompat(progressResultSet->setDesc);
|
||||
tupleTableSlot = MakeSingleTupleTableSlotCompat(progressResultSet->setDesc,
|
||||
&TTSOpsMinimalTuple);
|
||||
|
||||
/* iterate over tuples in tuple store, and send them to destination */
|
||||
for (;;)
|
||||
|
|
|
@ -1641,7 +1641,8 @@ AvailableExtensionVersion(void)
|
|||
/* pg_available_extensions returns result set containing all available extensions */
|
||||
(*pg_available_extensions)(fcinfo);
|
||||
|
||||
tupleTableSlot = MakeSingleTupleTableSlotCompat(extensionsResultSet->setDesc);
|
||||
tupleTableSlot = MakeSingleTupleTableSlotCompat(extensionsResultSet->setDesc,
|
||||
&TTSOpsMinimalTuple);
|
||||
hasTuple = tuplestore_gettupleslot(extensionsResultSet->setResult, goForward, doCopy,
|
||||
tupleTableSlot);
|
||||
while (hasTuple)
|
||||
|
|
|
@ -247,13 +247,11 @@ RangeVarGetRelidInternal(const RangeVar *relation, LOCKMODE lockmode, uint32 fla
|
|||
#if PG_VERSION_NUM >= 120000
|
||||
|
||||
#define NextCopyLastParam
|
||||
#define MakeSingleTupleTableSlotCompat(tupleDesc) \
|
||||
MakeSingleTupleTableSlot(tupleDesc, &TTSOpsHeapTuple)
|
||||
#define MakeSingleTupleTableSlotCompat MakeSingleTupleTableSlot
|
||||
#define AllocSetContextCreateExtended AllocSetContextCreateInternal
|
||||
#define ExecStoreTuple(tuple, slot, buffer, shouldFree) \
|
||||
ExecStoreHeapTuple(tuple, slot, shouldFree)
|
||||
#define NextCopyFromCompat NextCopyFrom
|
||||
#define QTW_EXAMINE_RTES QTW_EXAMINE_RTES_BEFORE
|
||||
#define ArrayRef SubscriptingRef
|
||||
#define T_ArrayRef T_SubscriptingRef
|
||||
#define or_clause is_orclause
|
||||
|
@ -272,7 +270,9 @@ RangeVarGetRelidInternal(const RangeVar *relation, LOCKMODE lockmode, uint32 fla
|
|||
#define InitFunctionCallInfoDataCompat InitFunctionCallInfoData
|
||||
|
||||
#else /* pre PG12 */
|
||||
#define MakeSingleTupleTableSlotCompat MakeSingleTupleTableSlot
|
||||
#define QTW_EXAMINE_RTES_BEFORE QTW_EXAMINE_RTES
|
||||
#define MakeSingleTupleTableSlotCompat(tupleDesc, tts_opts) \
|
||||
MakeSingleTupleTableSlot(tupleDesc)
|
||||
#define NextCopyFromCompat(cstate, econtext, values, nulls) \
|
||||
NextCopyFrom(cstate, econtext, values, nulls, NULL)
|
||||
#define GetSysCacheOid1Compat(cacheId, oidcol, key1) \
|
||||
|
|
Loading…
Reference in New Issue