Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
0f0d0953
T
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1193
Star
22018
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看板
提交
0f0d0953
编写于
8月 15, 2023
作者:
dengyihao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
rebuild index at tag0
上级
615e79d8
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
63 addition
and
14 deletion
+63
-14
source/dnode/mnode/impl/src/mndIndex.c
source/dnode/mnode/impl/src/mndIndex.c
+2
-2
tests/parallel_test/cases.task
tests/parallel_test/cases.task
+3
-0
tests/script/tsim/tagindex/add_index.sim
tests/script/tsim/tagindex/add_index.sim
+45
-3
tests/script/tsim/tagindex/sma_and_tag_index.sim
tests/script/tsim/tagindex/sma_and_tag_index.sim
+13
-9
未找到文件。
source/dnode/mnode/impl/src/mndIndex.c
浏览文件 @
0f0d0953
...
...
@@ -696,8 +696,8 @@ int8_t mndCheckIndexNameByTagName(SMnode *pMnode, SIdxObj *pIdxObj) {
continue
;
}
if
(
strncmp
(
pIdxObj
->
colName
,
pIdx
->
colName
,
TSDB_COL_NAME_LEN
)
==
0
)
{
sdbCancelFetch
(
pSdb
,
pIter
);
sdbRelease
(
pSdb
,
pIdx
);
sdbCancelFetch
(
pSdb
,
pIdx
);
exist
=
1
;
break
;
}
...
...
@@ -854,8 +854,8 @@ int32_t mndDropIdxsByStb(SMnode *pMnode, STrans *pTrans, SDbObj *pDb, SStbObj *p
if
(
pIdx
->
stbUid
==
pStb
->
uid
)
{
if
(
mndSetDropIdxCommitLogs
(
pMnode
,
pTrans
,
pIdx
)
!=
0
)
{
sdbCancelFetch
(
pSdb
,
pIter
);
sdbRelease
(
pSdb
,
pIdx
);
sdbCancelFetch
(
pSdb
,
pIdx
);
return
-
1
;
}
}
...
...
tests/parallel_test/cases.task
浏览文件 @
0f0d0953
...
...
@@ -1204,6 +1204,9 @@
,,y,script,./test.sh -f tsim/tag/drop_tag.sim
,,y,script,./test.sh -f tsim/tag/tbNameIn.sim
,,y,script,./test.sh -f tmp/monitor.sim
,,y,script,./test.sh -f tsim/tagindex/add_index.sim
,,y,script,./test.sh -f tsim/tagindex/sma_and_tag_index.sim
#develop test
,,n,develop-test,python3 ./test.py -f 2-query/table_count_scan.py
...
...
tests/script/tsim/tagindex/add_index.sim
浏览文件 @
0f0d0953
...
...
@@ -7,7 +7,7 @@ print ======== step0
$dbPrefix = ta_3_db
$tbPrefix = ta_3_tb
$mtPrefix = ta_3_mt
$tbNum = 50
0
$tbNum = 50
$rowNum = 20
$totalNum = 200
...
...
@@ -48,12 +48,16 @@ while $i < $tbNum
$i = $i + 1
endw
sql_error create index ti1 on $mtPrefix (t1)
sql create index ti2 on $mtPrefix (t2)
sql create index ti5 on $mtPrefix (t5)
print ==== test name conflict
#
sql_error create index ti1 on $mtPrefix(t1)
sql_error create index ti11 on $mtPrefix(t1)
sql_error create index ti3 on $mtPrefix(t2)
sql_error create index ti2 on $mtPrefix(t2)
...
...
@@ -73,6 +77,15 @@ while $i < $tbNum
$i = $i + 1
endw
$i = 0
while $i < $tbNum
sql select * from $mtPrefix where t1= $i ;
if $rows != 1 then
return -1
endi
$i = $i + 1
endw
print ===== test operator great equal
...
...
@@ -250,7 +263,7 @@ endw
print === show index
sql select * from information_schema.ins_indexes
if $rows !=
1
then
if $rows !=
2
then
return -1
endi
...
...
@@ -259,12 +272,41 @@ print === drop index ti2
sql drop index ti2
print === drop not exist index
sql select * from information_schema.ins_indexes
if $rows != 1 then
return -1
endi
sql drop index $data[0][0]
if $rows != 0 then
return -1
endi
sql_error drop index t2
sql_error drop index t3
sql create index ti0 on $mtPrefix (t1)
$i = $interval
while $i < $limit
sql select * from $mtPrefix where t1 <= $i ;
$tmp = $i - $interval
$tmp = $tmp + 1
if $rows != $tmp then
return -1
endi
$i = $i + 1
endw
sql_error create index ti0 on $mtPrefix (t1)
sql_error create index ti2 on $mtPrefix (t1)
sql_error create index t2i on ta_3_tb17 (t2)
...
...
tests/script/tsim/tagindex/sma_and_tag_index.sim
浏览文件 @
0f0d0953
...
...
@@ -69,7 +69,7 @@ sql create sma index smat2i on $mtPrefix function(max(c1)) interval(6m,10s) slid
sql select * from information_schema.ins_indexes
if $rows !=
2
then
if $rows !=
3
then
return -1
endi
...
...
@@ -84,7 +84,7 @@ while $i < 5
endw
sql select * from information_schema.ins_indexes
if $rows !=
6
then
if $rows !=
7
then
return -1
endi
...
...
@@ -114,13 +114,13 @@ sql use $dbPrefix
sql create table if not exists $mtPrefix (ts timestamp, c1 int) tags (t1 int, t2 int, t3 int, t4 int, t5 int)
sql create index tagt2i on $mtPrefix (t2)
sql select * from information_schema.ins_indexes
if $rows !=
1
then
if $rows !=
2
then
return -1
endi
sql alter table $mtPrefix drop tag t2
sql select * from information_schema.ins_indexes
if $rows !=
0
then
if $rows !=
1
then
return -1
endi
...
...
@@ -128,18 +128,22 @@ endi
print ==== rename tag name, and update index colName
sql create index tagt3i on $mtPrefix (t3)
sql select * from information_schema.ins_indexes
if $rows !=
1
then
if $rows !=
2
then
return -1
endi
sql alter table $mtPrefix rename tag t3 txxx
sql select * from information_schema.ins_indexes
if $rows !=
1
then
if $rows !=
2
then
return -1
endi
if $data05 != txxx then
return -1
if $data05 == txxx then
print "manual created index"
elif $data15 == txxx then
print "auto created index at tag0"
else
return -1;
endi
...
...
@@ -153,7 +157,7 @@ sql create table if not exists $mtPrefix (ts timestamp, c1 int) tags (t1 int, t2
sql create index tagt3i on $mtPrefix (t3)
sql select * from information_schema.ins_indexes
if $rows !=
2
then
if $rows !=
4
then
return -1
endi
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录