Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AD-638] Memory errors #65

Merged
merged 1 commit into from
Apr 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/linux-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,10 @@ jobs:
chmod +x ./src/odbc-test/scripts/import_test_data.sh
./src/odbc-test/scripts/import_test_data.sh

# - name: run-tests
# run: |
# ssh -f -N -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i ${{env.DOC_DB_PRIV_KEY_FILE}} -L${{env.DOC_DB_LOCAL_PORT}}:${{secrets.DOC_DB_HOST}}:${{env.DOC_DB_REMOTE_PORT}} ${{secrets.DOC_DB_USER}}
# ./build/odbc/bin/ignite-odbc-tests
- name: run-tests
run: |
ssh -f -N -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i ${{env.DOC_DB_PRIV_KEY_FILE}} -L${{env.DOC_DB_LOCAL_PORT}}:${{secrets.DOC_DB_HOST}}:${{env.DOC_DB_REMOTE_PORT}} ${{secrets.DOC_DB_USER}}
./build/odbc/bin/ignite-odbc-tests --catch_system_errors=false

- name: upload-test-report
if: always()
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/mac-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,10 @@ jobs:
run: |
chmod +x ./src/odbc-test/scripts/import_test_data.sh
./src/odbc-test/scripts/import_test_data.sh
# - name: run-tests
# run: |
# ssh -f -N -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i ${{env.DOC_DB_PRIV_KEY_FILE}} -L${{env.DOC_DB_LOCAL_PORT}}:${{secrets.DOC_DB_HOST}}:${{env.DOC_DB_REMOTE_PORT}} ${{secrets.DOC_DB_USER}}
# ./build/odbc/bin/ignite-odbc-tests
- name: run-tests
run: |
ssh -f -N -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i ${{env.DOC_DB_PRIV_KEY_FILE}} -L${{env.DOC_DB_LOCAL_PORT}}:${{secrets.DOC_DB_HOST}}:${{env.DOC_DB_REMOTE_PORT}} ${{secrets.DOC_DB_USER}}
./build/odbc/bin/ignite-odbc-tests --catch_system_errors=false
- name: upload-test-report
if: always()
uses: EnricoMi/publish-unit-test-result-action/[email protected]
Expand Down
15 changes: 15 additions & 0 deletions src/odbc/src/jni/java.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -970,6 +970,7 @@ JniErrorCode JniContext::DriverManagerGetConnection(
} else {
connection = new GlobalJObject(env, env->NewGlobalRef(result));
}
env->DeleteLocalRef(jConnectionString);
return errInfo.code;
}

Expand Down Expand Up @@ -1148,6 +1149,10 @@ JniErrorCode JniContext::DatabaseMetaDataGetTables(
jvm->GetMembers().m_DatabaseMetaDataGetTables, jCatalog, jSchemaPattern,
jTableNamePattern, jTypes);
ExceptionCheck(env, &errInfo);
env->DeleteLocalRef(jCatalog);
env->DeleteLocalRef(jSchemaPattern);
env->DeleteLocalRef(jTableNamePattern);
env->DeleteLocalRef(jTypes);

if (!result || errInfo.code != JniErrorCode::IGNITE_JNI_ERR_SUCCESS) {
resultSet = nullptr;
Expand Down Expand Up @@ -1181,6 +1186,11 @@ JniErrorCode JniContext::DatabaseMetaDataGetColumns(
jTableNamePattern, jColumnNamePattern);
ExceptionCheck(env, &errInfo);

env->DeleteLocalRef(jCatalog);
env->DeleteLocalRef(jSchemaPattern);
env->DeleteLocalRef(jTableNamePattern);
env->DeleteLocalRef(jColumnNamePattern);

if (!result || errInfo.code != JniErrorCode::IGNITE_JNI_ERR_SUCCESS) {
resultSet = nullptr;
return errInfo.code;
Expand Down Expand Up @@ -1268,6 +1278,8 @@ JniErrorCode JniContext::ResultSetGetString(
resultSet.Get()->GetRef(), jvm->GetMembers().m_ResultSetGetStringByName,
jColumnName);
ExceptionCheck(env, &errInfo);

env->DeleteLocalRef(jColumnName);

if (errInfo.code == JniErrorCode::IGNITE_JNI_ERR_SUCCESS) {
if (result != nullptr) {
Expand Down Expand Up @@ -1324,6 +1336,9 @@ JniErrorCode JniContext::ResultSetGetInt(
jvm->GetMembers().m_ResultSetGetIntByName,
jColumnName);
ExceptionCheck(env, &errInfo);

env->DeleteLocalRef(jColumnName);

if (errInfo.code == JniErrorCode::IGNITE_JNI_ERR_SUCCESS) {
bool wasNull;
errInfo.code = ResultSetWasNull(resultSet, wasNull, errInfo);
Expand Down