diff --git a/src/client/src/tscProfile.c b/src/client/src/tscProfile.c index 3b0e1b5775..6492075bbd 100644 --- a/src/client/src/tscProfile.c +++ b/src/client/src/tscProfile.c @@ -273,7 +273,7 @@ int tscBuildQueryStreamDesc(void *pMsg, STscObj *pObj) { pSdesc->num = htobe64(pStream->num); pSdesc->useconds = htobe64(pStream->useconds); - pSdesc->stime = htobe64(pStream->stime - pStream->interval.interval); + pSdesc->stime = (pStream->stime == INT64_MIN) ? htobe64(pStream->stime) : htobe64(pStream->stime - pStream->interval.interval); pSdesc->ctime = htobe64(pStream->ctime); pSdesc->slidingTime = htobe64(pStream->interval.sliding); diff --git a/src/client/src/tscStream.c b/src/client/src/tscStream.c index 7699e6f459..89fc1c2621 100644 --- a/src/client/src/tscStream.c +++ b/src/client/src/tscStream.c @@ -473,6 +473,10 @@ static int32_t tscSetSlidingWindowInfo(SSqlObj *pSql, SSqlStream *pStream) { static int64_t tscGetStreamStartTimestamp(SSqlObj *pSql, SSqlStream *pStream, int64_t stime) { SQueryInfo* pQueryInfo = tscGetQueryInfoDetail(&pSql->cmd, 0); + + if (stime == INT64_MIN) { + return stime; + } if (pStream->isProject) { // no data in table, flush all data till now to destination meter, 10sec delay diff --git a/src/cq/src/cqMain.c b/src/cq/src/cqMain.c index d4d202267c..854fbf2ec9 100644 --- a/src/cq/src/cqMain.c +++ b/src/cq/src/cqMain.c @@ -430,7 +430,7 @@ static void cqCreateStream(SCqContext *pContext, SCqObj *pObj) { pObj->tmrId = 0; if (pObj->pStream == NULL) { - pObj->pStream = taos_open_stream(pContext->dbConn, pObj->sqlStr, cqProcessStreamRes, 0, (void *)pObj->rid, NULL); + pObj->pStream = taos_open_stream(pContext->dbConn, pObj->sqlStr, cqProcessStreamRes, INT64_MIN, (void *)pObj->rid, NULL); // TODO the pObj->pStream may be released if error happens if (pObj->pStream) { diff --git a/src/kit/shell/src/shellEngine.c b/src/kit/shell/src/shellEngine.c index 0eb1248fad..899a0af615 100644 --- a/src/kit/shell/src/shellEngine.c +++ b/src/kit/shell/src/shellEngine.c @@ -391,6 +391,11 @@ int regex_match(const char *s, const char *reg, int cflags) { static char* formatTimestamp(char* buf, int64_t val, int precision) { + if (val == INT64_MIN) { + memset(buf, ' ', 23); + return buf; + } + if (args.is_raw_time) { sprintf(buf, "%" PRId64, val); return buf;