提交 4b6c0736 编写于 作者: dengyihao's avatar dengyihao

fix filter error

上级 5881bdb6
......@@ -1260,13 +1260,10 @@ int32_t metaFilterTableIds(SMeta *pMeta, SMetaFltParam *param, SArray *pUids) {
if (tdbTbcMoveTo(pCursor->pCur, pKey, nKey, &cmp) < 0) {
goto END;
}
if (cmp < 0) {
} else if (cmp > 0) {
if (param->reverse) {
tdbTbcMoveToPrev(pCursor->pCur);
} else {
tdbTbcMoveToNext(pCursor->pCur);
}
if (param->reverse) {
if (tdbTbcMoveToNext(pCursor->pCur) < 0) tdbTbcMoveToLast(pCursor->pCur);
} else {
if (tdbTbcMoveToPrev(pCursor->pCur) < 0) tdbTbcMoveToFirst(pCursor->pCur);
}
int count = 0;
......@@ -1282,13 +1279,13 @@ int32_t metaFilterTableIds(SMeta *pMeta, SMetaFltParam *param, SArray *pUids) {
STagIdxKey *p = entryKey;
if (p == NULL) break;
if (count >= 3) {
if (count >= 4) {
if (p->type != pCursor->type || p->suid != pCursor->suid || p->cid != pCursor->cid) {
break;
}
} else {
count++;
if (p->type != pCursor->type || p->suid != pCursor->suid || p->cid != pCursor->cid) {
count++;
valid = param->reverse ? tdbTbcMoveToPrev(pCursor->pCur) : tdbTbcMoveToNext(pCursor->pCur);
if (valid < 0) {
break;
......@@ -1308,11 +1305,11 @@ int32_t metaFilterTableIds(SMeta *pMeta, SMetaFltParam *param, SArray *pUids) {
}
taosArrayPush(pUids, &tuid);
} else if (cmp == 1) {
if (count >= 3) break;
if (count >= 4) break;
// not match but should continue to iter
} else {
// not match and no more result
if (count >= 3) break;
if (count >= 4) break;
}
count++;
valid = param->reverse ? tdbTbcMoveToPrev(pCursor->pCur) : tdbTbcMoveToNext(pCursor->pCur);
......
......@@ -76,8 +76,6 @@ $i = 0
while $i < $tbNum
sql select * from $mtPrefix where t2 > $i ;
$tmp = $tbNum - $i
$tmp = $tmp - 1
if $rows != $tmp then
print $rows
print $i
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册