You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kvrocks.apache.org by GitBox <gi...@apache.org> on 2022/07/26 13:15:48 UTC

[GitHub] [incubator-kvrocks] git-hulk commented on a diff in pull request #745: Add streams

git-hulk commented on code in PR #745:
URL: https://github.com/apache/incubator-kvrocks/pull/745#discussion_r929950380


##########
src/redis_cmd.cc:
##########
@@ -4730,6 +4735,876 @@ class CommandScript : public Commander {
   std::string subcommand_;
 };
 
+class CommandXAdd : public Commander {
+ public:
+  Status Parse(const std::vector<std::string> &args) override {
+    bool entry_id_found = false;
+    stream_name_ = args[1];
+
+    for (size_t i = 2; i < args.size(); ) {
+      auto val = Util::ToLower(args[i]);
+
+      if (val == "nomkstream" && !entry_id_found) {
+        nomkstream_ = true;
+        ++i;
+        continue;
+      }
+
+      if (val == "maxlen" && !entry_id_found) {
+        std::string max_len_str;
+        bool eq_sign_found = false;
+        if (args[i+1] == "=") {

Review Comment:
   Need to check the length of arguments before `i+1`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org