| 2725 | |
| 2726 | |
| 2727 | Validation::RTN Validation::walk_record(jrd_rel* relation, const rhd* header, USHORT length, |
| 2728 | RecordNumber number, bool delta_flag) |
| 2729 | { |
| 2730 | /************************************** |
| 2731 | * |
| 2732 | * w a l k _ r e c o r d |
| 2733 | * |
| 2734 | ************************************** |
| 2735 | * |
| 2736 | * Functional description |
| 2737 | * Walk a record. |
| 2738 | * |
| 2739 | **************************************/ |
| 2740 | |
| 2741 | #ifdef DEBUG_VAL_VERBOSE |
| 2742 | if (VAL_debug_level) |
| 2743 | { |
| 2744 | fprintf(stdout, "record: number %ld (%d/%d) ", |
| 2745 | number, |
| 2746 | (USHORT) number / tdbb->getDatabase()->dbb_max_records, |
| 2747 | (USHORT) number % tdbb->getDatabase()->dbb_max_records); |
| 2748 | print_rhd(length, header); |
| 2749 | } |
| 2750 | #endif |
| 2751 | |
| 2752 | if (header->rhd_flags & rhd_damaged) |
| 2753 | { |
| 2754 | corrupt(VAL_REC_DAMAGED, relation, number.getValue()); |
| 2755 | return rtn_ok; |
| 2756 | } |
| 2757 | |
| 2758 | const TraNumber transaction = Ods::getTraNum(header); |
| 2759 | |
| 2760 | if (transaction > vdr_max_transaction) |
| 2761 | corrupt(VAL_REC_BAD_TID, relation, number.getValue(), transaction); |
| 2762 | |
| 2763 | // If there's a back pointer, verify that it's good |
| 2764 | |
| 2765 | if (header->rhd_b_page && !(header->rhd_flags & rhd_chain)) |
| 2766 | { |
| 2767 | const RTN result = walk_chain(relation, header, number); |
| 2768 | if (result != rtn_ok) |
| 2769 | return result; |
| 2770 | } |
| 2771 | |
| 2772 | // If the record is a fragment, not large, or we're not interested in |
| 2773 | // chasing records, skip the record |
| 2774 | |
| 2775 | if ((header->rhd_flags & (rhd_fragment | rhd_deleted)) || |
| 2776 | !((header->rhd_flags & rhd_large) || (vdr_flags & VDR_records))) |
| 2777 | { |
| 2778 | return rtn_ok; |
| 2779 | } |
| 2780 | |
| 2781 | // Pick up what length there is on the fragment |
| 2782 | |
| 2783 | const rhdf* fragment = (rhdf*) header; |
| 2784 |
nothing calls this directly
no test coverage detected