You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "linhongzhi123 (via GitHub)" <gi...@apache.org> on 2023/09/16 08:44:41 UTC

[GitHub] [shardingsphere] linhongzhi123 opened a new issue, #28450: An error was reported about the fuzzy query statement

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

   ## Question
   
   **For English only**, other languages will not accept.
   
   Before asking a question, make sure you have:
   
   - Googled your question.
   - 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**.
   
   I used shardingSphere5.3.2。An exception occurred when executing the following sql using mybatis in the project
   sql
       @Select("select * from test_user where password like CONCAT('%',#{keyword},'%') ")
   The following exception occurs
   ![image](https://github.com/apache/shardingsphere/assets/56341816/f4e31d26-e879-4c05-a45a-d1639ab899ca)
   
   But I changed the sql to @Select("select * from test_user where password like CONCAT('%','ab','%') ")
   The function can run normally


-- 
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-unsubscribe@shardingsphere.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] linhongzhi123 commented on issue #28450: An error was reported about the fuzzy query statement

Posted by "linhongzhi123 (via GitHub)" <gi...@apache.org>.
linhongzhi123 commented on issue #28450:
URL: https://github.com/apache/shardingsphere/issues/28450#issuecomment-1722640973

   > 
   
   I have modified it according to your prompt, but it doesn't work. Do I need to add other dependencies? Here are my dependencies
   -------------------------
       <parent>
           <groupId>org.springframework.boot</groupId>
           <artifactId>spring-boot-starter-parent</artifactId>
           <version>2.5.7</version>
           <relativePath/> <!-- lookup parent from repository -->
       </parent>
           <dependency>
               <groupId>tk.mybatis</groupId>
               <artifactId>mapper-spring-boot-starter</artifactId>
               <version>4.2.1</version>
           </dependency>
           <dependency>
               <groupId>org.apache.shardingsphere</groupId>
               <artifactId>shardingsphere-jdbc-core</artifactId>
               <version>5.4.0</version>
           </dependency>
           <dependency>
               <artifactId>snakeyaml</artifactId>
               <groupId>org.yaml</groupId>
               <version>1.33</version>
           </dependency>


-- 
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-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] linhongzhi123 commented on issue #28450: An error was reported about the fuzzy query statement

Posted by "linhongzhi123 (via GitHub)" <gi...@apache.org>.
linhongzhi123 commented on issue #28450:
URL: https://github.com/apache/shardingsphere/issues/28450#issuecomment-1722436547

   > @linhongzhi123您能否提供更多信息来帮助我们重现此错误?
   
   This error occurs when I upgrade to 5.4.0
   
   ----------------------------------------------
   2023-09-17 17:33:02.008  WARN 17596 --- [           main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'shiroConfig': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'authService' defined in file [D:\project\台州平安大脑\tz_wg_zx\target\classes\com\codvision\serverboot\service\auth\AuthService.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'authMapper' defined in file [D:\project\台州平安大脑\tz_wg_zx\target\classes\com\codvision\serverboot\dao\AuthMapper.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory'; nested exception i
 s org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [tk/mybatis/mapper/autoconfigure/MapperAutoConfiguration.class]: Unsatisfied dependency expressed through method 'sqlSessionFactory' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [com/codvision/serverboot/config/DataSourceConfig.class]: Invocation of init method failed; nested exception is Cannot create property=rules for JavaBean=org.apache.shardingsphere.driver.api.yaml.YamlJDBCConfiguration@cc5460
    in 'reader', line 1, column 1:
       dataSources:
       ^
   Cannot create property=tables for JavaBean=org.apache.shardingsphere.encrypt.yaml.config.YamlEncryptRuleConfiguration@186374c
    in 'reader', line 9, column 3:
       - !ENCRYPT
         ^
   Cannot create property=columns for JavaBean=org.apache.shardingsphere.encrypt.yaml.config.rule.YamlEncryptTableRuleConfiguration@7bc16b
    in 'reader', line 12, column 7:
             columns:
             ^
   Cannot create property=cipherColumn for JavaBean=org.apache.shardingsphere.encrypt.yaml.config.rule.YamlEncryptColumnRuleConfiguration@6ad6d5
    in 'reader', line 14, column 11:
                 cipherColumn: id_card
                 ^
   Unable to find property 'cipherColumn' on class: org.apache.shardingsphere.encrypt.yaml.config.rule.YamlEncryptColumnRuleConfiguration
    in 'reader', line 14, column 25:
                 cipherColumn: id_card
                               ^
   
    in 'reader', line 13, column 9:
               id_card:
               ^
   
    in 'reader', line 11, column 5:
           test_user:
           ^
   
    in 'reader', line 9, column 1:
       - !ENCRYPT
       ^
   


-- 
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-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] An error was reported about the fuzzy query statement [shardingsphere]

Posted by "terrymanu (via GitHub)" <gi...@apache.org>.
terrymanu closed issue #28450: An error was reported about the fuzzy query statement
URL: https://github.com/apache/shardingsphere/issues/28450


-- 
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-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] linhongzhi123 commented on issue #28450: An error was reported about the fuzzy query statement

Posted by "linhongzhi123 (via GitHub)" <gi...@apache.org>.
linhongzhi123 commented on issue #28450:
URL: https://github.com/apache/shardingsphere/issues/28450#issuecomment-1722439034

   > The encryption API has been changed in version 5.4.0. Please refer to the documentation for modification.
   
   my yml
   ----------------
   ![image](https://github.com/apache/shardingsphere/assets/56341816/b8187d82-a2b9-4c4b-8e3b-323e4a0482f5)
   


-- 
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-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] An error was reported about the fuzzy query statement [shardingsphere]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #28450:
URL: https://github.com/apache/shardingsphere/issues/28450#issuecomment-1769239736

   There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be marked as stale.


-- 
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-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] strongduanmu commented on issue #28450: An error was reported about the fuzzy query statement

Posted by "strongduanmu (via GitHub)" <gi...@apache.org>.
strongduanmu commented on issue #28450:
URL: https://github.com/apache/shardingsphere/issues/28450#issuecomment-1722600179

   > Can the information be reproduced? If not, I can provide you with more information you need
   
   The queryWithCipherColumn has been removed.Everything else looks right.


-- 
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-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] linhongzhi123 commented on issue #28450: An error was reported about the fuzzy query statement

Posted by "linhongzhi123 (via GitHub)" <gi...@apache.org>.
linhongzhi123 commented on issue #28450:
URL: https://github.com/apache/shardingsphere/issues/28450#issuecomment-1722436769

   > @linhongzhi123 Can you provide more information to help us reproduce this bug?
   This error occurs when I upgrade to 5.4.0
   --------------------------------------
   Invocation of init method failed; nested exception is Cannot create property=rules for JavaBean=org.apache.shardingsphere.driver.api.yaml.YamlJDBCConfiguration@cc5460
    in 'reader', line 1, column 1:
       dataSources:
       ^
   Cannot create property=tables for JavaBean=org.apache.shardingsphere.encrypt.yaml.config.YamlEncryptRuleConfiguration@186374c
    in 'reader', line 9, column 3:
       - !ENCRYPT
         ^
   Cannot create property=columns for JavaBean=org.apache.shardingsphere.encrypt.yaml.config.rule.YamlEncryptTableRuleConfiguration@7bc16b
    in 'reader', line 12, column 7:
             columns:
             ^
   Cannot create property=cipherColumn for JavaBean=org.apache.shardingsphere.encrypt.yaml.config.rule.YamlEncryptColumnRuleConfiguration@6ad6d5
    in 'reader', line 14, column 11:
                 cipherColumn: id_card
                 ^
   Unable to find property 'cipherColumn' on class: org.apache.shardingsphere.encrypt.yaml.config.rule.YamlEncryptColumnRuleConfiguration
    in 'reader', line 14, column 25:
                 cipherColumn: id_card
                               ^
   
    in 'reader', line 13, column 9:
               id_card:
               ^
   
    in 'reader', line 11, column 5:
           test_user:
           ^
   
    in 'reader', line 9, column 1:
       - !ENCRYPT
       ^
   


-- 
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-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] linhongzhi123 commented on issue #28450: An error was reported about the fuzzy query statement

Posted by "linhongzhi123 (via GitHub)" <gi...@apache.org>.
linhongzhi123 commented on issue #28450:
URL: https://github.com/apache/shardingsphere/issues/28450#issuecomment-1722988656

   
   The query error is caused by the &stringtype=unspecified parameter following the database connection, but the following exception still occurs during startup
   ![image](https://github.com/apache/shardingsphere/assets/56341816/f955a89b-1745-4f15-a2da-d18d5f59539f)
   


-- 
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-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] strongduanmu commented on issue #28450: An error was reported about the fuzzy query statement

Posted by "strongduanmu (via GitHub)" <gi...@apache.org>.
strongduanmu commented on issue #28450:
URL: https://github.com/apache/shardingsphere/issues/28450#issuecomment-1722437502

   The encryption API has been changed in version 5.4.0. Please refer to the documentation for modification.


-- 
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-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] linhongzhi123 commented on issue #28450: An error was reported about the fuzzy query statement

Posted by "linhongzhi123 (via GitHub)" <gi...@apache.org>.
linhongzhi123 commented on issue #28450:
URL: https://github.com/apache/shardingsphere/issues/28450#issuecomment-1722689871

   > 您能提供一个演示来帮助重现此异常吗?
   After investigation, the reason is that I used Dynamic. During the configuration, the data source with vague encryption was handed over to Dynamic to manage, and the problem occurred when I read yml. My Dynamic configuration is as follows:
   
   @Configuration
   @AutoConfigureAfter({DynamicDataSourceAutoConfiguration.class, SpringBootConfiguration.class})
   public class DataSourceConfig {
   
       public static final String SHARDING_DATA_SOURCE_NAME = "shareen";
       /**
        * 动态数据源配置项
        */
       @Resource
       private DynamicDataSourceProperties dynamicDataSourceProperties;
   
       /**
        * shardingjdbc有四种数据源,需要根据业务注入不同的数据源
        *
        * <p>1. 未使用分片, 脱敏的名称(默认): shardingDataSource;
        * <p>2. 主从数据源: masterSlaveDataSource;
        * <p>3. 脱敏数据源:encryptDataSource;
        * <p>4. 影子数据源:shadowDataSource
        * <p>
        * shardingjdbc默认就是shardingDataSource
        * 如果需要设置其他的可以使用
        *
        * @Resource(value="") 设置
        */
       @Lazy
       @Resource
       DataSource shardingDataSource;
   
       /**
        * 将shardingDataSource放到了多数据源(dataSourceMap)中
        * 注意有个版本的bug,3.1.1版本 不会进入loadDataSources 方法,这样就一直造成数据源注册失败
        */
       @Bean
       public DynamicDataSourceProvider dynamicDataSourceProvider() {
           Map<String, DataSourceProperty> datasourceMap = dynamicDataSourceProperties.getDatasource();
           return new AbstractDataSourceProvider() {
               @SneakyThrows
               @Override
               public Map<String, DataSource> loadDataSources() {
                   File file = new File("src/main/resources/sharding.yml");
                   DataSource dataSource = YamlShardingSphereDataSourceFactory.createDataSource(file);
                   Map<String, DataSource> dataSourceMap = createDataSourceMap(datasourceMap);
                   // 将 shardingjdbc 管理的数据源也交给动态数据源管理
                   dataSourceMap.put(SHARDING_DATA_SOURCE_NAME, dataSource);
                   return dataSourceMap;
               }
           };
       }
   
       /**
        * 将动态数据源设置为首选的
        * 当spring存在多个数据源时, 自动注入的是首选的对象
        * 设置为主要的数据源之后,就可以支持shardingjdbc原生的配置方式了
        *
        * @return
        */
       @Primary
       @Bean
       public DataSource dataSource(DynamicDataSourceProvider dynamicDataSourceProvider) {
           DynamicRoutingDataSource dataSource = new DynamicRoutingDataSource();
           dataSource.setPrimary(dynamicDataSourceProperties.getPrimary());
           dataSource.setStrict(dynamicDataSourceProperties.getStrict());
           dataSource.setStrategy(dynamicDataSourceProperties.getStrategy());
           dataSource.setProvider(dynamicDataSourceProvider);
           dataSource.setP6spy(dynamicDataSourceProperties.getP6spy());
           dataSource.setSeata(dynamicDataSourceProperties.getSeata());
           return dataSource;
       }
   
   
   -----------------------------
    DataSource dataSource = YamlShardingSphereDataSourceFactory.createDataSource(file);
   //There was a problem reading yml here
   
   However, neither encryption nor blurring will work if I do not configure it this way, which is OK in version 5.3.2. If I want to use shardingSphere with Dynamic in version 5.4.0, how should I configure it? Please give me some guidance


-- 
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-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] strongduanmu commented on issue #28450: An error was reported about the fuzzy query statement

Posted by "strongduanmu (via GitHub)" <gi...@apache.org>.
strongduanmu commented on issue #28450:
URL: https://github.com/apache/shardingsphere/issues/28450#issuecomment-1722661733

   Can you provide a demo to help reproduce this exception?


-- 
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-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] linhongzhi123 commented on issue #28450: An error was reported about the fuzzy query statement

Posted by "linhongzhi123 (via GitHub)" <gi...@apache.org>.
linhongzhi123 commented on issue #28450:
URL: https://github.com/apache/shardingsphere/issues/28450#issuecomment-1722851868

   > 您能提供一个演示来帮助重现此异常吗?
   
   ![image](https://github.com/apache/shardingsphere/assets/56341816/80f7aca9-1618-46f9-ad7a-ded7346c148c)
   https://github.com/linhongzhi123/springbootdemo
   
   I changed the api call mode to start normally, but it still has the same problem when fuzzy search as 5.3.2


-- 
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-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] linhongzhi123 commented on issue #28450: An error was reported about the fuzzy query statement

Posted by "linhongzhi123 (via GitHub)" <gi...@apache.org>.
linhongzhi123 commented on issue #28450:
URL: https://github.com/apache/shardingsphere/issues/28450#issuecomment-1722440858

   Can the information be reproduced? If not, I can provide you with more information you need
   


-- 
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-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] linhongzhi123 commented on issue #28450: An error was reported about the fuzzy query statement

Posted by "linhongzhi123 (via GitHub)" <gi...@apache.org>.
linhongzhi123 commented on issue #28450:
URL: https://github.com/apache/shardingsphere/issues/28450#issuecomment-1722751641

   > 您能提供一个演示来帮助重现此异常吗?
   
   https://github.com/linhongzhi123/springbootdemo
   
   
   ---------------------------------
   This is my demo, please help me to have a look


-- 
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-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] linhongzhi123 commented on issue #28450: An error was reported about the fuzzy query statement

Posted by "linhongzhi123 (via GitHub)" <gi...@apache.org>.
linhongzhi123 commented on issue #28450:
URL: https://github.com/apache/shardingsphere/issues/28450#issuecomment-1722438796

   > @linhongzhi123 Can you provide more information to help us reproduce this bug?
   
   Here is my configuration information
   ----------------------------------------
   .properties
   spring.datasource.dynamic.datasource.shareen.url=jdbc:shardingsphere:classpath:sharding.yml
   spring.datasource.dynamic.datasource.shareen.driver-class-name=org.apache.shardingsphere.driver.ShardingSphereDriver
   
   
   --------------------------
   .yml
   dataSources:
     shareen:
       dataSourceClassName: com.zaxxer.hikari.HikariDataSource
       driverClassName: org.postgresql.Driver
       jdbcUrl: jdbc:postgresql://localhost:5432/tz_wg_zx?useUnicode=true&characterEncoding=utf8&autoReconnect=true&stringtype=unspecified
       username: postgres
       password: 123456
   rules:
   - !ENCRYPT
     tables:
       test_user:
         columns:
           id_card:
             cipher:
               name: id_card
               encryptorName: password_encryptor
             likeQuery:
               name: id_card_like
               encryptorName: like_encryptor
         queryWithCipherColumn: true
     encryptors:
       assisted_encryptor:
         type: AES
         props:
           aes-key-value: 123456abc
       like_encryptor:
         type: CHAR_DIGEST_LIKE
       password_encryptor:
         type: AES
         props:
           aes-key-value: 123456abc
   props:
     sql-show: true
   ---------------
   The above error occurs when the configuration is performed according to the 5.4.0 documentation。
   Hope you can answer
   


-- 
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-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] linhongzhi123 commented on issue #28450: An error was reported about the fuzzy query statement

Posted by "linhongzhi123 (via GitHub)" <gi...@apache.org>.
linhongzhi123 commented on issue #28450:
URL: https://github.com/apache/shardingsphere/issues/28450#issuecomment-1722445123

   > 加密 API 在 5.4.0 版本中已更改。请参考文档进行修改。
   I am waiting for your reply


-- 
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-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] strongduanmu commented on issue #28450: An error was reported about the fuzzy query statement

Posted by "strongduanmu (via GitHub)" <gi...@apache.org>.
strongduanmu commented on issue #28450:
URL: https://github.com/apache/shardingsphere/issues/28450#issuecomment-1722435229

   @linhongzhi123 Can you provide more information to help us reproduce this bug?


-- 
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-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] linhongzhi123 commented on issue #28450: An error was reported about the fuzzy query statement

Posted by "linhongzhi123 (via GitHub)" <gi...@apache.org>.
linhongzhi123 commented on issue #28450:
URL: https://github.com/apache/shardingsphere/issues/28450#issuecomment-1722440518

   I checked my configuration file and the format should be correct


-- 
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-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org