MCPcopy Create free account
hub / github.com/apache/cloudberry / ScanKeyListToArray

Function ScanKeyListToArray

src/backend/executor/nodeSeqscan.c:452–473  ·  view source on GitHub ↗

* Convert the list of ScanKey to the array, and append an emtpy ScanKey as * the end flag of the array. */

Source from the content-addressed store, hash-verified

450 * the end flag of the array.
451 */
452static ScanKey
453ScanKeyListToArray(List *keys, int *num)
454{
455 ScanKey sk;
456
457 if (list_length(keys) == 0)
458 return NULL;
459
460 Assert(num);
461 *num = list_length(keys);
462
463 sk = (ScanKey)palloc(sizeof(ScanKeyData) * (*num + 1));
464 for (int i = 0; i < *num; ++i)
465 memcpy(&sk[i], list_nth(keys, i), sizeof(ScanKeyData));
466
467 /*
468 * SK_EMPYT means the end of the array of the ScanKey
469 */
470 sk[*num].sk_flags = SK_EMPYT;
471
472 return sk;
473}

Callers 1

SeqNextFunction · 0.85

Calls 3

list_lengthFunction · 0.85
list_nthFunction · 0.85
pallocFunction · 0.50

Tested by

no test coverage detected