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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to