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

   shardingsphere-jdbc-core 5.4.1 and spring boot version 3.1.9,orm use jpa.
   i test like_encryptor on table t_account and column is mobile,I have 
inserted a piece of data into the t-account table , 
   
![1711610536044](https://github.com/apache/shardingsphere/assets/165254070/dd203143-db49-4bab-a6f5-3b058c50d709)
   sharding.yml as follows:
             mobile:
               name: mobile_ming #实际物理列名 明文列
               cipher:
                 name: mobile_cipher # 密文列名称
                 encryptorName: aes_encryptor # 密文列加密算法名称
               assistedQuery:
                 name: assisted_query_mobile #辅助查询列的名称
                 encryptorName: md5_encryptor #辅助查询列的算法名称
               likeQuery:
                 name: mobile_like #模糊查询列名称
                 encryptorName: like_encryptor #模糊查询算法名称
   
   
    sql method as follows:
     @Query("select u from AccountEntity u where u.mobile LIKE  %?1%")
     List<AccountEntity> findByMobileLike(String mobile);
   When I use the mobile field to perform a like query, an error is reported as 
follows:
   Caused by: java.sql.SQLException: Parameter index out of range (1 > number 
of parameters, which is 0).
   
   Logic SQL: select 
a1_0.account_id,a1_0.create_date,a1_0.create_from,a1_0.email,a1_0.last_login_channel,a1_0.last_login_date,a1_0.last_update_date,a1_0.mobile,a1_0.org_id,a1_0.password,a1_0.reject_reason,a1_0.status,a1_0.user_level,a1_0.username
 from t_account a1_0 where a1_0.mobile like replace(?,'\\','\\\\')
   2024-03-28T15:15:10.287+08:00  INFO 8940 --- [nio-9521-exec-4] 
ShardingSphere-SQL                       : Actual SQL: ds_0 ::: select 
a1_0.account_id,a1_0.create_date,a1_0.create_from,a1_0.email,a1_0.last_login_channel,a1_0.last_login_date,a1_0.last_update_date,a1_0.mobile_cipher
 AS mobile,a1_0.org_id,a1_0.password_cipher AS 
password,a1_0.reject_reason,a1_0.status,a1_0.user_level,a1_0.username from 
t_account a1_0 where a1_0.mobile_like like replace) ::: [%1598226%]
   


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