* ScanKeyEntryInitialize * Initializes a scan key entry given all the field values. * The target procedure is specified by OID (but can be invalid * if SK_SEARCHNULL or SK_SEARCHNOTNULL is set). * * Note: CurrentMemoryContext at call should be as long-lived as the ScanKey * itself, because that's what will be used for any subsidiary info attached * to the ScanKey's FmgrInfo record. */
| 29 | * to the ScanKey's FmgrInfo record. |
| 30 | */ |
| 31 | void |
| 32 | ScanKeyEntryInitialize(ScanKey entry, |
| 33 | int flags, |
| 34 | AttrNumber attributeNumber, |
| 35 | StrategyNumber strategy, |
| 36 | Oid subtype, |
| 37 | Oid collation, |
| 38 | RegProcedure procedure, |
| 39 | Datum argument) |
| 40 | { |
| 41 | entry->sk_flags = flags; |
| 42 | entry->sk_attno = attributeNumber; |
| 43 | entry->sk_strategy = strategy; |
| 44 | entry->sk_subtype = subtype; |
| 45 | entry->sk_collation = collation; |
| 46 | entry->sk_argument = argument; |
| 47 | if (RegProcedureIsValid(procedure)) |
| 48 | { |
| 49 | fmgr_info(procedure, &entry->sk_func); |
| 50 | } |
| 51 | else |
| 52 | { |
| 53 | Assert(flags & (SK_SEARCHNULL | SK_SEARCHNOTNULL)); |
| 54 | MemSet(&entry->sk_func, 0, sizeof(entry->sk_func)); |
| 55 | } |
| 56 | } |
| 57 | |
| 58 | /* |
| 59 | * ScanKeyInit |
no test coverage detected