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

yiguolei pushed a commit to branch dev-1.1.2
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/dev-1.1.2 by this push:
     new c60ae0f501 [Bug](date function) Return null if date format is invalid 
(#11720)
c60ae0f501 is described below

commit c60ae0f5018843ff6112ff3c054ecc9a71fa31d0
Author: Gabriel <gabrielleeb...@gmail.com>
AuthorDate: Fri Aug 12 14:07:55 2022 +0800

    [Bug](date function) Return null if date format is invalid (#11720)
---
 be/src/vec/runtime/vdatetime_value.cpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/be/src/vec/runtime/vdatetime_value.cpp 
b/be/src/vec/runtime/vdatetime_value.cpp
index fc2a93e6b6..60df6e4205 100644
--- a/be/src/vec/runtime/vdatetime_value.cpp
+++ b/be/src/vec/runtime/vdatetime_value.cpp
@@ -984,7 +984,10 @@ static bool str_to_int64(const char* ptr, const char** 
endptr, int64_t* ret) {
         n_end = end;
     }
     uint64_t value_1 = 0;
-    while (ptr < n_end && isdigit(*ptr)) {
+    while (ptr < n_end) {
+        if (!isdigit(*ptr)) {
+            return false;
+        }
         value_1 *= 10;
         value_1 += *ptr++ - '0';
     }


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

Reply via email to