未验证 提交 98846d56 编写于 作者: M Minglei Jin 提交者: GitHub

Merge pull request #11945 from taosdata/fix/TS-1312-2.4

fix(query): fixed a query coredump in Windows
......@@ -179,7 +179,7 @@ int64_t taosFSendFile(FILE *out_file, FILE *in_file, int64_t *offset, int64_t co
fwrite(buffer, 1, rlen, out_file);
return (int64_t)(writeLen + rlen);
} else {
fwrite(buffer, 1, _SEND_FILE_STEP_, in_file);
fwrite(buffer, 1, _SEND_FILE_STEP_, out_file);
writeLen += _SEND_FILE_STEP_;
}
}
......@@ -223,7 +223,7 @@ int64_t taosSendFile(SocketFd dfd, FileFd sfd, int64_t *offset, int64_t count) {
if (rlen <= 0) {
return writeLen;
} else {
taosWriteSocket(sfd, buffer, (int32_t)remain);
taosWriteSocket(dfd, buffer, (int32_t)remain);
writeLen += remain;
}
}
......
......@@ -125,7 +125,14 @@ STSBuf* tsBufCreateFromFile(const char* path, bool autoDelete) {
ret = fseek(pTSBuf->f, 0, SEEK_END);
UNUSED(ret);
// file meta data may be cached, close and reopen the file for accurate file size.
fclose(pTSBuf->f);
pTSBuf->f = fopen(pTSBuf->path, "rb+");
if (pTSBuf->f == NULL) {
return pTSBuf;
}
struct stat fileStat;
if (fstat(fileno(pTSBuf->f), &fileStat) != 0) {
tsBufDestroy(pTSBuf);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册