Skip to content

Commit d3029d2

Browse files
committed
Fixed one more case when type of field, used in the index, was ALTERed
1 parent 6c8b465 commit d3029d2

2 files changed

Lines changed: 4 additions & 8 deletions

File tree

src/jrd/Relation.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ class IndexPermanent : public Firebird::PermanentStorage
496496
RelationPermanent* idp_relation;
497497
MetaId idp_id;
498498
TraNumber idp_tranum = 0;
499-
UCHAR idp_state = 0; // Makes sense only for expression/conditional indices
499+
UCHAR idp_state = 0; // Makes limited sense for segmented indices
500500
UCHAR idp_formatNumber = 0;
501501

502502
[[noreturn]] void errIndexGone();
@@ -523,11 +523,6 @@ class IndexPermanent : public Firebird::PermanentStorage
523523
idp_state = state;
524524
}
525525

526-
UCHAR getState() const noexcept
527-
{
528-
return idp_state;
529-
}
530-
531526
UCHAR getFormat() const noexcept
532527
{
533528
return idp_formatNumber;

src/jrd/btr.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -696,8 +696,9 @@ idx_e IndexKey::compose(Record* record, bool skipNewFormat)
696696

697697
if (skipNewFormat)
698698
{
699-
auto* idp = m_relation->getPermanent()->lookupIndex(m_tdbb, m_index->idx_id, CacheFlag::AUTOCREATE);
700-
if (idp && (idp->getState() == Ods::irt_drop) && idp->getFormat() &&
699+
auto* idp = m_relation->getPermanent()->lookupIndex(m_tdbb, m_index->idx_id,
700+
CacheFlag::AUTOCREATE | CacheFlag::ERASED);
701+
if (idp && (m_index->idx_state == Ods::irt_drop) && idp->getFormat() &&
701702
(record->getFormat()->fmt_version > idp->getFormat()))
702703
{
703704
// tried to insert fresh formatted record into old index - skip this

0 commit comments

Comments
 (0)