mirror of https://github.com/citusdata/citus.git
Include IntegerArrayTypeToList from worker_protocol.h instead of array_type.h
On Citus versions <= 11.0, IntegerArrayTypeToList() doesn't exist and its helpers (DeconstructArrayObject() & ArrayObjectCount()) are defined in worker_protocol.h. (Seepull/6410/head9476f377b5
). So we add IntegerArrayTypeToList() into worker_protocol.c and include IntegerArrayTypeToList from worker_protocol.h instead of array_type.h in foreign_constraint.c. This is needed to backporta868cc049a
into this (release-11.0) branch, see the next commit.
parent
fcd0bdf370
commit
308f9298d7
|
@ -419,6 +419,26 @@ ArrayObjectCount(ArrayType *arrayObject)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Converts ArrayType to List.
|
||||||
|
*/
|
||||||
|
List *
|
||||||
|
IntegerArrayTypeToList(ArrayType *arrayObject)
|
||||||
|
{
|
||||||
|
List *list = NULL;
|
||||||
|
Datum *datumObjectArray = DeconstructArrayObject(arrayObject);
|
||||||
|
int arrayObjectCount = ArrayObjectCount(arrayObject);
|
||||||
|
|
||||||
|
for (int index = 0; index < arrayObjectCount; index++)
|
||||||
|
{
|
||||||
|
int32 intObject = DatumGetInt32(datumObjectArray[index]);
|
||||||
|
list = lappend_int(list, intObject);
|
||||||
|
}
|
||||||
|
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* InitTaskDirectory creates a job and task directory using given identifiers,
|
* InitTaskDirectory creates a job and task directory using given identifiers,
|
||||||
* if these directories do not already exist. The function then returns the task
|
* if these directories do not already exist. The function then returns the task
|
||||||
|
|
|
@ -118,6 +118,7 @@ extern StringInfo InitTaskDirectory(uint64 jobId, uint32 taskId);
|
||||||
extern void RemoveJobSchema(StringInfo schemaName);
|
extern void RemoveJobSchema(StringInfo schemaName);
|
||||||
extern Datum * DeconstructArrayObject(ArrayType *arrayObject);
|
extern Datum * DeconstructArrayObject(ArrayType *arrayObject);
|
||||||
extern int32 ArrayObjectCount(ArrayType *arrayObject);
|
extern int32 ArrayObjectCount(ArrayType *arrayObject);
|
||||||
|
extern List * IntegerArrayTypeToList(ArrayType *arrayObject);
|
||||||
extern FmgrInfo * GetFunctionInfo(Oid typeId, Oid accessMethodId, int16 procedureId);
|
extern FmgrInfo * GetFunctionInfo(Oid typeId, Oid accessMethodId, int16 procedureId);
|
||||||
extern uint64 ExtractShardIdFromTableName(const char *tableName, bool missingOk);
|
extern uint64 ExtractShardIdFromTableName(const char *tableName, bool missingOk);
|
||||||
extern void RepartitionCleanupJobDirectories(void);
|
extern void RepartitionCleanupJobDirectories(void);
|
||||||
|
|
Loading…
Reference in New Issue