fix sys idx bug
This commit is contained in:
parent
93a61a1893
commit
bac0f359ee
|
@ -752,8 +752,8 @@ end:
|
|||
}
|
||||
|
||||
static int tableUidCompare(const void* a, const void* b) {
|
||||
uint64_t u1 = *(uint64_t*)a;
|
||||
uint64_t u2 = *(uint64_t*)b;
|
||||
int64_t u1 = *(uint64_t*)a;
|
||||
int64_t u2 = *(uint64_t*)b;
|
||||
if (u1 == u2) {
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -3191,12 +3191,24 @@ static int32_t optSysCheckOper(SNode* pOpear) {
|
|||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int tableUidCompare(const void* a, const void* b) {
|
||||
int64_t u1 = *(int64_t*)a;
|
||||
int64_t u2 = *(int64_t*)b;
|
||||
if (u1 == u2) {
|
||||
return 0;
|
||||
}
|
||||
return u1 < u2 ? -1 : 1;
|
||||
}
|
||||
static int32_t optSysMergeRslt(SArray* mRslt, SArray* rslt) {
|
||||
// TODO, find comm mem from mRslt
|
||||
for (int i = 0; i < taosArrayGetSize(mRslt); i++) {
|
||||
SArray* aRslt = taosArrayGetP(mRslt, i);
|
||||
taosArrayAddAll(rslt, aRslt);
|
||||
}
|
||||
taosArraySort(rslt, tableUidCompare);
|
||||
taosArrayRemoveDuplicate(rslt, tableUidCompare, NULL);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -3455,7 +3467,7 @@ static SSDataBlock* sysTableBuildUserTablesByUids(SOperatorInfo* pOperator) {
|
|||
if (i >= taosArrayGetSize(pIdx->uids)) {
|
||||
doSetOperatorCompleted(pOperator);
|
||||
} else {
|
||||
pIdx->lastIdx = i;
|
||||
pIdx->lastIdx = i + 1;
|
||||
}
|
||||
|
||||
blockDataDestroy(p);
|
||||
|
@ -3465,6 +3477,8 @@ static SSDataBlock* sysTableBuildUserTablesByUids(SOperatorInfo* pOperator) {
|
|||
}
|
||||
static SSDataBlock* sysTableBuildUserTables(SOperatorInfo* pOperator) {
|
||||
SExecTaskInfo* pTaskInfo = pOperator->pTaskInfo;
|
||||
|
||||
qError("%p buildUserTable", pTaskInfo);
|
||||
SSysTableScanInfo* pInfo = pOperator->info;
|
||||
if (pInfo->pCur == NULL) {
|
||||
pInfo->pCur = metaOpenTbCursor(pInfo->readHandle.meta);
|
||||
|
|
|
@ -0,0 +1,65 @@
|
|||
system sh/stop_dnodes.sh
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sql connect
|
||||
|
||||
$dbPrefix = m_me_db_idx
|
||||
$tbPrefix = m_me_tb_idx
|
||||
$mtPrefix = m_me_mt_idx
|
||||
|
||||
print =============== step1
|
||||
$i = 0
|
||||
$db = $dbPrefix
|
||||
$mt = $mtPrefix
|
||||
|
||||
sql drop database if exists $db
|
||||
sql create database $db
|
||||
|
||||
sql use $db
|
||||
|
||||
sql create table $mt (ts timestamp, speed int) TAGS(sp int)
|
||||
|
||||
$tbNum = 10000
|
||||
|
||||
while $i < $tbNum
|
||||
$tb = $tbPrefix . $i
|
||||
sql insert into $tb using $mt tags( $i ) values(now, $i )
|
||||
$i = $i + 1
|
||||
endw
|
||||
|
||||
sql use information_schema
|
||||
sql select count(*) from ins_tables where db_name = "m_me_db_idx" and create_time > now() - 10m
|
||||
if $data[0][0] != $tbNum then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select count(*) from ins_tables where db_name = "m_me_db_idx" and create_time < now();
|
||||
if $data[0][0] != $tbNum then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sleep 1000
|
||||
|
||||
|
||||
sql use $db
|
||||
$doubletbNum = 20000
|
||||
|
||||
while $i < $doubletbNum
|
||||
$tb = $tbPrefix . $i
|
||||
sql insert into $tb using $mt tags( $i ) values(now, $i )
|
||||
$i = $i + 1
|
||||
endw
|
||||
|
||||
|
||||
sql use information_schema
|
||||
|
||||
sql select count(*) from ins_tables where db_name = "m_me_db_idx" and create_time < now();
|
||||
if $data[0][0] != $doubletbNum then
|
||||
print ==== $data[0][0]
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue