Introduces index_insert_compat macro

index_insert function now has a new parameter, indexUnchanged
This new macro give us the ability to use these new parameter for PG14 and they don't give the parameters for previous versions
Existing parameter is set to false

Relevant PG commit:
9dc718bdf2b1a574481a45624d42b674332e2903
pg14_support_3
Halil Ozan Akgul 2021-08-18 16:28:45 +03:00
parent 62e84a4342
commit 4199db699e
2 changed files with 6 additions and 2 deletions

View File

@ -1568,8 +1568,8 @@ ColumnarReadMissingRowsIntoIndex(TableScanDesc scan, Relation indexRelation,
Relation columnarRelation = scan->rs_rd;
IndexUniqueCheck indexUniqueCheck =
indexInfo->ii_Unique ? UNIQUE_CHECK_YES : UNIQUE_CHECK_NO;
index_insert(indexRelation, indexValues, indexNulls, columnarItemPointer,
columnarRelation, indexUniqueCheck, indexInfo);
index_insert_compat(indexRelation, indexValues, indexNulls, columnarItemPointer,
columnarRelation, indexUniqueCheck, false, indexInfo);
validateIndexState->tups_inserted += 1;
}

View File

@ -22,6 +22,8 @@
#define ExecSimpleRelationInsert_compat(a, b, c) \
ExecSimpleRelationInsert(a, b, c)
#define modifyStateResultRelInfo(a) ((a)->resultRelInfo)
#define index_insert_compat(a, b, c, d, e, f, g, h) \
index_insert(a, b, c, d, e, f, g, h)
#else
#define ColumnarProcessUtility_compat(a, b, c, d, e, f, g, h) \
ColumnarProcessUtility(a, b, d, e, f, g, h)
@ -31,6 +33,8 @@
#define ExecSimpleRelationInsert_compat(a, b, c) \
ExecSimpleRelationInsert(b, c)
#define modifyStateResultRelInfo(a) ((a)->estate->es_result_relation_info)
#define index_insert_compat(a, b, c, d, e, f, g, h) \
index_insert(a, b, c, d, e, f, h)
#endif
#define ACLCHECK_OBJECT_TABLE OBJECT_TABLE