You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2019/10/31 08:27:17 UTC

[GitHub] [incubator-shardingsphere] zcqshine opened a new issue #3424: Sharding-JDBC 4.0.0-RC2 not support '~' Operator of PostgreSQL

zcqshine opened a new issue #3424: Sharding-JDBC 4.0.0-RC2 not support '~' Operator of PostgreSQL  
URL: https://github.com/apache/incubator-shardingsphere/issues/3424
 
 
   ## Bug Report
   
   ### Which version of ShardingSphere did you use?
   4.0.0-RC2  4.0.0-RC3
   
   ### Which project did you use? Sharding-JDBC or Sharding-Proxy?
   Sharding-JDBC
   ### Expected behavior
   ```
    org.apache.shardingsphere.core.exception.ShardingException: Cannot support multiple schemas in one SQL
   	at org.apache.shardingsphere.core.optimize.api.segment.Tables.setSchema(Tables.java:61)
   	at org.apache.shardingsphere.core.optimize.api.segment.Tables.<init>(Tables.java:53)
   	at org.apache.shardingsphere.core.optimize.sharding.segment.condition.engine.WhereClauseShardingConditionEngine.createShardingConditions(WhereClauseShardingConditionEngine.java:76)
   	at org.apache.shardingsphere.core.optimize.sharding.engnie.dml.ShardingSelectOptimizeEngine.optimize(ShardingSelectOptimizeEngine.java:58)
   	at org.apache.shardingsphere.core.optimize.sharding.engnie.dml.ShardingSelectOptimizeEngine.optimize(ShardingSelectOptimizeEngine.java:47)
   	at org.apache.shardingsphere.core.route.router.sharding.ParsingSQLRouter.route(ParsingSQLRouter.java:72)
   	at org.apache.shardingsphere.core.route.PreparedStatementRoutingEngine.route(PreparedStatementRoutingEngine.java:66)
   	at org.apache.shardingsphere.core.PreparedQueryShardingEngine.route(PreparedQueryShardingEngine.java:60)
   	at org.apache.shardingsphere.core.BaseShardingEngine.executeRoute(BaseShardingEngine.java:86)
   	at org.apache.shardingsphere.core.BaseShardingEngine.shard(BaseShardingEngine.java:70)
   	at org.apache.shardingsphere.shardingjdbc.jdbc.core.statement.ShardingPreparedStatement.shard(ShardingPreparedStatement.java:224)
   	at org.apache.shardingsphere.shardingjdbc.jdbc.core.statement.ShardingPreparedStatement.execute(ShardingPreparedStatement.java:170)
   ```
   ### SQL
   
   ```SQL
    select count(1)
    from (
             select h.id, p.id, o.id
             from t_household h,
                  t_project p,
                  t_sys_org o
             where h.project_id = p.id
               and o.id = p.gov_org_id
               and o.parent_ids ~ (',1087190707023683585,')
             order by o.id) as total
   ```
   
   ### Reason analyze (If you can)
   If I replace `~` with `LIKE`,  is ok. 
   In `Tables` class, the program treats alias as schema:` h.id, p.id, o.id` 
   
   
   
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services