Merge pull request #29004 from taosdata/fix/TS-5712-main

fix:[TS-5712] calculate ts error in vectorMathTsSubHelper
This commit is contained in:
Shengliang Guan 2024-12-03 14:03:57 +08:00 committed by GitHub
commit 9829fb9b84
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 47 additions and 1 deletions

View File

@ -1377,7 +1377,7 @@ static int32_t vectorMathTsSubHelper(SColumnInfoData *pLeftCol, SColumnInfoData
SCL_ERR_RET(getVectorBigintValueFnLeft(pLeftCol->pData, i, &leftRes));
SCL_ERR_RET(getVectorBigintValueFnRight(pRightCol->pData, 0, &rightRes));
*output =
taosTimeAdd(leftRes, -rightRes, pRightCol->info.scale, pRightCol->info.precision);
taosTimeAdd(leftRes, -rightRes, pRightCol->info.scale, pRightCol->info.precision) * factor;
}
}
SCL_RET(TSDB_CODE_SUCCESS);

View File

@ -209,6 +209,7 @@
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/slimit.py -Q 2
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/slimit.py -Q 3
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/slimit.py -Q 4
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/ts-5712.py
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/ts-4233.py
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/ts-4233.py -Q 2
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/ts-4233.py -Q 3

View File

@ -0,0 +1,45 @@
import taos
from util.log import *
from util.sql import *
from util.cases import *
from util.dnodes import *
from util.common import *
class TDTestCase:
def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar)
tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), True)
self.dbname = 'db'
self.stbname = 'st'
def prepareData(self):
# db
tdSql.execute(f"create database db;")
tdSql.execute(f"use db")
# super table
tdSql.execute("CREATE TABLE t1( time TIMESTAMP, c1 BIGINT);")
# create index for all tags
tdSql.execute("INSERT INTO t1(time, c1) VALUES (1641024000000, 0)")
tdSql.execute("INSERT INTO t1(time, c1) VALUES (1641024000001, 0)")
def check(self):
tdSql.query(f"SELECT CAST(time AS BIGINT) FROM t1 WHERE (1 - time) > 0")
tdSql.checkRows(0)
def run(self):
self.prepareData()
self.check()
def stop(self):
tdSql.close()
tdLog.success(f"{__file__} successfully executed")
tdCases.addLinux(__file__, TDTestCase())
tdCases.addWindows(__file__, TDTestCase())