提交 fd6ec6d3 编写于 作者: S Shengliang Guan

minor changes

上级 359d8427
...@@ -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);
......
...@@ -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.
先完成此消息的编辑!
想要评论请 注册