未验证 提交 40d6194c 编写于 作者: S shenglian-zhou 提交者: GitHub

Merge pull request #11976 from taosdata/fix/td-14745

fix: two ts columns error when sample and interval
......@@ -1073,7 +1073,7 @@ static bool isTopBottomUniqueQuery(SQueryInfo* pQueryInfo) {
for (int32_t i = 0; i < size; ++i) {
int32_t functionId = tscExprGet(pQueryInfo, i)->base.functionId;
if (functionId == TSDB_FUNC_TOP || functionId == TSDB_FUNC_BOTTOM
if (functionId == TSDB_FUNC_TOP || functionId == TSDB_FUNC_BOTTOM || functionId == TSDB_FUNC_SAMPLE
|| functionId == TSDB_FUNC_UNIQUE || functionId == TSDB_FUNC_TAIL) {
return true;
}
......
......@@ -2701,8 +2701,11 @@ int32_t tscExprTopBottomIndex(SQueryInfo* pQueryInfo){
SExprInfo* pExpr = tscExprGet(pQueryInfo, i);
if (pExpr == NULL)
continue;
if (pExpr->base.functionId == TSDB_FUNC_TOP || pExpr->base.functionId == TSDB_FUNC_BOTTOM
|| pExpr->base.functionId == TSDB_FUNC_UNIQUE || pExpr->base.functionId == TSDB_FUNC_TAIL) {
if (pExpr->base.functionId == TSDB_FUNC_TOP
|| pExpr->base.functionId == TSDB_FUNC_BOTTOM
|| pExpr->base.functionId == TSDB_FUNC_SAMPLE
|| pExpr->base.functionId == TSDB_FUNC_UNIQUE
|| pExpr->base.functionId == TSDB_FUNC_TAIL) {
return i;
}
}
......
import sys
from util.log import *
from util.cases import *
from util.sql import *
from util.dnodes import tdDnodes
from math import inf
class TDTestCase:
def caseDescription(self):
'''
case1<shenglian zhou>: [TD-13946]core dump of sampling binary column so that when result from vnode exceeds INT16_MAX bytes
'''
return
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
self._conn = conn
def run(self):
print("running {}".format(__file__))
tdSql.execute("drop database if exists td14745")
tdSql.execute("create database td14745")
tdSql.execute("use td14745")
tdSql.execute("create table st ( ts timestamp, i int) tags (t1 int)")
tdSql.execute("create table ct1 using st tags(1)")
for i in range(100):
tdSql.execute("insert into ct1 values(now+{}a, {})".format(100*i, i))
tdSql.query("select sample(i,3) from ct1 interval(1s)")
tdSql.checkCols(2)
tdSql.query("select sample(i,3) from ct1 session(ts, 200a)")
tdSql.checkCols(2)
def stop(self):
tdSql.close()
tdLog.success("%s successfully executed" % __file__)
tdCases.addWindows(__file__, TDTestCase())
tdCases.addLinux(__file__, TDTestCase())
......@@ -725,6 +725,7 @@
5,,develop-test,python3 ./test.py -f 2-query/scalar_triangle.py
5,,develop-test,python3 ./test.py -f 2-query/scalar_expression.py
5,,develop-test,python3 ./test.py -f 2-query/scalar_powlog.py
5,,develop-test,python3 ./test.py -f 2-query/TD-14745.py
4,,system-test,python3 test.py -f 4-taosAdapter/TD-12163.py
4,,system-test,python3 ./test.py -f 3-connectors/restful/restful_binddbname.py
4,,system-test,python3 ./test.py -f 2-query/TD-12614.py
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册