RaigorJiang opened a new pull request, #40322: URL: https://github.com/apache/shardingsphere/pull/40322
## Problem MySQL TIME values can lose fractional seconds when JDBC retrieval materializes them as `java.sql.Time` before they reach the result merger and protocol encoder. Fixing serialization alone cannot recover precision already lost during retrieval. Connector/J can also report a zero scale for fractional TIME columns. Passing that metadata through unchanged produces an incorrect fractional precision in the runtime response header. ## Changes - Retrieve TIME values as `LocalTime` in the existing streaming and memory-loading paths to preserve fractional seconds. - Retain legacy `getTime` compatibility when typed retrieval throws `SQLFeatureNotSupportedException`. Remember successfully observed unsupported capabilities per result set and column to avoid repeated exceptions. - Preserve existing JDBC `Time` return shapes and Calcite's `java.sql.Time` row contract at their boundaries. - Preserve generic non-TIME `LocalTime` behavior, including String representation, assignable-interface identity, primitive boolean conversion, and unsupported-conversion SQLException behavior. - Encode fractional seconds in MySQL binary TIME results while retaining the existing legacy `Time` path. - Recover missing runtime TIME precision from the verified Connector/J display width, and use the binary character set for TIME response metadata. - Adapt existing PostgreSQL and Firebird serializers to the precise internal representation while retaining their legacy representations and wire units. - Extract private helpers for Proxy getter-type selection and Calcite TIME adaptation, keeping one value read per column. ## Validation - Relevant owner unit suites: **4,334 tests passed**, with no failures or errors. The latest executor/JDBC rerun accounts for **1,578** of these tests. - Affected consumer regression tests: **82 passed**. - Native Checkstyle and Spotless checks passed for all **25 changed Java files**, using exact file filters. - Rebuilt the Proxy distribution with Connector/J 8.4.0 installed in `ext-lib`. Verified that the 11 distributed production classes and the separately packaged optional executor class match the current compiled artifacts. - Compared direct MySQL and Proxy results using Go and JDBC across four backend configurations: **592 Go observations** and **45,360 JDBC observations**. The ordinary TIME precision and runtime metadata assertions passed, with no new or changed residual differences. - Compared baseline and current behavior through an actual two-storage H2 memory-merge/JDBC path. Generic `JAVA_OBJECT` strings, interface identities, boolean conversion, and failed-cast SQLException behavior remained unchanged. ## Scope This PR covers ordinary within-day TIME precision, with regression coverage for `TIME(0/3/6)` and existing shared consumers. Negative and at-least-24-hour TIME durations remain TODO. Fixed-width fractional text formatting, PREPARE precision metadata, declared column-precision loading and propagation, and further DATETIME/TIMESTAMP work remain separate follow-up tasks. -- 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]
