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

   Changes proposed in this pull request:
     - `FirebirdDateTimeUtils.setDate` decodes the date of DATE and TIMESTAMP 
parameter values as Firebird `NoThrowTimeStamp::decode_date` does: `day = (day 
+ 4) / 4` instead of `(day + 5) / 5`, and January and February move to the next 
year.
     - `FirebirdDateTimeUtils.asTimestamp` converts the fractions of a second 
(units of 1/10000 s) to nanoseconds with `NANOSECONDS_PER_FRACTION`; `getTime` 
returns `LocalTime` with full precision instead of `Timestamp`, which the 
backend driver stores in a TIME column only to milliseconds.
     - DATE, TIME and TIMESTAMP parameter values of `op_execute` and batch 
messages are stored as the client sent them: `2026-10-02 12:34:56.789` is no 
longer stored as `2026-08-20 12:34:56`.
   
   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 and 6.0.6
   
     `T_BQ (ID, TS TIMESTAMP)`: `INSERT` of 7 rows with `TS` `2026-10-02 
12:34:56.789`, `1900-01-01`, `2026-01-15`, `2024-02-29 23:59:59.9999`, 
`1858-11-17 00:00:00.0001`, `9999-12-31 23:59:59.9999` and NULL, `UPDATE ... 
SET TS = ?` (`2025-02-01 06:07:08.9`), `SELECT` with `TS = ?` and `TS < ?`, 
`DELETE ... WHERE TS = ?`. `T_RV (ID, DT DATE, TM TIME)`: the same for DATE and 
TIME. All values are parameters set with `setObject`; then the rows of each 
table are read directly from the server.
   
     Before the fix:
   
     | Query | Proxy | Server | Match |
     |---|---|---|---|
     | `T_BQ`: 7 `INSERT`, `UPDATE`, 2 `SELECT`, `DELETE` | updated 1 each; 
selected 9301 and 9304, 9305 | updated 1 each; selected 9301 and 9304, 9305 | 
yes |
     | `T_BQ` rows read directly from the server | 9301 `2026-08-20 12:34:56`, 
9302 `2024-11-26 06:07:08`, 9303 `2025-11-12 00:00`, 9304 `2023-12-18 
23:59:59`, 9306 `9999-10-31 23:59:59`, 9307 NULL | 9301 `2026-10-02 
12:34:56.789`, 9302 `2025-02-01 06:07:08.9`, 9303 `2026-01-15 00:00`, 9304 
`2024-02-29 23:59:59.9999`, 9306 `9999-12-31 23:59:59.9999`, 9307 NULL | no |
     | `T_RV`: 6 `INSERT`, `UPDATE`, 2 `SELECT`, `DELETE` | updated 1 each; 
selected 9321 and 9323 | updated 1 each; selected 9321 and 9323 | yes |
     | `T_RV` rows read directly from the server | 9321 `2026-08-20 12:34:56`, 
9322 `1999-12-18 13:14:15`, 9323 `2025-11-12 23:59:59`, 9324 `2023-12-18 
00:00`, 9326 NULL NULL | 9321 `2026-10-02 12:34:56.789`, 9322 `2000-02-29 
13:14:15.16`, 9323 `2026-01-15 23:59:59.9999`, 9324 `2024-02-29 00:00:00.0001`, 
9326 NULL NULL | no |
   
     After the fix:
   
     | Query | Proxy | Server | Match |
     |---|---|---|---|
     | `T_BQ`: 7 `INSERT`, `UPDATE`, 2 `SELECT`, `DELETE` | updated 1 each; 
selected 9301 and 9304, 9305 | updated 1 each; selected 9301 and 9304, 9305 | 
yes |
     | `T_BQ` rows read directly from the server | 9301 `2026-10-02 
12:34:56.789`, 9302 `2025-02-01 06:07:08.9`, 9303 `2026-01-15 00:00`, 9304 
`2024-02-29 23:59:59.9999`, 9306 `9999-12-31 23:59:59.9999`, 9307 NULL | 9301 
`2026-10-02 12:34:56.789`, 9302 `2025-02-01 06:07:08.9`, 9303 `2026-01-15 
00:00`, 9304 `2024-02-29 23:59:59.9999`, 9306 `9999-12-31 23:59:59.9999`, 9307 
NULL | yes |
     | `T_RV`: 6 `INSERT`, `UPDATE`, 2 `SELECT`, `DELETE` | updated 1 each; 
selected 9321 and 9323 | updated 1 each; selected 9321 and 9323 | yes |
     | `T_RV` rows read directly from the server | 9321 `2026-10-02 
12:34:56.789`, 9322 `2000-02-29 13:14:15.16`, 9323 `2026-01-15 23:59:59.9999`, 
9324 `2024-02-29 00:00:00.0001`, 9326 NULL NULL | 9321 `2026-10-02 
12:34:56.789`, 9322 `2000-02-29 13:14:15.16`, 9323 `2026-01-15 23:59:59.9999`, 
9324 `2024-02-29 00:00:00.0001`, 9326 NULL NULL | 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]

Reply via email to