提交 1d8ada31 编写于 作者: G Ganlin Zhao

[TD-11220]<feature>(query): time related functions

上级 4663d895
......@@ -10302,6 +10302,10 @@ int32_t exprTreeFromSqlExpr(SSqlCmd* pCmd, tExprNode **pExpr, const tSqlExpr* pS
return ret;
}
}
//set precision
STableMetaInfo* pTableMetaInfo = tscGetMetaInfo(pQueryInfo, pQueryInfo->curTableIdx);
STableComInfo tinfo = tscGetTableInfo(pTableMetaInfo->pTableMeta);
(*pExpr)->_func.precision = tinfo.precision;
} else {
// arithmetic expression on the results of aggregation functions
*pExpr = calloc(1, sizeof(tExprNode));
......
......@@ -134,6 +134,7 @@ typedef struct tExprNode {
int16_t functionId;
int32_t numChildren;
struct tExprNode **pChildren;
int32_t precision;
} _func;
TAOS_FIELD *pType;
......
......@@ -1189,7 +1189,7 @@ int32_t exprValidateTimeNode(tExprNode *pExpr) {
return TSDB_CODE_TSC_OUT_OF_MEMORY;
}
child->pVal->nType = TSDB_DATA_TYPE_TIMESTAMP;
child->pVal->i64 = taosGetTimestampToday() * 1000;
child->pVal->i64 = taosGetTimestampToday() * pExpr->_func.precision;
pExpr->resultType = TSDB_DATA_TYPE_TIMESTAMP;
pExpr->resultBytes = (int16_t)tDataTypes[pExpr->resultType].bytes;
break;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册