wangleizone opened a new issue, #24337:
URL: https://github.com/apache/shardingsphere/issues/24337

   ## Bug Report
   
   **For English only**, other languages will not accept.
   
   Before report a bug, make sure you have:
   
   - Searched open and closed [GitHub 
issues](https://github.com/apache/shardingsphere/issues).
   - Read documentation: [ShardingSphere 
Doc](https://shardingsphere.apache.org/document/current/en/overview).
   
   Please pay attention on issues you submitted, because we maybe need more 
details. 
   If no response anymore and we cannot reproduce it on current information, we 
will **close it**.
   
   Please answer these questions before submitting your issue. Thanks!
   
   ### Which version of ShardingSphere did you use?
   5.3.0
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   ShardingSphere-JDBC
   
   ### Expected behavior
   I am using the new feature in version 5.3.0, which allows encryption on a 
column for a LIKE fuzzy search. I am also using the CHAR_DIGEST_LIKE algorithm 
to generate the likeQueryColumn.
   
   But when I execute the following SQL for a fuzzy search, it throws an 
exception.
   
   ` select
           *
           from sla_user_service_recorde
           where user_name like CONCAT('%', #{userName}, '%')`
   
   Cause: java.sql.SQLException: Unknown exception: null
   ; uncategorized SQLException; SQL state [HY000]; error code [30000]; Unknown 
exception: null; nested exception is java.sql.SQLException: Unknown exception: 
null
        at 
org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:89)
   
   Caused by: java.sql.SQLException: Unknown exception: null
        at 
org.apache.shardingsphere.infra.util.exception.external.sql.ShardingSphereSQLException.toSQLException(ShardingSphereSQLException.java:62)
   
   I tried to remove the 'concat' function from the SQL statement and passed 
'%' as a part of the string parameter, and the query worked normally.
   ` select
         *
           from sla_user_service_recorde
           where user_name like #{userName} `
   
   
   ### Reason analyze (If you can)
   And I found that when using the '=' operator in the SQL query, the 'concat' 
function can be used normally. It is only when using the 'like' operator with 
the 'concat' function that an exception is thrown. I suspect this is a bug 
introduced in the new 5.3.0 version.
   


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

Reply via email to