fix(query): fix bug in "tbname in" query.
This commit is contained in:
parent
c9ce01c878
commit
fab32ae930
|
@ -943,8 +943,12 @@ static int32_t doFilterByTagCond(STableListInfo* pListInfo, SArray* pUidList, SN
|
||||||
|
|
||||||
// int64_t stt = taosGetTimestampUs();
|
// int64_t stt = taosGetTimestampUs();
|
||||||
SArray* pUidTagList = taosArrayInit(10, sizeof(STUidTagInfo));
|
SArray* pUidTagList = taosArrayInit(10, sizeof(STUidTagInfo));
|
||||||
|
copyExistedUids(pUidTagList, pUidList);
|
||||||
|
|
||||||
int32_t filter = optimizeTbnameInCond(metaHandle, pListInfo->suid, pUidTagList, pTagCond);
|
int32_t filter = optimizeTbnameInCond(metaHandle, pListInfo->suid, pUidTagList, pTagCond);
|
||||||
if (filter == 0) { // tbname in filter is activated, do nothing and return
|
if (filter == 0) { // tbname in filter is activated, do nothing and return
|
||||||
|
taosArrayClear(pUidList);
|
||||||
|
|
||||||
int32_t numOfRows = taosArrayGetSize(pUidTagList);
|
int32_t numOfRows = taosArrayGetSize(pUidTagList);
|
||||||
taosArrayEnsureCap(pUidList, numOfRows);
|
taosArrayEnsureCap(pUidList, numOfRows);
|
||||||
for(int32_t i = 0; i < numOfRows; ++i) {
|
for(int32_t i = 0; i < numOfRows; ++i) {
|
||||||
|
@ -956,7 +960,6 @@ static int32_t doFilterByTagCond(STableListInfo* pListInfo, SArray* pUidList, SN
|
||||||
goto end;
|
goto end;
|
||||||
} else {
|
} else {
|
||||||
// here we retrieve all tags from the vnode table-meta store
|
// here we retrieve all tags from the vnode table-meta store
|
||||||
copyExistedUids(pUidTagList, pUidList);
|
|
||||||
code = metaGetTableTags(metaHandle, pListInfo->suid, pUidTagList);
|
code = metaGetTableTags(metaHandle, pListInfo->suid, pUidTagList);
|
||||||
if (code != TSDB_CODE_SUCCESS) {
|
if (code != TSDB_CODE_SUCCESS) {
|
||||||
qError("failed to get table tags from meta, reason:%s, suid:%" PRIu64, tstrerror(code), pListInfo->suid);
|
qError("failed to get table tags from meta, reason:%s, suid:%" PRIu64, tstrerror(code), pListInfo->suid);
|
||||||
|
|
|
@ -351,7 +351,7 @@ sql_error select last_row(*) from (select * from nest_tb0) having c1 > 0
|
||||||
print ===========>td-4805
|
print ===========>td-4805
|
||||||
sql_error select tbname, i from (select * from nest_tb0) group by i;
|
sql_error select tbname, i from (select * from nest_tb0) group by i;
|
||||||
|
|
||||||
sql select count(*),c1 from (select * from nest_tb0) where c1 < 2 group by c1;
|
sql select count(*),c1 from (select * from nest_tb0) where c1 < 2 group by c1 order by c1;
|
||||||
if $rows != 2 then
|
if $rows != 2 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
Loading…
Reference in New Issue