ACL: mark more commands as read-only commands.

This commit is contained in:
antirez 2019-01-23 11:14:39 +01:00
parent effb84be17
commit 932a1196d8

View File

@ -101,11 +101,11 @@ volatile unsigned long lru_clock; /* Server global current LRU time. */
* This is the meaning of the flags: * This is the meaning of the flags:
* *
* write: write command (may modify the key space). * write: write command (may modify the key space).
* read-only: read-only command that will read data from keys without changing * read-only: all the non special commands just reading from keys without
* the content. Commands just returning information but not reading * changing the content, or returning other informations like
* from keys are usually not regarded as read-only commands, however * the TIME command. Special commands such administrative commands
* such commands will also lack the "write" and "admin" flags so * or transaction related commands (multi, exec, discard, ...)
* can be detected. One example is "TIME". * are not flagged as read-only commands.
* use-memory: may increase memory usage once called. Don't allow if out * use-memory: may increase memory usage once called. Don't allow if out
* of memory. * of memory.
* admin: admin command, like SAVE or SHUTDOWN. * admin: admin command, like SAVE or SHUTDOWN.
@ -591,7 +591,7 @@ struct redisCommand redisCommandTable[] = {
0,NULL,0,0,0,0,0,0}, 0,NULL,0,0,0,0,0,0},
{"echo",echoCommand,2, {"echo",echoCommand,2,
"fast", "read-only fast",
0,NULL,0,0,0,0,0,0}, 0,NULL,0,0,0,0,0,0},
{"save",saveCommand,1, {"save",saveCommand,1,
@ -611,7 +611,7 @@ struct redisCommand redisCommandTable[] = {
0,NULL,0,0,0,0,0,0}, 0,NULL,0,0,0,0,0,0},
{"lastsave",lastsaveCommand,1, {"lastsave",lastsaveCommand,1,
"random fast", "read-only random fast",
0,NULL,0,0,0,0,0,0}, 0,NULL,0,0,0,0,0,0},
{"type",typeCommand,2, {"type",typeCommand,2,
@ -797,7 +797,7 @@ struct redisCommand redisCommandTable[] = {
0,NULL,0,0,0,0,0,0}, 0,NULL,0,0,0,0,0,0},
{"time",timeCommand,1, {"time",timeCommand,1,
"random fast", "read-only random fast",
0,NULL,0,0,0,0,0,0}, 0,NULL,0,0,0,0,0,0},
{"bitop",bitopCommand,-4, {"bitop",bitopCommand,-4,
@ -946,7 +946,7 @@ struct redisCommand redisCommandTable[] = {
0,NULL,0,0,0,0,0,0}, 0,NULL,0,0,0,0,0,0},
{"lolwut",lolwutCommand,-1, {"lolwut",lolwutCommand,-1,
"fast", "read-only fast",
0,NULL,0,0,0,0,0,0}, 0,NULL,0,0,0,0,0,0},
{"acl",aclCommand,-2, {"acl",aclCommand,-2,