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/11/03 05:40:55 UTC

[GitHub] [shardingsphere] yoloz opened a new pull request, #21922: support MySQLComQuery Blob

yoloz opened a new pull request, #21922:
URL: https://github.com/apache/shardingsphere/pull/21922

   Fixes #21627 #3024 #21518.
   
   Changes proposed in this pull request:
     - revert stream bytes;
     - position of blob are replaced by parameter;
   
   
   ---
   
   Before committing this PR, I'm sure that I have checked the following options:
   - [ x] My code follows the [code of conduct](https://shardingsphere.apache.org/community/en/involved/conduct/code/) of this project.
   - [ x] I have self-reviewed the commit code.
   - [ x] I have (or in comment I request) added corresponding labels for the pull request.
   - [ x] I have passed maven check locally : `mvn clean install -B -T2C -DskipTests -Dmaven.javadoc.skip=true -e`.
   - [ ] I have made corresponding changes to the documentation.
   - [ ] I have added corresponding unit tests for my changes.
   


-- 
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] TeslaCN commented on pull request #21922: support MySQLComQuery Blob

Posted by GitBox <gi...@apache.org>.
TeslaCN commented on PR #21922:
URL: https://github.com/apache/shardingsphere/pull/21922#issuecomment-1301716358

   > > If this is a SQL, we should send it directly instead of extracting values from it. Maybe we need to figure out why the SQL cannot be sent to database directly.
   > 
   > yeah, i think direct read by packet.charset to string will lost some thing, also i found from `mysql server`, limit by my poor `c` and time ,no more thing get
   
   You may try enabling `sql-show` and check whether the SQL is rewrote correctly. We have met some issues about blob before. Such as https://github.com/apache/shardingsphere/issues/17892


-- 
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] TeslaCN commented on pull request #21922: support MySQLComQuery Blob

Posted by GitBox <gi...@apache.org>.
TeslaCN commented on PR #21922:
URL: https://github.com/apache/shardingsphere/pull/21922#issuecomment-1311162033

   We need to figure out the root cause of blob problem. I'm closing this for now.


-- 
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] TeslaCN commented on pull request #21922: support MySQLComQuery Blob

Posted by GitBox <gi...@apache.org>.
TeslaCN commented on PR #21922:
URL: https://github.com/apache/shardingsphere/pull/21922#issuecomment-1301710232

   If this is a SQL, we should send it directly instead of extracting values from it. Maybe what we need to figure out is why the SQL cannot be sent to database directly.


-- 
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] yoloz commented on pull request #21922: support MySQLComQuery Blob

Posted by GitBox <gi...@apache.org>.
yoloz commented on PR #21922:
URL: https://github.com/apache/shardingsphere/pull/21922#issuecomment-1301723730

   > > > If this is a SQL, we should send it directly instead of extracting values from it. Maybe we need to figure out why the SQL cannot be sent to database directly.
   > > 
   > > 
   > > yeah, i think direct read by packet.charset to string will lost some thing, also i found from `mysql server`, limit by my poor `c` and time ,no more thing get
   > 
   > You may try enabling `sql-show` and check whether the SQL is rewrote correctly. We have met some issues about blob before. Such as #17892
   
   ok, i try it again, at #21922  i have checked sql


-- 
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] TeslaCN closed pull request #21922: support MySQLComQuery Blob

Posted by GitBox <gi...@apache.org>.
TeslaCN closed pull request #21922: support MySQLComQuery Blob
URL: https://github.com/apache/shardingsphere/pull/21922


-- 
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] yoloz commented on pull request #21922: support MySQLComQuery Blob

Posted by GitBox <gi...@apache.org>.
yoloz commented on PR #21922:
URL: https://github.com/apache/shardingsphere/pull/21922#issuecomment-1301712091

   > If this is a SQL, we should send it directly instead of extracting values from it. Maybe we need to figure out why the SQL cannot be sent to database directly.
   
   yeah, i think direct read by packet.charset to string will lost some thing


-- 
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] yoloz commented on pull request #21922: support MySQLComQuery Blob

Posted by GitBox <gi...@apache.org>.
yoloz commented on PR #21922:
URL: https://github.com/apache/shardingsphere/pull/21922#issuecomment-1301703670

   Hi @TeslaCN 
   java-connector will append blob(stream) and bytes  in sql to send, which you can see [https://github.com/mysql/mysql-connector-j/blob/release/8.0/src/main/user-impl/java/com/mysql/cj/jdbc/ClientPreparedStatement.java](https://github.com/mysql/mysql-connector-j/blob/release/8.0/src/main/user-impl/java/com/mysql/cj/jdbc/ClientPreparedStatement.java) 1047行:
   ` Message sendPacket = ((PreparedQuery<?>) this.query).fillSendPacket(bindings);`
   ```java
    for (int i = 0; i < bindValues.length; i++) {
                   bindings.checkParameterSet(i);
   
                   sendPacket.writeBytes(StringLengthDataType.STRING_FIXED, staticSqlStrings[i]);
   
                   if (bindValues[i].isStream()) {
                       streamToBytes(sendPacket, bindValues[i].getStreamValue(), true, bindValues[i].getStreamLength(), useStreamLengths);
                   } else {
                       sendPacket.writeBytes(StringLengthDataType.STRING_FIXED, bindValues[i].getByteValue());
                   }
               }
   ```
   if use hex, begin with `x`, default `type bytes` use this, while no other set , `type blob` default use escape ,begin with `_binary` and:
   * `0` to `\0` , can see ascii ;
   * `\` and "`"  to double;


-- 
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] yoloz commented on pull request #21922: support MySQLComQuery Blob

Posted by GitBox <gi...@apache.org>.
yoloz commented on PR #21922:
URL: https://github.com/apache/shardingsphere/pull/21922#issuecomment-1312327157

   > We need to figure out the root cause of blob problem. I'm closing this for now.
   
   👌


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