| 4354 | |
| 4355 | |
| 4356 | static void page_validation_error(thread_db* tdbb, WIN* window, SSHORT type) |
| 4357 | { |
| 4358 | /************************************** |
| 4359 | * |
| 4360 | * p a g e _ v a l i d a t i o n _ e r r o r |
| 4361 | * |
| 4362 | ************************************** |
| 4363 | * |
| 4364 | * Functional description |
| 4365 | * We've detected a validation error on fetch. Generally |
| 4366 | * we've detected that the type of page fetched didn't match the |
| 4367 | * type of page we were expecting. Report an error and |
| 4368 | * get out. |
| 4369 | * This function will only be called rarely, as a page validation |
| 4370 | * error is an indication of on-disk database corruption. |
| 4371 | * |
| 4372 | **************************************/ |
| 4373 | SET_TDBB(tdbb); |
| 4374 | BufferDesc* bdb = window->win_bdb; |
| 4375 | const pag* page = bdb->bdb_buffer; |
| 4376 | |
| 4377 | PageSpace* pages = |
| 4378 | tdbb->getDatabase()->dbb_page_manager.findPageSpace(bdb->bdb_page.getPageSpaceID()); |
| 4379 | |
| 4380 | ERR_build_status(tdbb->tdbb_status_vector, |
| 4381 | Arg::Gds(isc_db_corrupt) << Arg::Str(pages->file->fil_string) << |
| 4382 | Arg::Gds(isc_page_type_err) << |
| 4383 | Arg::Gds(isc_badpagtyp) << Arg::Num(bdb->bdb_page.getPageNum()) << |
| 4384 | pagtype(type) << |
| 4385 | pagtype(page->pag_type)); |
| 4386 | // We should invalidate this bad buffer. |
| 4387 | CCH_unwind(tdbb, true); |
| 4388 | } |
| 4389 | |
| 4390 | |
| 4391 | #ifdef CACHE_READER |
no test coverage detected