You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2021/09/10 08:16:52 UTC

[GitHub] [incubator-doris] yangzhg commented on a change in pull request #6605: [Bug] fix `replace` function bug

yangzhg commented on a change in pull request #6605:
URL: https://github.com/apache/incubator-doris/pull/6605#discussion_r705989065



##########
File path: be/test/exprs/string_functions_test.cpp
##########
@@ -559,6 +559,11 @@ TEST_F(StringFunctionsTest, replace) {
     ASSERT_EQ(StringVal("http://华夏zhongguo:9090"),
               StringFunctions::replace(ctx, StringVal("http://中国hello:9090"),
                                        StringVal("中国hello"), StringVal("华夏zhongguo")));
+
+    //old substring is at the beginning of string
+    ASSERT_EQ(StringVal("ftp://www.baidu.com:9090"),
+              StringFunctions::replace(ctx, StringVal("http://www.baidu.com:9090"),
+                                       StringVal("http"), StringVal("ftp")));

Review comment:
       better add an empty string case




-- 
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