zihaoAK47 opened a new issue, #31899: URL: https://github.com/apache/shardingsphere/issues/31899
# Background Hi Community, Federated queries help users perform cross-database join queries, subqueries, and aggregate queries. Currently, we plan to enhance MySQL functions in the federated query environment to support more SQL execution scenarios in federated query contexts. For more details, please refer to: [Apache ShardingSphere Documentation on SQL Federation](https://shardingsphere.apache.org/document/current/cn/features/sql-federation/). Function document: https://dev.mysql.com/doc/refman/8.4/en/string-functions.html#function_locate # Task - [ ] `SELECT LOCATE(x'64', _utf8mb4'abcdef');` Run log: ``` expected: +-----------------------------------+ | LOCATE(x'64', _utf8mb4'abcdef') | +===================================+ | 4 | +-----------------------------------+ actual: SQL federation does not support SQL 'SELECT LOCATE(x'64', _utf8mb4'abcdef');\n'.\nMore details: Unsupported SQL operation: unsupported CommonExpressionSegment. ``` - [ ] `select locate("a","b",2),locate("","a",1);` Run log: ``` expected: +---------------------+--------------------+ | locate("a","b",2) | locate("","a",1) | +=====================+====================+ | 0 | 1 | +---------------------+--------------------+ actual: SQL federation does not support SQL \'select locate("a","b",2),locate("","a",1);\n\'.\nMore details: At line 0, column 0: No match found for function signature locate(<CHARACTER>, <CHARACTER>, <NUMERIC>) ``` - [ ] `select locate('he','hello',-2);` Run log: ``` expected: +---------------------------+ | locate('he','hello',-2) | +===========================+ | 0 | +---------------------------+ actual: SQL federation does not support SQL 'select locate('he','hello',-2);\n'.\nMore details: At line 0, column 0: No match found for function signature locate(<CHARACTER>, <CHARACTER>, <NUMERIC>) ``` - [ ] `select locate('he','hello'),locate('he','hello',2),locate('lo','hello',2) ;` Run log: ``` expected: +------------------------+--------------------------+--------------------------+ | locate('he','hello') | locate('he','hello',2) | locate('lo','hello',2) | +========================+==========================+==========================+ | 1 | 0 | 4 | +------------------------+--------------------------+--------------------------+ actual: SQL federation does not support SQL 'select locate('he','hello'),locate('he','hello',2),locate('lo','hello',2) ;\n'.\nMore details: At line 0, column 0: No match found for function signature locate(<CHARACTER>, <CHARACTER>) ``` -- 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: notifications-unsubscr...@shardingsphere.apache.org.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org