Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Range query correctness #4

Open
skyelves opened this issue Jan 9, 2022 · 0 comments
Open

Range query correctness #4

skyelves opened this issue Jan 9, 2022 · 0 comments

Comments

@skyelves
Copy link

skyelves commented Jan 9, 2022

fkey = (uint8_t *)&key;

fkey can not work on the machine using little-endian. Although insert and search can work well on both machines with big-endian or little-endian, the range query can only report the correct results on machines with big-endian.

For example, if I want to scan(0x1, 0x100), on a little-endian machine, fkey[0] of key 0x1 equals to 1 while fkey[0] of key 0x100 equals to 0. Therefore, key_key_lt returns false.

To fix this bug, defining a MACRO to get the fkey from the key works.

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

No branches or pull requests

1 participant