提交 1ca75c5a 编写于 作者: S slguan

fix bugs in package script

上级 3c3edeb2
......@@ -247,9 +247,9 @@ vercomp () {
function is_version_compatible() {
curr_version=$(${bin_dir}/taosd -V | cut -d ' ' -f 1)
curr_version=$(${bin_dir}/taosd -V | cut -d ' ' -f 2)
min_compatible_version=$(${script_dir}/bin/taosd -V | cut -d ' ' -f 2)
min_compatible_version=$(${script_dir}/bin/taosd -V | cut -d ' ' -f 4)
vercomp $curr_version $min_compatible_version
case $? in
......
......@@ -208,10 +208,10 @@ JNIEXPORT jlong JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_connectImp(JNIEn
ret = (jlong)taos_connect((char *)host, (char *)user, (char *)pass, (char *)dbname, jport);
if (ret == 0) {
jniError("jobj:%p, taos:%p, connect to tdengine failed, host=%s, user=%s, dbname=%s, port=%d", jobj, (void *)ret,
jniError("jobj:%p, conn:%p, connect to database failed, host=%s, user=%s, dbname=%s, port=%d", jobj, (void *)ret,
(char *)host, (char *)user, (char *)dbname, jport);
} else {
jniTrace("jobj:%p, taos:%p, connect to tdengine succeed, host=%s, user=%s, dbname=%s, port=%d", jobj, (void *)ret,
jniTrace("jobj:%p, conn:%p, connect to database succeed, host=%s, user=%s, dbname=%s, port=%d", jobj, (void *)ret,
(char *)host, (char *)user, (char *)dbname, jport);
}
......@@ -232,7 +232,7 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_executeQueryImp(J
}
if (jsql == NULL) {
jniError("jobj:%p, taos:%p, sql is null", jobj, tscon);
jniError("jobj:%p, conn:%p, sql is null", jobj, tscon);
return JNI_SQL_NULL;
}
......@@ -250,7 +250,7 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_executeQueryImp(J
int code = taos_query(tscon, dst);
if (code != 0) {
jniError("jobj:%p, taos:%p, code:%d, msg:%s, sql:%s", jobj, tscon, code, taos_errstr(tscon), dst);
jniError("jobj:%p, conn:%p, code:%d, msg:%s, sql:%s", jobj, tscon, code, taos_errstr(tscon), dst);
free(dst);
return JNI_TDENGINE_ERROR;
} else {
......@@ -259,9 +259,9 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_executeQueryImp(J
if (pSql->cmd.command == TSDB_SQL_INSERT) {
affectRows = taos_affected_rows(tscon);
jniTrace("jobj:%p, taos:%p, code:%d, affect rows:%d, sql:%s", jobj, tscon, code, affectRows, dst);
jniTrace("jobj:%p, conn:%p, code:%d, affect rows:%d, sql:%s", jobj, tscon, code, affectRows, dst);
} else {
jniTrace("jobj:%p, taos:%p, code:%d, sql:%s", jobj, tscon, code, dst);
jniTrace("jobj:%p, conn:%p, code:%d, sql:%s", jobj, tscon, code, dst);
}
free(dst);
......@@ -291,11 +291,22 @@ JNIEXPORT jlong JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_getResultSetImp(
return JNI_CONNECTION_NULL;
}
<<<<<<< Updated upstream
int num_fields = taos_field_count(tscon);
if (num_fields != 0) {
jlong ret = (jlong)taos_use_result(tscon);
jniTrace("jobj:%p, taos:%p, get resultset:%p", jobj, tscon, (void *)ret);
return ret;
=======
jlong ret = 0;
if (tscIsUpdateQuery(tscon)) {
ret = 0; // for update query, no result pointer
jniTrace("jobj:%p, conn:%p, no result", jobj, tscon);
} else {
ret = (jlong) taos_use_result(tscon);
jniTrace("jobj:%p, conn:%p, get resultset:%p", jobj, tscon, (void *) ret);
>>>>>>> Stashed changes
}
jniTrace("jobj:%p, taos:%p, no resultset", jobj, tscon);
......@@ -311,12 +322,12 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_freeResultSetImp(
}
if ((void *)res == NULL) {
jniError("jobj:%p, taos:%p, resultset is null", jobj, tscon);
jniError("jobj:%p, conn:%p, resultset is null", jobj, tscon);
return JNI_RESULT_SET_NULL;
}
taos_free_result((void *)res);
jniTrace("jobj:%p, taos:%p, free resultset:%p", jobj, tscon, (void *)res);
jniTrace("jobj:%p, conn:%p, free resultset:%p", jobj, tscon, (void *)res);
return JNI_SUCCESS;
}
......@@ -330,7 +341,7 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_getAffectedRowsIm
jint ret = taos_affected_rows(tscon);
jniTrace("jobj:%p, taos:%p, affect rows:%d", jobj, tscon, (void *)con, ret);
jniTrace("jobj:%p, conn:%p, affect rows:%d", jobj, tscon, (void *)con, ret);
return ret;
}
......@@ -346,7 +357,7 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_getSchemaMetaData
TAOS_RES *result = (TAOS_RES *)res;
if (result == NULL) {
jniError("jobj:%p, taos:%p, resultset is null", jobj, tscon);
jniError("jobj:%p, conn:%p, resultset is null", jobj, tscon);
return JNI_RESULT_SET_NULL;
}
......@@ -356,10 +367,10 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_getSchemaMetaData
// jobject arrayListObj = (*env)->NewObject(env, g_arrayListClass, g_arrayListConstructFp, "");
if (num_fields == 0) {
jniError("jobj:%p, taos:%p, resultset:%p, fields size is %d", jobj, tscon, res, num_fields);
jniError("jobj:%p, conn:%p, resultset:%p, fields size is %d", jobj, tscon, res, num_fields);
return JNI_NUM_OF_FIELDS_0;
} else {
jniTrace("jobj:%p, taos:%p, resultset:%p, fields size is %d", jobj, tscon, res, num_fields);
jniTrace("jobj:%p, conn:%p, resultset:%p, fields size is %d", jobj, tscon, res, num_fields);
for (int i = 0; i < num_fields; ++i) {
jobject metadataObj = (*env)->NewObject(env, g_metadataClass, g_metadataConstructFp);
(*env)->SetIntField(env, metadataObj, g_metadataColtypeField, fields[i].type);
......@@ -402,7 +413,7 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_fetchRowImp(JNIEn
TAOS_RES *result = (TAOS_RES *)res;
if (result == NULL) {
jniError("jobj:%p, taos:%p, resultset is null", jobj, tscon);
jniError("jobj:%p, conn:%p, resultset is null", jobj, tscon);
return JNI_RESULT_SET_NULL;
}
......@@ -410,7 +421,7 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_fetchRowImp(JNIEn
int num_fields = taos_num_fields(result);
if (num_fields == 0) {
jniError("jobj:%p, taos:%p, resultset:%p, fields size is %d", jobj, tscon, res, num_fields);
jniError("jobj:%p, conn:%p, resultset:%p, fields size is %d", jobj, tscon, res, num_fields);
return JNI_NUM_OF_FIELDS_0;
}
......@@ -418,10 +429,10 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_fetchRowImp(JNIEn
if (row == NULL) {
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);
jniTrace("jobj:%p, conn:%p, resultset:%p, fields size is %d, fetch row to the end", jobj, tscon, res, num_fields);
return JNI_FETCH_END;
} else {
jniTrace("jobj:%p, taos:%p, interruptted query", jobj, tscon);
jniTrace("jobj:%p, conn:%p, interruptted query", jobj, tscon);
return JNI_RESULT_SET_NULL;
}
}
......@@ -485,7 +496,7 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_closeConnectionIm
jniError("jobj:%p, connection is closed", jobj);
return JNI_CONNECTION_NULL;
} else {
jniTrace("jobj:%p, taos:%p, close connection success", jobj, tscon);
jniTrace("jobj:%p, conn:%p, close connection success", jobj, tscon);
taos_close(tscon);
return JNI_SUCCESS;
}
......@@ -640,7 +651,7 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_validateCreateTab
}
if (jsql == NULL) {
jniError("jobj:%p, taos:%p, sql is null", jobj, tscon);
jniError("jobj:%p, conn:%p, sql is null", jobj, tscon);
return JNI_SQL_NULL;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册