mirror of https://github.com/citusdata/citus.git
Use new var field names in the codebase
The codebase is updated to use varattnosync and varnosyn and we defined the macros for older versions. This way we can just remove the macros when we drop an older version.pull/3900/head
parent
b641f63bfd
commit
8e9b52971c
|
@ -93,7 +93,7 @@ RemoteScanTargetList(List *workerTargetList)
|
|||
|
||||
Var *remoteScanColumn = makeVarFromTargetEntry(tableId, workerTargetEntry);
|
||||
remoteScanColumn->varattno = columnId;
|
||||
remoteScanColumn->varoattno = columnId;
|
||||
remoteScanColumn->varattnosyn = columnId;
|
||||
columnId++;
|
||||
|
||||
if (remoteScanColumn->vartype == RECORDOID || remoteScanColumn->vartype ==
|
||||
|
|
|
@ -514,7 +514,7 @@ CreateTargetListForCombineQuery(List *targetList)
|
|||
|
||||
Var *column = makeVarFromTargetEntry(masterTableId, originalTargetEntry);
|
||||
column->varattno = columnId;
|
||||
column->varoattno = columnId;
|
||||
column->varattnosyn = columnId;
|
||||
columnId++;
|
||||
|
||||
if (column->vartype == RECORDOID || column->vartype == RECORDARRAYOID)
|
||||
|
|
|
@ -1365,7 +1365,7 @@ PartitionColumn(Oid relationId, uint32 rangeTableId)
|
|||
|
||||
partitionColumn = partitionKey;
|
||||
partitionColumn->varno = rangeTableId;
|
||||
partitionColumn->varnoold = rangeTableId;
|
||||
partitionColumn->varnosyn = rangeTableId;
|
||||
|
||||
return partitionColumn;
|
||||
}
|
||||
|
|
|
@ -1438,7 +1438,7 @@ MasterExtendedOpNode(MultiExtendedOp *originalOpNode,
|
|||
*/
|
||||
Var *column = makeVarFromTargetEntry(masterTableId, originalTargetEntry);
|
||||
column->varattno = walkerContext.columnId;
|
||||
column->varoattno = walkerContext.columnId;
|
||||
column->varattnosyn = walkerContext.columnId;
|
||||
walkerContext.columnId++;
|
||||
|
||||
if (column->vartype == RECORDOID || column->vartype == RECORDARRAYOID)
|
||||
|
@ -1673,9 +1673,9 @@ MasterAggregateExpression(Aggref *originalAggregate,
|
|||
}
|
||||
|
||||
columnToUpdate->varno = masterTableId;
|
||||
columnToUpdate->varnoold = masterTableId;
|
||||
columnToUpdate->varnosyn = masterTableId;
|
||||
columnToUpdate->varattno = startColumnCount + columnIndex;
|
||||
columnToUpdate->varoattno = startColumnCount + columnIndex;
|
||||
columnToUpdate->varattnosyn = startColumnCount + columnIndex;
|
||||
}
|
||||
|
||||
/* we added that many columns */
|
||||
|
|
|
@ -1086,8 +1086,8 @@ QueryJoinTree(MultiNode *multiNode, List *dependentJobList, List **rangeTableLis
|
|||
UpdateColumnAttributes(column, *rangeTableList, dependentJobList);
|
||||
|
||||
/* adjust our column old attributes for partition pruning to work */
|
||||
column->varnoold = column->varno;
|
||||
column->varoattno = column->varattno;
|
||||
column->varnosyn = column->varno;
|
||||
column->varattnosyn = column->varattno;
|
||||
}
|
||||
|
||||
/* make AND clauses explicit after fixing them */
|
||||
|
@ -1561,8 +1561,8 @@ UpdateAllColumnAttributes(Node *columnContainer, List *rangeTableList,
|
|||
static void
|
||||
UpdateColumnAttributes(Var *column, List *rangeTableList, List *dependentJobList)
|
||||
{
|
||||
Index originalTableId = column->varnoold;
|
||||
AttrNumber originalColumnId = column->varoattno;
|
||||
Index originalTableId = column->varnosyn;
|
||||
AttrNumber originalColumnId = column->varattnosyn;
|
||||
|
||||
/* find the new table identifier */
|
||||
Index newTableId = NewTableId(originalTableId, rangeTableList);
|
||||
|
@ -1646,8 +1646,8 @@ NewColumnId(Index originalTableId, AttrNumber originalColumnId,
|
|||
* Check against the *old* values for this column, as the new values
|
||||
* would have been updated already.
|
||||
*/
|
||||
if (column->varnoold == originalTableId &&
|
||||
column->varoattno == originalColumnId)
|
||||
if (column->varnosyn == originalTableId &&
|
||||
column->varattnosyn == originalColumnId)
|
||||
{
|
||||
newColumnId = columnIndex;
|
||||
break;
|
||||
|
@ -2977,8 +2977,8 @@ AnchorRangeTableIdList(List *rangeTableList, List *baseRangeTableIdList)
|
|||
|
||||
|
||||
/*
|
||||
* AdjustColumnOldAttributes adjust the old tableId (varnoold) and old columnId
|
||||
* (varoattno), and sets them equal to the new values. We need this adjustment
|
||||
* AdjustColumnOldAttributes adjust the old tableId (varnosyn) and old columnId
|
||||
* (varattnosyn), and sets them equal to the new values. We need this adjustment
|
||||
* for partition pruning where we compare these columns with partition columns
|
||||
* loaded from system catalogs. Since columns loaded from system catalogs always
|
||||
* have the same old and new values, we also need to adjust column values here.
|
||||
|
@ -2992,8 +2992,8 @@ AdjustColumnOldAttributes(List *expressionList)
|
|||
foreach(columnCell, columnList)
|
||||
{
|
||||
Var *column = (Var *) lfirst(columnCell);
|
||||
column->varnoold = column->varno;
|
||||
column->varoattno = column->varattno;
|
||||
column->varnosyn = column->varno;
|
||||
column->varattnosyn = column->varattno;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1681,8 +1681,8 @@ BuildReadIntermediateResultsQuery(List *targetEntryList, List *columnAliasList,
|
|||
functionColumnVar->vartypmod = columnTypMod;
|
||||
functionColumnVar->varcollid = columnCollation;
|
||||
functionColumnVar->varlevelsup = 0;
|
||||
functionColumnVar->varnoold = 1;
|
||||
functionColumnVar->varoattno = columnNumber;
|
||||
functionColumnVar->varnosyn = 1;
|
||||
functionColumnVar->varattnosyn = columnNumber;
|
||||
functionColumnVar->location = -1;
|
||||
|
||||
TargetEntry *newTargetEntry = makeNode(TargetEntry);
|
||||
|
|
|
@ -38,8 +38,6 @@
|
|||
#define CMDTAG_SELECT_COMPAT CMDTAG_SELECT
|
||||
#define ExplainOnePlanCompat(a, b, c, d, e, f, g) ExplainOnePlan(a, b, c, d, e, f, g, \
|
||||
NULL)
|
||||
#define varoattno varattnosyn
|
||||
#define varnoold varnosyn
|
||||
#define Set_ptr_value(a, b) ((a)->ptr_value = (b))
|
||||
#define RangeTableEntryFromNSItem(a) ((a)->p_rte)
|
||||
#define QueryCompletionCompat QueryCompletion
|
||||
|
@ -55,6 +53,8 @@
|
|||
#define Set_ptr_value(a, b) ((a)->data.ptr_value = (b))
|
||||
#define RangeTableEntryFromNSItem(a) (a)
|
||||
#define QueryCompletionCompat char
|
||||
#define varattnosyn varoattno
|
||||
#define varnosyn varnoold
|
||||
#endif
|
||||
#if PG_VERSION_NUM >= PG_VERSION_12
|
||||
|
||||
|
|
Loading…
Reference in New Issue