From a4f54043a98299ea9bb8b4dbf68e6e6ab8de3dce Mon Sep 17 00:00:00 2001 From: guybe7 Date: Wed, 20 Jan 2021 12:56:45 +0100 Subject: [PATCH] Fix firstkey,lastkey,step in COMMAND command for some commands (#8367) The output for COMMAND command was wrong for some commands. clients can use firstkey,lastkey,step to find (some) key name arguments, and the "movablekeys" flag to know that they can't know all (or any) of the key name arguments. These commands had the wrong output: 1. GEORADIUS*_RO used to have "movablekeys" (which it doesn't really need) 2. XREAD and XREADGROUP used to have (1,1,1). but that's completely wrong. 3. Z*STORE used to have (0,0,0) but it can at lest give the index of the dstkey (1,1,1) --- src/server.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/server.c b/src/server.c index f3d75ce04..03e448f10 100644 --- a/src/server.c +++ b/src/server.c @@ -449,15 +449,15 @@ struct redisCommand redisCommandTable[] = { {"zunionstore",zunionstoreCommand,-4, "write use-memory @sortedset", - 0,zunionInterDiffStoreGetKeys,0,0,0,0,0,0}, + 0,zunionInterDiffStoreGetKeys,1,1,1,0,0,0}, {"zinterstore",zinterstoreCommand,-4, "write use-memory @sortedset", - 0,zunionInterDiffStoreGetKeys,0,0,0,0,0,0}, + 0,zunionInterDiffStoreGetKeys,1,1,1,0,0,0}, {"zdiffstore",zdiffstoreCommand,-4, "write use-memory @sortedset", - 0,zunionInterDiffStoreGetKeys,0,0,0,0,0,0}, + 0,zunionInterDiffStoreGetKeys,1,1,1,0,0,0}, {"zunion",zunionCommand,-3, "read-only @sortedset", @@ -941,7 +941,7 @@ struct redisCommand redisCommandTable[] = { {"georadius_ro",georadiusroCommand,-6, "read-only @geo", - 0,georadiusGetKeys,1,1,1,0,0,0}, + 0,NULL,1,1,1,0,0,0}, {"georadiusbymember",georadiusbymemberCommand,-5, "write use-memory @geo", @@ -949,7 +949,7 @@ struct redisCommand redisCommandTable[] = { {"georadiusbymember_ro",georadiusbymemberroCommand,-5, "read-only @geo", - 0,georadiusGetKeys,1,1,1,0,0,0}, + 0,NULL,1,1,1,0,0,0}, {"geohash",geohashCommand,-2, "read-only @geo", @@ -1016,11 +1016,11 @@ struct redisCommand redisCommandTable[] = { {"xread",xreadCommand,-4, "read-only @stream @blocking", - 0,xreadGetKeys,1,1,1,0,0,0}, + 0,xreadGetKeys,0,0,0,0,0,0}, {"xreadgroup",xreadCommand,-7, "write @stream @blocking", - 0,xreadGetKeys,1,1,1,0,0,0}, + 0,xreadGetKeys,0,0,0,0,0,0}, {"xgroup",xgroupCommand,-2, "write use-memory @stream",