Merge pull request #29004 from taosdata/fix/TS-5712-main
fix:[TS-5712] calculate ts error in vectorMathTsSubHelper
This commit is contained in:
commit
9829fb9b84
|
@ -1377,7 +1377,7 @@ static int32_t vectorMathTsSubHelper(SColumnInfoData *pLeftCol, SColumnInfoData
|
||||||
SCL_ERR_RET(getVectorBigintValueFnLeft(pLeftCol->pData, i, &leftRes));
|
SCL_ERR_RET(getVectorBigintValueFnLeft(pLeftCol->pData, i, &leftRes));
|
||||||
SCL_ERR_RET(getVectorBigintValueFnRight(pRightCol->pData, 0, &rightRes));
|
SCL_ERR_RET(getVectorBigintValueFnRight(pRightCol->pData, 0, &rightRes));
|
||||||
*output =
|
*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);
|
SCL_RET(TSDB_CODE_SUCCESS);
|
||||||
|
|
|
@ -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 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 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/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
|
||||||
,,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 2
|
||||||
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/ts-4233.py -Q 3
|
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/ts-4233.py -Q 3
|
||||||
|
|
|
@ -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())
|
Loading…
Reference in New Issue