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

Hotfix/sangshuduo/td 4322 taosdemo fetch result (#6219)

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

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

check result file name length.
Co-authored-by: NShuduo Sang <sdsang@taosdata.com>
上级 0626a091
......@@ -1145,7 +1145,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;
......@@ -1161,7 +1161,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);
......@@ -2194,7 +2194,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);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册