makssent opened a new pull request, #40099:
URL: https://github.com/apache/shardingsphere/pull/40099
Changes proposed in this pull request:
- `FirebirdBlobInfoRegistry` keys BLOB columns by the exact actual table
name, so tables whose names differ only by trailing digits (`T_MD1`, `T_MD2`)
no longer share one entry; `trimToLogicTableName` is removed.
- `FirebirdPrepareStatementCommandExecutor.isBlobColumn` and
`resolveBlobSubtype` map the logical table name to the actual one via
`DataNodeRuleAttribute.findFirstActualTable`, and use the name itself when no
rule knows the table.
- The client receives in `isc_info_sql_sub_type` of `INSERT` parameters
and `SELECT` columns the BLOB subtype of its own table.
Verification:
The same queries were executed directly against a real database and through
the proxy, and the results were compared.
* Server: Firebird 5.0
* Clients: Jaybird 5.0.13
Tables `T_MD1 (ID INTEGER PRIMARY KEY, C BLOB SUB_TYPE TEXT)` and `T_MD2
(ID INTEGER PRIMARY KEY, C BLOB SUB_TYPE BINARY)`; for each table: prepared
`INSERT INTO <table> (ID, C) VALUES (?, ?)` with `setString`, then `SELECT C
FROM <table>`.
Before the fix:
| Query | Proxy | Server | Match |
|---|---|---|---|
| `T_MD1`: `INSERT` parameter `C` type | -4 (`LONGVARBINARY`) | -1
(`LONGVARCHAR`) | no |
| `T_MD1`: `SELECT` column `C` type | -4 `BLOB SUB_TYPE 0` | -1 `BLOB
SUB_TYPE 1` | no |
| `T_MD1`: class of the `C` value | `byte[]` | `String` | no |
| `T_MD2`: `INSERT` parameter `C` type | -4 (`LONGVARBINARY`) | -4
(`LONGVARBINARY`) | yes |
| `T_MD2`: `SELECT` column `C` type | -4 `BLOB SUB_TYPE 0` | -4 `BLOB
SUB_TYPE 0` | yes |
| `T_MD2`: class of the `C` value | `byte[]` | `byte[]` | yes |
After the fix:
| Query | Proxy | Server | Match |
|---|---|---|---|
| `T_MD1`: `INSERT` parameter `C` type | -1 (`LONGVARCHAR`) | -1
(`LONGVARCHAR`) | yes |
| `T_MD1`: `SELECT` column `C` type | -1 `BLOB SUB_TYPE 1` | -1 `BLOB
SUB_TYPE 1` | yes |
| `T_MD1`: class of the `C` value | `String` | `String` | yes |
| `T_MD2`: `INSERT` parameter `C` type | -4 (`LONGVARBINARY`) | -4
(`LONGVARBINARY`) | yes |
| `T_MD2`: `SELECT` column `C` type | -4 `BLOB SUB_TYPE 0` | -4 `BLOB
SUB_TYPE 0` | yes |
| `T_MD2`: class of the `C` value | `byte[]` | `byte[]` | yes |
---
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.
- [ ] I have (or in comment I request) added corresponding labels for the
pull request.
- [ ] I have passed maven check locally : `./mvnw clean install -B -T1C
-Dmaven.javadoc.skip -Dmaven.jacoco.skip -e`.
- [ ] I have made corresponding changes to the documentation.
- [x] I have added corresponding unit tests for my changes.
- [ ] 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/)
- [ ] I have specified the tool and the affected files or area for
substantial AI assistance, as required by the [AI-assisted contribution policy].
[AI-assisted contribution policy]:
https://github.com/apache/shardingsphere/blob/master/AI_POLICY.md
--
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]