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

Merge pull request #10754 from taosdata/szhou/bug/td-13946

[TD-13946]: fix bug caused by int16_t colBytes as head/tail/unique
......@@ -4946,7 +4946,7 @@ static int32_t createGlobalAggregateExpr(SQueryAttr* pQueryAttr, SQueryInfo* pQu
pse->colType = pExpr->base.resType;
if(pExpr->base.resBytes > INT16_MAX &&
(pExpr->base.functionId == TSDB_FUNC_UNIQUE || pExpr->base.functionId == TSDB_FUNC_MODE
|| pExpr->base.functionId == TSDB_FUNC_TAIL)){
|| pExpr->base.functionId == TSDB_FUNC_TAIL || pExpr->base.functionId == TSDB_FUNC_SAMPLE)){
pQueryAttr->interBytesForGlobal = pExpr->base.resBytes;
}else{
pse->colBytes = pExpr->base.resBytes;
......
......@@ -1935,7 +1935,7 @@ static SQLFunctionCtx* createSQLFunctionCtx(SQueryRuntimeEnv* pRuntimeEnv, SExpr
pCtx->inputType = pSqlExpr->colType;
if (pRuntimeEnv->pQueryAttr->interBytesForGlobal > INT16_MAX &&
(pSqlExpr->functionId == TSDB_FUNC_UNIQUE || pSqlExpr->functionId == TSDB_FUNC_MODE
|| pSqlExpr->functionId == TSDB_FUNC_TAIL)){
|| pSqlExpr->functionId == TSDB_FUNC_TAIL || pSqlExpr->functionId == TSDB_FUNC_SAMPLE)) {
pCtx->inputBytes = pRuntimeEnv->pQueryAttr->interBytesForGlobal;
}else{
pCtx->inputBytes = pSqlExpr->colBytes;
......
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 td13946")
tdSql.execute("create database td13946")
tdSql.execute("use td13946")
tdSql.execute("create table st ( ts timestamp, bin binary(100)) tags (t1 int)")
tdSql.execute("create table ct1 using st tags(1)")
tdSql.execute("create table ct2 using st tags(2)")
for i in range(0, 4000, 2):
tdSql.execute("insert into ct1 values(now + {}a, '{}')".format(i, i))
tdSql.execute("insert into ct2 values(now + {}a, '{}')".format(i+1, i+1))
tdSql.query("select sample(bin, 1000) from td13946.st group by tbname")
tdSql.execute('drop database td13946')
def stop(self):
tdSql.close()
tdLog.success("%s successfully executed" % __file__)
tdCases.addWindows(__file__, TDTestCase())
tdCases.addLinux(__file__, TDTestCase())
......@@ -18,3 +18,4 @@ python3 ./test.py -f 2-query/TD-13246.py
python3 ./test.py -f 2-query/TD-6347.py
python3 ./test.py -f 2-query/math_funcs.py
python3 ./test.py -f 2-query/function_histogram.py
python3 ./test.py -f 2-query/TD-13946.py
......@@ -713,6 +713,7 @@
5,,develop-test,python3 ./test.py -f 2-query/function_to_iso8601.py
5,,develop-test,python3 ./test.py -f 2-query/function_to_unixtimestamp.py
5,,develop-test,python3 ./test.py -f 2-query/time_window_keywords.py
5,,develop-test,python3 ./test.py -f 2-query/TD-13946.py
5,,develop-test,python3 ./test.py -f 2-query/query_window_keywords.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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册