Skip to content

branch-4.1: [bug](jdbc) fix sqlserver couldn't get schema with higher version driver jar (#63626)#63994

Merged
yiguolei merged 1 commit into
apache:branch-4.1from
zhangstar333:branch-4.1-63626
Jun 2, 2026
Merged

branch-4.1: [bug](jdbc) fix sqlserver couldn't get schema with higher version driver jar (#63626)#63994
yiguolei merged 1 commit into
apache:branch-4.1from
zhangstar333:branch-4.1-63626

Conversation

@zhangstar333
Copy link
Copy Markdown
Contributor

cherry-pick from master (#63626)

…ver jar (apache#63626)

Problem Summary:

https://github.com/microsoft/mssql-jdbc/blob/v13.4.0/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerDatabaseMetaData.java#L1887-L1934
```
SQLServer JDBC catalog lists schemas through DatabaseMetaData.getSchemas(conn.getCatalog(), null). With mssql-jdbc 13.4.x, when catalog is non-empty and schemaPattern is null, the
driver filters built-in schemas such as dbo, guest, sys, INFORMATION_SCHEMA, and db_*. As a result, SHOW DATABASES on a SQLServer JDBC catalog may miss schemas that were visible with
older mssql-jdbc versions.

Now SQLServer-specific override for schema discovery and passes schemaPattern % to getSchemas. % is the JDBC wildcard pattern for matching all schemas, so mssql-jdbc 13.4.x
returns the expected schemas without the driver-side built-in schema filtering. Older mssql-jdbc versions are also compatible with this behavior.
```
@zhangstar333 zhangstar333 requested a review from yiguolei as a code owner June 2, 2026 06:17
@zhangstar333
Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen
Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 0.00% (0/3) 🎉
Increment coverage report
Complete coverage report

@hello-stephen
Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 100.00% (3/3) 🎉
Increment coverage report
Complete coverage report

@hello-stephen
Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 18.75% (3/16) 🎉
Increment coverage report
Complete coverage report

@yiguolei yiguolei merged commit 62d1190 into apache:branch-4.1 Jun 2, 2026
28 of 32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants