diff --git a/src/client/src/tscSQLParser.c b/src/client/src/tscSQLParser.c index 4a9b0ac8150002a832db49704feaa71c889afcdd..c26d16c9e2ee151f0f97338f195a5bb50232b7c6 100644 --- a/src/client/src/tscSQLParser.c +++ b/src/client/src/tscSQLParser.c @@ -6678,9 +6678,8 @@ int32_t doCheckForStream(SSqlObj* pSql, SSqlInfo* pInfo) { const char* msg5 = "sql too long"; // todo ADD support const char* msg6 = "from missing in subclause"; const char* msg7 = "time interval is required"; - const char* msg8 = "query column is required"; - const char* msg9 = "the first column must be timestamp type"; - + const char* msg8 = "the first column should be primary timestamp column"; + SSqlCmd* pCmd = &pSql->cmd; SQueryInfo* pQueryInfo = tscGetQueryInfoDetail(pCmd, 0); assert(pQueryInfo->numOfTables == 1); @@ -6751,7 +6750,7 @@ int32_t doCheckForStream(SSqlObj* pSql, SSqlInfo* pInfo) { return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg8); } if( pSqlExpr->colInfo.colId != PRIMARYKEY_TIMESTAMP_COL_INDEX) { - return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg9); + return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg8); } } else { if (pQueryInfo->interval.interval == 0) { diff --git a/src/client/src/tscStream.c b/src/client/src/tscStream.c index ed024e21bacb3a08a3817505a0d29e7f8cbc0fef..de2f0087ce50603b100bf3c384be3dea13e05f2a 100644 --- a/src/client/src/tscStream.c +++ b/src/client/src/tscStream.c @@ -340,8 +340,12 @@ static void tscSetRetryTimer(SSqlStream *pStream, SSqlObj *pSql, int64_t timer) if (pStream->isProject) { int64_t now = taosGetTimestamp(pStream->precision); int64_t etime = now > pStream->etime ? pStream->etime : now; - - if (pStream->etime < now && now - pStream->etime > tsMaxRetentWindow) { + int64_t maxRetent = tsMaxRetentWindow * 1000; + if(pStream->precision == TSDB_TIME_PRECISION_MICRO) { + maxRetent *= 1000; + } + + if (pStream->etime < now && now - pStream->etime > maxRetent) { /* * current time window will be closed, since it too early to exceed the maxRetentWindow value */