You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "github-actions[bot] (via GitHub)" <gi...@apache.org> on 2023/04/26 04:18:38 UTC

[GitHub] [doris] github-actions[bot] commented on a diff in pull request #19089: [fix](core) fix multi_match_any maybe core down

github-actions[bot] commented on code in PR #19089:
URL: https://github.com/apache/doris/pull/19089#discussion_r1177317090


##########
be/src/vec/functions/functions_multi_string_search.cpp:
##########
@@ -278,13 +285,17 @@
 
             /// zero the result, scan, check, update the offset.
             res[i] = 0;
-            err = hs_scan(
-                    regexps->getDB(),
-                    reinterpret_cast<const char*>(haystack_data.data()) + prev_haystack_offset,
-                    static_cast<unsigned>(cur_haystack_length), 0, smart_scratch.get(), on_match,
-                    &res[i]);
-            if (err != HS_SUCCESS && err != HS_SCAN_TERMINATED)
-                return Status::InternalError("failed to scan with vectorscan");
+            if (cur_haystack_length == 0) {
+                null_map[i] = 1;
+            } else {
+                err = hs_scan(
+                        regexps->getDB(),
+                        reinterpret_cast<const char *>(haystack_data.data()) + prev_haystack_offset,
+                        static_cast<unsigned>(cur_haystack_length), 0, smart_scratch.get(), on_match,
+                        &res[i]);
+                if (err != HS_SUCCESS && err != HS_SCAN_TERMINATED)
+                    return Status::InternalError("failed to scan with vectorscan");

Review Comment:
   warning: statement should be inside braces [readability-braces-around-statements]
   
   ```suggestion
                   if (err != HS_SUCCESS && err != HS_SCAN_TERMINATED) {
                       return Status::InternalError("failed to scan with vectorscan");
   }
   ```
   



##########
be/src/vec/functions/functions_multi_string_search.cpp:
##########
@@ -201,11 +204,15 @@ struct FunctionMultiMatchAnyImpl {
                 return Status::InternalError("too long string to search");
             /// zero the result, scan, check, update the offset.
             res[i] = 0;
-            err = hs_scan(regexps->getDB(),
-                          reinterpret_cast<const char*>(haystack_data.data()) + offset,
-                          static_cast<unsigned>(length), 0, smart_scratch.get(), on_match, &res[i]);
-            if (err != HS_SUCCESS && err != HS_SCAN_TERMINATED)
-                return Status::InternalError("failed to scan with vectorscan");
+            if (length == 0) {
+                null_map[i] = 1;
+            } else {
+                err = hs_scan(regexps->getDB(),
+                              reinterpret_cast<const char *>(haystack_data.data()) + offset,
+                              static_cast<unsigned>(length), 0, smart_scratch.get(), on_match, &res[i]);
+                if (err != HS_SUCCESS && err != HS_SCAN_TERMINATED)
+                    return Status::InternalError("failed to scan with vectorscan");

Review Comment:
   warning: statement should be inside braces [readability-braces-around-statements]
   
   ```suggestion
                   if (err != HS_SUCCESS && err != HS_SCAN_TERMINATED) {
                       return Status::InternalError("failed to scan with vectorscan");
   }
   ```
   



-- 
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: commits-unsubscribe@doris.apache.org

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


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