| 111 | } |
| 112 | |
| 113 | static void dumpRecord(const WALRecord& record) { |
| 114 | switch (record.type) { |
| 115 | case WALRecordType::BEGIN_TRANSACTION_RECORD: |
| 116 | std::cout << " Type: BEGIN_TRANSACTION\n"; |
| 117 | break; |
| 118 | case WALRecordType::COMMIT_RECORD: |
| 119 | std::cout << " Type: COMMIT\n"; |
| 120 | break; |
| 121 | case WALRecordType::CHECKPOINT_RECORD: |
| 122 | std::cout << " Type: CHECKPOINT\n"; |
| 123 | break; |
| 124 | case WALRecordType::COPY_TABLE_RECORD: { |
| 125 | const auto& copyRecord = record.constCast<CopyTableRecord>(); |
| 126 | std::cout << " Type: COPY_TABLE\n"; |
| 127 | std::cout << " TableID: " << copyRecord.tableID << "\n"; |
| 128 | break; |
| 129 | } |
| 130 | case WALRecordType::CREATE_CATALOG_ENTRY_RECORD: { |
| 131 | const auto& createRecord = record.constCast<CreateCatalogEntryRecord>(); |
| 132 | std::cout << " Type: CREATE_CATALOG_ENTRY\n"; |
| 133 | if (createRecord.ownedCatalogEntry) { |
| 134 | std::cout << " Entry Type: " |
| 135 | << static_cast<uint8_t>(createRecord.ownedCatalogEntry->getType()) << "\n"; |
| 136 | std::cout << " Entry Name: " << createRecord.ownedCatalogEntry->getName() << "\n"; |
| 137 | } |
| 138 | std::cout << " IsInternal: " << (createRecord.isInternal ? "true" : "false") << "\n"; |
| 139 | break; |
| 140 | } |
| 141 | case WALRecordType::CREATE_INDEX_RECORD: { |
| 142 | const auto& createIndexRecord = record.constCast<CreateIndexRecord>(); |
| 143 | std::cout << " Type: CREATE_INDEX\n"; |
| 144 | if (createIndexRecord.ownedCatalogEntry) { |
| 145 | std::cout << " Entry Name: " << createIndexRecord.ownedCatalogEntry->getName() |
| 146 | << "\n"; |
| 147 | } |
| 148 | std::cout << " TreeBytes: " << createIndexRecord.treeBytes.size() << "\n"; |
| 149 | break; |
| 150 | } |
| 151 | case WALRecordType::DROP_CATALOG_ENTRY_RECORD: { |
| 152 | const auto& dropRecord = record.constCast<DropCatalogEntryRecord>(); |
| 153 | std::cout << " Type: DROP_CATALOG_ENTRY\n"; |
| 154 | std::cout << " EntryID: " << dropRecord.entryID << "\n"; |
| 155 | std::cout << " EntryType: " << static_cast<uint8_t>(dropRecord.entryType) << "\n"; |
| 156 | break; |
| 157 | } |
| 158 | case WALRecordType::ALTER_TABLE_ENTRY_RECORD: { |
| 159 | const auto& alterRecord = record.constCast<AlterTableEntryRecord>(); |
| 160 | std::cout << " Type: ALTER_TABLE_ENTRY\n"; |
| 161 | if (alterRecord.ownedAlterInfo) { |
| 162 | std::cout << " TableName: " << alterRecord.ownedAlterInfo->tableName << "\n"; |
| 163 | std::cout << " AlterType: " |
| 164 | << static_cast<uint8_t>(alterRecord.ownedAlterInfo->alterType) << "\n"; |
| 165 | } |
| 166 | break; |
| 167 | } |
| 168 | case WALRecordType::UPDATE_SEQUENCE_RECORD: { |
| 169 | const auto& seqRecord = record.constCast<UpdateSequenceRecord>(); |
| 170 | std::cout << " Type: UPDATE_SEQUENCE\n"; |
no test coverage detected