Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
dd759783
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看板
提交
dd759783
编写于
9月 19, 2022
作者:
sangshuduo
浏览文件
操作
浏览文件
下载
差异文件
Merge branch '3.0' into feat/sangshuduo/TD-14141-update-taostools-for3.0
上级
4e36fe0c
83fcf4fd
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
67 addition
and
55 deletion
+67
-55
source/common/src/systable.c
source/common/src/systable.c
+2
-2
source/dnode/mnode/impl/inc/mndDef.h
source/dnode/mnode/impl/inc/mndDef.h
+2
-2
source/dnode/mnode/impl/inc/mndTrans.h
source/dnode/mnode/impl/inc/mndTrans.h
+1
-1
source/dnode/mnode/impl/src/mndStream.c
source/dnode/mnode/impl/src/mndStream.c
+1
-1
source/dnode/mnode/impl/src/mndTrans.c
source/dnode/mnode/impl/src/mndTrans.c
+32
-32
tests/system-test/1-insert/table_param_ttl.py
tests/system-test/1-insert/table_param_ttl.py
+26
-14
tests/system-test/fulltest.sh
tests/system-test/fulltest.sh
+1
-1
utils/test/c/sdbDump.c
utils/test/c/sdbDump.c
+2
-2
未找到文件。
source/common/src/systable.c
浏览文件 @
dd759783
...
...
@@ -227,8 +227,8 @@ static const SSysDbTableSchema transSchema[] = {
{.
name
=
"id"
,
.
bytes
=
4
,
.
type
=
TSDB_DATA_TYPE_INT
,
.
sysInfo
=
false
},
{.
name
=
"create_time"
,
.
bytes
=
8
,
.
type
=
TSDB_DATA_TYPE_TIMESTAMP
,
.
sysInfo
=
false
},
{.
name
=
"stage"
,
.
bytes
=
TSDB_TRANS_STAGE_LEN
+
VARSTR_HEADER_SIZE
,
.
type
=
TSDB_DATA_TYPE_VARCHAR
,
.
sysInfo
=
false
},
{.
name
=
"db
1
"
,
.
bytes
=
SYSTABLE_SCH_DB_NAME_LEN
,
.
type
=
TSDB_DATA_TYPE_VARCHAR
,
.
sysInfo
=
false
},
{.
name
=
"
db2"
,
.
bytes
=
SYSTABLE_SCH_DB
_NAME_LEN
,
.
type
=
TSDB_DATA_TYPE_VARCHAR
,
.
sysInfo
=
false
},
{.
name
=
"db"
,
.
bytes
=
SYSTABLE_SCH_DB_NAME_LEN
,
.
type
=
TSDB_DATA_TYPE_VARCHAR
,
.
sysInfo
=
false
},
{.
name
=
"
stable"
,
.
bytes
=
SYSTABLE_SCH_TABLE
_NAME_LEN
,
.
type
=
TSDB_DATA_TYPE_VARCHAR
,
.
sysInfo
=
false
},
{.
name
=
"failed_times"
,
.
bytes
=
4
,
.
type
=
TSDB_DATA_TYPE_INT
,
.
sysInfo
=
false
},
{.
name
=
"last_exec_time"
,
.
bytes
=
8
,
.
type
=
TSDB_DATA_TYPE_TIMESTAMP
,
.
sysInfo
=
false
},
{.
name
=
"last_action_info"
,
.
bytes
=
(
TSDB_TRANS_ERROR_LEN
-
1
)
+
VARSTR_HEADER_SIZE
,
.
type
=
TSDB_DATA_TYPE_VARCHAR
},
...
...
source/dnode/mnode/impl/inc/mndDef.h
浏览文件 @
dd759783
...
...
@@ -165,8 +165,8 @@ typedef struct {
SEpSet
lastEpset
;
tmsg_t
lastMsgType
;
tmsg_t
originRpcType
;
char
dbname
1
[
TSDB_TABLE_FNAME_LEN
];
char
dbname2
[
TSDB_TABLE_FNAME_LEN
];
char
dbname
[
TSDB_TABLE_FNAME_LEN
];
char
stbname
[
TSDB_TABLE_FNAME_LEN
];
int32_t
startFunc
;
int32_t
stopFunc
;
int32_t
paramLen
;
...
...
source/dnode/mnode/impl/inc/mndTrans.h
浏览文件 @
dd759783
...
...
@@ -71,7 +71,7 @@ int32_t mndTransAppendRedoAction(STrans *pTrans, STransAction *pAction);
int32_t
mndTransAppendUndoAction
(
STrans
*
pTrans
,
STransAction
*
pAction
);
void
mndTransSetRpcRsp
(
STrans
*
pTrans
,
void
*
pCont
,
int32_t
contLen
);
void
mndTransSetCb
(
STrans
*
pTrans
,
ETrnFunc
startFunc
,
ETrnFunc
stopFunc
,
void
*
param
,
int32_t
paramLen
);
void
mndTransSetDbName
(
STrans
*
pTrans
,
const
char
*
dbname
1
,
const
char
*
dbname2
);
void
mndTransSetDbName
(
STrans
*
pTrans
,
const
char
*
dbname
,
const
char
*
stbname
);
void
mndTransSetSerial
(
STrans
*
pTrans
);
void
mndTransSetOper
(
STrans
*
pTrans
,
EOperType
oper
);
...
...
source/dnode/mnode/impl/src/mndStream.c
浏览文件 @
dd759783
...
...
@@ -671,7 +671,7 @@ static int32_t mndProcessCreateStreamReq(SRpcMsg *pReq) {
mError
(
"stream:%s, failed to create since %s"
,
createStreamReq
.
name
,
terrstr
());
goto
_OVER
;
}
mndTransSetDbName
(
pTrans
,
createStreamReq
.
sourceDB
,
streamObj
.
targetDb
);
mndTransSetDbName
(
pTrans
,
createStreamReq
.
sourceDB
,
streamObj
.
targetDb
);
// hack way
mDebug
(
"trans:%d, used to create stream:%s"
,
pTrans
->
id
,
createStreamReq
.
name
);
// create stb for stream
...
...
source/dnode/mnode/impl/src/mndTrans.c
浏览文件 @
dd759783
...
...
@@ -127,8 +127,8 @@ static SSdbRaw *mndTransActionEncode(STrans *pTrans) {
SDB_SET_INT8
(
pRaw
,
dataPos
,
0
,
_OVER
)
SDB_SET_INT16
(
pRaw
,
dataPos
,
pTrans
->
originRpcType
,
_OVER
)
SDB_SET_INT64
(
pRaw
,
dataPos
,
pTrans
->
createdTime
,
_OVER
)
SDB_SET_BINARY
(
pRaw
,
dataPos
,
pTrans
->
dbname
1
,
TSDB_TABLE_FNAME_LEN
,
_OVER
)
SDB_SET_BINARY
(
pRaw
,
dataPos
,
pTrans
->
dbname2
,
TSDB_TABLE_FNAME_LEN
,
_OVER
)
SDB_SET_BINARY
(
pRaw
,
dataPos
,
pTrans
->
dbname
,
TSDB_TABLE_FNAME_LEN
,
_OVER
)
SDB_SET_BINARY
(
pRaw
,
dataPos
,
pTrans
->
stbname
,
TSDB_TABLE_FNAME_LEN
,
_OVER
)
SDB_SET_INT32
(
pRaw
,
dataPos
,
pTrans
->
redoActionPos
,
_OVER
)
int32_t
redoActionNum
=
taosArrayGetSize
(
pTrans
->
redoActions
);
...
...
@@ -289,8 +289,8 @@ static SSdbRow *mndTransActionDecode(SSdbRaw *pRaw) {
pTrans
->
oper
=
oper
;
SDB_GET_INT16
(
pRaw
,
dataPos
,
&
pTrans
->
originRpcType
,
_OVER
)
SDB_GET_INT64
(
pRaw
,
dataPos
,
&
pTrans
->
createdTime
,
_OVER
)
SDB_GET_BINARY
(
pRaw
,
dataPos
,
pTrans
->
dbname
1
,
TSDB_TABLE_FNAME_LEN
,
_OVER
)
SDB_GET_BINARY
(
pRaw
,
dataPos
,
pTrans
->
dbname2
,
TSDB_TABLE_FNAME_LEN
,
_OVER
)
SDB_GET_BINARY
(
pRaw
,
dataPos
,
pTrans
->
dbname
,
TSDB_TABLE_FNAME_LEN
,
_OVER
)
SDB_GET_BINARY
(
pRaw
,
dataPos
,
pTrans
->
stbname
,
TSDB_TABLE_FNAME_LEN
,
_OVER
)
SDB_GET_INT32
(
pRaw
,
dataPos
,
&
pTrans
->
redoActionPos
,
_OVER
)
SDB_GET_INT32
(
pRaw
,
dataPos
,
&
redoActionNum
,
_OVER
)
SDB_GET_INT32
(
pRaw
,
dataPos
,
&
undoActionNum
,
_OVER
)
...
...
@@ -706,7 +706,7 @@ int32_t mndSetRpcInfoForDbTrans(SMnode *pMnode, SRpcMsg *pMsg, EOperType oper, c
if
(
pIter
==
NULL
)
break
;
if
(
pTrans
->
oper
==
oper
)
{
if
(
strcasecmp
(
dbname
,
pTrans
->
dbname
1
)
==
0
)
{
if
(
strcasecmp
(
dbname
,
pTrans
->
dbname
)
==
0
)
{
mInfo
(
"trans:%d, db:%s oper:%d matched with input"
,
pTrans
->
id
,
dbname
,
oper
);
if
(
pTrans
->
pRpcArray
==
NULL
)
{
pTrans
->
pRpcArray
=
taosArrayInit
(
1
,
sizeof
(
SRpcHandleInfo
));
...
...
@@ -725,12 +725,12 @@ int32_t mndSetRpcInfoForDbTrans(SMnode *pMnode, SRpcMsg *pMsg, EOperType oper, c
return
code
;
}
void
mndTransSetDbName
(
STrans
*
pTrans
,
const
char
*
dbname
1
,
const
char
*
dbname2
)
{
if
(
dbname
1
!=
NULL
)
{
tstrncpy
(
pTrans
->
dbname
1
,
dbname1
,
TSDB_TABLE_FNAME_LEN
);
void
mndTransSetDbName
(
STrans
*
pTrans
,
const
char
*
dbname
,
const
char
*
stbname
)
{
if
(
dbname
!=
NULL
)
{
tstrncpy
(
pTrans
->
dbname
,
dbname
,
TSDB_TABLE_FNAME_LEN
);
}
if
(
dbname2
!=
NULL
)
{
tstrncpy
(
pTrans
->
dbname2
,
dbname2
,
TSDB_TABLE_FNAME_LEN
);
if
(
stbname
!=
NULL
)
{
tstrncpy
(
pTrans
->
stbname
,
stbname
,
TSDB_TABLE_FNAME_LEN
);
}
}
...
...
@@ -759,9 +759,9 @@ static int32_t mndTransSync(SMnode *pMnode, STrans *pTrans) {
return
0
;
}
static
bool
mndCheckDbConflict
(
const
char
*
db
,
STrans
*
pTrans
)
{
if
(
db
[
0
]
==
0
)
return
false
;
if
(
strcasecmp
(
db
,
pTrans
->
dbname1
)
==
0
||
strcasecmp
(
db
,
pTrans
->
dbname2
)
==
0
)
return
true
;
static
bool
mndCheckDbConflict
(
const
char
*
conflict
,
STrans
*
pTrans
)
{
if
(
conflict
[
0
]
==
0
)
return
false
;
if
(
strcasecmp
(
conflict
,
pTrans
->
dbname
)
==
0
||
strcasecmp
(
conflict
,
pTrans
->
stbname
)
==
0
)
return
true
;
return
false
;
}
...
...
@@ -780,28 +780,28 @@ static bool mndCheckTransConflict(SMnode *pMnode, STrans *pNew) {
if
(
pNew
->
conflict
==
TRN_CONFLICT_DB
)
{
if
(
pTrans
->
conflict
==
TRN_CONFLICT_GLOBAL
)
conflict
=
true
;
if
(
pTrans
->
conflict
==
TRN_CONFLICT_DB
||
pTrans
->
conflict
==
TRN_CONFLICT_DB_INSIDE
)
{
if
(
mndCheckDbConflict
(
pNew
->
dbname
1
,
pTrans
))
conflict
=
true
;
if
(
mndCheckDbConflict
(
pNew
->
dbname2
,
pTrans
))
conflict
=
true
;
if
(
mndCheckDbConflict
(
pNew
->
dbname
,
pTrans
))
conflict
=
true
;
if
(
mndCheckDbConflict
(
pNew
->
stbname
,
pTrans
))
conflict
=
true
;
}
}
if
(
pNew
->
conflict
==
TRN_CONFLICT_DB_INSIDE
)
{
if
(
pTrans
->
conflict
==
TRN_CONFLICT_GLOBAL
)
conflict
=
true
;
if
(
pTrans
->
conflict
==
TRN_CONFLICT_DB
)
{
if
(
mndCheckDbConflict
(
pNew
->
dbname
1
,
pTrans
))
conflict
=
true
;
if
(
mndCheckDbConflict
(
pNew
->
dbname2
,
pTrans
))
conflict
=
true
;
if
(
mndCheckDbConflict
(
pNew
->
dbname
,
pTrans
))
conflict
=
true
;
if
(
mndCheckDbConflict
(
pNew
->
stbname
,
pTrans
))
conflict
=
true
;
}
if
(
pTrans
->
conflict
==
TRN_CONFLICT_DB_INSIDE
)
{
if
(
mndCheckDbConflict
(
pNew
->
dbname2
,
pTrans
))
conflict
=
true
;
// for stb
if
(
mndCheckDbConflict
(
pNew
->
stbname
,
pTrans
))
conflict
=
true
;
// for stb
}
}
if
(
conflict
)
{
mError
(
"trans:%d, db
1:%s db2:%s type:%d, can't execute since conflict with trans:%d db1:%s db2
:%s type:%d"
,
pNew
->
id
,
pNew
->
dbname
1
,
pNew
->
dbname2
,
pNew
->
conflict
,
pTrans
->
id
,
pTrans
->
dbname1
,
pTrans
->
dbname2
,
mError
(
"trans:%d, db
:%s stb:%s type:%d, can't execute since conflict with trans:%d db:%s stb
:%s type:%d"
,
pNew
->
id
,
pNew
->
dbname
,
pNew
->
stbname
,
pNew
->
conflict
,
pTrans
->
id
,
pTrans
->
dbname
,
pTrans
->
stbname
,
pTrans
->
conflict
);
}
else
{
mDebug
(
"trans:%d, db
1:%s db2:%s type:%d, not conflict with trans:%d db1:%s db2
:%s type:%d"
,
pNew
->
id
,
pNew
->
dbname
1
,
pNew
->
dbname2
,
pNew
->
conflict
,
pTrans
->
id
,
pTrans
->
dbname1
,
pTrans
->
dbname2
,
mDebug
(
"trans:%d, db
:%s stb:%s type:%d, not conflict with trans:%d db:%s stb
:%s type:%d"
,
pNew
->
id
,
pNew
->
dbname
,
pNew
->
stbname
,
pNew
->
conflict
,
pTrans
->
id
,
pTrans
->
dbname
,
pTrans
->
stbname
,
pTrans
->
conflict
);
}
sdbRelease
(
pMnode
->
pSdb
,
pTrans
);
...
...
@@ -812,7 +812,7 @@ static bool mndCheckTransConflict(SMnode *pMnode, STrans *pNew) {
int32_t
mndTransPrepare
(
SMnode
*
pMnode
,
STrans
*
pTrans
)
{
if
(
pTrans
->
conflict
==
TRN_CONFLICT_DB
||
pTrans
->
conflict
==
TRN_CONFLICT_DB_INSIDE
)
{
if
(
strlen
(
pTrans
->
dbname
1
)
==
0
&&
strlen
(
pTrans
->
dbname2
)
==
0
)
{
if
(
strlen
(
pTrans
->
dbname
)
==
0
&&
strlen
(
pTrans
->
stbname
)
==
0
)
{
terrno
=
TSDB_CODE_MND_TRANS_CONFLICT
;
mError
(
"trans:%d, failed to prepare conflict db not set"
,
pTrans
->
id
);
return
-
1
;
...
...
@@ -913,12 +913,12 @@ static void mndTransSendRpcRsp(SMnode *pMnode, STrans *pTrans) {
if
(
pTrans
->
originRpcType
==
TDMT_MND_CREATE_DB
)
{
mInfo
(
"trans:%d, origin msgtype:%s"
,
pTrans
->
id
,
TMSG_INFO
(
pTrans
->
originRpcType
));
SDbObj
*
pDb
=
mndAcquireDb
(
pMnode
,
pTrans
->
dbname
1
);
SDbObj
*
pDb
=
mndAcquireDb
(
pMnode
,
pTrans
->
dbname
);
if
(
pDb
!=
NULL
)
{
for
(
int32_t
j
=
0
;
j
<
12
;
j
++
)
{
bool
ready
=
mndIsDbReady
(
pMnode
,
pDb
);
if
(
!
ready
)
{
mInfo
(
"trans:%d, db:%s not ready yet, wait %d times"
,
pTrans
->
id
,
pTrans
->
dbname
1
,
j
);
mInfo
(
"trans:%d, db:%s not ready yet, wait %d times"
,
pTrans
->
id
,
pTrans
->
dbname
,
j
);
taosMsleep
(
1000
);
}
else
{
break
;
...
...
@@ -929,7 +929,7 @@ static void mndTransSendRpcRsp(SMnode *pMnode, STrans *pTrans) {
}
else
if
(
pTrans
->
originRpcType
==
TDMT_MND_CREATE_STB
)
{
void
*
pCont
=
NULL
;
int32_t
contLen
=
0
;
if
(
0
==
mndBuildSMCreateStbRsp
(
pMnode
,
pTrans
->
dbname
1
,
pTrans
->
dbname2
,
&
pCont
,
&
contLen
)
!=
0
)
{
if
(
0
==
mndBuildSMCreateStbRsp
(
pMnode
,
pTrans
->
dbname
,
pTrans
->
stbname
,
&
pCont
,
&
contLen
)
!=
0
)
{
mndTransSetRpcRsp
(
pTrans
,
pCont
,
contLen
);
}
}
...
...
@@ -1599,15 +1599,15 @@ static int32_t mndRetrieveTrans(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBl
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
stage
,
false
);
char
dbname
1
[
TSDB_DB_NAME_LEN
+
VARSTR_HEADER_SIZE
]
=
{
0
};
STR_WITH_MAXSIZE_TO_VARSTR
(
dbname
1
,
mndGetDbStr
(
pTrans
->
dbname1
),
pShow
->
pMeta
->
pSchemas
[
cols
].
bytes
);
char
dbname
[
TSDB_DB_NAME_LEN
+
VARSTR_HEADER_SIZE
]
=
{
0
};
STR_WITH_MAXSIZE_TO_VARSTR
(
dbname
,
mndGetDbStr
(
pTrans
->
dbname
),
pShow
->
pMeta
->
pSchemas
[
cols
].
bytes
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
dbname
1
,
false
);
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
dbname
,
false
);
char
dbname2
[
TSDB_DB_NAME_LEN
+
VARSTR_HEADER_SIZE
]
=
{
0
};
STR_WITH_MAXSIZE_TO_VARSTR
(
dbname2
,
mndGetDbStr
(
pTrans
->
dbname2
),
pShow
->
pMeta
->
pSchemas
[
cols
].
bytes
);
char
stbname
[
TSDB_DB_NAME_LEN
+
VARSTR_HEADER_SIZE
]
=
{
0
};
STR_WITH_MAXSIZE_TO_VARSTR
(
stbname
,
mndGetDbStr
(
pTrans
->
stbname
),
pShow
->
pMeta
->
pSchemas
[
cols
].
bytes
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
dbname2
,
false
);
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
stbname
,
false
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
&
pTrans
->
failedTimes
,
false
);
...
...
tests/system-test/1-insert/table_param_ttl.py
浏览文件 @
dd759783
...
...
@@ -31,45 +31,57 @@ class TDTestCase:
tdSql
.
prepare
()
for
i
in
range
(
self
.
tbnum
):
tdSql
.
execute
(
f
'create table
{
self
.
ntbname
}
_
{
i
}
(ts timestamp,c0 int) ttl
{
self
.
ttl_param
}
'
)
tdSql
.
query
(
f
'show tables'
)
tdSql
.
execute
(
f
'create table
db.
{
self
.
ntbname
}
_
{
i
}
(ts timestamp,c0 int) ttl
{
self
.
ttl_param
}
'
)
tdSql
.
query
(
f
'show
db.
tables'
)
tdSql
.
checkRows
(
self
.
tbnum
)
sleep
(
self
.
updatecfgDict
[
'ttlUnit'
]
*
self
.
ttl_param
+
self
.
updatecfgDict
[
'ttlPushInterval'
])
tdSql
.
query
(
f
'show tables'
)
tdSql
.
query
(
f
'show
db.
tables'
)
tdSql
.
checkRows
(
0
)
for
i
in
range
(
self
.
tbnum
):
tdSql
.
execute
(
f
'create table
{
self
.
ntbname
}
_
{
i
}
(ts timestamp,c0 int) ttl
{
self
.
default_ttl
}
'
)
tdSql
.
execute
(
f
'create table
db.
{
self
.
ntbname
}
_
{
i
}
(ts timestamp,c0 int) ttl
{
self
.
default_ttl
}
'
)
for
i
in
range
(
int
(
self
.
tbnum
/
2
)):
tdSql
.
execute
(
f
'alter table
{
self
.
ntbname
}
_
{
i
}
ttl
{
self
.
modify_ttl
}
'
)
tdSql
.
execute
(
f
'alter table
db.
{
self
.
ntbname
}
_
{
i
}
ttl
{
self
.
modify_ttl
}
'
)
sleep
(
self
.
updatecfgDict
[
'ttlUnit'
]
*
self
.
modify_ttl
+
self
.
updatecfgDict
[
'ttlPushInterval'
])
tdSql
.
query
(
f
'show tables'
)
tdSql
.
query
(
f
'show
db.
tables'
)
tdSql
.
checkRows
(
self
.
tbnum
-
int
(
self
.
tbnum
/
2
))
tdSql
.
execute
(
'drop database db'
)
def
ttl_check_ctb
(
self
):
tdSql
.
prepare
()
tdSql
.
execute
(
f
'create table
{
self
.
stbname
}
(ts timestamp,c0 int) tags(t0 int)'
)
tdSql
.
execute
(
f
'create table
db.
{
self
.
stbname
}
(ts timestamp,c0 int) tags(t0 int)'
)
for
i
in
range
(
self
.
tbnum
):
tdSql
.
execute
(
f
'create table
{
self
.
stbname
}
_
{
i
}
using
{
self
.
stbname
}
tags(
{
i
}
) ttl
{
self
.
ttl_param
}
'
)
tdSql
.
query
(
f
'show tables'
)
tdSql
.
execute
(
f
'create table
db.
{
self
.
stbname
}
_
{
i
}
using db.
{
self
.
stbname
}
tags(
{
i
}
) ttl
{
self
.
ttl_param
}
'
)
tdSql
.
query
(
f
'show
db.
tables'
)
tdSql
.
checkRows
(
self
.
tbnum
)
sleep
(
self
.
updatecfgDict
[
'ttlUnit'
]
*
self
.
ttl_param
+
self
.
updatecfgDict
[
'ttlPushInterval'
])
tdSql
.
query
(
f
'show tables'
)
tdSql
.
query
(
f
'show
db.
tables'
)
tdSql
.
checkRows
(
0
)
for
i
in
range
(
self
.
tbnum
):
tdSql
.
execute
(
f
'create table
{
self
.
stbname
}
_
{
i
}
using
{
self
.
stbname
}
tags(
{
i
}
) ttl
{
self
.
default_ttl
}
'
)
tdSql
.
query
(
f
'show tables'
)
tdSql
.
execute
(
f
'create table
db.
{
self
.
stbname
}
_
{
i
}
using db.
{
self
.
stbname
}
tags(
{
i
}
) ttl
{
self
.
default_ttl
}
'
)
tdSql
.
query
(
f
'show
db.
tables'
)
tdSql
.
checkRows
(
self
.
tbnum
)
for
i
in
range
(
int
(
self
.
tbnum
/
2
)):
tdSql
.
execute
(
f
'alter table
{
self
.
stbname
}
_
{
i
}
ttl
{
self
.
modify_ttl
}
'
)
tdSql
.
execute
(
f
'alter table
db.
{
self
.
stbname
}
_
{
i
}
ttl
{
self
.
modify_ttl
}
'
)
sleep
(
self
.
updatecfgDict
[
'ttlUnit'
]
*
self
.
modify_ttl
+
self
.
updatecfgDict
[
'ttlPushInterval'
])
tdSql
.
query
(
f
'show tables'
)
tdSql
.
query
(
f
'show
db.
tables'
)
tdSql
.
checkRows
(
self
.
tbnum
-
int
(
self
.
tbnum
/
2
))
tdSql
.
execute
(
'drop database db'
)
def
ttl_check_insert
(
self
):
tdSql
.
prepare
()
tdSql
.
execute
(
f
'create table db.
{
self
.
stbname
}
(ts timestamp,c0 int) tags(t0 int)'
)
for
i
in
range
(
self
.
tbnum
):
tdSql
.
execute
(
f
'insert into db.
{
self
.
stbname
}
_
{
i
}
using db.
{
self
.
stbname
}
tags(
{
i
}
) ttl
{
self
.
ttl_param
}
values(now,1)'
)
tdSql
.
query
(
f
'show db.tables'
)
tdSql
.
checkRows
(
self
.
tbnum
)
sleep
(
self
.
updatecfgDict
[
'ttlUnit'
]
*
self
.
ttl_param
+
self
.
updatecfgDict
[
'ttlPushInterval'
])
tdSql
.
query
(
f
'show db.tables'
)
tdSql
.
checkRows
(
0
)
tdSql
.
execute
(
'drop database db'
)
def
run
(
self
):
self
.
ttl_check_ntb
()
self
.
ttl_check_ctb
()
self
.
ttl_check_insert
()
def
stop
(
self
):
tdSql
.
close
()
...
...
tests/system-test/fulltest.sh
浏览文件 @
dd759783
...
...
@@ -32,7 +32,7 @@ python3 ./test.py -f 1-insert/block_wise.py
python3 ./test.py
-f
1-insert/create_retentions.py
python3 ./test.py
-f
1-insert/table_param_ttl.py
python3 ./test.py
-f
1-insert/mutil_stage.py
python3 ./test.py
-f
1-insert/table_param_ttl.py
-R
python3 ./test.py
-f
1-insert/update_data_muti_rows.py
python3 ./test.py
-f
1-insert/db_tb_name_check.py
...
...
utils/test/c/sdbDump.c
浏览文件 @
dd759783
...
...
@@ -294,8 +294,8 @@ void dumpTrans(SSdb *pSdb, SJson *json) {
tjsonAddIntegerToObject
(
item
,
"conflict"
,
pObj
->
conflict
);
tjsonAddIntegerToObject
(
item
,
"exec"
,
pObj
->
exec
);
tjsonAddStringToObject
(
item
,
"createdTime"
,
i642str
(
pObj
->
createdTime
));
tjsonAddStringToObject
(
item
,
"dbname
1"
,
pObj
->
dbname1
);
tjsonAddStringToObject
(
item
,
"
dbname2"
,
pObj
->
dbname2
);
tjsonAddStringToObject
(
item
,
"dbname
"
,
pObj
->
dbname
);
tjsonAddStringToObject
(
item
,
"
stbname"
,
pObj
->
stbname
);
tjsonAddIntegerToObject
(
item
,
"commitLogNum"
,
taosArrayGetSize
(
pObj
->
commitActions
));
tjsonAddIntegerToObject
(
item
,
"redoActionNum"
,
taosArrayGetSize
(
pObj
->
redoActions
));
tjsonAddIntegerToObject
(
item
,
"undoActionNum"
,
taosArrayGetSize
(
pObj
->
undoActions
));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录