Skip to content

fix(gstat): Use correct RHD, RHDE and RHDF based on header flags in gstat - #9245

Open
TreeHunter9 wants to merge 2 commits into
FirebirdSQL:masterfrom
TreeHunter9:master-dpm-store-big-record-edge-case-fix
Open

TreeHunter9 wants to merge 2 commits into
FirebirdSQL:masterfrom
TreeHunter9:master-dpm-store-big-record-edge-case-fix

Conversation

@TreeHunter9

@TreeHunter9 TreeHunter9 commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Changes in dpm.epp and sqz.cpp are related to the edge case where record size is big for RHDE (cannot store it with this header), but is enough for RHD, so the whole record will be put in tail, the head will not contain any data;

This patch affects v5 and v6.

Related to #9244.

…stat

- Changes in dpm.epp and sqz.cpp are related to the edge case where record size is big for RHDE (cannot store it with this header), but is enough for RHD, so the whole record will be put in tail, the head will not contain any data;
Comment thread src/jrd/dpm.epp
Comment thread src/jrd/sqz.cpp
*
**************************************/
fb_assert(m_length > outLength);
[[maybe_unused]] const bool truncateAll = m_length <= outLength;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May be it is better to fix caller (store_big_record()) and not break compressor assumptions ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure that we are breaking compressor assumption. As I see, it's fine that we can have head with no data, so at least outLength can be equal to m_length. But, anyway, I think it's fine that outLength can also be bigger then m_length because outLength is more like a buffer size, and return value will contain actual length anyway, so I see no restriction why we should limit outLength value to m_length (except branch if (m_runs.isEmpty()) at the beginning will break if outLength is bigger then m_length, but I can fix that).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dyemanov, what do you think ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants