This is an automated email from the ASF dual-hosted git repository.
morningman pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-doris.git
The following commit(s) were added to refs/heads/master by this push:
new 69bd91b [BUG] Tablet is not readable and delete handler report -1903
error, when condition value contains \n (#4531)
69bd91b is described below
commit 69bd91b617268bc5a1d90e1b0819c0557a3acd02
Author: ZhangYu0123 <[email protected]>
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: [email protected]
For additional commands, e-mail: [email protected]