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

fix: binary list key randomly droped by lrem #2118

Merged

Conversation

Summer-0827
Copy link
Contributor

1.slice之间的比较用==
2.非slice之间的比较用memcmp

@dingxiaoshuai123
Copy link
Collaborator

Discussion from the Pika developer community group : If there is '\x00' in the data, the strcmp function will terminate prematurely, resulting in incorrect comparison results. The solution is to use memcmp or the == operator of Slice (which internally uses memcmp) for comparison, which ensures the correctness of the comparison results.

AlexStocks
AlexStocks previously approved these changes Nov 13, 2023
@wanghenshui wanghenshui changed the title memcmp replace strcmp fix: binary list key randomly droped by lrem Nov 13, 2023
@wanghenshui wanghenshui self-requested a review November 13, 2023 05:36
wanghenshui
wanghenshui previously approved these changes Nov 13, 2023
@wanghenshui wanghenshui self-requested a review November 13, 2023 05:52
wanghenshui
wanghenshui previously approved these changes Nov 13, 2023
@AlexStocks AlexStocks merged commit 6cde9c1 into OpenAtomFoundation:unstable Nov 13, 2023
11 checks passed
bigdaronlee163 pushed a commit to bigdaronlee163/pika that referenced this pull request Jun 8, 2024
* memcmp replace strcmp

* fix

* pivot covert to Slice

* add lists unit test

* no need convert to slice

* Update src/storage/src/redis_lists.cc

* fix space in  redis_lists.cc

---------

Co-authored-by: yaxin0710 <[email protected]>
Co-authored-by: Ted Mostly <[email protected]>
cheniujh pushed a commit to cheniujh/pika that referenced this pull request Sep 24, 2024
* memcmp replace strcmp

* fix

* pivot covert to Slice

* add lists unit test

* no need convert to slice

* Update src/storage/src/redis_lists.cc

* fix space in  redis_lists.cc

---------

Co-authored-by: yaxin0710 <[email protected]>
Co-authored-by: Ted Mostly <[email protected]>
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.

5 participants