| 5626 | |
| 5627 | |
| 5628 | static void generate_jump_nodes(thread_db* tdbb, btree_page* page, |
| 5629 | JumpNodeList* jumpNodes, |
| 5630 | USHORT excludeOffset, USHORT* jumpersSize, |
| 5631 | USHORT* splitIndex, USHORT* splitPrefix, USHORT keyLen) |
| 5632 | { |
| 5633 | /************************************** |
| 5634 | * |
| 5635 | * g e n e r a t e _ j u m p _ n o d e s |
| 5636 | * |
| 5637 | ************************************** |
| 5638 | * |
| 5639 | * Functional description |
| 5640 | * |
| 5641 | **************************************/ |
| 5642 | |
| 5643 | SET_TDBB(tdbb); |
| 5644 | const Database* dbb = tdbb->getDatabase(); |
| 5645 | fb_assert(page); |
| 5646 | fb_assert(jumpNodes); |
| 5647 | fb_assert(jumpersSize); |
| 5648 | |
| 5649 | const bool leafPage = (page->btr_level == 0); |
| 5650 | const USHORT jumpAreaSize = page->btr_jump_interval; |
| 5651 | |
| 5652 | *jumpersSize = 0; |
| 5653 | UCHAR* pointer = page->btr_nodes + page->btr_jump_size; |
| 5654 | |
| 5655 | temporary_key jumpKey, currentKey; |
| 5656 | jumpKey.key_flags = 0; |
| 5657 | jumpKey.key_length = 0; |
| 5658 | currentKey.key_flags = 0; |
| 5659 | currentKey.key_length = 0; |
| 5660 | UCHAR* jumpData = jumpKey.key_data; |
| 5661 | USHORT jumpLength = 0; |
| 5662 | UCHAR* currentData = currentKey.key_data; |
| 5663 | |
| 5664 | if (splitIndex) |
| 5665 | *splitIndex = 0; |
| 5666 | |
| 5667 | if (splitPrefix) |
| 5668 | *splitPrefix = 0; |
| 5669 | |
| 5670 | const UCHAR* newAreaPosition = pointer + jumpAreaSize; |
| 5671 | const UCHAR* const startpoint = page->btr_nodes + page->btr_jump_size; |
| 5672 | const UCHAR* const endpoint = (UCHAR*) page + page->btr_length; |
| 5673 | const UCHAR* halfpoint = (UCHAR*) page + (BTR_SIZE + page->btr_jump_size + page->btr_length) / 2; |
| 5674 | const UCHAR* const excludePointer = (UCHAR*) page + excludeOffset; |
| 5675 | IndexJumpNode jumpNode; |
| 5676 | IndexNode node; |
| 5677 | |
| 5678 | ULONG leftPageSize = 0; |
| 5679 | ULONG splitPageSize = 0; |
| 5680 | |
| 5681 | while (pointer < endpoint && newAreaPosition < endpoint) |
| 5682 | { |
| 5683 | pointer = node.readNode(pointer, leafPage); |
| 5684 | |
| 5685 | if (node.isEndBucket || node.isEndLevel) |
no test coverage detected