Skip to content

Serializing integers #81

Closed
Closed

Description

@dmitrykuzmenkov

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.

Activity

  1. nicolasff commented on Nov 16, 2011

    @nicolasff
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions