Skip to content

renameNx delivers false on success #1

Closed

Description

@tompro

If I use renameNx and rename a key to a key that is currently not existing the operation is performed well on Redis server. Nevertheless I get false as result from phpredis.

The follwing test fails:

$redis->set('oldkey', 'value');
$this->assertTrue(
    $redis->renameNx('oldkey', 'newkey')
);

Activity

  1. nicolasff commented on Mar 28, 2011

    @nicolasff
    Member

    Hello,

    Thanks for this report. I'll have a look tomorrow morning and integrate your test.

  2. tompro commented on Mar 29, 2011

    @tompro
    Author

    Cool. Thanks for this fast reply.

  3. nicolasff commented on Mar 30, 2011

    @nicolasff
    Member

    Hello again,

    It seems that the either the return value of RENAMENX has changed in Redis itself, or this bug has been here for a long time. I have fixed this issue and added a unit test.

    Could you please confirm that it works as expected?

  4. tompro commented on Mar 30, 2011

    @tompro
    Author

    Works like a charm. All green :) . During the next weeks I am going to cover most phpredis functions with tests as I am currently building a higher level library. I'll let you know when I encounter something else. I hope this is not very anoying for you :) .

  5. nicolasff commented on Mar 30, 2011

    @nicolasff
    Member

    Not at all, thanks for reporting this. The more I can fix, the better it will be :-)

  6. fotografi commented on Aug 12, 2016

    @fotografi
    No description provided.
  7. added a commit that references this issue on Nov 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions