Skip to content

[PECOBLR-530] Fix leak in preparedStatement + fix interpolation in metadata#854

Merged
samikshya-db merged 2 commits into
databricks:mainfrom
samikshya-db:samikshya-chand_data/fixLeak
Jun 23, 2025
Merged

[PECOBLR-530] Fix leak in preparedStatement + fix interpolation in metadata#854
samikshya-db merged 2 commits into
databricks:mainfrom
samikshya-db:samikshya-chand_data/fixLeak

Conversation

@samikshya-db

@samikshya-db samikshya-db commented Jun 20, 2025

Copy link
Copy Markdown
Collaborator

Description

This PR does 2 things :

  1. Closes the describe query statement in preparedStatement (fix the leak)
  2. Fixes the errors when sql does not have parameters defined (Otherwise a parsing error is thrown from the backend). For example Describe select ? fails whereas Describe select '?' passes

Testing

  • The leakage in our driver is fixed after this code change. Verified by using a serverless warehouse I created on dogfood samikshya-test-small-warehouse. The warehouse closes within 5 minutes (which is the timeout I have set too)

Code used :

Connection connection = DriverManager.getConnection(JDBC_URL, USERNAME, PASSWORD);
PreparedStatement preparedStatement = connection.prepareStatement("select 1");
ResultSetMetaData rs= preparedStatement.getMetaData();
Screenshot 2025-06-03 at 9 19 32 PM

Additional Notes to the Reviewer

@samikshya-db

Copy link
Copy Markdown
Collaborator Author

Merging this as we had done the review as part of #847 (This PR got closed as a result of OSS processes.)

@samikshya-db samikshya-db merged commit fdbcfbc into databricks:main Jun 23, 2025
14 of 16 checks passed
@samikshya-db samikshya-db deleted the samikshya-chand_data/fixLeak branch June 23, 2025 19:45
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