| 52 | // Validation/garbage collection/repair control block |
| 53 | |
| 54 | class Validation |
| 55 | { |
| 56 | public: |
| 57 | // vdr_flags |
| 58 | |
| 59 | static const USHORT VDR_online = 0x01; // online validation (no exclusive attachment) |
| 60 | static const USHORT VDR_update = 0x02; // fix simple things |
| 61 | static const USHORT VDR_repair = 0x04; // fix non-simple things (-mend) |
| 62 | static const USHORT VDR_records = 0x08; // Walk all records |
| 63 | static const USHORT VDR_partial = 0x10; // Walk only (some) relations |
| 64 | |
| 65 | private: |
| 66 | |
| 67 | enum FETCH_CODE |
| 68 | { |
| 69 | fetch_ok, |
| 70 | //fetch_checksum, |
| 71 | fetch_type, |
| 72 | fetch_duplicate |
| 73 | }; |
| 74 | |
| 75 | enum RTN |
| 76 | { |
| 77 | rtn_ok, |
| 78 | rtn_corrupt, |
| 79 | rtn_eof |
| 80 | }; |
| 81 | |
| 82 | struct IdxInfo |
| 83 | { |
| 84 | IdxInfo() |
| 85 | {} |
| 86 | |
| 87 | index_desc m_desc; |
| 88 | RecordBitmap* m_recs = nullptr; |
| 89 | IndexCondition* m_condition = nullptr; |
| 90 | }; |
| 91 | |
| 92 | enum VAL_ERRORS |
| 93 | { |
| 94 | VAL_PAG_WRONG_TYPE = 0, |
| 95 | VAL_PAG_CHECKSUM_ERR = 1, |
| 96 | VAL_PAG_DOUBLE_ALLOC = 2, |
| 97 | VAL_PAG_IN_USE = 3, |
| 98 | VAL_PAG_ORPHAN = 4, |
| 99 | VAL_BLOB_INCONSISTENT = 5, |
| 100 | VAL_BLOB_CORRUPT = 6, |
| 101 | VAL_BLOB_TRUNCATED = 7, |
| 102 | VAL_REC_CHAIN_BROKEN = 8, |
| 103 | VAL_DATA_PAGE_CONFUSED = 9, |
| 104 | VAL_DATA_PAGE_LINE_ERR = 10, |
| 105 | VAL_INDEX_PAGE_CORRUPT = 11, |
| 106 | VAL_P_PAGE_LOST = 12, |
| 107 | VAL_P_PAGE_INCONSISTENT = 13, |
| 108 | VAL_REC_DAMAGED = 14, |
| 109 | VAL_REC_BAD_TID = 15, |
| 110 | VAL_REC_FRAGMENT_CORRUPT = 16, |
| 111 | VAL_REC_WRONG_LENGTH = 17, |