From 9ec0b1445d902adce88febb1186db044877e8583 Mon Sep 17 00:00:00 2001 From: huolibo Date: Mon, 5 Dec 2022 16:08:55 +0800 Subject: [PATCH] fix: jni add error code msg (#18699) --- src/client/src/TSDBJNIConnector.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/client/src/TSDBJNIConnector.c b/src/client/src/TSDBJNIConnector.c index c7d328bf1d..854f64d2d4 100644 --- a/src/client/src/TSDBJNIConnector.c +++ b/src/client/src/TSDBJNIConnector.c @@ -120,7 +120,7 @@ int32_t check_for_params(jobject jobj, jlong conn, jlong res) { } if ((TAOS_RES *)res == NULL) { - jniError("jobj:%p, conn:%p, res is null", jobj, (TAOS *)conn); + jniError("jobj:%p, conn:%p, param res is null", jobj, (TAOS *)conn); return JNI_RESULT_SET_NULL; } @@ -395,8 +395,8 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_freeResultSetImp( return code; } - taos_free_result((void *)res); jniDebug("jobj:%p, conn:%p, free resultset:%p", jobj, (TAOS *)con, (void *)res); + taos_free_result((void *)res); return JNI_SUCCESS; } @@ -491,7 +491,7 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_fetchRowImp(JNIEn numOfFields); return JNI_FETCH_END; } else { - jniDebug("jobj:%p, conn:%p, interrupted query", jobj, tscon); + jniDebug("jobj:%p, conn:%p, interrupted query. fetch row error code: %d, msg:%s", jobj, tscon, code, taos_errstr(result)); return JNI_RESULT_SET_NULL; } } @@ -587,7 +587,7 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_fetchBlockImp(JNI numOfFields); return JNI_FETCH_END; } else { - jniDebug("jobj:%p, conn:%p, query interrupted", jobj, tscon); + jniError("jobj:%p, conn:%p, query interrupted. fetch block error code:%d, msg:%s", jobj, tscon, code, taos_errstr(tres)); return JNI_RESULT_SET_NULL; } } -- GitLab