1fanwang opened a new pull request, #5290:
URL: https://github.com/apache/calcite/pull/5290

   ## Jira Link
   
   Calcite requires the PR title and commit subject to match the Jira summary.
   
   [CALCITE-5121](https://issues.apache.org/jira/browse/CALCITE-5121)
   
   ## Changes Proposed
   
   A JDBC schema created from connection properties can fail during connection 
initialization. Today that failure escapes as a `RuntimeException`, even though 
`DriverManager.getConnection` callers expect `SQLException` for connection 
errors.
   
   This wraps runtime failures from model initialization in `SQLException`, 
matching the existing `IOException` path and the JDBC contract. The regression 
test drives the real `DriverManager.getConnection` path with an invalid JDBC 
schema URL.
   
   ## Testing
   
   Before the fix, the new test failed with `Unexpected exception type thrown, 
expected: <java.sql.SQLException> but was: <java.lang.RuntimeException>`.
   
   After the fix:
   
   ```text
   ./gradlew --no-daemon --parallel --max-workers=6 :core:test --tests 
org.apache.calcite.test.JdbcTest.testJdbcSchemaDirectConnectionInitWrapsRuntimeException
   BUILD SUCCESSFUL in 18s
   ```
   
   Surrounding checks:
   
   ```text
   ./gradlew --no-daemon --parallel --max-workers=6 :core:test --tests 
org.apache.calcite.test.JdbcTest :core:checkstyleMain :core:checkstyleTest 
:core:autostyleCheck
   409 completed, 0 failed, 15 skipped, org.apache.calcite.test.JdbcTest
   BUILD SUCCESSFUL in 51s
   ```
   


-- 
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]

Reply via email to