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 2021/11/12 09:30:56 UTC

[GitHub] [shardingsphere] CrackerSuperior opened a new issue #13574: Are subqueries not allowed in the "value" in the "insert" statement?

CrackerSuperior opened a new issue #13574:
URL: https://github.com/apache/shardingsphere/issues/13574


   version:
     master
   
   config:
   ``` yaml
   schemaName: zeus
   
   dataSources:
     ds_0:
       url: jdbc:mysql://127.0.0.1:3306/zeustest_0?serverTimezone=UTC&useSSL=false&characterEncoding=utf-8
       username: pcloud
       password: pcloud
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 50
       minPoolSize: 1
     ds_1:
       url: jdbc:mysql://127.0.0.1:3306/zeustest_1?serverTimezone=UTC&useSSL=false&characterEncoding=utf-8
       username: pcloud
       password: pcloud
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 50
       minPoolSize: 1
   
   rules:
     - !SHARDING
       tables:
         cloud_node_service:
           actualDataNodes: ds_${0..1}.cloud_node_service
         cloud_service:
           actualDataNodes: ds_${0..1}.cloud_service
       bindingTables:
         - cloud_node_service,cloud_service
       defaultDatabaseStrategy:
         standard:
           shardingColumn: service_uuid
           shardingAlgorithmName: database_inline_service
       defaultTableStrategy:
         none:
       shardingAlgorithms:
         database_inline_service:
           type: HASH_MOD
           props:
             sharding-count: 2
   ```
   
   error:
   ``` sql
   mysql> insert into cloud_node_service (node_id,service_uuid,version,version_time,metadata) values('teststr',(select service_uuid from cloud_service wher
   e app_name ='powercloud' and service_name = 'vesta_server-basHostProductService'),'1.0',localtimestamp(0),'testtest') ON DUPLICATE KEY UPDATE version_ti
   me = VALUES(version_time);
   ERROR 1997 (C1997): Runtime exception: [org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.subquery.SubqueryExpressionSegment cannot be ca
   st to org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.simple.LiteralExpressionSegment]
   ```


-- 
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 #13574: Are subqueries not allowed in the "value" in the "insert" statement?

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


   @CrackerSuperior Thank you for your feedback, this statement is not supported now. We will consider supporting the execution of this statement in next version.


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