未验证 提交 d1f15a82 编写于 作者: sangshuduo's avatar sangshuduo 提交者: GitHub

Hotfix/sangshuduo/td 4322 taosdemo fetch result for develop (#6220)

* [TD-4322]<fix>: taosdemo query then fetch result.

* build again.

* [TD-4322]<fix>: taosdemo fetch result.

check result file name length.
Co-authored-by: NShuduo Sang <sdsang@taosdata.com>
上级 432f961e
...@@ -1178,7 +1178,7 @@ static void fetchResult(TAOS_RES *res, char* resultFile) { ...@@ -1178,7 +1178,7 @@ static void fetchResult(TAOS_RES *res, char* resultFile) {
// fetch the records row by row // fetch the records row by row
while((row = taos_fetch_row(res))) { while((row = taos_fetch_row(res))) {
if ((resultFile) if ((resultFile) && (strlen(resultFile) > 0)
&& (totalLen >= 100*1024*1024 - 32000)) { && (totalLen >= 100*1024*1024 - 32000)) {
appendResultBufToFile(databuf, resultFile); appendResultBufToFile(databuf, resultFile);
totalLen = 0; totalLen = 0;
...@@ -1194,7 +1194,7 @@ static void fetchResult(TAOS_RES *res, char* resultFile) { ...@@ -1194,7 +1194,7 @@ static void fetchResult(TAOS_RES *res, char* resultFile) {
verbosePrint("%s() LN%d, databuf=%s resultFile=%s\n", verbosePrint("%s() LN%d, databuf=%s resultFile=%s\n",
__func__, __LINE__, databuf, resultFile); __func__, __LINE__, databuf, resultFile);
if (resultFile) { if ((resultFile) && (strlen(resultFile) > 0)) {
appendResultBufToFile(databuf, resultFile); appendResultBufToFile(databuf, resultFile);
} }
free(databuf); free(databuf);
...@@ -2231,7 +2231,7 @@ static int postProceSql(char *host, struct sockaddr_in *pServAddr, uint16_t port ...@@ -2231,7 +2231,7 @@ static int postProceSql(char *host, struct sockaddr_in *pServAddr, uint16_t port
response_buf[RESP_BUF_LEN - 1] = '\0'; response_buf[RESP_BUF_LEN - 1] = '\0';
printf("Response:\n%s\n", response_buf); printf("Response:\n%s\n", response_buf);
if (resultFile) { if ((resultFile) && (strlen(resultFile) > 0)) {
appendResultBufToFile(response_buf, resultFile); appendResultBufToFile(response_buf, resultFile);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册