From 638865fd5ba005e11e04e226cd8c3513a81e0970 Mon Sep 17 00:00:00 2001 From: fang Date: Tue, 24 Sep 2019 15:21:06 +0800 Subject: [PATCH 1/3] [JIRANONE] modify JDBC client, if there is no action after query, before return 0 rows result, now throw exception --- src/client/src/TSDBJNIConnector.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/client/src/TSDBJNIConnector.c b/src/client/src/TSDBJNIConnector.c index 5ffa1c34fc..9853a6dec1 100644 --- a/src/client/src/TSDBJNIConnector.c +++ b/src/client/src/TSDBJNIConnector.c @@ -396,8 +396,18 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_fetchRowImp(JNIEn TAOS_ROW row = taos_fetch_row(result); if (row == NULL) { - jniTrace("jobj:%p, taos:%p, resultset:%p, fields size is %d, fetch row to the end", jobj, tscon, res, num_fields); - return JNI_FETCH_END; + int tserrno = taos_errno(tscon); + if (tserrno == 0) { + jniTrace("jobj:%p, taos:%p, resultset:%p, fields size is %d, fetch row to the end", jobj, tscon, res, num_fields); + return JNI_FETCH_END; + } else { + jclass cls; + cls = (*env)->FindClass(env,"com/taosdata/jdbc/TSDBError"); + if(cls == NULL){ + return JNI_TDENGINE_ERROR; + } + (*env)->ThrowNew(env,cls,"Interruppted query"); + } } for (int i = 0; i < num_fields; i++) { @@ -619,4 +629,4 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_validateCreateTab JNIEXPORT jstring JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_getTsCharset(JNIEnv *env, jobject jobj) { return (*env)->NewStringUTF(env, (const char *)tsCharset); -} \ No newline at end of file +} From a151f2d4406892cc9d8566979f501301a4edbe3b Mon Sep 17 00:00:00 2001 From: fang Date: Tue, 24 Sep 2019 15:44:53 +0800 Subject: [PATCH 2/3] [GITHUB] modify the version of dependency jackson in the pom.xml in the opentsdb test --- tests/comparisonTest/opentsdb/opentsdbtest/pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/comparisonTest/opentsdb/opentsdbtest/pom.xml b/tests/comparisonTest/opentsdb/opentsdbtest/pom.xml index b4f29bea5d..01a3f47b65 100644 --- a/tests/comparisonTest/opentsdb/opentsdbtest/pom.xml +++ b/tests/comparisonTest/opentsdb/opentsdbtest/pom.xml @@ -106,19 +106,19 @@ com.fasterxml.jackson.core jackson-annotations - 2.9.5 + 2.9.10 com.fasterxml.jackson.core jackson-core - 2.9.5 + 2.9.10 com.fasterxml.jackson.core jackson-databind - 2.9.5 + 2.9.10 From 00a9dcd3979b1c9af6193c2a560053b8a1e5f889 Mon Sep 17 00:00:00 2001 From: fangpanpan <53251079+fangpanpan@users.noreply.github.com> Date: Wed, 25 Sep 2019 11:09:07 +0800 Subject: [PATCH 3/3] Update TSDBJNIConnector.c --- src/client/src/TSDBJNIConnector.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/client/src/TSDBJNIConnector.c b/src/client/src/TSDBJNIConnector.c index 9853a6dec1..70db011aa6 100644 --- a/src/client/src/TSDBJNIConnector.c +++ b/src/client/src/TSDBJNIConnector.c @@ -401,12 +401,8 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_fetchRowImp(JNIEn jniTrace("jobj:%p, taos:%p, resultset:%p, fields size is %d, fetch row to the end", jobj, tscon, res, num_fields); return JNI_FETCH_END; } else { - jclass cls; - cls = (*env)->FindClass(env,"com/taosdata/jdbc/TSDBError"); - if(cls == NULL){ - return JNI_TDENGINE_ERROR; - } - (*env)->ThrowNew(env,cls,"Interruppted query"); + jniTrace("jobj:%p, taos:%p, interruptted query", jobj, tscon); + return JNI_RESULT_SET_NULL; } }