fix(client): set the initial value for num_of_rows.

This commit is contained in:
Haojun Liao 2023-03-16 22:36:02 +08:00
parent 970155a845
commit 1b219f7a66
3 changed files with 7 additions and 4 deletions

View File

@ -581,8 +581,8 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_fetchBlockImp(JNI
return JNI_RESULT_SET_NULL;
}
void *data;
int32_t numOfRows;
void *data = NULL;
int32_t numOfRows = 0;
int error_code = taos_fetch_raw_block(tres, &numOfRows, &data);
if (numOfRows == 0) {
if (error_code == JNI_SUCCESS) {

View File

@ -611,6 +611,9 @@ int taos_fetch_block_s(TAOS_RES *res, int *numOfRows, TAOS_ROW *rows) {
}
int taos_fetch_raw_block(TAOS_RES *res, int *numOfRows, void **pData) {
*numOfRows = 0;
*pData = NULL;
if (res == NULL || TD_RES_TMQ_META(res)) {
return 0;
}

View File

@ -361,8 +361,8 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_tmq_TMQConnector_fetchRawBlockImp(
TAOS_RES *tres = (TAOS_RES *)res;
void *data;
int32_t numOfRows;
void *data = NULL;
int32_t numOfRows = 0;
int error_code = taos_fetch_raw_block(tres, &numOfRows, &data);
if (numOfRows == 0) {
if (error_code == JNI_SUCCESS) {