-
Notifications
You must be signed in to change notification settings - Fork 85
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 encode string as integer #39
Conversation
I will review it later today |
Actually, -1 should be encoded as int
|
I read some rdb libs where decoders read uint. so encoder better only encodes uint too. |
For your information, redis use string2ll to determine whether int encoding can be used. |
Let me think about it |
rdbtools supported signed int32 too. I prefer to follow the redis official strategy. https://github.com/sripathikrishnan/redis-rdb-tools/blob/master/rdbtools/parser.py#L494 |
ok. but the encoder and decoder should be modified accordingly. current codes only support uint. |
Although the code is a bit strange, it does work for negative numbers.😂 I'll sort it out. |
encoder should be strict about the strings that can be encoded as integer.
as strconv.ParseInt() is not accurate for this case, we need to check the string content and pick up
the "pure" uint32 or uint64 numbers.
Also the WriteSetObject() function has a wrong state to fix.
Fix issue #38
Fix issue #40