Commit a8b6efea authored by Wen Hui's avatar Wen Hui Committed by Oran Agra
Browse files

Add optional for FCALL and FCALL_RO command json file (#10988)



According to the Redis functions documentation, FCALL command format could be
FCALL function_name numberOfKeys [key1, key2, key3.....] [arg1, arg2, arg3.....]

So in the json file of fcall and fcall_ro, we should add optional for key and arg part.
Just like EVAL...
Co-authored-by: default avatarBinbin <binloveplay1314@qq.com>
(cherry picked from commit 2d3240f3)
parent 888effe4
...@@ -3352,8 +3352,8 @@ struct redisCommandArg EVAL_RO_Args[] = { ...@@ -3352,8 +3352,8 @@ struct redisCommandArg EVAL_RO_Args[] = {
struct redisCommandArg FCALL_Args[] = { struct redisCommandArg FCALL_Args[] = {
{"function",ARG_TYPE_STRING,-1,NULL,NULL,NULL,CMD_ARG_NONE}, {"function",ARG_TYPE_STRING,-1,NULL,NULL,NULL,CMD_ARG_NONE},
{"numkeys",ARG_TYPE_INTEGER,-1,NULL,NULL,NULL,CMD_ARG_NONE}, {"numkeys",ARG_TYPE_INTEGER,-1,NULL,NULL,NULL,CMD_ARG_NONE},
{"key",ARG_TYPE_KEY,0,NULL,NULL,NULL,CMD_ARG_MULTIPLE}, {"key",ARG_TYPE_KEY,0,NULL,NULL,NULL,CMD_ARG_OPTIONAL|CMD_ARG_MULTIPLE},
{"arg",ARG_TYPE_STRING,-1,NULL,NULL,NULL,CMD_ARG_MULTIPLE}, {"arg",ARG_TYPE_STRING,-1,NULL,NULL,NULL,CMD_ARG_OPTIONAL|CMD_ARG_MULTIPLE},
{0} {0}
}; };
...@@ -3369,8 +3369,8 @@ struct redisCommandArg FCALL_Args[] = { ...@@ -3369,8 +3369,8 @@ struct redisCommandArg FCALL_Args[] = {
struct redisCommandArg FCALL_RO_Args[] = { struct redisCommandArg FCALL_RO_Args[] = {
{"function",ARG_TYPE_STRING,-1,NULL,NULL,NULL,CMD_ARG_NONE}, {"function",ARG_TYPE_STRING,-1,NULL,NULL,NULL,CMD_ARG_NONE},
{"numkeys",ARG_TYPE_INTEGER,-1,NULL,NULL,NULL,CMD_ARG_NONE}, {"numkeys",ARG_TYPE_INTEGER,-1,NULL,NULL,NULL,CMD_ARG_NONE},
{"key",ARG_TYPE_KEY,0,NULL,NULL,NULL,CMD_ARG_MULTIPLE}, {"key",ARG_TYPE_KEY,0,NULL,NULL,NULL,CMD_ARG_OPTIONAL|CMD_ARG_MULTIPLE},
{"arg",ARG_TYPE_STRING,-1,NULL,NULL,NULL,CMD_ARG_MULTIPLE}, {"arg",ARG_TYPE_STRING,-1,NULL,NULL,NULL,CMD_ARG_OPTIONAL|CMD_ARG_MULTIPLE},
{0} {0}
}; };
......
...@@ -52,11 +52,13 @@ ...@@ -52,11 +52,13 @@
"name": "key", "name": "key",
"type": "key", "type": "key",
"key_spec_index": 0, "key_spec_index": 0,
"optional": true,
"multiple": true "multiple": true
}, },
{ {
"name": "arg", "name": "arg",
"type": "string", "type": "string",
"optional": true,
"multiple": true "multiple": true
} }
] ]
......
...@@ -51,11 +51,13 @@ ...@@ -51,11 +51,13 @@
"name": "key", "name": "key",
"type": "key", "type": "key",
"key_spec_index": 0, "key_spec_index": 0,
"optional": true,
"multiple": true "multiple": true
}, },
{ {
"name": "arg", "name": "arg",
"type": "string", "type": "string",
"optional": true,
"multiple": true "multiple": true
} }
] ]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment