diff --git a/src/commands.def b/src/commands.def index f42afbbb8..12775f12b 100644 --- a/src/commands.def +++ b/src/commands.def @@ -12585,7 +12585,7 @@ struct COMMAND_STRUCT redisCommandTable[] = { {MAKE_CMD("srem","Removes one or more members from a set. Deletes the set if the last member was removed.","O(N) where N is the number of members to be removed.","1.0.0",CMD_DOC_NONE,NULL,NULL,"set",COMMAND_GROUP_SET,SREM_History,1,SREM_Tips,0,sremCommand,-3,CMD_WRITE|CMD_FAST,ACL_CATEGORY_SET,SREM_Keyspecs,1,NULL,2),.args=SREM_Args}, {MAKE_CMD("sscan","Iterates over members of a set.","O(1) for every call. O(N) for a complete iteration, including enough command calls for the cursor to return back to 0. N is the number of elements inside the collection.","2.8.0",CMD_DOC_NONE,NULL,NULL,"set",COMMAND_GROUP_SET,SSCAN_History,0,SSCAN_Tips,1,sscanCommand,-3,CMD_READONLY,ACL_CATEGORY_SET,SSCAN_Keyspecs,1,NULL,4),.args=SSCAN_Args}, {MAKE_CMD("sunion","Returns the union of multiple sets.","O(N) where N is the total number of elements in all given sets.","1.0.0",CMD_DOC_NONE,NULL,NULL,"set",COMMAND_GROUP_SET,SUNION_History,0,SUNION_Tips,1,sunionCommand,-2,CMD_READONLY,ACL_CATEGORY_SET,SUNION_Keyspecs,1,NULL,1),.args=SUNION_Args}, -{MAKE_CMD("sunioncard","Returns the number of members of the union of multiple sets.","O(N) where N is the total number of elements in all given sets.","8.8.0",CMD_DOC_NONE,NULL,NULL,"set",COMMAND_GROUP_SET,SUNIONCARD_History,0,SUNIONCARD_Tips,0,sunioncardCommand,-3,CMD_READONLY,ACL_CATEGORY_SET,SUNIONCARD_Keyspecs,1,sintercardGetKeys,4),.args=SUNIONCARD_Args}, +{MAKE_CMD("sunioncard","Returns the number of members of the union of multiple sets.","O(N) where N is the total number of elements in all given sets.","8.8.0",CMD_DOC_NONE,NULL,NULL,"set",COMMAND_GROUP_SET,SUNIONCARD_History,0,SUNIONCARD_Tips,0,sunioncardCommand,-3,CMD_READONLY,ACL_CATEGORY_SET,SUNIONCARD_Keyspecs,1,sunioncardGetKeys,4),.args=SUNIONCARD_Args}, {MAKE_CMD("sunionstore","Stores the union of multiple sets in a key.","O(N) where N is the total number of elements in all given sets.","1.0.0",CMD_DOC_NONE,NULL,NULL,"set",COMMAND_GROUP_SET,SUNIONSTORE_History,0,SUNIONSTORE_Tips,0,sunionstoreCommand,-3,CMD_WRITE|CMD_DENYOOM,ACL_CATEGORY_SET,SUNIONSTORE_Keyspecs,2,NULL,2),.args=SUNIONSTORE_Args}, /* sorted_set */ {MAKE_CMD("bzmpop","Removes and returns a member by score from one or more sorted sets. Blocks until a member is available otherwise. Deletes the sorted set if the last element was popped.","O(K) + O(M*log(N)) where K is the number of provided keys, N being the number of elements in the sorted set, and M being the number of elements popped.","7.0.0",CMD_DOC_NONE,NULL,NULL,"sorted_set",COMMAND_GROUP_SORTED_SET,BZMPOP_History,0,BZMPOP_Tips,0,bzmpopCommand,-5,CMD_WRITE|CMD_BLOCKING,ACL_CATEGORY_SORTEDSET,BZMPOP_Keyspecs,1,blmpopGetKeys,5),.args=BZMPOP_Args}, diff --git a/src/commands/sunioncard.json b/src/commands/sunioncard.json index 0694bc514..2c38b8152 100644 --- a/src/commands/sunioncard.json +++ b/src/commands/sunioncard.json @@ -6,7 +6,7 @@ "since": "8.8.0", "arity": -3, "function": "sunioncardCommand", - "get_keys_function": "sintercardGetKeys", + "get_keys_function": "sunioncardGetKeys", "command_flags": [ "READONLY" ], diff --git a/src/db.c b/src/db.c index 87881a991..81adfe9bc 100644 --- a/src/db.c +++ b/src/db.c @@ -3560,6 +3560,11 @@ int sintercardGetKeys(struct redisCommand *cmd, robj **argv, int argc, getKeysRe return genericGetKeys(0, 1, 2, 1, argv, argc, result); } +int sunioncardGetKeys(struct redisCommand *cmd, robj **argv, int argc, getKeysResult *result) { + UNUSED(cmd); + return genericGetKeys(0, 1, 2, 1, argv, argc, result); +} + int zunionInterDiffStoreGetKeys(struct redisCommand *cmd, robj **argv, int argc, getKeysResult *result) { UNUSED(cmd); return genericGetKeys(1, 2, 3, 1, argv, argc, result); diff --git a/src/server.h b/src/server.h index 5202afea5..7d7f68b2c 100644 --- a/src/server.h +++ b/src/server.h @@ -4099,6 +4099,7 @@ int doesCommandHaveChannelsWithFlags(struct redisCommand *cmd, int flags); void getKeysFreeResult(getKeysResult *result); int extractKeysAndSlot(struct redisCommand *cmd, robj **argv, int argc, getKeysResult *result, int *slot); int sintercardGetKeys(struct redisCommand *cmd,robj **argv, int argc, getKeysResult *result); +int sunioncardGetKeys(struct redisCommand *cmd,robj **argv, int argc, getKeysResult *result); int zunionInterDiffGetKeys(struct redisCommand *cmd,robj **argv, int argc, getKeysResult *result); int zunionInterDiffStoreGetKeys(struct redisCommand *cmd,robj **argv, int argc, getKeysResult *result); int evalGetKeys(struct redisCommand *cmd, robj **argv, int argc, getKeysResult *result);