Skip to content

fix(bqjdbc): only create Statement object when necessary in BDMetaData#12752

Open
Neenu1995 wants to merge 2 commits intomainfrom
ns/dbmetadata-fix
Open

fix(bqjdbc): only create Statement object when necessary in BDMetaData#12752
Neenu1995 wants to merge 2 commits intomainfrom
ns/dbmetadata-fix

Conversation

@Neenu1995
Copy link
Copy Markdown
Contributor

@Neenu1995 Neenu1995 commented Apr 10, 2026

b/501419313

Remove pre-emptive BigQueryStatement object creation in BigQueryDatabaseMetData constructor.

@Neenu1995 Neenu1995 requested review from a team as code owners April 10, 2026 16:25
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors BigQueryDatabaseMetaData by removing the shared BigQueryStatement member and updating various metadata methods to either pass null to BigQueryJsonResultSet or use local statements. A critical issue was identified in getPrimaryKeys, getImportedKeys, and getExportedKeys, where the use of try-with-resources causes the Statement and its associated ResultSet to be closed before the caller can use them. It is recommended to use stmt.closeOnCompletion() to ensure the statement remains open until the result set is processed.

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.

1 participant