From b9fa620b26d23cb652122ac5b59072be1f6083d5 Mon Sep 17 00:00:00 2001 From: facetosea <285808407@qq.com> Date: Tue, 24 Oct 2023 15:05:24 +0800 Subject: [PATCH 1/6] shell query --- tools/shell/src/shellEngine.c | 227 +++++++++++++++++++++------------- 1 file changed, 143 insertions(+), 84 deletions(-) diff --git a/tools/shell/src/shellEngine.c b/tools/shell/src/shellEngine.c index a7f79fc9db..6cde16856e 100644 --- a/tools/shell/src/shellEngine.c +++ b/tools/shell/src/shellEngine.c @@ -22,6 +22,23 @@ #include "shellAuto.h" #include "shellInt.h" +typedef struct { + const char *sql; + bool vertical; + tsem_t sem; + int64_t numOfRows; // the num of this batch + int64_t numOfAllRows; + + int32_t numFields; + TAOS_FIELD *fields; + int32_t precision; + + int32_t maxColNameLen; // for vertical print + int32_t width[TSDB_MAX_COLUMNS]; // for horizontal print + + uint64_t resShowMaxNum; +} tsDumpInfo; + static bool shellIsEmptyCommand(const char *cmd); static int32_t shellRunSingleCommand(char *command); static void shellRecordCommandToHistory(char *command); @@ -31,8 +48,8 @@ static char *shellFormatTimestamp(char *buf, int64_t val, int32_t precision); static int64_t shellDumpResultToFile(const char *fname, TAOS_RES *tres); static void shellPrintNChar(const char *str, int32_t length, int32_t width); static void shellPrintGeometry(const unsigned char *str, int32_t length, int32_t width); -static int64_t shellVerticalPrintResult(TAOS_RES *tres, const char *sql); -static int64_t shellHorizontalPrintResult(TAOS_RES *tres, const char *sql); +static void shellVerticalPrintResult(TAOS_RES *tres, tsDumpInfo* dump_info); +static void shellHorizontalPrintResult(TAOS_RES *tres, tsDumpInfo* dump_info); static int64_t shellDumpResult(TAOS_RES *tres, char *fname, int32_t *error_no, bool vertical, const char *sql); static void shellReadHistory(); static void shellWriteHistory(); @@ -702,64 +719,88 @@ bool shellIsShowQuery(const char *sql) { return false; } -int64_t shellVerticalPrintResult(TAOS_RES *tres, const char *sql) { - TAOS_ROW row = taos_fetch_row(tres); - if (row == NULL) { - return 0; +void init_dump_info(tsDumpInfo *dump_info, TAOS_RES *tres, const char *sql, bool vertical) { + dump_info->sql = sql; + dump_info->vertical = vertical; + tsem_init(&dump_info->sem, 0, 0); + dump_info->numOfAllRows = 0; + + dump_info->numFields = taos_num_fields(tres); + dump_info->fields = taos_fetch_fields(tres); + dump_info->precision = taos_result_precision(tres); + + dump_info->resShowMaxNum = UINT64_MAX; + + if (shell.args.commands == NULL && shell.args.file[0] == 0 && !shellIsShowWhole(dump_info->sql)) { + dump_info->resShowMaxNum = SHELL_DEFAULT_RES_SHOW_NUM; } - int32_t num_fields = taos_num_fields(tres); - TAOS_FIELD *fields = taos_fetch_fields(tres); - int32_t precision = taos_result_precision(tres); - - int32_t maxColNameLen = 0; - for (int32_t col = 0; col < num_fields; col++) { - int32_t len = (int32_t)strlen(fields[col].name); - if (len > maxColNameLen) { - maxColNameLen = len; + if (vertical) { + dump_info->maxColNameLen = 0; + for (int32_t col = 0; col < dump_info->numFields; col++) { + int32_t len = (int32_t)strlen(dump_info->fields[col].name); + if (len > dump_info->maxColNameLen) { + dump_info->maxColNameLen = len; + } + } + } else { + for (int32_t col = 0; col < dump_info->numFields; col++) { + dump_info->width[col] = shellCalcColWidth(dump_info->fields + col, dump_info->precision); } } +} - uint64_t resShowMaxNum = UINT64_MAX; - - if (shell.args.commands == NULL && shell.args.file[0] == 0 && !shellIsShowWhole(sql)) { - resShowMaxNum = SHELL_DEFAULT_RES_SHOW_NUM; +void shellVerticalPrintResult(TAOS_RES *tres, tsDumpInfo *dump_info) { + if (dump_info->numOfRows <= 0) return; + if (dump_info->numOfAllRows >= dump_info->resShowMaxNum) { + return; } - int64_t numOfRows = 0; - int32_t showMore = 1; - do { - if (numOfRows < resShowMaxNum) { - printf("*************************** %"PRId64".row ***************************\r\n", numOfRows + 1); + TAOS_ROW row = taos_fetch_row(tres); + if (row == NULL) { + return; + } - int32_t *length = taos_fetch_lengths(tres); + int64_t numOfPintRows = dump_info->numOfAllRows; + int numOfPrintRowsThisOne = 0; - for (int32_t i = 0; i < num_fields; i++) { - TAOS_FIELD *field = fields + i; + while (row != NULL) { + printf("*************************** %" PRId64 ".row ***************************\r\n", numOfPintRows + 1); - int32_t padding = (int32_t)(maxColNameLen - strlen(field->name)); - printf("%*.s%s: ", padding, " ", field->name); + int32_t *length = taos_fetch_lengths(tres); - shellPrintField((const char *)row[i], field, 0, length[i], precision); - putchar('\r'); - putchar('\n'); - } - } else if (showMore) { + for (int32_t i = 0; i < dump_info->numFields; i++) { + TAOS_FIELD *field = dump_info->fields + i; + + int32_t padding = (int32_t)(dump_info->maxColNameLen - strlen(field->name)); + printf("%*.s%s: ", padding, " ", field->name); + + shellPrintField((const char *)row[i], field, 0, length[i], dump_info->precision); + putchar('\r'); + putchar('\n'); + } + + numOfPintRows++; + numOfPrintRowsThisOne++; + + if (numOfPintRows == dump_info->resShowMaxNum) { printf("\r\n"); - printf(" Notice: The result shows only the first %d rows.\r\n", SHELL_DEFAULT_RES_SHOW_NUM); + printf(" Notice: The result shows only the first %d rows.\r\n", dump_info->resShowMaxNum); printf(" You can use the `LIMIT` clause to get fewer result to show.\r\n"); printf(" Or use '>>' to redirect the whole set of the result to a specified file.\r\n"); printf("\r\n"); printf(" You can use Ctrl+C to stop the underway fetching.\r\n"); printf("\r\n"); - showMore = 0; + return; } - numOfRows++; - row = taos_fetch_row(tres); - } while (row != NULL); + if (numOfPrintRowsThisOne == dump_info->numOfRows) { + return; + } - return numOfRows; + row = taos_fetch_row(tres); + } + return; } int32_t shellCalcColWidth(TAOS_FIELD *field, int32_t precision) { @@ -856,47 +897,42 @@ void shellPrintHeader(TAOS_FIELD *fields, int32_t *width, int32_t num_fields) { putchar('\n'); } -int64_t shellHorizontalPrintResult(TAOS_RES *tres, const char *sql) { +void shellHorizontalPrintResult(TAOS_RES *tres, tsDumpInfo *dump_info) { + if (dump_info->numOfRows <= 0) return; + if (dump_info->numOfAllRows >= dump_info->resShowMaxNum) { + return; + } + TAOS_ROW row = taos_fetch_row(tres); if (row == NULL) { - return 0; + return; } - int32_t num_fields = taos_num_fields(tres); - TAOS_FIELD *fields = taos_fetch_fields(tres); - int32_t precision = taos_result_precision(tres); - - int32_t width[TSDB_MAX_COLUMNS]; - for (int32_t col = 0; col < num_fields; col++) { - width[col] = shellCalcColWidth(fields + col, precision); + int64_t numOfPintRows = dump_info->numOfAllRows; + int numOfPrintRowsThisOne = 0; + if (numOfPintRows == 0) { + shellPrintHeader(dump_info->fields, dump_info->width, dump_info->numFields); } - shellPrintHeader(fields, width, num_fields); - - uint64_t resShowMaxNum = UINT64_MAX; - - if (shell.args.commands == NULL && shell.args.file[0] == 0 && !shellIsShowWhole(sql)) { - resShowMaxNum = SHELL_DEFAULT_RES_SHOW_NUM; - } - - int64_t numOfRows = 0; - int32_t showMore = 1; - - do { + while (row != NULL) { int32_t *length = taos_fetch_lengths(tres); - if (numOfRows < resShowMaxNum) { - for (int32_t i = 0; i < num_fields; i++) { - putchar(' '); - shellPrintField((const char *)row[i], fields + i, width[i], length[i], precision); - putchar(' '); - putchar('|'); - } - putchar('\r'); - putchar('\n'); - } else if (showMore) { + for (int32_t i = 0; i < dump_info->numFields; i++) { + putchar(' '); + shellPrintField((const char *)row[i], dump_info->fields + i, dump_info->width[i], length[i], + dump_info->precision); + putchar(' '); + putchar('|'); + } + putchar('\r'); + putchar('\n'); + + numOfPintRows++; + numOfPrintRowsThisOne++; + + if (numOfPintRows == dump_info->resShowMaxNum) { printf("\r\n"); - printf(" Notice: The result shows only the first %d rows.\r\n", SHELL_DEFAULT_RES_SHOW_NUM); - if (shellIsShowQuery(sql)) { + printf(" Notice: The result shows only the first %d rows.\r\n", dump_info->resShowMaxNum); + if (shellIsShowQuery(dump_info->sql)) { printf(" You can use '>>' to redirect the whole set of the result to a specified file.\r\n"); } else { printf(" You can use the `LIMIT` clause to get fewer result to show.\r\n"); @@ -905,28 +941,51 @@ int64_t shellHorizontalPrintResult(TAOS_RES *tres, const char *sql) { printf("\r\n"); printf(" You can use Ctrl+C to stop the underway fetching.\r\n"); printf("\r\n"); - showMore = 0; + return; } - numOfRows++; - row = taos_fetch_row(tres); - } while (row != NULL); + if (numOfPrintRowsThisOne == dump_info->numOfRows) { + return; + } - return numOfRows; + row = taos_fetch_row(tres); + } + return; +} + +void shellDumpResultCallback(void *param, TAOS_RES *tres, int num_of_rows) { + tsDumpInfo *dump_info = (tsDumpInfo *)param; + if (num_of_rows > 0) { + dump_info->numOfRows = num_of_rows; + if (dump_info->vertical) { + shellVerticalPrintResult(tres, dump_info); + } else { + shellHorizontalPrintResult(tres, dump_info); + } + dump_info->numOfAllRows += num_of_rows; + taos_fetch_rows_a(tres, shellDumpResultCallback, param); + } else { + if (num_of_rows < 0) { + printf("\033[31masync retrieve failed, code: %d\033[0m\n", num_of_rows); + } + tsem_post(&dump_info->sem); + } } int64_t shellDumpResult(TAOS_RES *tres, char *fname, int32_t *error_no, bool vertical, const char *sql) { - int64_t numOfRows = 0; + int64_t num_of_rows = 0; if (fname != NULL) { - numOfRows = shellDumpResultToFile(fname, tres); - } else if (vertical) { - numOfRows = shellVerticalPrintResult(tres, sql); + num_of_rows = shellDumpResultToFile(fname, tres); } else { - numOfRows = shellHorizontalPrintResult(tres, sql); + tsDumpInfo dump_info; + init_dump_info(&dump_info, tres, sql, vertical); + taos_fetch_rows_a(tres, shellDumpResultCallback, &dump_info); + tsem_wait(&dump_info.sem); + num_of_rows = dump_info.numOfAllRows; } *error_no = taos_errno(tres); - return numOfRows; + return num_of_rows; } void shellReadHistory() { From c14dbbdd01fe3833b6245dc1fd137530a0ebf689 Mon Sep 17 00:00:00 2001 From: facetosea <285808407@qq.com> Date: Tue, 24 Oct 2023 15:15:39 +0800 Subject: [PATCH 2/6] print exception log --- tools/shell/src/shellEngine.c | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/tools/shell/src/shellEngine.c b/tools/shell/src/shellEngine.c index 6cde16856e..f911637cc3 100644 --- a/tools/shell/src/shellEngine.c +++ b/tools/shell/src/shellEngine.c @@ -751,13 +751,9 @@ void init_dump_info(tsDumpInfo *dump_info, TAOS_RES *tres, const char *sql, bool } void shellVerticalPrintResult(TAOS_RES *tres, tsDumpInfo *dump_info) { - if (dump_info->numOfRows <= 0) return; - if (dump_info->numOfAllRows >= dump_info->resShowMaxNum) { - return; - } - TAOS_ROW row = taos_fetch_row(tres); if (row == NULL) { + printf("\033[31mtaos_fetch_row failed.\033[0m\n"); return; } @@ -898,13 +894,9 @@ void shellPrintHeader(TAOS_FIELD *fields, int32_t *width, int32_t num_fields) { } void shellHorizontalPrintResult(TAOS_RES *tres, tsDumpInfo *dump_info) { - if (dump_info->numOfRows <= 0) return; - if (dump_info->numOfAllRows >= dump_info->resShowMaxNum) { - return; - } - TAOS_ROW row = taos_fetch_row(tres); if (row == NULL) { + printf("\033[31mtaos_fetch_row failed.\033[0m\n"); return; } @@ -957,10 +949,12 @@ void shellDumpResultCallback(void *param, TAOS_RES *tres, int num_of_rows) { tsDumpInfo *dump_info = (tsDumpInfo *)param; if (num_of_rows > 0) { dump_info->numOfRows = num_of_rows; - if (dump_info->vertical) { - shellVerticalPrintResult(tres, dump_info); - } else { - shellHorizontalPrintResult(tres, dump_info); + if (dump_info->numOfAllRows < dump_info->resShowMaxNum) { + if (dump_info->vertical) { + shellVerticalPrintResult(tres, dump_info); + } else { + shellHorizontalPrintResult(tres, dump_info); + } } dump_info->numOfAllRows += num_of_rows; taos_fetch_rows_a(tres, shellDumpResultCallback, param); From 9c5f8165ccb4523ff8f8f876b182be2166193fe6 Mon Sep 17 00:00:00 2001 From: facetosea <285808407@qq.com> Date: Tue, 24 Oct 2023 16:02:24 +0800 Subject: [PATCH 3/6] print uint64 --- tools/shell/src/shellEngine.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/shell/src/shellEngine.c b/tools/shell/src/shellEngine.c index f911637cc3..ec7bb26563 100644 --- a/tools/shell/src/shellEngine.c +++ b/tools/shell/src/shellEngine.c @@ -781,7 +781,7 @@ void shellVerticalPrintResult(TAOS_RES *tres, tsDumpInfo *dump_info) { if (numOfPintRows == dump_info->resShowMaxNum) { printf("\r\n"); - printf(" Notice: The result shows only the first %d rows.\r\n", dump_info->resShowMaxNum); + printf(" Notice: The result shows only the first %ld rows.\r\n", dump_info->resShowMaxNum); printf(" You can use the `LIMIT` clause to get fewer result to show.\r\n"); printf(" Or use '>>' to redirect the whole set of the result to a specified file.\r\n"); printf("\r\n"); @@ -923,7 +923,7 @@ void shellHorizontalPrintResult(TAOS_RES *tres, tsDumpInfo *dump_info) { if (numOfPintRows == dump_info->resShowMaxNum) { printf("\r\n"); - printf(" Notice: The result shows only the first %d rows.\r\n", dump_info->resShowMaxNum); + printf(" Notice: The result shows only the first %ld rows.\r\n", dump_info->resShowMaxNum); if (shellIsShowQuery(dump_info->sql)) { printf(" You can use '>>' to redirect the whole set of the result to a specified file.\r\n"); } else { From ebd5f7c20d84e0540f515d6deaeae09e3ecff6bc Mon Sep 17 00:00:00 2001 From: facetosea <25808407@qq.com> Date: Wed, 25 Oct 2023 07:15:29 +0800 Subject: [PATCH 4/6] fix print log on mac --- tools/shell/src/shellEngine.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/shell/src/shellEngine.c b/tools/shell/src/shellEngine.c index ec7bb26563..3b150230e7 100644 --- a/tools/shell/src/shellEngine.c +++ b/tools/shell/src/shellEngine.c @@ -781,7 +781,7 @@ void shellVerticalPrintResult(TAOS_RES *tres, tsDumpInfo *dump_info) { if (numOfPintRows == dump_info->resShowMaxNum) { printf("\r\n"); - printf(" Notice: The result shows only the first %ld rows.\r\n", dump_info->resShowMaxNum); + printf(" Notice: The result shows only the first %d rows.\r\n", SHELL_DEFAULT_RES_SHOW_NUM); printf(" You can use the `LIMIT` clause to get fewer result to show.\r\n"); printf(" Or use '>>' to redirect the whole set of the result to a specified file.\r\n"); printf("\r\n"); @@ -923,7 +923,7 @@ void shellHorizontalPrintResult(TAOS_RES *tres, tsDumpInfo *dump_info) { if (numOfPintRows == dump_info->resShowMaxNum) { printf("\r\n"); - printf(" Notice: The result shows only the first %ld rows.\r\n", dump_info->resShowMaxNum); + printf(" Notice: The result shows only the first %d rows.\r\n", SHELL_DEFAULT_RES_SHOW_NUM); if (shellIsShowQuery(dump_info->sql)) { printf(" You can use '>>' to redirect the whole set of the result to a specified file.\r\n"); } else { From 2b0c144c8eeaa8389b7b442fd904c36c78ebd722 Mon Sep 17 00:00:00 2001 From: haoranchen Date: Fri, 27 Oct 2023 09:52:59 +0800 Subject: [PATCH 5/6] Revert "test:delete zlib cache in ci" --- tests/parallel_test/container_build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/parallel_test/container_build.sh b/tests/parallel_test/container_build.sh index 8652161d17..94704b1c25 100755 --- a/tests/parallel_test/container_build.sh +++ b/tests/parallel_test/container_build.sh @@ -68,9 +68,9 @@ docker run \ -v ${REP_REAL_PATH}/community/contrib/cpp-stub/:${REP_DIR}/community/contrib/cpp-stub \ -v ${REP_REAL_PATH}/community/contrib/libuv/:${REP_DIR}/community/contrib/libuv \ -v ${REP_REAL_PATH}/community/contrib/lz4/:${REP_DIR}/community/contrib/lz4 \ + -v ${REP_REAL_PATH}/community/contrib/zlib/:${REP_DIR}/community/contrib/zlib \ --rm --ulimit core=-1 taos_test:v1.0 sh -c "pip uninstall taospy -y;pip3 install taospy==2.7.2;cd $REP_DIR;rm -rf debug;mkdir -p debug;cd debug;cmake .. -DBUILD_HTTP=false -DBUILD_TOOLS=true -DBUILD_TEST=true -DWEBSOCKET=true -DBUILD_TAOSX=true -DJEMALLOC_ENABLED=0;make -j 10|| exit 1" # -v ${REP_REAL_PATH}/community/contrib/jemalloc/:${REP_DIR}/community/contrib/jemalloc \ -# -v ${REP_REAL_PATH}/community/contrib/zlib/:${REP_DIR}/community/contrib/zlib \ if [[ -d ${WORKDIR}/debugNoSan ]] ;then echo "delete ${WORKDIR}/debugNoSan" @@ -97,10 +97,10 @@ docker run \ -v ${REP_REAL_PATH}/community/contrib/cpp-stub/:${REP_DIR}/community/contrib/cpp-stub \ -v ${REP_REAL_PATH}/community/contrib/libuv/:${REP_DIR}/community/contrib/libuv \ -v ${REP_REAL_PATH}/community/contrib/lz4/:${REP_DIR}/community/contrib/lz4 \ + -v ${REP_REAL_PATH}/community/contrib/zlib/:${REP_DIR}/community/contrib/zlib \ -v ${REP_REAL_PATH}/community/contrib/jemalloc/:${REP_DIR}/community/contrib/jemalloc \ --rm --ulimit core=-1 taos_test:v1.0 sh -c "pip uninstall taospy -y;pip3 install taospy==2.7.2;cd $REP_DIR;rm -rf debug;mkdir -p debug;cd debug;cmake .. -DBUILD_HTTP=false -DBUILD_TOOLS=true -DBUILD_TEST=true -DWEBSOCKET=true -DBUILD_SANITIZER=1 -DTOOLS_SANITIZE=true -DTOOLS_BUILD_TYPE=Debug -DBUILD_TAOSX=true -DJEMALLOC_ENABLED=0;make -j 10|| exit 1 " - # -v ${REP_REAL_PATH}/community/contrib/zlib/:${REP_DIR}/community/contrib/zlib \ mv ${REP_REAL_PATH}/debug ${WORKDIR}/debugSan ret=$? From e6df389151d25994ff51c9db9d05760f09c384c6 Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Fri, 27 Oct 2023 11:46:59 +0800 Subject: [PATCH 6/6] fix:add req_id for raw block interface --- include/client/taos.h | 3 +++ source/client/src/clientRawBlockWrite.c | 13 +++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/include/client/taos.h b/include/client/taos.h index f75a84baa8..45dc85f6d9 100644 --- a/include/client/taos.h +++ b/include/client/taos.h @@ -338,8 +338,11 @@ typedef struct tmq_raw_data { DLL_EXPORT int32_t tmq_get_raw(TAOS_RES *res, tmq_raw_data *raw); DLL_EXPORT int32_t tmq_write_raw(TAOS *taos, tmq_raw_data raw); DLL_EXPORT int taos_write_raw_block(TAOS *taos, int numOfRows, char *pData, const char *tbname); +DLL_EXPORT int taos_write_raw_block_with_reqid(TAOS *taos, int numOfRows, char *pData, const char *tbname, int64_t reqid); DLL_EXPORT int taos_write_raw_block_with_fields(TAOS *taos, int rows, char *pData, const char *tbname, TAOS_FIELD *fields, int numFields); +DLL_EXPORT int taos_write_raw_block_with_fields_with_reqid(TAOS *taos, int rows, char *pData, const char *tbname, + TAOS_FIELD *fields, int numFields, int64_t reqid); DLL_EXPORT void tmq_free_raw(tmq_raw_data raw); // Returning null means error. Returned result need to be freed by tmq_free_json_meta diff --git a/source/client/src/clientRawBlockWrite.c b/source/client/src/clientRawBlockWrite.c index e7ba30d78c..a12dc8d839 100644 --- a/source/client/src/clientRawBlockWrite.c +++ b/source/client/src/clientRawBlockWrite.c @@ -1338,6 +1338,11 @@ end: int taos_write_raw_block_with_fields(TAOS* taos, int rows, char* pData, const char* tbname, TAOS_FIELD* fields, int numFields) { + return taos_write_raw_block_with_fields_with_reqid(taos, rows, pData, tbname, fields, numFields, 0); +} + +int taos_write_raw_block_with_fields_with_reqid(TAOS *taos, int rows, char *pData, const char *tbname, + TAOS_FIELD *fields, int numFields, int64_t reqid){ if (!taos || !pData || !tbname) { return TSDB_CODE_INVALID_PARA; } @@ -1347,7 +1352,7 @@ int taos_write_raw_block_with_fields(TAOS* taos, int rows, char* pData, const ch SHashObj* pVgHash = NULL; uDebug("taos_write_raw_block_with_fields called"); - SRequestObj* pRequest = (SRequestObj*)createRequest(*(int64_t*)taos, TSDB_SQL_INSERT, 0); + SRequestObj* pRequest = (SRequestObj*)createRequest(*(int64_t*)taos, TSDB_SQL_INSERT, reqid); if (!pRequest) { uError("WriteRaw:createRequest error request is null"); code = terrno; @@ -1427,6 +1432,10 @@ end: } int taos_write_raw_block(TAOS* taos, int rows, char* pData, const char* tbname) { + return taos_write_raw_block_with_reqid(taos, rows, pData, tbname, 0); +} + +int taos_write_raw_block_with_reqid(TAOS* taos, int rows, char* pData, const char* tbname, int64_t reqid) { if (!taos || !pData || !tbname) { return TSDB_CODE_INVALID_PARA; } @@ -1436,7 +1445,7 @@ int taos_write_raw_block(TAOS* taos, int rows, char* pData, const char* tbname) SHashObj* pVgHash = NULL; uDebug("taos_write_raw_block called"); - SRequestObj* pRequest = (SRequestObj*)createRequest(*(int64_t*)taos, TSDB_SQL_INSERT, 0); + SRequestObj* pRequest = (SRequestObj*)createRequest(*(int64_t*)taos, TSDB_SQL_INSERT, reqid); if (!pRequest) { uError("WriteRaw:createRequest error request is null"); code = terrno;