This is an automated email from the ASF dual-hosted git repository. morningman pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push: new 45cdda0290c [fix](jdbc catalog) fix be crash when create jdbc catalog without driver jar (#42948) 45cdda0290c is described below commit 45cdda0290cfcd23dc6a938c0606dbcb67913492 Author: zy-kkk <zhongy...@gmail.com> AuthorDate: Thu Oct 31 11:07:01 2024 +0800 [fix](jdbc catalog) fix be crash when create jdbc catalog without driver jar (#42948) When creating a JDBC Catalog, a connection test is performed. However, if the JDBC Driver path does not exist, we should report an error that the file cannot be opened and not clean up the resources, because the resources have not been created. Cleaning up non-existent resources will cause the program to crash. This PR is changed to clean up only when the resources are created. --- be/src/vec/exec/vjdbc_connector.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/be/src/vec/exec/vjdbc_connector.cpp b/be/src/vec/exec/vjdbc_connector.cpp index 2e819dd77c4..14263cf4c08 100644 --- a/be/src/vec/exec/vjdbc_connector.cpp +++ b/be/src/vec/exec/vjdbc_connector.cpp @@ -193,6 +193,9 @@ Status JdbcConnector::test_connection() { } Status JdbcConnector::clean_datasource() { + if (!_is_open) { + return Status::OK(); + } JNIEnv* env = nullptr; RETURN_IF_ERROR(JniUtil::GetJNIEnv(&env)); env->CallNonvirtualVoidMethod(_executor_obj, _executor_clazz, _executor_clean_datasource_id); --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org