提交 f7fda015 编写于 作者: S Shengliang Guan

fix(tools): remove un necessary codes in taos shell

上级 86354a99
...@@ -85,7 +85,6 @@ typedef struct { ...@@ -85,7 +85,6 @@ typedef struct {
TAOS* conn; TAOS* conn;
TdThread pid; TdThread pid;
tsem_t cancelSem; tsem_t cancelSem;
int64_t result;
} SShellObj; } SShellObj;
// shellArguments.c // shellArguments.c
......
...@@ -213,13 +213,10 @@ void shellRunSingleCommandImp(char *command) { ...@@ -213,13 +213,10 @@ void shellRunSingleCommandImp(char *command) {
return; return;
} }
int64_t oresult = atomic_load_64(&shell.result);
if (shellRegexMatch(command, "^\\s*use\\s+[a-zA-Z0-9_]+\\s*;\\s*$", REG_EXTENDED | REG_ICASE)) { if (shellRegexMatch(command, "^\\s*use\\s+[a-zA-Z0-9_]+\\s*;\\s*$", REG_EXTENDED | REG_ICASE)) {
fprintf(stdout, "Database changed.\n\n"); fprintf(stdout, "Database changed.\n\n");
fflush(stdout); fflush(stdout);
atomic_store_64(&shell.result, 0);
taos_free_result(pSql); taos_free_result(pSql);
return; return;
...@@ -230,10 +227,7 @@ void shellRunSingleCommandImp(char *command) { ...@@ -230,10 +227,7 @@ void shellRunSingleCommandImp(char *command) {
int32_t error_no = 0; int32_t error_no = 0;
int32_t numOfRows = shellDumpResult(pSql, fname, &error_no, printMode); int32_t numOfRows = shellDumpResult(pSql, fname, &error_no, printMode);
if (numOfRows < 0) { if (numOfRows < 0) return;
atomic_store_64(&shell.result, 0);
return;
}
et = taosGetTimestampUs(); et = taosGetTimestampUs();
if (error_no == 0) { if (error_no == 0) {
...@@ -250,8 +244,6 @@ void shellRunSingleCommandImp(char *command) { ...@@ -250,8 +244,6 @@ void shellRunSingleCommandImp(char *command) {
} }
printf("\n"); printf("\n");
atomic_store_64(&shell.result, 0);
} }
char *shellFormatTimestamp(char *buf, int64_t val, int32_t precision) { char *shellFormatTimestamp(char *buf, int64_t val, int32_t precision) {
...@@ -398,7 +390,6 @@ int32_t shellDumpResultToFile(const char *fname, TAOS_RES *tres) { ...@@ -398,7 +390,6 @@ int32_t shellDumpResultToFile(const char *fname, TAOS_RES *tres) {
row = taos_fetch_row(tres); row = taos_fetch_row(tres);
} while (row != NULL); } while (row != NULL);
atomic_store_64(&shell.result, 0);
taosCloseFile(&pFile); taosCloseFile(&pFile);
return numOfRows; return numOfRows;
...@@ -766,7 +757,6 @@ void shellWriteHistory() { ...@@ -766,7 +757,6 @@ void shellWriteHistory() {
void shellPrintError(TAOS_RES *tres, int64_t st) { void shellPrintError(TAOS_RES *tres, int64_t st) {
int64_t et = taosGetTimestampUs(); int64_t et = taosGetTimestampUs();
atomic_store_ptr(&shell.result, 0);
fprintf(stderr, "\nDB error: %s (%.6fs)\n", taos_errstr(tres), (et - st) / 1E6); fprintf(stderr, "\nDB error: %s (%.6fs)\n", taos_errstr(tres), (et - st) / 1E6);
taos_free_result(tres); taos_free_result(tres);
} }
...@@ -872,7 +862,6 @@ void shellGetGrantInfo() { ...@@ -872,7 +862,6 @@ void shellGetGrantInfo() {
fprintf(stdout, "Server is Enterprise %s Edition, %s and will expire at %s.\n", serverVersion, sinfo, expiretime); fprintf(stdout, "Server is Enterprise %s Edition, %s and will expire at %s.\n", serverVersion, sinfo, expiretime);
} }
atomic_store_64(&shell.result, 0);
taos_free_result(tres); taos_free_result(tres);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册