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: Binbin <binloveplay1314@qq.com>
This commit is contained in:
Wen Hui
2022-07-17 02:40:07 -04:00
committed by GitHub
parent 847cdca151
commit 2d3240f31b
3 changed files with 8 additions and 4 deletions

View File

@@ -3352,8 +3352,8 @@ struct redisCommandArg EVAL_RO_Args[] = {
struct redisCommandArg FCALL_Args[] = {
{"function",ARG_TYPE_STRING,-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},
{"arg",ARG_TYPE_STRING,-1,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_OPTIONAL|CMD_ARG_MULTIPLE},
{0}
};
@@ -3369,8 +3369,8 @@ struct redisCommandArg FCALL_Args[] = {
struct redisCommandArg FCALL_RO_Args[] = {
{"function",ARG_TYPE_STRING,-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},
{"arg",ARG_TYPE_STRING,-1,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_OPTIONAL|CMD_ARG_MULTIPLE},
{0}
};

View File

@@ -52,11 +52,13 @@
"name": "key",
"type": "key",
"key_spec_index": 0,
"optional": true,
"multiple": true
},
{
"name": "arg",
"type": "string",
"optional": true,
"multiple": true
}
]

View File

@@ -51,11 +51,13 @@
"name": "key",
"type": "key",
"key_spec_index": 0,
"optional": true,
"multiple": true
},
{
"name": "arg",
"type": "string",
"optional": true,
"multiple": true
}
]