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/09/15 08:13:23 UTC

[GitHub] [shardingsphere] CrackerSuperior opened a new issue #12446: ERROR 1999 (C1999): Unknown exception: [Insert statement does not support sharding table routing to multiple data nodes.]

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


   **The configuration file is as follows:**
   
   schemaName: encrypt_db
   
   dataSources:
    encrypt_0:
      url: jdbc:mysql://172.18.40.129:3306/encrypt?serverTimezone=UTC&useSSL=false
      username: pcloud
      password: pcloud
      connectionTimeoutMilliseconds: 30000
      idleTimeoutMilliseconds: 60000
      maxLifetimeMilliseconds: 1800000
      maxPoolSize: 50
      minPoolSize: 1
    encrypt_1:
      url: jdbc:mysql://172.18.40.131:3306/encrypt?serverTimezone=UTC&useSSL=false
      username: pcloud
      password: pcloud
      connectionTimeoutMilliseconds: 30000
      idleTimeoutMilliseconds: 60000
      maxLifetimeMilliseconds: 1800000
      maxPoolSize: 50
      minPoolSize: 1
    encrypt_2:
      url: jdbc:mysql://172.18.40.164:3306/encrypt?serverTimezone=UTC&useSSL=false
      username: pcloud
      password: pcloud
      connectionTimeoutMilliseconds: 30000
      idleTimeoutMilliseconds: 60000
      maxLifetimeMilliseconds: 1800000
      maxPoolSize: 50
      minPoolSize: 1
   
   rules:
   - !ENCRYPT
    encryptors:
      aes_encryptor:
        type: AES
        props:
          aes-key-value: 123456abc
      md5_encryptor:
        type: MD5
    tables:
      t_encrypt:
        columns:
          user_id:
            plainColumn: user_plain
            cipherColumn: user_cipher
            encryptorName: aes_encryptor
          order_id:
            cipherColumn: order_cipher
            encryptorName: md5_encryptor
   - !SHARDING
    tables:
      t_encrypt:
        actualDataNodes: encrypt_${0..2}.t_encrypt
        keyGenerateStrategy:
          column: order_id
          keyGeneratorName: snowflake
    bindingTables:
      - t_encrypt
    defaultDatabaseStrategy:
      standard:
        shardingColumn: order_id
        shardingAlgorithmName: database_inline
    defaultTableStrategy:
      none:
   
    shardingAlgorithms:
      database_inline:
        type: INLINE
        props:
          algorithm-expression: encrypt_${order_id % 3}
   
    keyGenerators:
      snowflake:
        type: SNOWFLAKE
        props:
          worker-id: 123
   
   
   **The reasons for the error are as follows:**
   
   mysql> show create table t_encrypt;
   +-----------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | Table     | Create Table
   
   
                                 |
   +-----------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | t_encrypt | CREATE TABLE `t_encrypt` (
     `order_cipher` bigint(20) NOT NULL,
     `user_cipher` int(11) NOT NULL,
     `user_plain` int(11) NOT NULL,
     `time` timestamp(6) NULL DEFAULT NULL,
     PRIMARY KEY (`order_cipher`)
   ) ENGINE=InnoDB DEFAULT CHARSET=utf8 |
   +-----------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   1 row in set (0.01 sec)
   
   mysql> insert into t_encrypt(user_id,time) values(1,now(6));
   ERROR 1999 (C1999): Unknown exception: [Insert statement does not support sharding table routing to multiple data nodes.]


-- 
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 #12446: ERROR 1999 (C1999): Unknown exception: [Insert statement does not support sharding table routing to multiple data nodes.]

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


   > > @CrackerSuperior Add sharding columns for insert statement.
   > 
   > Did I write my insert statement wrong?
   
   @CrackerSuperior The defaultDatabaseStrategy that you configured uses orderId to sharding. This rule will be used on the encrypt table (because there is no database strategy on the encrypt table). Then use a statement that does not contain orderId, which will cause the all datebase route.


-- 
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 #12446: ERROR 1999 (C1999): Unknown exception: [Insert statement does not support sharding table routing to multiple data nodes.]

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


   The exception reported by this issue is a reasonable result, so I will close this issue. If you have any questions, please 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 #12446: ERROR 1999 (C1999): Unknown exception: [Insert statement does not support sharding table routing to multiple data nodes.]

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


   @CrackerSuperior You can refer to shardingsphere-example——https://github.com/apache/shardingsphere/tree/master/examples/shardingsphere-jdbc-example.


-- 
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] zjcnb removed a comment on issue #12446: ERROR 1999 (C1999): Unknown exception: [Insert statement does not support sharding table routing to multiple data nodes.]

Posted by GitBox <gi...@apache.org>.
zjcnb removed a comment on issue #12446:
URL: https://github.com/apache/shardingsphere/issues/12446#issuecomment-919842157


   @CrackerSuperior Hi, you can try remove encrypt_1 and encrypt_2. And why configure the same data source.
   


-- 
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] CrackerSuperior commented on issue #12446: ERROR 1999 (C1999): Unknown exception: [Insert statement does not support sharding table routing to multiple data nodes.]

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


   > @CrackerSuperior Add sharding columns for insert statement.
   
   Did I write my insert statement wrong?


-- 
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] CrackerSuperior commented on issue #12446: ERROR 1999 (C1999): Unknown exception: [Insert statement does not support sharding table routing to multiple data nodes.]

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


   > Hi @CrackerSuperior, thank you for your feedback. In order to avoid duplicate data, we have checked the full sharding route. You need to add sharding conditions when executing the insert statement.
   
   So what should I do


-- 
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] CrackerSuperior commented on issue #12446: ERROR 1999 (C1999): Unknown exception: [Insert statement does not support sharding table routing to multiple data nodes.]

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


   > @CrackerSuperior为插入语句添加分片列。
   
   Sorry, I'm a little confused. Can you provide an example?


-- 
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] itwoods commented on issue #12446: ERROR 1999 (C1999): Unknown exception: [Insert statement does not support sharding table routing to multiple data nodes.]

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


   Has the problem been solved?  How do I do that? It looks like it's written the same as the example  


-- 
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] CrackerSuperior commented on issue #12446: ERROR 1999 (C1999): Unknown exception: [Insert statement does not support sharding table routing to multiple data nodes.]

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


   > @CrackerSuperior You can refer to shardingsphere-example——https://github.com/apache/shardingsphere/tree/master/examples/shardingsphere-jdbc-example.
   
   My configuration file is basically the same as the example, except that I have added the repository rules


-- 
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] zjcnb commented on issue #12446: ERROR 1999 (C1999): Unknown exception: [Insert statement does not support sharding table routing to multiple data nodes.]

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


   @CrackerSuperior Hi, you can try remove encrypt_1 and encrypt_2. And why configure the same data source.
   


-- 
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 closed issue #12446: ERROR 1999 (C1999): Unknown exception: [Insert statement does not support sharding table routing to multiple data nodes.]

Posted by GitBox <gi...@apache.org>.
strongduanmu closed issue #12446:
URL: https://github.com/apache/shardingsphere/issues/12446


   


-- 
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 #12446: ERROR 1999 (C1999): Unknown exception: [Insert statement does not support sharding table routing to multiple data nodes.]

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


   Hi @CrackerSuperior, thank you for your feedback. In order to avoid duplicate data, we have checked the full sharding route. You need to add sharding conditions when executing the insert statement.


-- 
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 #12446: ERROR 1999 (C1999): Unknown exception: [Insert statement does not support sharding table routing to multiple data nodes.]

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


   @CrackerSuperior Add sharding columns for insert statement.


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