Skip to content

Commit

Permalink
Merge pull request #22716 from taosdata/fix/3.1/TD-26104
Browse files Browse the repository at this point in the history
fix: select tags from child table error
  • Loading branch information
dapan1121 committed Sep 6, 2023
2 parents 8b67828 + 3a8fc1d commit 3c98ab7
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
5 changes: 5 additions & 0 deletions source/libs/planner/src/planLogicCreater.c
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,11 @@ static bool tagScanNodeHasTbname(SNode* pKeys) {
static int32_t tagScanSetExecutionMode(SScanLogicNode* pScan) {
pScan->onlyMetaCtbIdx = false;

if (pScan->tableType == TSDB_CHILD_TABLE) {
pScan->onlyMetaCtbIdx = false;
return TSDB_CODE_SUCCESS;
}

if (tagScanNodeListHasTbname(pScan->pScanPseudoCols)) {
pScan->onlyMetaCtbIdx = false;
return TSDB_CODE_SUCCESS;
Expand Down
13 changes: 13 additions & 0 deletions tests/script/tsim/query/tag_scan.sim
Original file line number Diff line number Diff line change
Expand Up @@ -127,4 +127,17 @@ if $data01 != @1aa@ then
return -1
endi

sql select tags t,b from ctt11
print $rows
print $data00 $data01
if $rows != 1 then
return -1
endi
if $data00 != @1@ then
return -1
endi
if $data01 != @1aa@ then
return -1
endi

system sh/exec.sh -n dnode1 -s stop -x SIGINT

0 comments on commit 3c98ab7

Please sign in to comment.