提交 1720e556 编写于 作者: S shenglian zhou

fix coredump when max and projection appears at the outer query

上级 5ae3f8db
...@@ -2490,6 +2490,7 @@ int32_t addProjectionExprAndResultField(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, t ...@@ -2490,6 +2490,7 @@ int32_t addProjectionExprAndResultField(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, t
/*SExprInfo* pExpr = */ tscAddFuncInSelectClause(pQueryInfo, startPos, TSDB_FUNC_TAGPRJ, &index, &colSchema, /*SExprInfo* pExpr = */ tscAddFuncInSelectClause(pQueryInfo, startPos, TSDB_FUNC_TAGPRJ, &index, &colSchema,
TSDB_COL_TAG, getNewResColId(pCmd)); TSDB_COL_TAG, getNewResColId(pCmd));
} }
pQueryInfo->type |= TSDB_QUERY_TYPE_PROJECTION_QUERY;
} else { } else {
STableMetaInfo* pTableMetaInfo = tscGetMetaInfo(pQueryInfo, index.tableIndex); STableMetaInfo* pTableMetaInfo = tscGetMetaInfo(pQueryInfo, index.tableIndex);
STableMeta* pTableMeta = pTableMetaInfo->pTableMeta; STableMeta* pTableMeta = pTableMetaInfo->pTableMeta;
......
...@@ -941,4 +941,14 @@ if $data02 != 0 then ...@@ -941,4 +941,14 @@ if $data02 != 0 then
return -1 return -1
endi 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
system sh/exec.sh -n dnode1 -s stop -x SIGINT 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.
先完成此消息的编辑!
想要评论请 注册