]> git.saurik.com Git - redis.git/commitdiff
S*STORE now return the cardinality of the resulting set
authorantirez <antirez@gmail.com>
Fri, 22 May 2009 13:29:27 +0000 (15:29 +0200)
committerantirez <antirez@gmail.com>
Fri, 22 May 2009 13:29:27 +0000 (15:29 +0200)
client-libraries/ruby_2/rubyredis.rb
redis.c

index ae572bcb597f91863a8929094c712a80584e36b9..38823206eac34372d2416508dab0bd8c460a8568 100644 (file)
@@ -236,7 +236,7 @@ class RedisClient
             }
             res
         else
             }
             res
         else
-            raise "Protocol error, got '#{rtype}' as initial reply bye"
+            raise "Protocol error, got '#{rtype}' as initial reply byte"
         end
     end
 end
         end
     end
 end
diff --git a/redis.c b/redis.c
index 6adf521ba63f59860cf30d7d2f040f637223b44e..397d9b7e546c56c42ffbf5f91ede08e7a69b7215 100644 (file)
--- 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 {
     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);
         server.dirty++;
     }
     zfree(dv);
@@ -3157,7 +3158,8 @@ static void sunionDiffGenericCommand(redisClient *c, robj **setskeys, int setsnu
     if (!dstkey) {
         decrRefCount(dstset);
     } else {
     if (!dstkey) {
         decrRefCount(dstset);
     } else {
-        addReply(c,shared.ok);
+        addReplySds(c,sdscatprintf(sdsempty(),":%d\r\n",
+            dictSize((dict*)dstset->ptr)));
         server.dirty++;
     }
     zfree(dv);
         server.dirty++;
     }
     zfree(dv);