diff --git a/src/kit/shell/src/shellEngine.c b/src/kit/shell/src/shellEngine.c index 750335a0379f3c1474ca15f823d15f43cd99224e..b0f71368ac0c44200ca1c1ae4f4b3812e7abc744 100644 --- a/src/kit/shell/src/shellEngine.c +++ b/src/kit/shell/src/shellEngine.c @@ -368,6 +368,10 @@ static char* formatTimestamp(char* buf, int64_t val, int precision) { tt = (time_t)(val / 1000); } + 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/src/os/src/windows/w64Dir.c b/src/os/src/windows/w64Dir.c index 7816dac0d61c22155a8cdbcf55e6d87d932762c2..c486cd0d4076cd3800882299ea5ac8607f964bbb 100644 --- a/src/os/src/windows/w64Dir.c +++ b/src/os/src/windows/w64Dir.c @@ -23,7 +23,7 @@ void taosRemoveDir(char *rootDir) { int taosMkDir(const char *path, mode_t mode) { uError("%s not implemented yet", __FUNCTION__); - return -1; + return 0; } void taosMvDir(char* destDir, char *srcDir) { diff --git a/tests/script/windows/compute/leastsquare.sim b/tests/script/windows/compute/leastsquare.sim index 4cd3ad1fb91898ba528864ed1a09dd148526a702..69c8fb377b00ad28013ac81f07818151bf387791 100644 --- a/tests/script/windows/compute/leastsquare.sim +++ b/tests/script/windows/compute/leastsquare.sim @@ -69,12 +69,14 @@ if $data00 != @{slop:1.000000, intercept:1.000000}@ then endi print =============== step5 +print select leastsquares(tbcol, 1, 1) as b from $tb interval(1d) sql select leastsquares(tbcol, 1, 1) as b from $tb interval(1m) print ===> $data01 if $data01 != @{slop:1.000000, intercept:1.000000}@ then return -1 endi +print select leastsquares(tbcol, 1, 1) as b from $tb interval(1d) sql select leastsquares(tbcol, 1, 1) as b from $tb interval(1d) print ===> $data01 if $data01 != @{slop:1.000000, intercept:1.000000}@ then diff --git a/tests/tsim/src/simExe.c b/tests/tsim/src/simExe.c index 8bc9a76545d749b698d9dcac5bc8d2a48aa9b103..0a1829f7c775980fce37f09606b04f4153d327b7 100644 --- a/tests/tsim/src/simExe.c +++ b/tests/tsim/src/simExe.c @@ -783,10 +783,15 @@ bool simExecuteNativeSqlCommand(SScript *script, char *rest, bool isSlow) { break; case TSDB_DATA_TYPE_TIMESTAMP: tt = *(int64_t *)row[i] / 1000; + if (tt < 0) { + tt = 0; + } + tp = localtime(&tt); strftime(timeStr, 64, "%y-%m-%d %H:%M:%S", tp); sprintf(value, "%s.%03d", timeStr, - (int)(*((int64_t *)row[i]) % 1000)); + (int)(*((int64_t *)row[i]) % 1000)); + break; default: break;