MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / makeKeys

Method makeKeys

src/jrd/btr.cpp:767–805  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

765}
766
767void IndexScanListIterator::makeKeys(thread_db* tdbb, temporary_key* lower, temporary_key* upper)
768{
769 m_lowerValues[m_segno] = *m_iterator;
770 m_upperValues[m_segno] = *m_iterator;
771
772 const auto keyType =
773 (m_retrieval->irb_generic & irb_multi_starting) ? INTL_KEY_MULTI_STARTING :
774 (m_retrieval->irb_generic & irb_starting) ? INTL_KEY_PARTIAL :
775 (m_retrieval->irb_desc.idx_flags & idx_unique) ? INTL_KEY_UNIQUE :
776 INTL_KEY_SORT;
777
778 // Make the lower bound key
779
780 idx_e errorCode = BTR_make_key(tdbb, m_retrieval->irb_lower_count, getLowerValues(),
781 getScale(), &m_retrieval->irb_desc, lower, keyType, nullptr);
782
783 if (errorCode == idx_e_ok)
784 {
785 if (m_retrieval->irb_generic & irb_equality)
786 {
787 // If we have an equality search, lower/upper bounds are actually the same key
788 copy_key(lower, upper);
789 }
790 else
791 {
792 // Make the upper bound key
793
794 errorCode = BTR_make_key(tdbb, m_retrieval->irb_upper_count, getUpperValues(),
795 getScale(), &m_retrieval->irb_desc, upper, keyType, nullptr);
796 }
797 }
798
799 if (errorCode != idx_e_ok)
800 {
801 index_desc temp_idx = m_retrieval->irb_desc;
802 IndexErrorContext context(m_retrieval->irb_relation, &temp_idx);
803 context.raise(tdbb, errorCode);
804 }
805}
806
807
808void BTR_all(thread_db* tdbb, jrd_rel* relation, IndexDescList& idxList, RelationPages* relPages)

Callers

nothing calls this directly

Calls 4

BTR_make_keyFunction · 0.85
getScaleFunction · 0.85
copy_keyFunction · 0.70
raiseMethod · 0.45

Tested by

no test coverage detected