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

   ## 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?
   ```
   we find java version: java8, full_version=1.8.0_131
   ShardingSphere-5.1.2-SNAPSHOT
   Commit ID: dirty-1b77c33983198a420e974a302d2a891ca05ae664
   Commit Message: Support openGauss cursor, close, move and fetch statements 
route and rewrite in sharding scenario (#18148)
   Branch: 1b77c33983198a420e974a302d2a891ca05ae664
   Build time: 2022-06-02T15:58:32+0800
   ```
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
    ShardingSphere-Proxy
   ### Expected behavior
   no errors
   ### Actual behavior
   ```
   - everything you need to get the most out of using Atomikos!
   [INFO ] 2022-06-03 16:29:27.677 [main] o.a.s.p.v.ShardingSphereProxyVersion 
- Database name is `PostgreSQL`, version is `9.2.4`, database name is `test`
   [INFO ] 2022-06-03 16:29:27.897 [main] o.a.s.p.frontend.ShardingSphereProxy 
- ShardingSphere-Proxy Memory mode started successfully
   [ERROR] 2022-06-03 16:29:34.161 [Connection-93-ThreadExecutor] 
o.a.s.p.f.c.CommandExecutorTask - Exception occur:
   java.lang.NullPointerException: null
       at 
org.apache.shardingsphere.sharding.rule.ShardingRule.findTableRule(ShardingRule.java:398)
       at 
org.apache.shardingsphere.sharding.rule.ShardingRule.getJoinConditionTables(ShardingRule.java:803)
       at 
org.apache.shardingsphere.sharding.rule.ShardingRule.isJoinConditionContainsShardingColumns(ShardingRule.java:782)
       at 
org.apache.shardingsphere.sharding.rule.ShardingRule.isAllBindingTables(ShardingRule.java:483)
       at 
org.apache.shardingsphere.sharding.route.engine.type.ShardingRouteEngineFactory.getDQLRouteEngineForShardingTable(ShardingRouteEngineFactory.java:202)
       at 
org.apache.shardingsphere.sharding.route.engine.type.ShardingRouteEngineFactory.getDQLRoutingEngine(ShardingRouteEngineFactory.java:196)
       at 
org.apache.shardingsphere.sharding.route.engine.type.ShardingRouteEngineFactory.newInstance(ShardingRouteEngineFactory.java:102)
       at 
org.apache.shardingsphere.sharding.route.engine.ShardingSQLRouter.createRouteContext(ShardingSQLRouter.java:57)
       at 
org.apache.shardingsphere.sharding.route.engine.ShardingSQLRouter.createRouteContext(ShardingSQLRouter.java:45)
       at 
org.apache.shardingsphere.infra.route.engine.impl.PartialSQLRouteExecutor.route(PartialSQLRouteExecutor.java:68)
       at 
org.apache.shardingsphere.infra.route.engine.SQLRouteEngine.route(SQLRouteEngine.java:53)
       at 
org.apache.shardingsphere.infra.context.kernel.KernelProcessor.route(KernelProcessor.java:54)
       at 
org.apache.shardingsphere.infra.context.kernel.KernelProcessor.generateExecutionContext(KernelProcessor.java:46)
       at 
org.apache.shardingsphere.proxy.backend.communication.jdbc.JDBCDatabaseCommunicationEngine.execute(JDBCDatabaseCommunicationEngine.java:124)
       at 
org.apache.shardingsphere.proxy.frontend.postgresql.command.query.extended.JDBCPortal.bind(JDBCPortal.java:131)
       at 
org.apache.shardingsphere.proxy.frontend.postgresql.command.query.extended.bind.PostgreSQLComBindExecutor.execute(PostgreSQLComBindExecutor.java:54)
       at 
org.apache.shardingsphere.proxy.frontend.postgresql.command.query.extended.PostgreSQLAggregatedCommandExecutor.execute(PostgreSQLAggregatedCommandExecutor.java:41)
       at 
org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.executeCommand(CommandExecutorTask.java:106)
       at 
org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.run(CommandExecutorTask.java:76)
       at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
       at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
       at java.lang.Thread.run(Thread.java:748)
   [ERROR] 2022-06-03 16:29:34.197 [Connection-184-ThreadExecutor] 
o.a.s.p.f.c.CommandExecutorTask - Exception occur:
   java.lang.NullPointerException: null
       at 
org.apache.shardingsphere.sharding.rule.ShardingRule.findTableRule(ShardingRule.java:398)
       at 
org.apache.shardingsphere.sharding.rule.ShardingRule.getJoinConditionTables(ShardingRule.java:803)
       at 
org.apache.shardingsphere.sharding.rule.ShardingRule.isJoinConditionContainsShardingColumns(ShardingRule.java:782)
       at 
org.apache.shardingsphere.sharding.rule.ShardingRule.isAllBindingTables(ShardingRule.java:483)
       at 
org.apache.shardingsphere.sharding.route.engine.type.ShardingRouteEngineFactory.getDQLRouteEngineForShardingTable(ShardingRouteEngineFactory.java:202)
       at 
org.apache.shardingsphere.sharding.route.engine.type.ShardingRouteEngineFactory.getDQLRoutingEngine(ShardingRouteEngineFactory.java:196)
       at 
org.apache.shardingsphere.sharding.route.engine.type.ShardingRouteEngineFactory.newInstance(ShardingRouteEngineFactory.java:102)
       at 
org.apache.shardingsphere.sharding.route.engine.ShardingSQLRouter.createRouteContext(ShardingSQLRouter.java:57)
   
   ```
   ### Reason analyze (If you can)
   My test program uses the openGauss postgres library, which contains the 
gaussdb schema by default. At the same time, our username is also gaussdb, 
which will implicitly trigger the search path logic of the underlying database. 
All the test tables were created in the gaussdb schema. During the pressure 
test, SS did not implement the search path function, and the tables were 
searched in the public schema by default, so an exception occurred.
   
   Maybe ShardingSphere currently does not support the search path feature now.
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule 
configuration, when exception occur etc.
   
   #### config-sharding.yaml
   ```
   schemaName: test
   
   dataSources:
     ds_0:
       url: jdbc:postgresql://ip:5555/postgres
       username: gaussdb
       password: 
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 3000
       minPoolSize: 1
   
   
   rules:
     - !SHARDING
       bindingTables:
         - bmsql_warehouse, bmsql_customer
         - bmsql_stock, bmsql_district, bmsql_order_line
       defaultDatabaseStrategy:
         none:
       defaultTableStrategy:
         none:
       keyGenerators:
         snowflake:
           type: SNOWFLAKE
       tables:
         bmsql_config:
           actualDataNodes: ds_0.bmsql_config
   
         bmsql_warehouse:
           actualDataNodes: ds_0.bmsql_warehouse
           databaseStrategy:
             standard:
               shardingColumn: w_id
               shardingAlgorithmName: mod_1
   
         bmsql_district:
           actualDataNodes: ds_0.bmsql_district
           databaseStrategy:
             standard:
               shardingColumn: d_w_id
               shardingAlgorithmName: mod_1
   
         bmsql_customer:
           actualDataNodes: ds_0.bmsql_customer
           databaseStrategy:
             standard:
               shardingColumn: c_w_id
               shardingAlgorithmName: mod_1
   
   ...
   ```
   #### server.yaml
   ```
   rules:
     - !AUTHORITY
       users:
         - root@%:root
       provider:
         type: ALL_PRIVILEGES_PERMITTED
   
   
   props:
   ```
   ### Example codes for reproduce this issue (such as a github link).
   


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