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

   Fixes #39203.
   
   Changes proposed in this pull request:
     - Decode MySQL binary prepared statement numeric parameters using the 
unsigned flag carried by `COM_STMT_EXECUTE`, instead of the `UNSIGNED` flag of 
the target column metadata.
     - Prevent a signed `setInt(-1)` parameter from being decoded as 
`4294967295` before it reaches an `INT UNSIGNED` backend column.
     - Remove `parameterColumnDefinitionFlags` from 
`MySQLServerPreparedStatement`, because target column flags must not determine 
client parameter wire decoding.
     - Keep `parameterColumnTypes` for the existing BLOB handling path, so 
string-family parameters targeting BLOB columns continue to preserve raw bytes.
     - Add signed and unsigned numeric packet coverage using the same `FF FF FF 
FF` payload:
       - client unsigned flag `0x00` decodes to `-1`;
       - client unsigned flag `0x80` decodes to `4294967295L`.
     - Keep regression coverage for `STRING`, `VAR_STRING`, and `VARCHAR` 
parameters targeting `TINYBLOB`, `BLOB`, `MEDIUMBLOB`, and `LONGBLOB` columns.
   
   Manual verification:
     - Verified `INT UNSIGNED <- setInt(-1)` through Proxy now forwards `-1` 
and receives the same `SQLState 22001` out-of-range error as a direct MySQL 
connection.
     - Verified valid unsigned numeric INSERT and UPDATE scenarios through 
Proxy.
     - Verified INSERT and UPDATE byte preservation for `TINYBLOB`, `BLOB`, 
`MEDIUMBLOB`, `LONGBLOB`, `LONG VARBINARY`, `BINARY`, and `VARBINARY`.
   
   ---
   
   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 : `./mvnw clean install -B -T1C 
-Dmaven.javadoc.skip -Dmaven.jacoco.skip -e`.
   - [x] I have made corresponding changes to the documentation. No user 
documentation change is required for this bug fix.
   - [x] I have added corresponding unit tests for my changes.
   - [x] I have updated the Release Notes of the current development version. 
For more details, see [Update Release 
Note](https://shardingsphere.apache.org/community/en/involved/contribute/contributor/).


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