You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by mo...@apache.org on 2020/09/07 02:05:57 UTC

[incubator-doris] 02/04: [BUG] Tablet is not readable and delete handler report -1903 error, when condition value contains \n (#4531)

This is an automated email from the ASF dual-hosted git repository.

morningman pushed a commit to branch branch-0.13
in repository https://gitbox.apache.org/repos/asf/incubator-doris.git

commit af3ff75ea71ab926175ff5df6598ef5c47f2c207
Author: ZhangYu0123 <67...@users.noreply.github.com>
AuthorDate: Sun Sep 6 20:29:44 2020 +0800

    [BUG] Tablet is not readable and delete handler report -1903 error, when condition value contains \n (#4531)
---
 be/src/olap/delete_handler.cpp | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/be/src/olap/delete_handler.cpp b/be/src/olap/delete_handler.cpp
index ed6da56..a58b3e4 100644
--- a/be/src/olap/delete_handler.cpp
+++ b/be/src/olap/delete_handler.cpp
@@ -197,9 +197,13 @@ bool DeleteHandler::_parse_condition(const std::string& condition_str, TConditio
     smatch what;
 
     try {
-        // Condition string format
+        // Condition string format, the format is (column_name)(op)(value) 
+        // eg:  condition_str="c1 = 1597751948193618247  and length(source)<1;\n;\n"
+        //  group1:  (\w+) matchs "c1"
+        //  group2:  ((?:=)|(?:!=)|(?:>>)|(?:<<)|(?:>=)|(?:<=)|(?:\*=)|(?:IS)) matchs  "="
+        //  group3:  ((?:[\s\S]+)?) matchs "1597751948193618247  and length(source)<1;\n;\n"
         const char* const CONDITION_STR_PATTERN =
-                R"((\w+)\s*((?:=)|(?:!=)|(?:>>)|(?:<<)|(?:>=)|(?:<=)|(?:\*=)|(?:IS))\s*((?:[\S ]+)?))";
+                R"((\w+)\s*((?:=)|(?:!=)|(?:>>)|(?:<<)|(?:>=)|(?:<=)|(?:\*=)|(?:IS))\s*((?:[\s\S]+)?))";
         regex ex(CONDITION_STR_PATTERN);
         if (regex_match(condition_str, what, ex)) {
             if (condition_str.size() != what[0].str().size()) {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org