From: antirez Date: Fri, 22 May 2009 13:29:27 +0000 (+0200) Subject: S*STORE now return the cardinality of the resulting set X-Git-Url: https://git.saurik.com/redis.git/commitdiff_plain/03fd01c7eb56e1878e133857e95dcc8d23d14445 S*STORE now return the cardinality of the resulting set --- diff --git a/client-libraries/ruby_2/rubyredis.rb b/client-libraries/ruby_2/rubyredis.rb index ae572bcb..38823206 100644 --- a/client-libraries/ruby_2/rubyredis.rb +++ b/client-libraries/ruby_2/rubyredis.rb @@ -236,7 +236,7 @@ class RedisClient } res else - raise "Protocol error, got '#{rtype}' as initial reply bye" + raise "Protocol error, got '#{rtype}' as initial reply byte" end end end diff --git a/redis.c b/redis.c index 6adf521b..397d9b7e 100644 --- a/redis.c +++ b/redis.c @@ -3052,7 +3052,8 @@ static void sinterGenericCommand(redisClient *c, robj **setskeys, int setsnum, r if (!dstkey) { lenobj->ptr = sdscatprintf(sdsempty(),"*%d\r\n",cardinality); } else { - addReply(c,shared.ok); + addReplySds(c,sdscatprintf(sdsempty(),":%d\r\n", + dictSize((dict*)dstset->ptr))); server.dirty++; } zfree(dv); @@ -3157,7 +3158,8 @@ static void sunionDiffGenericCommand(redisClient *c, robj **setskeys, int setsnu if (!dstkey) { decrRefCount(dstset); } else { - addReply(c,shared.ok); + addReplySds(c,sdscatprintf(sdsempty(),":%d\r\n", + dictSize((dict*)dstset->ptr))); server.dirty++; } zfree(dv);