未验证 提交 044d56ea 编写于 作者: D dapan1121 提交者: GitHub

Merge pull request #9095 from taosdata/szhou/hotfix/td-11969

TD-11969: fix coredump when max and projection appears at the outer query
......@@ -2490,6 +2490,7 @@ int32_t addProjectionExprAndResultField(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, t
/*SExprInfo* pExpr = */ tscAddFuncInSelectClause(pQueryInfo, startPos, TSDB_FUNC_TAGPRJ, &index, &colSchema,
TSDB_COL_TAG, getNewResColId(pCmd));
}
pQueryInfo->type |= TSDB_QUERY_TYPE_PROJECTION_QUERY;
} else {
STableMetaInfo* pTableMetaInfo = tscGetMetaInfo(pQueryInfo, index.tableIndex);
STableMeta* pTableMeta = pTableMetaInfo->pTableMeta;
......
......@@ -941,6 +941,17 @@ if $data02 != 0 then
return -1
endi
print ==============> TD-11969
sql create database test11969;
sql use test11969;
sql create stable st (ts timestamp , id int ) tags (ind int );
sql insert into sub1 using st tags(1) values(now ,1);
sql insert into sub1 using st tags(1) values(now ,2);
sql insert into sub2 using st tags(2) values(now ,3);
sql insert into sub2 using st tags(2) values(now ,4);
sql_error select max(ts_inter) ,tbname from (select elapsed(ts) ts_inter ,tbname from st interval (1s) group by tbname) order by ts
sql drop database test11969
print ==========================================> TD-11097
sql create database td11097
sql use td11097
......@@ -1144,4 +1155,5 @@ if $data51 != @43@ then
return -1
endi
sql drop database td11097
system sh/exec.sh -n dnode1 -s stop -x SIGINT
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册