fix: invalid read/write
This commit is contained in:
parent
8b8748769c
commit
0237c68e27
|
@ -663,12 +663,23 @@ int32_t metaFilteTableIds(SMeta *pMeta, SMetaFltParam *param, SArray *pUids) {
|
||||||
|
|
||||||
void * entryKey = NULL, *entryVal = NULL;
|
void * entryKey = NULL, *entryVal = NULL;
|
||||||
int32_t nEntryKey, nEntryVal;
|
int32_t nEntryKey, nEntryVal;
|
||||||
|
bool first = true;
|
||||||
while (1) {
|
while (1) {
|
||||||
valid = tdbTbcGet(pCursor->pCur, (const void **)&entryKey, &nEntryKey, (const void **)&entryVal, &nEntryVal);
|
valid = tdbTbcGet(pCursor->pCur, (const void **)&entryKey, &nEntryKey, (const void **)&entryVal, &nEntryVal);
|
||||||
if (valid < 0) {
|
if (valid < 0) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
STagIdxKey *p = entryKey;
|
STagIdxKey *p = entryKey;
|
||||||
|
if (p->type != pCursor->type) {
|
||||||
|
if (first) {
|
||||||
|
valid = param->reverse ? tdbTbcMoveToPrev(pCursor->pCur) : tdbTbcMoveToNext(pCursor->pCur);
|
||||||
|
if (valid < 0) break;
|
||||||
|
continue;
|
||||||
|
} else {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
first = false;
|
||||||
if (p != NULL) {
|
if (p != NULL) {
|
||||||
int32_t cmp = (*param->filterFunc)(p->data, pKey->data, pKey->type);
|
int32_t cmp = (*param->filterFunc)(p->data, pKey->data, pKey->type);
|
||||||
if (cmp == 0) {
|
if (cmp == 0) {
|
||||||
|
|
|
@ -73,5 +73,80 @@ if $rows != 6 then
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
|
||||||
|
print ========== prepare stbBin and ctbBin
|
||||||
|
sql create table db.stbBin (ts timestamp, c1 int, c2 binary(4)) tags(t1 binary(16))
|
||||||
|
|
||||||
|
|
||||||
|
sql create table db.ctbBin using db.stbBin tags("a")
|
||||||
|
sql insert into db.ctbBin values(now, 1, "2")
|
||||||
|
|
||||||
|
sql create table db.ctbBin1 using db.stbBin tags("b")
|
||||||
|
sql insert into db.ctbBin1 values(now, 2, "2")
|
||||||
|
|
||||||
|
sql create table db.ctbBin2 using db.stbBin tags("c")
|
||||||
|
sql insert into db.ctbBin2 values(now, 3, "2")
|
||||||
|
|
||||||
|
sql create table db.ctbBin3 using db.stbBin tags("d")
|
||||||
|
sql insert into db.ctbBin3 values(now, 4, "2")
|
||||||
|
|
||||||
|
sql select * from db.stbBin where t1 = "a"
|
||||||
|
if $rows != 1 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
|
||||||
|
|
||||||
|
sql select * from db.stbBin where t1 < "a"
|
||||||
|
if $rows != 0 then
|
||||||
|
return -=1
|
||||||
|
endi
|
||||||
|
|
||||||
|
sql select * from db.stbBin where t1 < "b"
|
||||||
|
if $rows != 1 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
|
||||||
|
|
||||||
|
sql select * from db.stbBin where t1 between "a" and "e"
|
||||||
|
if $rows != 4 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
|
||||||
|
|
||||||
|
print ========== prepare stbNc and ctbNc
|
||||||
|
sql create table db.stbNc (ts timestamp, c1 int, c2 binary(4)) tags(t1 nchar(16))
|
||||||
|
|
||||||
|
|
||||||
|
sql create table db.ctbNc using db.stbNc tags("a")
|
||||||
|
sql insert into db.ctbNc values(now, 1, "2")
|
||||||
|
|
||||||
|
sql create table db.ctbNc1 using db.stbNc tags("b")
|
||||||
|
sql insert into db.ctbNc1 values(now, 2, "2")
|
||||||
|
|
||||||
|
sql create table db.ctbNc2 using db.stbNc tags("c")
|
||||||
|
sql insert into db.ctbNc2 values(now, 3, "2")
|
||||||
|
|
||||||
|
sql create table db.ctbNc3 using db.stbNc tags("d")
|
||||||
|
sql insert into db.ctbNc3 values(now, 4, "2")
|
||||||
|
|
||||||
|
sql select * from db.stbNc where t1 = "a"
|
||||||
|
if $rows != 1 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
|
||||||
|
|
||||||
|
sql select * from db.stbNc where t1 < "a"
|
||||||
|
if $rows != 0 then
|
||||||
|
return -=1
|
||||||
|
endi
|
||||||
|
|
||||||
|
sql select * from db.stbNc where t1 < "b"
|
||||||
|
if $rows != 1 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
|
||||||
|
|
||||||
|
sql select * from db.stbNc where t1 between "a" and "e"
|
||||||
|
if $rows != 4 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
|
|
Loading…
Reference in New Issue