diff options
author | Binbin <binloveplay1314@qq.com> | 2022-05-27 17:58:00 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-27 12:58:00 +0300 |
commit | 2a099d49d457239201b38c3ec97054a167658b6e (patch) | |
tree | df5a74aff673143a9c093db5e9f06b778a4bb910 /src/commands/renamenx.json | |
parent | 6f7c1a8ce6861fb382f8313d07a6e2a13217a690 (diff) | |
download | redis-2a099d49d457239201b38c3ec97054a167658b6e.tar.gz |
Fix some commands key spec in json files (#10779)
There are some commands that has the wrong key specs.
This PR adds a key-spec related check in generate-command-code.py.
Check if the index is valid, or if there is an unused index.
The check result will look like:
```
[root]# python utils/generate-command-code.py
Processing json files...
Linking container command to subcommands...
Checking all commands...
command: RESTORE_ASKING may have unused key_spec
command: RENAME may have unused key_spec
command: PFDEBUG may have unused key_spec
command: WATCH key_specs missing flags
command: LCS arg: key2 key_spec_index error
command: RENAMENX may have unused key_spec
Error: There are errors in the commands check, please check the above logs.
```
The following commands have been fixed according to the check results:
- RESTORE ASKING: add missing arguments section (and history section)
- RENAME: newkey's key_spec_index should be 1
- PFDEBUG: add missing arguments (and change the arity from -3 to 3)
- WATCH: add missing key_specs flags: RO, like EXIST (it allow you to know the key exists, or is modified, but doesn't "leak" the data)
- LCS: key2 key_spec_index error, there is only one key-spec
- RENAMENX: newkey's key_spec_index should be 1
Diffstat (limited to 'src/commands/renamenx.json')
-rw-r--r-- | src/commands/renamenx.json | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/commands/renamenx.json b/src/commands/renamenx.json index 99c318ca7..afa4f658b 100644 --- a/src/commands/renamenx.json +++ b/src/commands/renamenx.json @@ -67,7 +67,7 @@ { "name": "newkey", "type": "key", - "key_spec_index": 0 + "key_spec_index": 1 } ] } |