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

   ## Summary
   - `IPv4Literal.parseIPv4toLong` silently returned `0L` for invalid input 
(e.g. `'not_an_ip'`), so `ColumnDef.validateDefaultValue` accepted any string 
as an IPv4 default value.
   - Changed the three `return 0L` error paths to `throw AnalysisException`, 
matching the behavior of `IPv6Literal` which already rejects invalid defaults 
at DDL time.
   - Added unit tests covering valid/invalid IPv4 literals and 
`ColumnDef.validateDefaultValue` for `Type.IPV4`.
   
   ## Test plan
   - [x] `IPV4LiteralTest` — 4 tests pass (valid literals, invalid literals, 
validateDefaultValue valid/invalid)
   - [ ] Verify `CREATE TABLE ... (ip IPV4 DEFAULT 'not_an_ip')` is rejected
   - [ ] Verify `CREATE TABLE ... (ip IPV4 DEFAULT '192.168.0.1')` still works


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