fix: write histroy in shell

This commit is contained in:
Shengliang Guan 2022-04-25 19:29:15 +08:00
parent f2ea7c1fbd
commit 5a91ecfb7c
1 changed files with 1 additions and 1 deletions

View File

@ -750,7 +750,7 @@ void shellReadHistory() {
void shellWriteHistory() { void shellWriteHistory() {
SShellHistory *pHistory = &shell.history; SShellHistory *pHistory = &shell.history;
TdFilePtr pFile = taosOpenFile(pHistory->file, TD_FILE_WRITE | TD_FILE_STREAM); TdFilePtr pFile = taosOpenFile(pHistory->file, TD_FILE_CREATE | TD_FILE_WRITE | TD_FILE_STREAM | TD_FILE_APPEND);
if (pFile == NULL) return; if (pFile == NULL) return;
for (int32_t i = pHistory->hstart; i != pHistory->hend;) { for (int32_t i = pHistory->hstart; i != pHistory->hend;) {