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

Serializing integers #81

Closed
dmitrykuzmenkov opened this issue Nov 16, 2011 · 1 comment
Closed

Serializing integers #81

dmitrykuzmenkov opened this issue Nov 16, 2011 · 1 comment

Comments

@dmitrykuzmenkov
Copy link

I use Redis::OPT_SERIALIZER = Redis::SERIALIZER_IGBINARY
So when I'm saving the integer i gotta serialized it.

And In redis-cli enviroment get:

get relation:1:82
"\x00\x00\x00\x02\x06\x01"

(its values: 1)

But when i do increment this one key i got not serialized data and incremented from zero (not 1, as this key contained)

get relation:1:82
"1"

So may be its bug or not but may be no need to serialize int/float etc types?

Also i cant get sort by key becauze integers are serialized and i must turn off it to take effect.

@nicolasff
Copy link
Member

Hello,

This issue has been raised before, but unfortunately there isn't much I can do in this case.
If you do an MGET with several keys, and some of them are serialized while some are not, phpredis won't be able to know which to deserialize and which to leave as they are. Trying to detect it would be unreliable, as you may want to store binary data that phpredis could interpret as igbinary strings.

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

2 participants