Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
fd6ec6d3
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看板
提交
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
SStbObj
*
pStb
=
NULL
;
int32_t
cols
=
0
;
char
*
pWrite
;
char
prefix
[
64
]
=
{
0
};
char
prefix
[
TSDB_DB_FNAME_LEN
]
=
{
0
};
SDbObj
*
pDb
=
mndAcquireDb
(
pMnode
,
pShow
->
db
);
if
(
pDb
==
NULL
)
{
return
TSDB_CODE_MND_INVALID_DB
;
}
if
(
pDb
==
NULL
)
return
0
;
tstrncpy
(
prefix
,
pShow
->
db
,
64
);
tstrncpy
(
prefix
,
pShow
->
db
,
TSDB_DB_FNAME_LEN
);
strcat
(
prefix
,
TS_PATH_DELIMITER
);
int32_t
prefixLen
=
(
int32_t
)
strlen
(
prefix
);
...
...
tests/script/sim/db/basic6.sim
浏览文件 @
fd6ec6d3
...
...
@@ -7,8 +7,10 @@ print ============================ dnode1 start
$i = 0
$dbPrefix = db
$stPrefix = st
$tbPrefix = tb
$db = $dbPrefix . $i
$st = $stPrefix . $i
$tb = $tbPrefix . $i
print =============== step1
...
...
@@ -68,15 +70,51 @@ if $data06 != 15 then
return -1
endi
return
print =============== step6
$i = $i + 1
while $i < 5
$db = $dbPrefix . $i
$st = $stPrefix . $i
$tb = $tbPrefix . $i
print create database $db
sql create database $db
print 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
endw
return
print =============== step7
$i = 0
while $i < 5
...
...
@@ -86,93 +124,179 @@ while $i < 5
endw
print =============== step8
$i =
0
$i =
1
$db = $dbPrefix . $i
$st = $stPrefix . $i
$tb = $tbPrefix . $i
sql create database $db
sql use $db
sql create table st (ts timestamp, i int) tags (j int)
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)
system sh/exec.sh -n dnode1 -s stop -x SIGINT
return
sql show stables
if $rows != 1 then
return -1
endi
if $data00 != $st then
return -1
endi
sql show tables
if $rows != 1 then
return -1
endi
if $data00 != $tb then
return -1
endi
print =============== step9
sql drop database $db
print =============== step10
sql create database $db
sql use $db
sql show stables
if $rows != 0 then
return -1
endi
sql show tables
if $rows != 0 then
return -1
endi
print =============== step11
sql create table st (ts timestamp, i int) tags (j int)
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
if $rows != 1 then
return -1
endi
if $data00 != $tb then
return -1
endi
print =============== step12
sql drop database $db
print =============== step13
sql create database $db
sql use $db
sql show stables
if $rows != 0 then
return -1
endi
sql show tables
if $rows != 0 then
return -1
endi
sql create table st (ts timestamp, i int) tags (j int)
sql create table $tb using st tags(1)
print ============== step14
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
if $rows != 1 then
return -1
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)
return
sql select * from $tb
if $rows != 5 then
return -1
endi
sql select * from $stb
if $rows != 5 then
return -1
endi
print =============== step14
sql drop database $db
print =============== step15
sql create database $db
sql use $db
sql show stables
if $rows != 0 then
return -1
endi
sql show tables
if $rows != 0 then
return -1
endi
print =============== step16
sql create table st (ts timestamp, i int) tags (j int)
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
if $rows != 1 then
return -1
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
if $rows != 0 then
if $rows != 5 then
return -1
endi
sql select * from $stb
if $rows != 5 then
return -1
endi
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录