Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
fd6ec6d3
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1185
Star
22015
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
fd6ec6d3
编写于
1月 19, 2022
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
minor changes
上级
359d8427
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
142 addition
and
20 deletion
+142
-20
source/dnode/mnode/impl/src/mndStb.c
source/dnode/mnode/impl/src/mndStb.c
+3
-5
tests/script/sim/db/basic6.sim
tests/script/sim/db/basic6.sim
+139
-15
未找到文件。
source/dnode/mnode/impl/src/mndStb.c
浏览文件 @
fd6ec6d3
...
@@ -839,14 +839,12 @@ static int32_t mndRetrieveStb(SMnodeMsg *pReq, SShowObj *pShow, char *data, int3
...
@@ -839,14 +839,12 @@ static int32_t mndRetrieveStb(SMnodeMsg *pReq, SShowObj *pShow, char *data, int3
SStbObj
*
pStb
=
NULL
;
SStbObj
*
pStb
=
NULL
;
int32_t
cols
=
0
;
int32_t
cols
=
0
;
char
*
pWrite
;
char
*
pWrite
;
char
prefix
[
64
]
=
{
0
};
char
prefix
[
TSDB_DB_FNAME_LEN
]
=
{
0
};
SDbObj
*
pDb
=
mndAcquireDb
(
pMnode
,
pShow
->
db
);
SDbObj
*
pDb
=
mndAcquireDb
(
pMnode
,
pShow
->
db
);
if
(
pDb
==
NULL
)
{
if
(
pDb
==
NULL
)
return
0
;
return
TSDB_CODE_MND_INVALID_DB
;
}
tstrncpy
(
prefix
,
pShow
->
db
,
64
);
tstrncpy
(
prefix
,
pShow
->
db
,
TSDB_DB_FNAME_LEN
);
strcat
(
prefix
,
TS_PATH_DELIMITER
);
strcat
(
prefix
,
TS_PATH_DELIMITER
);
int32_t
prefixLen
=
(
int32_t
)
strlen
(
prefix
);
int32_t
prefixLen
=
(
int32_t
)
strlen
(
prefix
);
...
...
tests/script/sim/db/basic6.sim
浏览文件 @
fd6ec6d3
...
@@ -7,8 +7,10 @@ print ============================ dnode1 start
...
@@ -7,8 +7,10 @@ print ============================ dnode1 start
$i = 0
$i = 0
$dbPrefix = db
$dbPrefix = db
$stPrefix = st
$tbPrefix = tb
$tbPrefix = tb
$db = $dbPrefix . $i
$db = $dbPrefix . $i
$st = $stPrefix . $i
$tb = $tbPrefix . $i
$tb = $tbPrefix . $i
print =============== step1
print =============== step1
...
@@ -68,15 +70,51 @@ if $data06 != 15 then
...
@@ -68,15 +70,51 @@ if $data06 != 15 then
return -1
return -1
endi
endi
return
print =============== step6
print =============== step6
$i = $i + 1
$i = $i + 1
while $i < 5
while $i < 5
$db = $dbPrefix . $i
$db = $dbPrefix . $i
$st = $stPrefix . $i
$tb = $tbPrefix . $i
print create database $db
sql create database $db
sql create database $db
print use $db
sql use $db
sql use $db
print create table $st (ts timestamp, i int) tags (j int)
sql create table $st (ts timestamp, i int) tags (j int)
print create table $tb using $st tags(1)
sql create table $tb using $st tags(1)
sql show stables
if $rows != 1 then
return -1
endi
print $data00 $data01 $data02 $data03
if $data00 != $st then
return -1
endi
sql show tables
if $rows != 1 then
return -1
endi
print $data00 $data01 $data02 $data03
if $data00 != $tb then
return -1
endi
$i = $i + 1
$i = $i + 1
endw
endw
return
print =============== step7
print =============== step7
$i = 0
$i = 0
while $i < 5
while $i < 5
...
@@ -86,93 +124,179 @@ while $i < 5
...
@@ -86,93 +124,179 @@ while $i < 5
endw
endw
print =============== step8
print =============== step8
$i =
0
$i =
1
$db = $dbPrefix . $i
$db = $dbPrefix . $i
$st = $stPrefix . $i
$tb = $tbPrefix . $i
$tb = $tbPrefix . $i
sql create database $db
sql create database $db
sql use $db
sql use $db
sql create table st (ts timestamp, i int) tags (j int)
sql create table
$
st (ts timestamp, i int) tags (j int)
sql create table $tb using st tags(1)
sql create table $tb using
$
st tags(1)
system sh/exec.sh -n dnode1 -s stop -x SIGINT
sql show stables
return
if $rows != 1 then
return -1
endi
if $data00 != $st then
return -1
endi
sql show tables
sql show tables
if $rows != 1 then
if $rows != 1 then
return -1
return -1
endi
endi
if $data00 != $tb then
return -1
endi
print =============== step9
print =============== step9
sql drop database $db
sql drop database $db
print =============== step10
print =============== step10
sql create database $db
sql create database $db
sql use $db
sql use $db
sql show stables
if $rows != 0 then
return -1
endi
sql show tables
sql show tables
if $rows != 0 then
if $rows != 0 then
return -1
return -1
endi
endi
print =============== step11
print =============== step11
sql create table st (ts timestamp, i int) tags (j int)
sql create table $st (ts timestamp, i int) tags (j int)
sql create table $tb using st tags(1)
sql create table $tb using $st tags(1)
sql show stables
if $rows != 1 then
return -1
endi
if $data00 != $st then
return -1
endi
sql show tables
sql show tables
if $rows != 1 then
if $rows != 1 then
return -1
return -1
endi
endi
if $data00 != $tb then
return -1
endi
print =============== step12
print =============== step12
sql drop database $db
sql drop database $db
print =============== step13
print =============== step13
sql create database $db
sql create database $db
sql use $db
sql use $db
sql show stables
if $rows != 0 then
return -1
endi
sql show tables
sql show tables
if $rows != 0 then
if $rows != 0 then
return -1
return -1
endi
endi
sql create table st (ts timestamp, i int) tags (j int)
print ============== step14
sql create table $tb using st tags(1)
sql create table $st (ts timestamp, i int) tags (j int)
sql create table $tb using $st tags(1)
sql show stables
if $rows != 1 then
return -1
endi
if $data00 != $st then
return -1
endi
sql show tables
sql show tables
if $rows != 1 then
if $rows != 1 then
return -1
return -1
endi
endi
if $data00 != $tb then
return -1
endi
sql insert into $tb values (now+1a, 0)
sql insert into $tb values (now+1a, 0)
sql insert into $tb values (now+2a, 1)
sql insert into $tb values (now+2a, 1)
sql insert into $tb values (now+3a, 2)
sql insert into $tb values (now+3a, 2)
sql insert into $tb values (now+4a, 3)
sql insert into $tb values (now+4a, 3)
sql insert into $tb values (now+5a, 4)
sql insert into $tb values (now+5a, 4)
return
sql select * from $tb
sql select * from $tb
if $rows != 5 then
if $rows != 5 then
return -1
return -1
endi
endi
sql select * from $stb
if $rows != 5 then
return -1
endi
print =============== step14
print =============== step14
sql drop database $db
sql drop database $db
print =============== step15
print =============== step15
sql create database $db
sql create database $db
sql use $db
sql use $db
sql show stables
if $rows != 0 then
return -1
endi
sql show tables
sql show tables
if $rows != 0 then
if $rows != 0 then
return -1
return -1
endi
endi
print =============== step16
print =============== step16
sql create table st (ts timestamp, i int) tags (j int)
sql create table $st (ts timestamp, i int) tags (j int)
sql create table $tb using st tags(1)
sql create table $tb using $st tags(1)
sql show stables
if $rows != 1 then
return -1
endi
if $data00 != $st then
return -1
endi
sql show tables
sql show tables
if $rows != 1 then
if $rows != 1 then
return -1
return -1
endi
endi
if $data00 != $tb then
return -1
endi
sql insert into $tb values (now+1a, 0)
sql insert into $tb values (now+2a, 1)
sql insert into $tb values (now+3a, 2)
sql insert into $tb values (now+4a, 3)
sql insert into $tb values (now+5a, 4)
sql select * from $tb
sql select * from $tb
if $rows != 0 then
if $rows != 5 then
return -1
endi
sql select * from $stb
if $rows != 5 then
return -1
return -1
endi
endi
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录