Merge branch 'main' of https://github.com/taosdata/TDengine into fix/TD-26042

This commit is contained in:
wangmm0220 2023-08-30 22:13:42 +08:00
commit 2686a2632b
3 changed files with 17 additions and 3 deletions

View File

@ -3221,7 +3221,7 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = {
{
.name = "now",
.type = FUNCTION_TYPE_NOW,
.classification = FUNC_MGT_SCALAR_FUNC | FUNC_MGT_DATETIME_FUNC,
.classification = FUNC_MGT_SCALAR_FUNC | FUNC_MGT_DATETIME_FUNC | FUNC_MGT_KEEP_ORDER_FUNC,
.translateFunc = translateNowToday,
.getEnvFunc = NULL,
.initFunc = NULL,
@ -3231,7 +3231,7 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = {
{
.name = "today",
.type = FUNCTION_TYPE_TODAY,
.classification = FUNC_MGT_SCALAR_FUNC | FUNC_MGT_DATETIME_FUNC,
.classification = FUNC_MGT_SCALAR_FUNC | FUNC_MGT_DATETIME_FUNC | FUNC_MGT_KEEP_ORDER_FUNC,
.translateFunc = translateNowToday,
.getEnvFunc = NULL,
.initFunc = NULL,

View File

@ -2166,10 +2166,12 @@ static void cliSchedMsgToNextNode(SCliMsg* pMsg, SCliThrd* pThrd) {
if (rpcDebugFlag & DEBUG_DEBUG) {
STraceId* trace = &pMsg->msg.info.traceId;
char tbuf[256] = {0};
char* tbuf = taosMemoryCalloc(1, TSDB_FQDN_LEN * 5);
EPSET_DEBUG_STR(&pCtx->epSet, tbuf);
tGDebug("%s retry on next node,use:%s, step: %d,timeout:%" PRId64 "", transLabel(pThrd->pTransInst), tbuf,
pCtx->retryStep, pCtx->retryNextInterval);
taosMemoryFree(tbuf);
}
STaskArg* arg = taosMemoryMalloc(sizeof(STaskArg));

View File

@ -101,6 +101,18 @@ class TDTestCase:
self.now_check_ntb()
self.now_check_stb()
## TD-25540
tdSql.execute(f'create database db1')
tdSql.execute(f'use db1')
tdSql.execute(f"create table db1.tb (ts timestamp, c0 int)")
tdSql.execute(f'insert into db1.tb values(now + 1h, 1)')
for func in {"NOW", "NOW()", "TODAY()", "1", "'1970-01-01 00:00:00'"}:
tdSql.query(f"SELECT _wstart, count(*) FROM (SELECT ts, LAST(c0) FROM db1.tb WHERE ts > {func}) interval(1d);")
tdSql.checkRows(1)
def stop(self):
tdSql.close()
tdLog.success(f"{__file__} successfully executed")