suxiaogang223 opened a new pull request, #68321:
URL: https://github.com/apache/doris/pull/68321
### What problem does this PR solve?
JDBC Catalog currently decides whether a MySQL-compatible endpoint is Doris
by parsing `version_comment`. That value is display text and may change with
product branding or packaging. When the expected marker is absent, the endpoint
is treated as MySQL and Doris-specific types can be mapped incorrectly.
This change exposes a stable, read-only `doris_server_identity` session
variable with the value `apache_doris`. Both JDBC client implementations probe
this variable first and use exact identity matching. If the remote endpoint
does not expose the variable, they fall back to the existing `version_comment`
detection so older endpoints remain compatible.
The compatibility adjustment for existing enterprise version comments
remains a separate commit, allowing it to be reviewed or applied independently.
### Release note
Use a stable server identity when detecting Doris JDBC endpoints, with
backward-compatible fallback for older endpoints.
### Check List (For Author)
- Test: Unit Test
- `./run-fe-ut.sh --run
org.apache.doris.datasource.jdbc.client.JdbcMySQLClientTest,org.apache.doris.connector.jdbc.client.JdbcMySQLConnectorClientTest`
- Both test classes passed: 4 tests total, 0 failures, 0 errors, 0
skipped
- FE build, checkstyle, and metadata funnel checks passed as part of the
test command
- Behavior changed: Yes. JDBC Catalog prefers the stable server identity and
falls back to the existing version comment probe when the identity variable is
unavailable.
- Does this need documentation: No
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]