* ArrayExtractDatums extracts Datums of given type from given array. */
| 235 | * ArrayExtractDatums extracts Datums of given type from given array. |
| 236 | */ |
| 237 | void |
| 238 | ArrayExtractDatums(ArrayType *array, Oid elemType, |
| 239 | Datum **elems, bool **nulls, int *nelems) |
| 240 | { |
| 241 | HeapTuple typeTup = SearchSysCache1(TYPEOID, ObjectIdGetDatum(elemType)); |
| 242 | if (!HeapTupleIsValid(typeTup)) |
| 243 | { |
| 244 | ereport(ERROR, (errmsg("cache lookup failed for type %u", elemType))); |
| 245 | } |
| 246 | |
| 247 | Form_pg_type typeStruct = (Form_pg_type) GETSTRUCT(typeTup); |
| 248 | |
| 249 | deconstruct_array(array, elemType, typeStruct->typlen, |
| 250 | typeStruct->typbyval, typeStruct->typalign, |
| 251 | elems, nulls, nelems); |
| 252 | |
| 253 | ReleaseSysCache(typeTup); |
| 254 | } |
no outgoing calls
no test coverage detected