fix filter error
This commit is contained in:
parent
1acb4dd676
commit
db7dec0347
|
@ -50,11 +50,8 @@ static void mndDestroySmaObj(SSmaObj *pSmaObj);
|
||||||
|
|
||||||
// retrieve sma index and tag index
|
// retrieve sma index and tag index
|
||||||
static int32_t mndRetrieveIdx(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBlock, int32_t rows) {
|
static int32_t mndRetrieveIdx(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBlock, int32_t rows) {
|
||||||
// TODO
|
|
||||||
int32_t read = mndRetrieveSma(pReq, pShow, pBlock, rows);
|
int32_t read = mndRetrieveSma(pReq, pShow, pBlock, rows);
|
||||||
|
|
||||||
read += mndRetrieveTagIdx(pReq, pShow, pBlock, rows - read);
|
read += mndRetrieveTagIdx(pReq, pShow, pBlock, rows - read);
|
||||||
|
|
||||||
return read;
|
return read;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1124,8 +1124,10 @@ int32_t metaFilterCreateTime(SMeta *pMeta, SMetaFltParam *param, SArray *pUids)
|
||||||
if (cmp == 0)
|
if (cmp == 0)
|
||||||
taosArrayPush(pUids, &p->uid);
|
taosArrayPush(pUids, &p->uid);
|
||||||
else {
|
else {
|
||||||
if (param->equal == true) break;
|
if (param->equal == true) {
|
||||||
count++;
|
if (count > TRY_ERROR_LIMIT) break;
|
||||||
|
count++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
valid = param->reverse ? tdbTbcMoveToPrev(pCursor->pCur) : tdbTbcMoveToNext(pCursor->pCur);
|
valid = param->reverse ? tdbTbcMoveToPrev(pCursor->pCur) : tdbTbcMoveToNext(pCursor->pCur);
|
||||||
if (valid < 0) break;
|
if (valid < 0) break;
|
||||||
|
@ -1182,8 +1184,10 @@ int32_t metaFilterTableName(SMeta *pMeta, SMetaFltParam *param, SArray *pUids) {
|
||||||
tb_uid_t tuid = *(tb_uid_t *)pEntryVal;
|
tb_uid_t tuid = *(tb_uid_t *)pEntryVal;
|
||||||
taosArrayPush(pUids, &tuid);
|
taosArrayPush(pUids, &tuid);
|
||||||
} else {
|
} else {
|
||||||
if (param->equal == true) break;
|
if (param->equal == true) {
|
||||||
count++;
|
if (count > TRY_ERROR_LIMIT) break;
|
||||||
|
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) {
|
||||||
|
@ -1329,8 +1333,10 @@ int32_t metaFilterTableIds(SMeta *pMeta, SMetaFltParam *param, SArray *pUids) {
|
||||||
}
|
}
|
||||||
taosArrayPush(pUids, &tuid);
|
taosArrayPush(pUids, &tuid);
|
||||||
} else {
|
} else {
|
||||||
if (param->equal == true) break;
|
if (param->equal == true) {
|
||||||
count++;
|
if (count > TRY_ERROR_LIMIT) break;
|
||||||
|
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) {
|
||||||
|
|
|
@ -219,8 +219,8 @@ int32_t sysFilte__CreateTime(void* arg, SNode* pNode, SArray* result) {
|
||||||
|
|
||||||
SOperatorNode* pOper = (SOperatorNode*)pNode;
|
SOperatorNode* pOper = (SOperatorNode*)pNode;
|
||||||
SValueNode* pVal = (SValueNode*)pOper->pRight;
|
SValueNode* pVal = (SValueNode*)pOper->pRight;
|
||||||
bool reverse = false;
|
|
||||||
|
|
||||||
|
bool reverse = false;
|
||||||
bool equal = false;
|
bool equal = false;
|
||||||
__optSysFilter func = optSysGetFilterFunc(pOper->opType, &reverse, &equal);
|
__optSysFilter func = optSysGetFilterFunc(pOper->opType, &reverse, &equal);
|
||||||
if (func == NULL) return -1;
|
if (func == NULL) return -1;
|
||||||
|
|
|
@ -0,0 +1,81 @@
|
||||||
|
system sh/stop_dnodes.sh
|
||||||
|
system sh/deploy.sh -n dnode1 -i 1
|
||||||
|
system sh/exec.sh -n dnode1 -s start
|
||||||
|
sql connect
|
||||||
|
|
||||||
|
print ======== step0
|
||||||
|
$dbPrefix = ta_3_db
|
||||||
|
$tbPrefix = ta_3_tb
|
||||||
|
$mtPrefix = ta_3_mt
|
||||||
|
$tbNum = 101
|
||||||
|
$rowNum = 20
|
||||||
|
$totalNum = 200
|
||||||
|
|
||||||
|
print =============== create database
|
||||||
|
sql create database $dbPrefix
|
||||||
|
sql use $dbPrefix
|
||||||
|
|
||||||
|
print =============== create super table and register tag index
|
||||||
|
sql create table if not exists $mtPrefix (ts timestamp, c1 int) tags (t1 int, t2 int, t3 int, t4 int, t5 int)
|
||||||
|
|
||||||
|
sql show stables
|
||||||
|
if $rows != 1 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
|
||||||
|
print =============== create child table
|
||||||
|
|
||||||
|
$i = 0
|
||||||
|
while $i < $tbNum
|
||||||
|
$tb = $tbPrefix . $i
|
||||||
|
sql create table $tb using $mtPrefix tags( $i , $i , $i , $i , $i );
|
||||||
|
$i = $i + 1
|
||||||
|
endw
|
||||||
|
|
||||||
|
sql show tables
|
||||||
|
if $rows != $tbNum then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
print =============== insert data into each table
|
||||||
|
$i = 0
|
||||||
|
while $i < $tbNum
|
||||||
|
$tb = $tbPrefix . $i
|
||||||
|
sql insert into $tb values(now, $i );
|
||||||
|
$i = $i + 1
|
||||||
|
endw
|
||||||
|
|
||||||
|
|
||||||
|
sql create index ti2 on $mtPrefix (t2)
|
||||||
|
|
||||||
|
print ==== test name conflict
|
||||||
|
#
|
||||||
|
sql_error create index ti3 on $mtPrefix(t2)
|
||||||
|
|
||||||
|
sql_error create index ti2 on $mtPrefix(t2)
|
||||||
|
sql_error create index ti2 on $mtPrefix(t1)
|
||||||
|
sql_error create index ti2 on $mtPrefix(t3)
|
||||||
|
sql_error create index ti2 on $mtPrefix(txx)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
print === show index
|
||||||
|
|
||||||
|
sql select * from information_schema.ins_indexes
|
||||||
|
if $rows != 1 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
Loading…
Reference in New Issue