jitawangzi commented on issue #21518:
URL: 
https://github.com/apache/shardingsphere/issues/21518#issuecomment-1277076166

   I reproduced the complete test code and running environment, test project 
address:
   https://github.com/jitawangzi/ShardingSphereProxyBlobTest.git
   
   Just run Main directly, and you can see data errors in the output:
   
   ```binary data equals result : false```
   
   The test project also contains all the configuration of ShardingSphere,sql 
of create table,
   
   I have modified the configuration  "config-sharding.yaml"
   
   
   ``` 
   schemaName: test_sharding
   
   dataSources:
     ds_0:
       url: jdbc:mysql://127.0.0.1:51234/test?serverTimezone=UTC&useSSL=false
       username: sharding
       password: sharding
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 50
       minPoolSize: 1
   ```
   
   and "server.yaml"
   
   ``` 
   
   rules:
     - !AUTHORITY
        users:
         - sharding@:sharding
        provider:
         type: ALL_PRIVILEGES_PERMITTED
     - !TRANSACTION
        defaultType: LOCAL
     - !SQL_PARSER
        sqlCommentParseEnabled: true
        sqlStatementCache:
         initialCapacity: 2000
         maximumSize: 65535
        parseTreeCache:
         initialCapacity: 128
         maximumSize: 1024
   
   props:
     max-connections-size-per-query: 3
     kernel-executor-size: 16
     proxy-frontend-flush-threshold: 128
     proxy-opentracing-enabled: false
     proxy-hint-enabled: false
     sql-show: true
     check-table-metadata-enabled: false
     show-process-list-enabled: false
     proxy-backend-query-fetch-size: -1
     check-duplicate-table-enabled: false
     proxy-frontend-executor-size: 0
     proxy-backend-executor-suitable: OLAP
     proxy-frontend-max-connections: 0 
     proxy-mysql-default-version: 8.0.26
   
     ```
   
   
     main test code : 
   
     ``` 
                SpringContextLoader.start("applicationContext.xml");
   
                DataRecord record = new DataRecord();
                byte[] oriArray = new byte[] { 1, 0, 99, 111, 109, 46, 108, 
115, 46, 114, 112, 99, 46, 115, 101, 114, 118, 101, 114, 46, 82,
                                112, 99, 82, 101, 113, 117, 101, 115, -12, 49, 
48, 46, 48, 46, 52, 46, 49, -75, 75, 74, 65, 104, 115, 100, 97, 107, 100,
                                104, 97, 115, 107, -28, 115, 101, 116, 68, 97, 
116, -31, 1, 1, 91, 76, 106, 97, 118, 97, 46, 108, 97, 110, 103, 46, 79,
                                98, 106, 101, 99, 116, -69, 6, 9, -64, -39, 
-86, 20, 3, 115, 100, 104, 98, 115, 97, 104, 100, 98, 115, -31, 1, 2, 99,
                                111, 109, 46, 108, 115, 46, 114, 112, 99, 46, 
115, 101, 114, 118, 101, 114, 46, 82, 112, 99, 82, 101, 115, 112, 111,
                                110, 115, -27, 0, 0, 0, 3, 115, 107, 104, 100, 
98, 115, 107, 100, 117, 104, 97, 108, 100, 115, 106, 102, 100, 107, 106,
                                97, 102, 110, 97, 100, 102, -22, 10, 66, 61, 
-8, -5, 108, 25, 0, 0, 3, 2, 0, 3, 0, 0 };
                record.setBytedata(oriArray);
                record.setUuid(UUID.randomUUID().toString());
                record.setType(3);
   
                DataRecordMapper mapper = 
SpringContextLoader.getContext().getBean(DataRecordMapper.class);
                mapper.insert(record);
                DataRecord recordSelect = 
mapper.selectByPrimaryKey(record.getUuid());
                System.out.println();
                System.out.println("binary data equals result : " + 
Arrays.equals(record.getBytedata(), recordSelect.getBytedata()));
                System.out.println();
                System.out.println("int data equals result : " + 
record.getType().equals(recordSelect.getType()));
     ```
   
     watch output : 
   
   **binary data equals result : false**
   
   int data equals result : true
   
   you can also modify jdbc.properties and connect to mysql directly , 
   ``` #  connect to mysql directly
   
#dburl=jdbc:mysql://39.106.203.93:51234/test?autoReconnect=true&zeroDateTimeBehavior=convertToNull&characterEncoding=UTF-8&serverTimezone=UTC
   ```
   output:
   
   
   **binary data equals result : true**
   
   int data equals result : true


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