提交 629d58a0 编写于 作者: X xywang

feat(query): fixed parsing error in rewriting results to file

上级 56fa4e71
......@@ -244,13 +244,22 @@ void shellRunCommandOnServer(TAOS *con, char command[]) {
int64_t st, et;
wordexp_t full_path;
char * sptr = NULL;
char * tmp = NULL;
char * cptr = NULL;
char * fname = NULL;
bool printMode = false;
sptr = command;
while ((sptr = tstrstr(sptr, ">>", true)) != NULL) {
if (regex_match(sptr + 2, "^\\s*+[a-zA-Z0-9_]+\\s*;\\s*$", REG_EXTENDED | REG_ICASE)) {
// find the last ">>" if any
tmp = sptr;
sptr += 2;
}
sptr = tmp;
if (sptr != NULL) {
if (regex_match(sptr + 2, "^\\s*[\\>|\\<|\\<=|\\>=|=|!=]\\s*;\\s*$", REG_EXTENDED | REG_ICASE) == 0) {
cptr = tstrstr(command, ";", true);
if (cptr != NULL) {
*cptr = '\0';
......@@ -262,10 +271,6 @@ void shellRunCommandOnServer(TAOS *con, char command[]) {
}
*sptr = '\0';
fname = full_path.we_wordv[0];
break;
} else {
sptr += 2;
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册