Skip to content

Commit

Permalink
chore: disable search and stream group commands
Browse files Browse the repository at this point in the history
  • Loading branch information
PragmaTwice committed Jul 1, 2024
1 parent 7353a35 commit c8826e7
Show file tree
Hide file tree
Showing 4 changed files with 1,067 additions and 1,063 deletions.
17 changes: 9 additions & 8 deletions src/commands/cmd_search.cc
Original file line number Diff line number Diff line change
Expand Up @@ -358,13 +358,14 @@ class CommandFTDrop : public Commander {
};
};

REDIS_REGISTER_COMMANDS(MakeCmdAttr<CommandFTCreate>("ft.create", -2, "write exclusive no-multi no-script", 0, 0, 0),
MakeCmdAttr<CommandFTSearchSQL>("ft.searchsql", 2, "read-only", 0, 0, 0),
MakeCmdAttr<CommandFTSearch>("ft.search", -3, "read-only", 0, 0, 0),
MakeCmdAttr<CommandFTExplainSQL>("ft.explainsql", -2, "read-only", 0, 0, 0),
MakeCmdAttr<CommandFTExplain>("ft.explain", -3, "read-only", 0, 0, 0),
MakeCmdAttr<CommandFTInfo>("ft.info", 2, "read-only", 0, 0, 0),
MakeCmdAttr<CommandFTList>("ft._list", 1, "read-only", 0, 0, 0),
MakeCmdAttr<CommandFTDrop>("ft.dropindex", 2, "write exclusive no-multi no-script", 0, 0, 0));
// REDIS_REGISTER_COMMANDS(MakeCmdAttr<CommandFTCreate>("ft.create", -2, "write exclusive no-multi no-script", 0, 0, 0),
// MakeCmdAttr<CommandFTSearchSQL>("ft.searchsql", 2, "read-only", 0, 0, 0),
// MakeCmdAttr<CommandFTSearch>("ft.search", -3, "read-only", 0, 0, 0),
// MakeCmdAttr<CommandFTExplainSQL>("ft.explainsql", -2, "read-only", 0, 0, 0),
// MakeCmdAttr<CommandFTExplain>("ft.explain", -3, "read-only", 0, 0, 0),
// MakeCmdAttr<CommandFTInfo>("ft.info", 2, "read-only", 0, 0, 0),
// MakeCmdAttr<CommandFTList>("ft._list", 1, "read-only", 0, 0, 0),
// MakeCmdAttr<CommandFTDrop>("ft.dropindex", 2, "write exclusive no-multi no-script", 0, 0,
// 0));

} // namespace redis
37 changes: 19 additions & 18 deletions src/commands/cmd_stream.cc
Original file line number Diff line number Diff line change
Expand Up @@ -655,10 +655,10 @@ class CommandXInfo : public Commander {

count_ = *parse_result;
}
} else if (val == "groups" && args.size() == 3) {
subcommand_ = "groups";
} else if (val == "consumers" && args.size() == 4) {
subcommand_ = "consumers";
// } else if (val == "groups" && args.size() == 3) {
// subcommand_ = "groups";
// } else if (val == "consumers" && args.size() == 4) {
// subcommand_ = "consumers";
} else {
return {Status::RedisParseErr, errUnknownSubcommandOrWrongArguments};
}
Expand Down Expand Up @@ -1736,19 +1736,20 @@ class CommandXSetId : public Commander {
std::optional<uint64_t> entries_added_;
};

REDIS_REGISTER_COMMANDS(MakeCmdAttr<CommandXAck>("xack", -4, "write no-dbsize-check", 1, 1, 1),
MakeCmdAttr<CommandXAdd>("xadd", -5, "write", 1, 1, 1),
MakeCmdAttr<CommandXDel>("xdel", -3, "write no-dbsize-check", 1, 1, 1),
MakeCmdAttr<CommandXClaim>("xclaim", -6, "write", 1, 1, 1),
MakeCmdAttr<CommandAutoClaim>("xautoclaim", -6, "write", 1, 1, 1),
MakeCmdAttr<CommandXGroup>("xgroup", -4, "write", 2, 2, 1),
MakeCmdAttr<CommandXLen>("xlen", -2, "read-only", 1, 1, 1),
MakeCmdAttr<CommandXInfo>("xinfo", -2, "read-only", 0, 0, 0),
MakeCmdAttr<CommandXRange>("xrange", -4, "read-only", 1, 1, 1),
MakeCmdAttr<CommandXRevRange>("xrevrange", -2, "read-only", 1, 1, 1),
MakeCmdAttr<CommandXRead>("xread", -4, "read-only", 0, 0, 0),
MakeCmdAttr<CommandXReadGroup>("xreadgroup", -7, "write", 0, 0, 0),
MakeCmdAttr<CommandXTrim>("xtrim", -4, "write no-dbsize-check", 1, 1, 1),
MakeCmdAttr<CommandXSetId>("xsetid", -3, "write", 1, 1, 1))
REDIS_REGISTER_COMMANDS(
// MakeCmdAttr<CommandXAck>("xack", -4, "write no-dbsize-check", 1, 1, 1),
MakeCmdAttr<CommandXAdd>("xadd", -5, "write", 1, 1, 1),
MakeCmdAttr<CommandXDel>("xdel", -3, "write no-dbsize-check", 1, 1, 1),
// MakeCmdAttr<CommandXClaim>("xclaim", -6, "write", 1, 1, 1),
// MakeCmdAttr<CommandAutoClaim>("xautoclaim", -6, "write", 1, 1, 1),
// MakeCmdAttr<CommandXGroup>("xgroup", -4, "write", 2, 2, 1),
MakeCmdAttr<CommandXLen>("xlen", -2, "read-only", 1, 1, 1),
MakeCmdAttr<CommandXInfo>("xinfo", -2, "read-only", 0, 0, 0),
MakeCmdAttr<CommandXRange>("xrange", -4, "read-only", 1, 1, 1),
MakeCmdAttr<CommandXRevRange>("xrevrange", -2, "read-only", 1, 1, 1),
MakeCmdAttr<CommandXRead>("xread", -4, "read-only", 0, 0, 0),
// MakeCmdAttr<CommandXReadGroup>("xreadgroup", -7, "write", 0, 0, 0),
MakeCmdAttr<CommandXTrim>("xtrim", -4, "write no-dbsize-check", 1, 1, 1),
MakeCmdAttr<CommandXSetId>("xsetid", -3, "write", 1, 1, 1))

} // namespace redis
2 changes: 2 additions & 0 deletions tests/gocase/unit/search/search_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ import (
)

func TestSearch(t *testing.T) {
t.Skip("search commands is disabled")

srv := util.StartServer(t, map[string]string{})
defer srv.Close()

Expand Down
Loading

0 comments on commit c8826e7

Please sign in to comment.