Skip to content

Commit 3dd6a2f

Browse files
committed
Improvement CORE-5647 - Increase number of formats/versions of views from 255 to 32K.
1 parent b31e373 commit 3dd6a2f

2 files changed

Lines changed: 13 additions & 2 deletions

File tree

src/jrd/dfw.epp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5615,8 +5615,16 @@ static bool make_version(thread_db* tdbb, SSHORT phase, DeferredWork* work, jrd_
56155615
null_view = blob_id.isEmpty();
56165616
external_flag = REL.RDB$EXTERNAL_FILE[0];
56175617

5618-
if (REL.RDB$FORMAT == MAX_TABLE_VERSIONS)
5619-
raiseTooManyVersionsError(obj_relation, work->dfw_name);
5618+
if (REL.RDB$VIEW_BLR.NULL)
5619+
{
5620+
if (REL.RDB$FORMAT == MAX_TABLE_VERSIONS)
5621+
raiseTooManyVersionsError(obj_relation, work->dfw_name);
5622+
}
5623+
else
5624+
{
5625+
if (REL.RDB$FORMAT == MAX_VIEW_VERSIONS)
5626+
raiseTooManyVersionsError(obj_view, work->dfw_name);
5627+
}
56205628

56215629
MODIFY REL USING
56225630
blb* blob = blb::create(tdbb, transaction, &REL.RDB$RUNTIME);

src/jrd/ods.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -718,4 +718,7 @@ const USHORT RAW_HEADER_SIZE = 1024; // ROUNDUP(HDR_SIZE, PAGE_ALIGNMENT);
718718
// max number of table formats (aka versions), limited by "UCHAR rhd_format"
719719
const int MAX_TABLE_VERSIONS = 255;
720720

721+
// max number of view formats (aka versions), limited by "SSHORT RDB$FORMAT"
722+
const int MAX_VIEW_VERSIONS = MAX_SSHORT;
723+
721724
#endif // JRD_ODS_H

0 commit comments

Comments
 (0)