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

fix filter error

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