Merge pull request #23514 from taosdata/szhou/3.0/fix/TD-27089
fix: tag scan mode when no columns after const optimization
This commit is contained in:
commit
51f1798474
|
@ -285,7 +285,7 @@ static SNode* createConstantValue() {
|
|||
static int32_t calcConstProjections(SCalcConstContext* pCxt, SSelectStmt* pSelect, bool subquery) {
|
||||
SNode* pProj = NULL;
|
||||
WHERE_EACH(pProj, pSelect->pProjectionList) {
|
||||
if (subquery && !pSelect->isDistinct && isUselessCol((SExprNode*)pProj)) {
|
||||
if (subquery && !pSelect->isDistinct && !pSelect->tagScan && isUselessCol((SExprNode*)pProj)) {
|
||||
ERASE_NODE(pSelect->pProjectionList);
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -140,4 +140,28 @@ if $data01 != @1aa@ then
|
|||
return -1
|
||||
endi
|
||||
|
||||
sql create table stb34 (ts timestamp, f int) tags(t int);
|
||||
sql insert into ctb34 using stb34 tags(1) values(now, 1)(now+1s, 2);
|
||||
sql select 1 from (select tags t from stb34 order by t)
|
||||
print $rows
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select count(*) from (select tags t from stb34)
|
||||
if $data00 != 1 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
||||
sql select 1 from (select tags ts from stb34)
|
||||
print $rows
|
||||
if $rows != 2 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select count(*) from (select tags ts from stb34)
|
||||
if $data00 != 2 then
|
||||
return -1
|
||||
endi
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
|
|
Loading…
Reference in New Issue