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 2022/04/01 09:07:38 UTC

[GitHub] [shardingsphere] azexcy opened a new issue #16548: the comment statement can't work in ShardingSphere-Proxy

azexcy opened a new issue #16548:
URL: https://github.com/apache/shardingsphere/issues/16548


   ## Bug Report
   
   ### Which version of ShardingSphere did you use?
   
   5.1.1
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   
   ShardingSphere-Proxy
   
   ### Expected behavior
   
   after create table by  ShardingSphere-Proxy, then i want to add the comment on t_order; it's execute ok on DataGrip or Navicat
   
   ```sql
   ##  i replace the actual table name  to logic table name
   COMMENT ON TABLE "t_order_0" IS 'Test table comment';
   ```
   <img width="767" alt="image" src="https://user-images.githubusercontent.com/101622833/161228933-35043c1f-35c0-4a58-92f2-f46f65b80f04.png">
   
   
   same problem with the sql
   ```sql
   ## same problem 
   COMMENT ON COLUMN "t_order_0"."user_id" IS 'id of user';
   ```
   
   ### Actual behavior
   
   execute this sql  in ShardingSphere-Proxy 
   
   ```
   sharding_db=> COMMENT ON TABLE "t_order" IS 'Test table comment';
   ERROR:  You have an error in your SQL syntax
   sharding_db=>
   ```
   
   ### Reason analyze (If you can)
   
   i find the problem is at `PostgreSQLParser.parse()` 
   
   <img width="1117" alt="image" src="https://user-images.githubusercontent.com/101622833/161229940-968dfd4a-3d1a-43df-a43a-d9cc74ed54e1.png">
   
   final the exception is happened  at  `PostgreSQLStatementParser` 
   
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
   Prepare operation:
   1. config yaml (use postgreSQL)
   ```xml
   schemaName: sharding_db
   
   dataSources:
     ds_0:
       url: jdbc:postgresql://127.0.0.1:5432/ds_0
       username: postgres
       password: postgres
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 5
       minPoolSize: 1
     ds_1:
       url: jdbc:postgresql://127.0.0.1:5432/ds_1
       username: postgres
       password: postgres
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 5
       minPoolSize: 1
   
   rules:
   - !SHARDING
     tables:
       t_order:
         actualDataNodes: ds_${0..1}.t_order_${0..1}
         tableStrategy:
           standard:
             shardingColumn: order_id
             shardingAlgorithmName: t_order_inline
         keyGenerateStrategy:
             column: order_id
             keyGeneratorName: snowflake
     defaultDatabaseStrategy:
       standard:
         shardingColumn: user_id
         shardingAlgorithmName: database_inline
     defaultTableStrategy:
       none:
   
     shardingAlgorithms:
       database_inline:
         type: INLINE
         props:
           algorithm-expression: ds_${user_id % 2}
       t_order_inline:
         type: INLINE
         props:
           algorithm-expression: t_order_${order_id % 2}
   
     keyGenerators:
       snowflake:
         type: SNOWFLAKE
   ```
   
   2. create table by ShardingSphere-Proxy
   
   ```sql
   CREATE TABLE t_order (
     order_id bigint NOT NULL,
     user_id int NOT NULL,
     status varchar(50) DEFAULT NULL,
     PRIMARY KEY (order_id)
   ) ;
   ```
   
   
   ### 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: notifications-unsubscribe@shardingsphere.apache.org

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



[GitHub] [shardingsphere] tuichenchuxin commented on issue #16548: the comment statement can't work in ShardingSphere-Proxy

Posted by GitBox <gi...@apache.org>.
tuichenchuxin commented on issue #16548:
URL: https://github.com/apache/shardingsphere/issues/16548#issuecomment-1086575900


   Sure, I'll check it.


-- 
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 #16548: the comment statement can't work in ShardingSphere-Proxy

Posted by GitBox <gi...@apache.org>.
strongduanmu commented on issue #16548:
URL: https://github.com/apache/shardingsphere/issues/16548#issuecomment-1086575336


   @tuichenchuxin Can you help check this issue?


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