| 1487 | |
| 1488 | |
| 1489 | static IndexMultiKeyStatus |
| 1490 | CheckIndexHasArrays(Relation indexRelation, IndexAmRoutine *coreRoutine) |
| 1491 | { |
| 1492 | /* Start a nested query lookup */ |
| 1493 | IndexScanDesc innerDesc = coreRoutine->ambeginscan(indexRelation, 1, 0); |
| 1494 | |
| 1495 | ScanKeyData arrayKey = { 0 }; |
| 1496 | arrayKey.sk_attno = 1; |
| 1497 | arrayKey.sk_collation = InvalidOid; |
| 1498 | arrayKey.sk_strategy = BSON_INDEX_STRATEGY_IS_MULTIKEY; |
| 1499 | arrayKey.sk_argument = PointerGetDatum(PgbsonInitEmpty()); |
| 1500 | |
| 1501 | innerDesc->parallel_scan = NULL; |
| 1502 | coreRoutine->amrescan(innerDesc, &arrayKey, 1, NULL, 0); |
| 1503 | bool hasArrays = coreRoutine->amgettuple(innerDesc, ForwardScanDirection); |
| 1504 | coreRoutine->amendscan(innerDesc); |
| 1505 | return hasArrays ? IndexMultiKeyStatus_HasArrays : IndexMultiKeyStatus_HasNoArrays; |
| 1506 | } |
| 1507 | |
| 1508 | |
| 1509 | bool |
no test coverage detected