superdiaodiao opened a new pull request, #30196:
URL: https://github.com/apache/doris/pull/30196

   ## Proposed changes
   
   Issue Number: close #xxx
   
   Functions related:
   - inet_aton
   - inet6_aton
   - is_ipv4_compat
   - is_ipv4_mapped
   
   
   
   <!--Describe your changes.-->
   
   Before this PR,  **inet(6)_aton** is an alias of**ipv4(6)_string_to_num** 
like Clickhouse, which will throw an **exception** while handling a **valid IP 
address or NULL** input.
   
   
![image](https://github.com/apache/doris/assets/42577861/ff484eab-4fd6-448d-8879-548adbe2bd92)
   
   
   However, in MySQL, inet(6)_aton prefers to ignore the exception and return 
**NULL**. What's more, two functions, is_ipv4_compat and is_ipv4_mapped in 
MySQL both nest inet6_aton and return NULL as well.
   
   
![image](https://github.com/apache/doris/assets/42577861/11b7b78a-8226-4986-8421-cb67b499c1ad)
   
   
   
   
   In this PR, after Doris Community's discussion, in order to better 
compatible with Clickhouse and MySQL, we switch inet(6)_aton alias origin 
function from ipv4(6)_string_to_num to **ipv4(6)_string_to_num_or_null**.
   
   
![image](https://github.com/apache/doris/assets/42577861/ec0361dc-13e2-4a56-b44a-71d348a69555)
   
   Meanwhile, If users still want to have an **exception** while handling a 
**valid IP address or NULL** input, we suggest you to **directly use 
ipv4(6)_string_to_num**.
   
   ## Further comments
   
   If this is a relatively large or complex change, kick off the discussion at 
[[email protected]](mailto:[email protected]) by explaining why you 
chose the solution you did and what alternatives you considered, etc...
   
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to