Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
79478826
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
79478826
编写于
10月 24, 2022
作者:
S
Shengliang Guan
提交者:
GitHub
10月 24, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #17589 from taosdata/fix/sysTableIdx
fix: fix sys idx bug
上级
b1158636
bac0f359
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
84 addition
and
5 deletion
+84
-5
source/libs/executor/src/executil.c
source/libs/executor/src/executil.c
+3
-3
source/libs/executor/src/scanoperator.c
source/libs/executor/src/scanoperator.c
+16
-2
tests/script/tsim/stable/metrics_idx.sim
tests/script/tsim/stable/metrics_idx.sim
+65
-0
未找到文件。
source/libs/executor/src/executil.c
浏览文件 @
79478826
...
...
@@ -122,7 +122,7 @@ void initGroupedResultInfo(SGroupResInfo* pGroupResInfo, SSHashObj* pHashmap, in
if
(
order
==
TSDB_ORDER_ASC
||
order
==
TSDB_ORDER_DESC
)
{
__compar_fn_t
fn
=
(
order
==
TSDB_ORDER_ASC
)
?
resultrowComparAsc
:
resultrowComparDesc
;
int32_t
size
=
POINTER_BYTES
;
int32_t
size
=
POINTER_BYTES
;
taosSort
(
pGroupResInfo
->
pRows
->
pData
,
taosArrayGetSize
(
pGroupResInfo
->
pRows
),
size
,
fn
);
}
...
...
@@ -752,8 +752,8 @@ end:
}
static
int
tableUidCompare
(
const
void
*
a
,
const
void
*
b
)
{
u
int64_t
u1
=
*
(
uint64_t
*
)
a
;
u
int64_t
u2
=
*
(
uint64_t
*
)
b
;
int64_t
u1
=
*
(
uint64_t
*
)
a
;
int64_t
u2
=
*
(
uint64_t
*
)
b
;
if
(
u1
==
u2
)
{
return
0
;
}
...
...
source/libs/executor/src/scanoperator.c
浏览文件 @
79478826
...
...
@@ -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
);
...
...
@@ -3464,7 +3476,9 @@ static SSDataBlock* sysTableBuildUserTablesByUids(SOperatorInfo* pOperator) {
return
(
pInfo
->
pRes
->
info
.
rows
==
0
)
?
NULL
:
pInfo
->
pRes
;
}
static
SSDataBlock
*
sysTableBuildUserTables
(
SOperatorInfo
*
pOperator
)
{
SExecTaskInfo
*
pTaskInfo
=
pOperator
->
pTaskInfo
;
SExecTaskInfo
*
pTaskInfo
=
pOperator
->
pTaskInfo
;
qError
(
"%p buildUserTable"
,
pTaskInfo
);
SSysTableScanInfo
*
pInfo
=
pOperator
->
info
;
if
(
pInfo
->
pCur
==
NULL
)
{
pInfo
->
pCur
=
metaOpenTbCursor
(
pInfo
->
readHandle
.
meta
);
...
...
tests/script/tsim/stable/metrics_idx.sim
0 → 100644
浏览文件 @
79478826
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
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录