From 3d651aecf5a3efb917357447e50eff0b5a27c29a Mon Sep 17 00:00:00 2001 From: Roman Gershman Date: Mon, 19 Jun 2023 13:12:48 +0300 Subject: [PATCH] fix: out of bounds typo (#1434) Signed-off-by: Roman Gershman --- src/server/dragonfly_test.cc | 4 ++++ src/server/server_family.cc | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/server/dragonfly_test.cc b/src/server/dragonfly_test.cc index a5a6b7662..47f126552 100644 --- a/src/server/dragonfly_test.cc +++ b/src/server/dragonfly_test.cc @@ -605,6 +605,10 @@ TEST_F(DflyEngineTest, Issue752) { ASSERT_THAT(resp.GetVec(), ElementsAre(IntArg(0), IntArg(0))); } +TEST_F(DflyEngineTest, Latency) { + Run({"latency", "latest"}); +} + // TODO: to test transactions with a single shard since then all transactions become local. // To consider having a parameter in dragonfly engine controlling number of shards // unconditionally from number of cpus. TO TEST BLPOP under multi for single/multi argument case. diff --git a/src/server/server_family.cc b/src/server/server_family.cc index 924c9e2b7..008c7e4f2 100644 --- a/src/server/server_family.cc +++ b/src/server/server_family.cc @@ -2041,7 +2041,7 @@ void ServerFamily::LastSave(CmdArgList args, ConnectionContext* cntx) { void ServerFamily::Latency(CmdArgList args, ConnectionContext* cntx) { ToUpper(&args[0]); - string_view sub_cmd = ArgS(args, 01); + string_view sub_cmd = ArgS(args, 0); if (sub_cmd == "LATEST") { return (*cntx)->SendEmptyArray();