diff --git a/src/kit/shell/src/shellEngine.c b/src/kit/shell/src/shellEngine.c index a7a69e5f457f2729c0ff6065b865b7f1b141ab7a..2838dc5386bbbf44106e6be0ae38c3905dd0cc8a 100644 --- a/src/kit/shell/src/shellEngine.c +++ b/src/kit/shell/src/shellEngine.c @@ -371,9 +371,13 @@ static char* formatTimestamp(char* buf, int64_t val, int precision) { tt = (time_t)(val / 1000); } +/* comment out as it make testcases like select_with_tags.sim fail. + but in windows, this may cause the call to localtime crash if tt < 0, + need to find a better solution. if (tt < 0) { tt = 0; } + */ struct tm* ptm = localtime(&tt); size_t pos = strftime(buf, 32, "%Y-%m-%d %H:%M:%S", ptm); diff --git a/tests/tsim/src/simExe.c b/tests/tsim/src/simExe.c index 0a1829f7c775980fce37f09606b04f4153d327b7..677cea54c2e33b75d8e00b83e03b2e8be475ff3e 100644 --- a/tests/tsim/src/simExe.c +++ b/tests/tsim/src/simExe.c @@ -783,9 +783,13 @@ bool simExecuteNativeSqlCommand(SScript *script, char *rest, bool isSlow) { break; case TSDB_DATA_TYPE_TIMESTAMP: tt = *(int64_t *)row[i] / 1000; + /* comment out as it make testcases like select_with_tags.sim fail. + but in windows, this may cause the call to localtime crash if tt < 0, + need to find a better solution. if (tt < 0) { tt = 0; } + */ tp = localtime(&tt); strftime(timeStr, 64, "%y-%m-%d %H:%M:%S", tp);