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/10/11 08:51:10 UTC

[GitHub] [incubator-doris] tianhui5 opened a new issue #6810: [Bug] String function behaves not identically to the mysql implementation

tianhui5 opened a new issue #6810:
URL: https://github.com/apache/incubator-doris/issues/6810


   ### Search before asking
   
   - [X] I had searched in the [issues](https://github.com/apache/incubator-doris/issues?q=is%3Aissue) and found no similar issues.
   
   
   ### Version
   
   a6e905e
   
   ### What's Wrong?
   
   When I use string function of "left()", it's not entirely identical to MySQL implemention. Because when the input string is empty, the result of function is NULL instand of empty string.
   
   ### What You Expected?
   
   I think the result of function "left(\"\", 5)" should be empty string just like MySQL did.
   
   ### How to Reproduce?
   
   Input query of: `SELECT LEFT("", 10) FROM sample_table;", and make sure `sample_table` is not empty, you can get the result of NULL.
   
   ### Anything Else?
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [X] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
   


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


[GitHub] [incubator-doris] EmmyMiao87 commented on issue #6810: [Bug] String function behaves not identically to the mysql implementation

Posted by GitBox <gi...@apache.org>.
EmmyMiao87 commented on issue #6810:
URL: https://github.com/apache/incubator-doris/issues/6810#issuecomment-940765343


   I realize the behaviors of Doris as following:
   
   ```
   MySQL [ml_test]> select left("", 10) ;
   +--------------+
   | left('', 10) |
   +--------------+
   | NULL         |
   +--------------+
   1 row in set (0.020 sec)
   
   MySQL [ml_test]> select left("", 1) ;
   +-------------+
   | left('', 1) |
   +-------------+
   | NULL        |
   +-------------+
   1 row in set (0.020 sec)
   
   MySQL [ml_test]> select left("a", 1) ;
   +--------------+
   | left('a', 1) |
   +--------------+
   | a            |
   +--------------+
   1 row in set (0.021 sec)
   
   MySQL [ml_test]> select left("a", 2) ;
   +--------------+
   | left('a', 2) |
   +--------------+
   | a            |
   +--------------+
   1 row in set (0.020 sec)
   ```
   
   When number > str len, the original str should be returned


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