Skip to content

[core] fix NPE in BTreeFileMetaSelector when btree index contains empty string key.#7812

Open
zhoulii wants to merge 3 commits into
apache:masterfrom
zhoulii:fix-btree-meta
Open

[core] fix NPE in BTreeFileMetaSelector when btree index contains empty string key.#7812
zhoulii wants to merge 3 commits into
apache:masterfrom
zhoulii:fix-btree-meta

Conversation

@zhoulii
Copy link
Copy Markdown
Member

@zhoulii zhoulii commented May 11, 2026

Purpose

close #7811

Tests

@zhoulii zhoulii closed this May 11, 2026
@zhoulii zhoulii reopened this May 11, 2026
sliceOutput.writeInt(lastKey.length);
sliceOutput.writeBytes(lastKey);
} else {
sliceOutput.writeInt(0);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Dose this have incompatibility risks? For example if an old version file is all-null, a new version meta will set the firstKey and lastKey as an empty byte[].

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good catch! You're right — there is a backward compatibility risk. When an old-version file has all-null keys (serialized as int(0) for both keys), the new deserializer would incorrectly read them as byte[0] instead of null. Fixed already.

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.

[Bug] NPE in BTreeFileMetaSelector when btree global index contains empty string key

2 participants