From d1f15a82eb825f12f4d422ab853951c12e73f289 Mon Sep 17 00:00:00 2001 From: Shuduo Sang Date: Mon, 24 May 2021 20:16:26 +0800 Subject: [PATCH] Hotfix/sangshuduo/td 4322 taosdemo fetch result for develop (#6220) * [TD-4322]: taosdemo query then fetch result. * build again. * [TD-4322]: taosdemo fetch result. check result file name length. Co-authored-by: Shuduo Sang --- src/kit/taosdemo/taosdemo.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/kit/taosdemo/taosdemo.c b/src/kit/taosdemo/taosdemo.c index 5afc8c44a1..0f3adc29be 100644 --- a/src/kit/taosdemo/taosdemo.c +++ b/src/kit/taosdemo/taosdemo.c @@ -1178,7 +1178,7 @@ static void fetchResult(TAOS_RES *res, char* resultFile) { // fetch the records row by row while((row = taos_fetch_row(res))) { - if ((resultFile) + if ((resultFile) && (strlen(resultFile) > 0) && (totalLen >= 100*1024*1024 - 32000)) { appendResultBufToFile(databuf, resultFile); totalLen = 0; @@ -1194,7 +1194,7 @@ static void fetchResult(TAOS_RES *res, char* resultFile) { verbosePrint("%s() LN%d, databuf=%s resultFile=%s\n", __func__, __LINE__, databuf, resultFile); - if (resultFile) { + if ((resultFile) && (strlen(resultFile) > 0)) { appendResultBufToFile(databuf, resultFile); } free(databuf); @@ -2231,7 +2231,7 @@ static int postProceSql(char *host, struct sockaddr_in *pServAddr, uint16_t port response_buf[RESP_BUF_LEN - 1] = '\0'; printf("Response:\n%s\n", response_buf); - if (resultFile) { + if ((resultFile) && (strlen(resultFile) > 0)) { appendResultBufToFile(response_buf, resultFile); } -- GitLab