Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Redis CPAN distribution.

Report information
The Basics
Id: 74561
Status: resolved
Priority: 0/
Queue: Redis

People
Owner: Nobody in particular
Requestors: tow [...] nsense.net
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Redis cpan module, "sort" implementation
Date: Tue, 31 Jan 2012 13:15:13 +0100
To: bug-Redis [...] rt.cpan.org
From: Tom Van De Wiele <tow [...] nsense.net>
Hello, The "sort" command in the perl CPAN implementation does not return anything. Redis returns the elements that were sorted when issuing a sort command. The perl implementation does not seem to do that? --- use strict; use Redis; my $r = Redis->new; my @m = $r->sort("mykey BY nosort LIMIT 0 5"); my $num = @m; print $num; => yields 0 where it should be 5 --- Is this a deliberate deviation from the way redis does things? A bug? Best regards Tom
Subject: Re: [rt.cpan.org #74561] Redis cpan module, "sort" implementation
Date: Tue, 31 Jan 2012 15:25:30 +0000
To: bug-Redis [...] rt.cpan.org
From: Pedro Melo <melo [...] simplicidade.org>
Hi, On Tue, Jan 31, 2012 at 12:15 PM, Tom Van De Wiele via RT <bug-Redis@rt.cpan.org> wrote: Show quoted text
> The "sort" command in the perl CPAN implementation does not return > anything. Redis returns the elements that were sorted when issuing  a sort > command. The perl implementation does not seem to do that?
sort command works. Its tested by 01-basic.t. See this small program: #!perl use strict; use warnings; use Redis; use Data::Dump qw(pp); my $r = Redis->new; $r->lpush('list', 1, 2, 3, 4, 5); print pp([$r->sort('list')]), "\n"; print pp([$r->sort(qw(list by nosort limit 0 5))]), "\n"; This prints the expected elements. Show quoted text
> my @m = $r->sort("mykey BY nosort LIMIT 0 5");
The problem is that you are passing a single string, so Redis will look for a list named 'mykey BY nosort LIMIT 0 5'. You need to pass that as a list with 6 elements: mykey, BY, nosort, LIMIT, 0 and 5. Bye, -- Pedro Melo @pedromelo http://www.simplicidade.org/ http://about.me/melo xmpp:melo@simplicidade.org mailto:melo@simplicidade.org
Subject: Re: [rt.cpan.org #74561] Redis cpan module, "sort" implementation
Date: Tue, 31 Jan 2012 16:33:26 +0100
To: bug-Redis [...] rt.cpan.org
From: Tom Van De Wiele <tow [...] nsense.net>
Cheers On Tue, Jan 31, 2012 at 4:26 PM, melo@simplicidade.org via RT < bug-Redis@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=74561 > > > Hi, > > On Tue, Jan 31, 2012 at 12:15 PM, Tom Van De Wiele via RT > <bug-Redis@rt.cpan.org> wrote:
> > The "sort" command in the perl CPAN implementation does not return > > anything. Redis returns the elements that were sorted when issuing a
> sort
> > command. The perl implementation does not seem to do that?
> > sort command works. Its tested by 01-basic.t. See this small program: > > #!perl > > use strict; > use warnings; > use Redis; > use Data::Dump qw(pp); > > my $r = Redis->new; > > $r->lpush('list', 1, 2, 3, 4, 5); > print pp([$r->sort('list')]), "\n"; > print pp([$r->sort(qw(list by nosort limit 0 5))]), "\n"; > > This prints the expected elements. > >
> > my @m = $r->sort("mykey BY nosort LIMIT 0 5");
> > The problem is that you are passing a single string, so Redis will > look for a list named 'mykey BY nosort LIMIT 0 5'. You need to pass > that as a list with 6 elements: mykey, BY, nosort, LIMIT, 0 and 5. > > Bye, > -- > Pedro Melo > @pedromelo > http://www.simplicidade.org/ > http://about.me/melo > xmpp:melo@simplicidade.org > mailto:melo@simplicidade.org > >
-- Tom Van de Wiele | Principal Security Consultant nSense A/S | Meldahlsgade 5, 5. sal | 1613 København V | Denmark Mobile phone: +45 2933 2252 | E-mail: tow@nsense.net Web: www.nsense.net Driven by the Challenge_
I assume that this is fixed then :)
Subject: Re: [rt.cpan.org #74561] Redis cpan module, "sort" implementation
Date: Tue, 6 Mar 2012 10:42:48 +0100
To: bug-Redis [...] rt.cpan.org
From: Tom Van De Wiele <tow [...] nsense.net>
Yes sir, thanks. On Tue, Mar 6, 2012 at 10:30 AM, Pedro Melo via RT <bug-Redis@rt.cpan.org>wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=74561 > > > I assume that this is fixed then :) >
-- Tom Van de Wiele | Principal Security Consultant nSense A/S | Meldahlsgade 5, 5. sal | 1613 København V | Denmark Mobile phone: +45 2933 2252 | E-mail: tow@nsense.net Web: www.nsense.net Driven by the Challenge_
RT re-opened this after the last message, resolving again.