thswlsqls opened a new issue, #39096: URL: https://github.com/apache/shardingsphere/issues/39096
## Bug Report ### Which version of ShardingSphere did you use? master @ 620e40a33c3 ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy? Both ### Expected behavior `PrestoFunctionOption.getIfNullFunctionName()` should return the null-coalescing function that Presto/Trino actually provides, namely `COALESCE`. ### Actual behavior It returns `IFNULL`, a function that does not exist in Presto/Trino. The dialect exposes a function name the target database cannot execute. ### Reason analyze (If you can) `PrestoFunctionOption.getIfNullFunctionName()` (`database/connector/dialect/presto/src/main/java/org/apache/shardingsphere/database/connector/presto/metadata/database/option/PrestoFunctionOption.java` line 35-37) returns the `IFNULL` default inherited from PR #38350. Presto/Trino conditional-expression docs list only `COALESCE` for null coalescing; there is no `IFNULL`. The sibling `PostgreSQLFunctionOption.getIfNullFunctionName()` faces the same absence and already returns `COALESCE` (PR #38466), with a committer TODO stating IFNULL-less dialects should map onto `COALESCE`. Presto was left uncorrected. ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc. N/A. The incorrect value is returned directly by the dialect metadata capability; see the reason analysis above. ### Example codes for reproduce this issue (such as a github link). N/A -- 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]
