Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
91a5f895
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1184
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,发现更多精彩内容 >>
提交
91a5f895
编写于
11月 24, 2022
作者:
H
Hongze Cheng
浏览文件
操作
浏览文件
下载
差异文件
Merge branch '3.0' of
https://github.com/taosdata/TDengine
into refact/submit_req
上级
73e73618
fe171df1
变更
29
隐藏空白更改
内联
并排
Showing
29 changed file
with
392 addition
and
124 deletion
+392
-124
Jenkinsfile2
Jenkinsfile2
+2
-2
cmake/taostools_CMakeLists.txt.in
cmake/taostools_CMakeLists.txt.in
+1
-1
include/common/tdatablock.h
include/common/tdatablock.h
+27
-0
include/libs/sync/sync.h
include/libs/sync/sync.h
+1
-0
source/client/src/clientRawBlockWrite.c
source/client/src/clientRawBlockWrite.c
+12
-5
source/common/src/tdatablock.c
source/common/src/tdatablock.c
+5
-1
source/common/src/trow.c
source/common/src/trow.c
+4
-2
source/dnode/mgmt/mgmt_mnode/src/mmHandle.c
source/dnode/mgmt/mgmt_mnode/src/mmHandle.c
+1
-1
source/dnode/mgmt/mgmt_vnode/src/vmHandle.c
source/dnode/mgmt/mgmt_vnode/src/vmHandle.c
+1
-1
source/dnode/vnode/src/tq/tq.c
source/dnode/vnode/src/tq/tq.c
+2
-1
source/dnode/vnode/src/tsdb/tsdbRead.c
source/dnode/vnode/src/tsdb/tsdbRead.c
+2
-1
source/libs/executor/src/groupoperator.c
source/libs/executor/src/groupoperator.c
+3
-0
source/libs/executor/src/joinoperator.c
source/libs/executor/src/joinoperator.c
+12
-8
source/libs/parser/src/parInsertStmt.c
source/libs/parser/src/parInsertStmt.c
+7
-2
source/libs/qworker/src/qworker.c
source/libs/qworker/src/qworker.c
+1
-1
source/libs/scalar/src/sclfunc.c
source/libs/scalar/src/sclfunc.c
+34
-7
source/libs/sync/inc/syncInt.h
source/libs/sync/inc/syncInt.h
+1
-0
source/libs/sync/inc/syncMessage.h
source/libs/sync/inc/syncMessage.h
+1
-0
source/libs/sync/src/syncIndexMgr.c
source/libs/sync/src/syncIndexMgr.c
+3
-2
source/libs/sync/src/syncMain.c
source/libs/sync/src/syncMain.c
+33
-1
source/libs/sync/src/syncUtil.c
source/libs/sync/src/syncUtil.c
+2
-2
tests/parallel_test/cases.task
tests/parallel_test/cases.task
+66
-59
tests/system-test/1-insert/test_stmt_muti_insert_query.py
tests/system-test/1-insert/test_stmt_muti_insert_query.py
+1
-0
tests/system-test/1-insert/test_stmt_set_tbname_tag.py
tests/system-test/1-insert/test_stmt_set_tbname_tag.py
+1
-0
tests/system-test/2-query/insert_select.py
tests/system-test/2-query/insert_select.py
+108
-0
tests/system-test/2-query/select_index.py
tests/system-test/2-query/select_index.py
+47
-19
tests/system-test/2-query/sml.py
tests/system-test/2-query/sml.py
+1
-1
tests/system-test/7-tmq/tmq3mnodeSwitch.py
tests/system-test/7-tmq/tmq3mnodeSwitch.py
+12
-7
tests/system-test/pytest.sh
tests/system-test/pytest.sh
+1
-0
未找到文件。
Jenkinsfile2
浏览文件 @
91a5f895
...
...
@@ -361,7 +361,7 @@ pipeline {
}
parallel {
stage('check docs') {
agent{label " worker03 || slave215 || slave217 || slave219 || Mac_catalina "}
agent{label "
slave1_47 || slave1_48 || slave1_49 || slave1_52 ||
worker03 || slave215 || slave217 || slave219 || Mac_catalina "}
steps {
check_docs()
}
...
...
@@ -407,7 +407,7 @@ pipeline {
}
}
stage('linux test') {
agent{label " worker03 || slave215 || slave217 || slave219 "}
agent{label "
slave1_47 || slave1_48 || slave1_49 || slave1_52 ||
worker03 || slave215 || slave217 || slave219 "}
options { skipDefaultCheckout() }
when {
changeRequest()
...
...
cmake/taostools_CMakeLists.txt.in
浏览文件 @
91a5f895
...
...
@@ -2,7 +2,7 @@
# taos-tools
ExternalProject_Add(taos-tools
GIT_REPOSITORY https://github.com/taosdata/taos-tools.git
GIT_TAG
efa2a5f
GIT_TAG
fab042d
SOURCE_DIR "${TD_SOURCE_DIR}/tools/taos-tools"
BINARY_DIR ""
#BUILD_IN_SOURCE TRUE
...
...
include/common/tdatablock.h
浏览文件 @
91a5f895
...
...
@@ -90,6 +90,33 @@ static FORCE_INLINE bool colDataIsNull_s(const SColumnInfoData* pColumnInfoData,
}
}
static
FORCE_INLINE
bool
colDataIsNNull_s
(
const
SColumnInfoData
*
pColumnInfoData
,
int32_t
startIndex
,
uint32_t
nRows
)
{
if
(
!
pColumnInfoData
->
hasNull
)
{
return
false
;
}
if
(
IS_VAR_DATA_TYPE
(
pColumnInfoData
->
info
.
type
))
{
for
(
int32_t
i
=
startIndex
;
i
<
nRows
;
++
i
)
{
if
(
!
colDataIsNull_var
(
pColumnInfoData
,
i
))
{
return
false
;
}
}
}
else
{
if
(
pColumnInfoData
->
nullbitmap
==
NULL
)
{
return
false
;
}
for
(
int32_t
i
=
startIndex
;
i
<
nRows
;
++
i
)
{
if
(
!
colDataIsNull_f
(
pColumnInfoData
->
nullbitmap
,
i
))
{
return
false
;
}
}
}
return
true
;
}
static
FORCE_INLINE
bool
colDataIsNull
(
const
SColumnInfoData
*
pColumnInfoData
,
uint32_t
totalRows
,
uint32_t
row
,
SColumnDataAgg
*
pColAgg
)
{
if
(
!
pColumnInfoData
->
hasNull
)
{
...
...
include/libs/sync/sync.h
浏览文件 @
91a5f895
...
...
@@ -41,6 +41,7 @@ extern "C" {
#define SNAPSHOT_WAIT_MS 1000 * 30
#define SYNC_APPEND_ENTRIES_TIMEOUT_MS 10000
#define SYNC_HEART_TIMEOUT_MS 1000 * 8
#define SYNC_MAX_BATCH_SIZE 1
#define SYNC_INDEX_BEGIN 0
...
...
source/client/src/clientRawBlockWrite.c
浏览文件 @
91a5f895
...
...
@@ -1275,6 +1275,7 @@ int taos_write_raw_block(TAOS* taos, int rows, char* pData, const char* tbname)
nVar
++
;
}
}
fLen
-=
sizeof
(
TSKEY
);
int32_t
extendedRowSize
=
rowSize
+
TD_ROW_HEAD_LEN
-
sizeof
(
TSKEY
)
+
nVar
*
sizeof
(
VarDataOffsetT
)
+
(
int32_t
)
TD_BITMAP_BYTES
(
numOfCols
-
1
);
...
...
@@ -1333,7 +1334,9 @@ int taos_write_raw_block(TAOS* taos, int rows, char* pData, const char* tbname)
}
}
offset
+=
TYPE_BYTES
[
pColumn
->
type
];
if
(
pColumn
->
colId
!=
PRIMARYKEY_TIMESTAMP_COL_ID
)
{
offset
+=
TYPE_BYTES
[
pColumn
->
type
];
}
}
tdSRowEnd
(
&
rb
);
int32_t
rowLen
=
TD_ROW_LEN
(
rowData
);
...
...
@@ -1503,6 +1506,7 @@ static int32_t tmqWriteRawDataImpl(TAOS* taos, void* data, int32_t dataLen) {
nVar
++
;
}
}
fLen
-=
sizeof
(
TSKEY
);
int32_t
rows
=
rspObj
.
resInfo
.
numOfRows
;
int32_t
extendedRowSize
=
rowSize
+
TD_ROW_HEAD_LEN
-
sizeof
(
TSKEY
)
+
nVar
*
sizeof
(
VarDataOffsetT
)
+
...
...
@@ -1585,8 +1589,9 @@ static int32_t tmqWriteRawDataImpl(TAOS* taos, void* data, int32_t dataLen) {
tdAppendColValToRow
(
&
rb
,
pColumn
->
colId
,
pColumn
->
type
,
TD_VTYPE_NORM
,
colData
,
true
,
offset
,
k
);
}
}
offset
+=
TYPE_BYTES
[
pColumn
->
type
];
if
(
pColumn
->
colId
!=
PRIMARYKEY_TIMESTAMP_COL_ID
)
{
offset
+=
TYPE_BYTES
[
pColumn
->
type
];
}
}
tdSRowEnd
(
&
rb
);
int32_t
rowLen
=
TD_ROW_LEN
(
rowData
);
...
...
@@ -1803,6 +1808,7 @@ static int32_t tmqWriteRawMetaDataImpl(TAOS* taos, void* data, int32_t dataLen)
nVar
++
;
}
}
fLen
-=
sizeof
(
TSKEY
);
int32_t
rows
=
rspObj
.
resInfo
.
numOfRows
;
int32_t
extendedRowSize
=
rowSize
+
TD_ROW_HEAD_LEN
-
sizeof
(
TSKEY
)
+
nVar
*
sizeof
(
VarDataOffsetT
)
+
...
...
@@ -1888,8 +1894,9 @@ static int32_t tmqWriteRawMetaDataImpl(TAOS* taos, void* data, int32_t dataLen)
tdAppendColValToRow
(
&
rb
,
pColumn
->
colId
,
pColumn
->
type
,
TD_VTYPE_NORM
,
colData
,
true
,
offset
,
k
);
}
}
offset
+=
TYPE_BYTES
[
pColumn
->
type
];
if
(
pColumn
->
colId
!=
PRIMARYKEY_TIMESTAMP_COL_ID
)
{
offset
+=
TYPE_BYTES
[
pColumn
->
type
];
}
}
tdSRowEnd
(
&
rb
);
int32_t
rowLen
=
TD_ROW_LEN
(
rowData
);
...
...
source/common/src/tdatablock.c
浏览文件 @
91a5f895
...
...
@@ -652,7 +652,10 @@ int32_t blockDataFromBuf1(SSDataBlock* pBlock, const char* buf, size_t capacity)
ASSERT
(
pCol
->
varmeta
.
length
<=
pCol
->
varmeta
.
allocLen
);
}
memcpy
(
pCol
->
pData
,
pStart
,
colLength
);
if
(
!
colDataIsNNull_s
(
pCol
,
0
,
pBlock
->
info
.
rows
))
{
memcpy
(
pCol
->
pData
,
pStart
,
colLength
);
}
pStart
+=
pCol
->
info
.
bytes
*
capacity
;
}
...
...
@@ -2052,6 +2055,7 @@ int32_t buildSubmitReqFromDataBlock(SSubmitReq** pReq, const SSDataBlock* pDataB
isStartKey
=
true
;
tdAppendColValToRow
(
&
rb
,
PRIMARYKEY_TIMESTAMP_COL_ID
,
TSDB_DATA_TYPE_TIMESTAMP
,
TD_VTYPE_NORM
,
var
,
true
,
offset
,
k
);
continue
;
// offset should keep 0 for next column
}
else
if
(
colDataIsNull_s
(
pColInfoData
,
j
))
{
tdAppendColValToRow
(
&
rb
,
PRIMARYKEY_TIMESTAMP_COL_ID
+
k
,
TSDB_DATA_TYPE_TIMESTAMP
,
TD_VTYPE_NULL
,
NULL
,
...
...
source/common/src/trow.c
浏览文件 @
91a5f895
...
...
@@ -412,7 +412,9 @@ int32_t tdSTSRowNew(SArray *pArray, STSchema *pTSchema, STSRow **ppRow) {
valType
=
TD_VTYPE_NULL
;
}
else
if
(
IS_VAR_DATA_TYPE
(
pTColumn
->
type
))
{
varDataSetLen
(
varBuf
,
pColVal
->
value
.
nData
);
memcpy
(
varDataVal
(
varBuf
),
pColVal
->
value
.
pData
,
pColVal
->
value
.
nData
);
if
(
pColVal
->
value
.
nData
!=
0
)
{
memcpy
(
varDataVal
(
varBuf
),
pColVal
->
value
.
pData
,
pColVal
->
value
.
nData
);
}
val
=
varBuf
;
}
else
{
val
=
(
const
void
*
)
&
pColVal
->
value
.
val
;
...
...
@@ -1093,4 +1095,4 @@ void tTSRowGetVal(STSRow *pRow, STSchema *pTSchema, int16_t iCol, SColVal *pColV
memcpy
(
&
pColVal
->
value
.
val
,
cv
.
val
,
tDataTypes
[
pTColumn
->
type
].
bytes
);
}
}
}
\ No newline at end of file
}
source/dnode/mgmt/mgmt_mnode/src/mmHandle.c
浏览文件 @
91a5f895
...
...
@@ -196,7 +196,7 @@ SArray *mmGetMsgHandles() {
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_SYNC_PRE_SNAPSHOT
,
mmPutMsgToSyncQueue
,
1
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_SYNC_PRE_SNAPSHOT_REPLY
,
mmPutMsgToSyncQueue
,
1
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_SYNC_HEARTBEAT
,
mmPutMsgToSyncCtrlQueue
,
1
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_SYNC_HEARTBEAT_REPLY
,
mmPutMsgToSync
Ctrl
Queue
,
1
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_SYNC_HEARTBEAT_REPLY
,
mmPutMsgToSyncQueue
,
1
)
==
NULL
)
goto
_OVER
;
code
=
0
;
...
...
source/dnode/mgmt/mgmt_vnode/src/vmHandle.c
浏览文件 @
91a5f895
...
...
@@ -464,7 +464,7 @@ SArray *vmGetMsgHandles() {
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_SYNC_PRE_SNAPSHOT_REPLY
,
vmPutMsgToSyncQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_SYNC_HEARTBEAT
,
vmPutMsgToSyncCtrlQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_SYNC_HEARTBEAT_REPLY
,
vmPutMsgToSync
Ctrl
Queue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_SYNC_HEARTBEAT_REPLY
,
vmPutMsgToSyncQueue
,
0
)
==
NULL
)
goto
_OVER
;
code
=
0
;
...
...
source/dnode/vnode/src/tq/tq.c
浏览文件 @
91a5f895
...
...
@@ -1275,6 +1275,7 @@ int32_t tqProcessDelReq(STQ* pTq, void* pReq, int32_t len, int64_t ver) {
if
(
streamTaskInput
(
pTask
,
(
SStreamQueueItem
*
)
pRefBlock
)
<
0
)
{
qError
(
"stream task input del failed, task id %d"
,
pTask
->
taskId
);
atomic_sub_fetch_32
(
pRef
,
1
);
taosFreeQitem
(
pRefBlock
);
continue
;
}
...
...
@@ -1292,7 +1293,7 @@ int32_t tqProcessDelReq(STQ* pTq, void* pReq, int32_t len, int64_t ver) {
int32_t
ref
=
atomic_sub_fetch_32
(
pRef
,
1
);
ASSERT
(
ref
>=
0
);
if
(
ref
==
0
)
{
taosMemoryFree
(
pDelBlock
);
blockDataDestroy
(
pDelBlock
);
taosMemoryFree
(
pRef
);
}
...
...
source/dnode/vnode/src/tsdb/tsdbRead.c
浏览文件 @
91a5f895
...
...
@@ -2432,7 +2432,8 @@ static int32_t buildComposedDataBlock(STsdbReader* pReader) {
TSDBKEY
keyInBuf
=
getCurrentKeyInBuf
(
pBlockScanInfo
,
pReader
);
// it is a clean block, load it directly
if
(
isCleanFileDataBlock
(
pReader
,
pBlockInfo
,
pBlock
,
pBlockScanInfo
,
keyInBuf
,
pLastBlockReader
))
{
if
(
isCleanFileDataBlock
(
pReader
,
pBlockInfo
,
pBlock
,
pBlockScanInfo
,
keyInBuf
,
pLastBlockReader
)
&&
pBlock
->
nRow
<=
pReader
->
capacity
)
{
if
(
asc
||
((
!
asc
)
&&
(
!
hasDataInLastBlock
(
pLastBlockReader
))))
{
copyBlockDataToSDataBlock
(
pReader
,
pBlockScanInfo
);
...
...
source/libs/executor/src/groupoperator.c
浏览文件 @
91a5f895
...
...
@@ -936,6 +936,9 @@ static SSDataBlock* buildStreamPartitionResult(SOperatorInfo* pOperator) {
}
else
{
pDest
->
info
.
parTbName
[
0
]
=
0
;
}
if
(
pParInfo
->
groupId
&&
pDest
->
info
.
parTbName
[
0
])
{
streamStatePutParName
(
pOperator
->
pTaskInfo
->
streamInfo
.
pState
,
pParInfo
->
groupId
,
pDest
->
info
.
parTbName
);
}
/*printf("\n\n set name %s\n\n", pDest->info.parTbName);*/
blockDataDestroy
(
pTmpBlock
);
blockDataDestroy
(
pResBlock
);
...
...
source/libs/executor/src/joinoperator.c
浏览文件 @
91a5f895
...
...
@@ -54,22 +54,26 @@ static void extractTimeCondition(SJoinOperatorInfo* pInfo, SOperatorInfo** pDown
SColumnNode
*
col2
=
(
SColumnNode
*
)
pNode
->
pRight
;
SColumnNode
*
leftTsCol
=
NULL
;
SColumnNode
*
rightTsCol
=
NULL
;
if
(
col1
->
dataBlockId
==
pDownstream
[
0
]
->
resultDataBlockId
)
{
ASSERT
(
col2
->
dataBlockId
==
pDownstream
[
1
]
->
resultDataBlockId
);
if
(
col1
->
dataBlockId
==
col2
->
dataBlockId
)
{
leftTsCol
=
col1
;
rightTsCol
=
col2
;
}
else
{
ASSERT
(
col1
->
dataBlockId
==
pDownstream
[
1
]
->
resultDataBlockId
);
ASSERT
(
col2
->
dataBlockId
==
pDownstream
[
0
]
->
resultDataBlockId
);
leftTsCol
=
col2
;
rightTsCol
=
col1
;
if
(
col1
->
dataBlockId
==
pDownstream
[
0
]
->
resultDataBlockId
)
{
ASSERT
(
col2
->
dataBlockId
==
pDownstream
[
1
]
->
resultDataBlockId
);
leftTsCol
=
col1
;
rightTsCol
=
col2
;
}
else
{
ASSERT
(
col1
->
dataBlockId
==
pDownstream
[
1
]
->
resultDataBlockId
);
ASSERT
(
col2
->
dataBlockId
==
pDownstream
[
0
]
->
resultDataBlockId
);
leftTsCol
=
col2
;
rightTsCol
=
col1
;
}
}
setJoinColumnInfo
(
&
pInfo
->
leftCol
,
leftTsCol
);
setJoinColumnInfo
(
&
pInfo
->
rightCol
,
rightTsCol
);
}
else
{
ASSERT
(
false
);
}
}
}}
SOperatorInfo
*
createMergeJoinOperatorInfo
(
SOperatorInfo
**
pDownstream
,
int32_t
numOfDownstream
,
SSortMergeJoinPhysiNode
*
pJoinNode
,
SExecTaskInfo
*
pTaskInfo
)
{
...
...
source/libs/parser/src/parInsertStmt.c
浏览文件 @
91a5f895
...
...
@@ -47,6 +47,7 @@ int32_t qBindStmtTagsValue(void* pBlock, void* boundTags, int64_t suid, const ch
TAOS_MULTI_BIND
*
bind
,
char
*
msgBuf
,
int32_t
msgBufLen
)
{
STableDataBlocks
*
pDataBlock
=
(
STableDataBlocks
*
)
pBlock
;
SMsgBuf
pBuf
=
{.
buf
=
msgBuf
,
.
len
=
msgBufLen
};
int32_t
code
=
TSDB_CODE_SUCCESS
;
SParsedDataColInfo
*
tags
=
(
SParsedDataColInfo
*
)
boundTags
;
if
(
NULL
==
tags
)
{
return
TSDB_CODE_QRY_APP_ERROR
;
...
...
@@ -59,10 +60,10 @@ int32_t qBindStmtTagsValue(void* pBlock, void* boundTags, int64_t suid, const ch
SArray
*
tagName
=
taosArrayInit
(
8
,
TSDB_COL_NAME_LEN
);
if
(
!
tagName
)
{
return
buildInvalidOperationMsg
(
&
pBuf
,
"out of memory"
);
code
=
buildInvalidOperationMsg
(
&
pBuf
,
"out of memory"
);
goto
end
;
}
int32_t
code
=
TSDB_CODE_SUCCESS
;
SSchema
*
pSchema
=
getTableTagSchema
(
pDataBlock
->
pTableMeta
);
bool
isJson
=
false
;
...
...
@@ -77,6 +78,10 @@ int32_t qBindStmtTagsValue(void* pBlock, void* boundTags, int64_t suid, const ch
int32_t
colLen
=
pTagSchema
->
bytes
;
if
(
IS_VAR_DATA_TYPE
(
pTagSchema
->
type
))
{
colLen
=
bind
[
c
].
length
[
0
];
if
((
colLen
+
VARSTR_HEADER_SIZE
)
>
pTagSchema
->
bytes
)
{
code
=
buildInvalidOperationMsg
(
&
pBuf
,
"tag length is too big"
);
goto
end
;
}
}
taosArrayPush
(
tagName
,
pTagSchema
->
name
);
if
(
pTagSchema
->
type
==
TSDB_DATA_TYPE_JSON
)
{
...
...
source/libs/qworker/src/qworker.c
浏览文件 @
91a5f895
...
...
@@ -743,7 +743,7 @@ int32_t qwProcessCQuery(QW_FPARAMS_DEF, SQWMsg *qwMsg) {
}
QW_LOCK
(
QW_WRITE
,
&
ctx
->
lock
);
if
(
queryStop
||
code
||
0
==
atomic_load_8
((
int8_t
*
)
&
ctx
->
queryContinue
))
{
if
(
(
queryStop
&&
(
0
==
atomic_load_8
((
int8_t
*
)
&
ctx
->
queryContinue
)))
||
code
||
0
==
atomic_load_8
((
int8_t
*
)
&
ctx
->
queryContinue
))
{
// Note: query is not running anymore
QW_SET_PHASE
(
ctx
,
0
);
QW_UNLOCK
(
QW_WRITE
,
&
ctx
->
lock
);
...
...
source/libs/scalar/src/sclfunc.c
浏览文件 @
91a5f895
...
...
@@ -1758,18 +1758,45 @@ int32_t sumScalarFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *
break
;
}
if
(
IS_SIGNED_NUMERIC_TYPE
(
type
))
{
int64_t
*
in
=
(
int64_t
*
)
pInputData
->
pData
;
if
(
IS_SIGNED_NUMERIC_TYPE
(
type
)
||
type
==
TSDB_DATA_TYPE_BOOL
)
{
int64_t
*
out
=
(
int64_t
*
)
pOutputData
->
pData
;
*
out
+=
in
[
i
];
if
(
type
==
TSDB_DATA_TYPE_TINYINT
||
type
==
TSDB_DATA_TYPE_BOOL
)
{
int8_t
*
in
=
(
int8_t
*
)
pInputData
->
pData
;
*
out
+=
in
[
i
];
}
else
if
(
type
==
TSDB_DATA_TYPE_SMALLINT
)
{
int16_t
*
in
=
(
int16_t
*
)
pInputData
->
pData
;
*
out
+=
in
[
i
];
}
else
if
(
type
==
TSDB_DATA_TYPE_INT
)
{
int32_t
*
in
=
(
int32_t
*
)
pInputData
->
pData
;
*
out
+=
in
[
i
];
}
else
if
(
type
==
TSDB_DATA_TYPE_BIGINT
)
{
int64_t
*
in
=
(
int64_t
*
)
pInputData
->
pData
;
*
out
+=
in
[
i
];
}
}
else
if
(
IS_UNSIGNED_NUMERIC_TYPE
(
type
))
{
uint64_t
*
in
=
(
uint64_t
*
)
pInputData
->
pData
;
uint64_t
*
out
=
(
uint64_t
*
)
pOutputData
->
pData
;
*
out
+=
in
[
i
];
if
(
type
==
TSDB_DATA_TYPE_UTINYINT
)
{
uint8_t
*
in
=
(
uint8_t
*
)
pInputData
->
pData
;
*
out
+=
in
[
i
];
}
else
if
(
type
==
TSDB_DATA_TYPE_USMALLINT
)
{
uint16_t
*
in
=
(
uint16_t
*
)
pInputData
->
pData
;
*
out
+=
in
[
i
];
}
else
if
(
type
==
TSDB_DATA_TYPE_UINT
)
{
uint32_t
*
in
=
(
uint32_t
*
)
pInputData
->
pData
;
*
out
+=
in
[
i
];
}
else
if
(
type
==
TSDB_DATA_TYPE_UBIGINT
)
{
uint64_t
*
in
=
(
uint64_t
*
)
pInputData
->
pData
;
*
out
+=
in
[
i
];
}
}
else
if
(
IS_FLOAT_TYPE
(
type
))
{
double
*
in
=
(
double
*
)
pInputData
->
pData
;
double
*
out
=
(
double
*
)
pOutputData
->
pData
;
*
out
+=
in
[
i
];
if
(
type
==
TSDB_DATA_TYPE_FLOAT
)
{
float
*
in
=
(
float
*
)
pInputData
->
pData
;
*
out
+=
in
[
i
];
}
else
if
(
type
==
TSDB_DATA_TYPE_DOUBLE
)
{
double
*
in
=
(
double
*
)
pInputData
->
pData
;
*
out
+=
in
[
i
];
}
}
}
...
...
source/libs/sync/inc/syncInt.h
浏览文件 @
91a5f895
...
...
@@ -232,6 +232,7 @@ int32_t syncNodeSendMsgById(const SRaftId* destRaftId, SSyncNode* pSyncNode, S
int32_t
syncNodeSendMsgByInfo
(
const
SNodeInfo
*
nodeInfo
,
SSyncNode
*
pSyncNode
,
SRpcMsg
*
pMsg
);
SyncIndex
syncMinMatchIndex
(
SSyncNode
*
pSyncNode
);
int32_t
syncCacheEntry
(
SSyncLogStore
*
pLogStore
,
SSyncRaftEntry
*
pEntry
,
LRUHandle
**
h
);
bool
syncNodeHeartbeatTimeout
(
SSyncNode
*
pSyncNode
);
// raft state change --------------
void
syncNodeUpdateTerm
(
SSyncNode
*
pSyncNode
,
SyncTerm
term
);
...
...
source/libs/sync/inc/syncMessage.h
浏览文件 @
91a5f895
...
...
@@ -137,6 +137,7 @@ typedef struct SyncHeartbeatReply {
SyncTerm
term
;
SyncTerm
privateTerm
;
int64_t
startTime
;
int64_t
timeStamp
;
}
SyncHeartbeatReply
;
typedef
struct
SyncPreSnapshot
{
...
...
source/libs/sync/src/syncIndexMgr.c
浏览文件 @
91a5f895
...
...
@@ -50,9 +50,10 @@ void syncIndexMgrClear(SSyncIndexMgr *pSyncIndexMgr) {
memset
(
pSyncIndexMgr
->
privateTerm
,
0
,
sizeof
(
pSyncIndexMgr
->
privateTerm
));
// int64_t timeNow = taosGetMonotonicMs();
int64_t
timeNow
=
taosGetTimestampMs
();
for
(
int
i
=
0
;
i
<
pSyncIndexMgr
->
replicaNum
;
++
i
)
{
pSyncIndexMgr
->
startTimeArr
[
i
]
=
0
;
pSyncIndexMgr
->
recvTimeArr
[
i
]
=
0
;
pSyncIndexMgr
->
recvTimeArr
[
i
]
=
timeNow
;
}
/*
...
...
@@ -147,7 +148,7 @@ int64_t syncIndexMgrGetRecvTime(SSyncIndexMgr *pSyncIndexMgr, const SRaftId *pRa
return
recvTime
;
}
}
ASSERT
(
0
);
return
-
1
;
}
...
...
source/libs/sync/src/syncMain.c
浏览文件 @
91a5f895
...
...
@@ -639,6 +639,14 @@ int32_t syncNodePropose(SSyncNode* pSyncNode, SRpcMsg* pMsg, bool isWeak) {
return
-
1
;
}
// heartbeat timeout
if
(
syncNodeHeartbeatTimeout
(
pSyncNode
))
{
terrno
=
TSDB_CODE_SYN_PROPOSE_NOT_READY
;
sNError
(
pSyncNode
,
"failed to sync propose since hearbeat timeout, type:%s, last:%"
PRId64
", cmt:%"
PRId64
,
TMSG_INFO
(
pMsg
->
msgType
),
syncNodeGetLastIndex
(
pSyncNode
),
pSyncNode
->
commitIndex
);
return
-
1
;
}
// optimized one replica
if
(
syncNodeIsOptimizedOneReplica
(
pSyncNode
,
pMsg
))
{
SyncIndex
retIndex
;
...
...
@@ -2086,6 +2094,29 @@ int32_t syncCacheEntry(SSyncLogStore* pLogStore, SSyncRaftEntry* pEntry, LRUHand
return
code
;
}
bool
syncNodeHeartbeatTimeout
(
SSyncNode
*
pSyncNode
)
{
if
(
pSyncNode
->
replicaNum
==
1
)
{
return
false
;
}
int32_t
toCount
=
0
;
int64_t
tsNow
=
taosGetTimestampMs
();
for
(
int32_t
i
=
0
;
i
<
pSyncNode
->
peersNum
;
++
i
)
{
int64_t
recvTime
=
syncIndexMgrGetRecvTime
(
pSyncNode
->
pMatchIndex
,
&
(
pSyncNode
->
peersId
[
i
]));
if
(
recvTime
==
0
||
recvTime
==
-
1
)
{
continue
;
}
if
(
tsNow
-
recvTime
>
SYNC_HEART_TIMEOUT_MS
)
{
toCount
++
;
}
}
bool
b
=
(
toCount
>=
pSyncNode
->
quorum
?
true
:
false
);
return
b
;
}
static
int32_t
syncNodeAppendNoop
(
SSyncNode
*
ths
)
{
int32_t
ret
=
0
;
...
...
@@ -2127,6 +2158,7 @@ int32_t syncNodeOnHeartbeat(SSyncNode* ths, const SRpcMsg* pRpcMsg) {
pMsgReply
->
srcId
=
ths
->
myRaftId
;
pMsgReply
->
term
=
ths
->
pRaftStore
->
currentTerm
;
pMsgReply
->
privateTerm
=
8864
;
// magic number
pMsgReply
->
timeStamp
=
taosGetTimestampMs
();
if
(
pMsg
->
term
==
ths
->
pRaftStore
->
currentTerm
&&
ths
->
state
!=
TAOS_SYNC_STATE_LEADER
)
{
syncNodeResetElectTimer
(
ths
);
...
...
@@ -2191,7 +2223,7 @@ int32_t syncNodeOnHeartbeatReply(SSyncNode* ths, const SRpcMsg* pRpcMsg) {
syncLogRecvHeartbeatReply
(
ths
,
pMsg
,
""
);
// update last reply time, make decision whether the other node is alive or not
syncIndexMgrSetRecvTime
(
ths
->
pMatchIndex
,
&
pMsg
->
destId
,
pMsg
->
startTime
);
syncIndexMgrSetRecvTime
(
ths
->
pMatchIndex
,
&
pMsg
->
srcId
,
pMsg
->
timeStamp
);
return
0
;
}
...
...
source/libs/sync/src/syncUtil.c
浏览文件 @
91a5f895
...
...
@@ -424,8 +424,8 @@ void syncLogRecvHeartbeatReply(SSyncNode* pSyncNode, const SyncHeartbeatReply* p
char
host
[
64
];
uint16_t
port
;
syncUtilU642Addr
(
pMsg
->
srcId
.
addr
,
host
,
sizeof
(
host
),
&
port
);
sNTrace
(
pSyncNode
,
"recv sync-heartbeat-reply from %s:%d {term:%"
PRId64
",
pterm
:%"
PRId64
"}, %s"
,
host
,
port
,
pMsg
->
term
,
pMsg
->
privateTerm
,
s
);
sNTrace
(
pSyncNode
,
"recv sync-heartbeat-reply from %s:%d {term:%"
PRId64
",
ts
:%"
PRId64
"}, %s"
,
host
,
port
,
pMsg
->
term
,
pMsg
->
timeStamp
,
s
);
}
void
syncLogSendSyncPreSnapshot
(
SSyncNode
*
pSyncNode
,
const
SyncPreSnapshot
*
pMsg
,
const
char
*
s
)
{
...
...
tests/parallel_test/cases.task
浏览文件 @
91a5f895
...
...
@@ -231,7 +231,7 @@
,,y,script,./test.sh -f tsim/stream/windowClose.sim
,,y,script,./test.sh -f tsim/stream/ignoreExpiredData.sim
,,y,script,./test.sh -f tsim/stream/sliding.sim
,,,script,./test.sh -f tsim/stream/partitionbyColumnInterval.sim
,,
y
,script,./test.sh -f tsim/stream/partitionbyColumnInterval.sim
,,y,script,./test.sh -f tsim/stream/partitionbyColumnSession.sim
,,y,script,./test.sh -f tsim/stream/partitionbyColumnState.sim
,,y,script,./test.sh -f tsim/stream/deleteInterval.sim
...
...
@@ -406,38 +406,38 @@
,,y,system-test,./pytest.sh python3 ./test.py -f 0-others/taosShellNetChk.py
,,y,system-test,./pytest.sh python3 ./test.py -f 0-others/telemetry.py
,,y,system-test,./pytest.sh python3 ./test.py -f 0-others/taosdMonitor.py
,,n,system-test,python3 ./test.py -f 0-others/taosdShell.py -N 5 -M 3 -Q 3
,,n,system-test,python3 ./test.py -f 0-others/udfTest.py
,,n,system-test,python3 ./test.py -f 0-others/udf_create.py
,,n,system-test,python3 ./test.py -f 0-others/udf_restart_taosd.py
,,n,system-test,python3 ./test.py -f 0-others/cachemodel.py
,,n,system-test,python3 ./test.py -f 0-others/udf_cfg1.py
,,
n,system-test,
python3 ./test.py -f 0-others/udf_cfg2.py
,,
n,system-test,python3 ./test.py -f 0-others/taosdShell.py -N 5 -M 3 -Q 3
,,
,system-test,
python3 ./test.py -f 0-others/sysinfo.py
,,
,system-test,
python3 ./test.py -f 0-others/user_control.py
,,
,system-test,
python3 ./test.py -f 0-others/fsync.py
,,,system-test,python3 ./test.py -f 0-others/compatibility.py
,,,system-test,python3 ./test.py -f 1-insert/alter_database.py
,,
,system-test,
python3 ./test.py -f 1-insert/influxdb_line_taosc_insert.py
,,
y,system-test,./pytest.sh
python3 ./test.py -f 0-others/udf_cfg2.py
,,
y,system-test,./pytest.sh python3 ./test.py -f 0-others/cachemodel.py
,,
y,system-test,./pytest.sh
python3 ./test.py -f 0-others/sysinfo.py
,,
y,system-test,./pytest.sh
python3 ./test.py -f 0-others/user_control.py
,,
y,system-test,./pytest.sh
python3 ./test.py -f 0-others/fsync.py
,,
n
,system-test,python3 ./test.py -f 0-others/compatibility.py
#
,,,system-test,python3 ./test.py -f 1-insert/alter_database.py
,,
y,system-test,./pytest.sh
python3 ./test.py -f 1-insert/influxdb_line_taosc_insert.py
,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/opentsdb_telnet_line_taosc_insert.py
,,,system-test,python3 ./test.py -f 1-insert/opentsdb_json_taosc_insert.py
,,,system-test,python3 ./test.py -f 1-insert/test_stmt_muti_insert_query.py
,,,system-test,python3 ./test.py -f 1-insert/test_stmt_set_tbname_tag.py
,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/alter_stable.py
,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/alter_table.py
,,,system-test,python3 ./test.py -f 1-insert/boundary.py
,,,system-test,python3 ./test.py -f 1-insert/insertWithMoreVgroup.py
,,
,system-test,
python3 ./test.py -f 1-insert/table_comment.py
,,
n
,system-test,python3 ./test.py -f 1-insert/boundary.py
,,
n
,system-test,python3 ./test.py -f 1-insert/insertWithMoreVgroup.py
,,
y,system-test,./pytest.sh
python3 ./test.py -f 1-insert/table_comment.py
,,,system-test,python3 ./test.py -f 1-insert/time_range_wise.py
,,,system-test,python3 ./test.py -f 1-insert/block_wise.py
,,,system-test,python3 ./test.py -f 1-insert/create_retentions.py
,,
,system-test,
python3 ./test.py -f 1-insert/mutil_stage.py
,,
y,system-test,./pytest.sh
python3 ./test.py -f 1-insert/mutil_stage.py
,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/table_param_ttl.py
,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/table_param_ttl.py -R
,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/update_data_muti_rows.py
,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/db_tb_name_check.py
,,,system-test,python3 ./test.py -f 1-insert/database_pre_suf.py
,,
,system-test,
python3 ./test.py -f 1-insert/InsertFuturets.py
,,
y,system-test,./pytest.sh
python3 ./test.py -f 1-insert/InsertFuturets.py
,,y,system-test,./pytest.sh python3 ./test.py -f 0-others/show.py
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/abs.py
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/abs.py -R
...
...
@@ -543,8 +543,8 @@
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/max.py -R
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/min.py
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/min.py -R
,,
,system-test,
python3 ./test.py -f 2-query/mode.py
,,
,system-test,
python3 ./test.py -f 2-query/mode.py -R
,,
y,system-test,./pytest.sh
python3 ./test.py -f 2-query/mode.py
,,
y,system-test,./pytest.sh
python3 ./test.py -f 2-query/mode.py -R
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/Now.py
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/Now.py -R
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/percentile.py
...
...
@@ -563,8 +563,8 @@
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/sin.py -R
,,,system-test,python3 ./test.py -f 2-query/smaTest.py
,,,system-test,python3 ./test.py -f 2-query/smaTest.py -R
,,
,system-test,
python3 ./test.py -f 2-query/sml.py
,,
,system-test,
python3 ./test.py -f 2-query/sml.py -R
,,
y,system-test,./pytest.sh
python3 ./test.py -f 2-query/sml.py
,,
y,system-test,./pytest.sh
python3 ./test.py -f 2-query/sml.py -R
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/spread.py
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/spread.py -R
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/sqrt.py
...
...
@@ -611,15 +611,15 @@
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/varchar.py -R
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/case_when.py
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/case_when.py -R
,,
,system-test,
python3 ./test.py -f 1-insert/update_data.py
,,
y,system-test,./pytest.sh
python3 ./test.py -f 1-insert/update_data.py
,,,system-test,python3 ./test.py -f 1-insert/tb_100w_data_order.py
,,
,system-test,
python3 ./test.py -f 1-insert/delete_stable.py
,,
,system-test,
python3 ./test.py -f 1-insert/delete_childtable.py
,,
,system-test,
python3 ./test.py -f 1-insert/delete_normaltable.py
,,
y,system-test,./pytest.sh
python3 ./test.py -f 1-insert/delete_stable.py
,,
y,system-test,./pytest.sh
python3 ./test.py -f 1-insert/delete_childtable.py
,,
y,system-test,./pytest.sh
python3 ./test.py -f 1-insert/delete_normaltable.py
,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/keep_expired.py
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/join2.py
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/union1.py
,,
,system-test,
python3 ./test.py -f 2-query/concat2.py
,,
y,system-test,./pytest.sh
python3 ./test.py -f 2-query/concat2.py
,,,system-test,python3 ./test.py -f 2-query/json_tag.py
,,,system-test,python3 ./test.py -f 2-query/nestedQuery.py
,,,system-test,python3 ./test.py -f 2-query/nestedQuery_str.py
...
...
@@ -725,7 +725,9 @@
,,,system-test,python3 ./test.py -f 7-tmq/stbTagFilter-multiCtb.py
,,,system-test,python3 ./test.py -f 99-TDcase/TD-19201.py
,,,system-test,python3 ./test.py -f 7-tmq/tmqSubscribeStb-r3.py -N 5
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/between.py -Q 2
,,,system-test,python3 ./test.py -f 7-tmq/tmq3mnodeSwitch.py -N 6 -M 3
,,,system-test,python3 ./test.py -f 7-tmq/tmq3mnodeSwitch.py -N 6 -M 3 -n 3
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/between.py -Q 2
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/distinct.py -Q 2
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/varchar.py -Q 2
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/ltrim.py -Q 2
...
...
@@ -754,7 +756,7 @@
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/Today.py -Q 2
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/max.py -Q 2
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/min.py -Q 2
,,
,system-test,
python3 ./test.py -f 2-query/mode.py -Q 2
,,
y,system-test,./pytest.sh
python3 ./test.py -f 2-query/mode.py -Q 2
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/count.py -Q 2
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/countAlwaysReturnValue.py -Q 2
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/last.py -Q 2
...
...
@@ -791,15 +793,15 @@
,,,system-test,python3 ./test.py -f 2-query/stablity.py -Q 2
,,,system-test,python3 ./test.py -f 2-query/stablity_1.py -Q 2
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/avg.py -Q 2
,,
,system-test,
python3 ./test.py -f 2-query/elapsed.py -Q 2
,,
,system-test,
python3 ./test.py -f 2-query/csum.py -Q 2
,,
y,system-test,./pytest.sh
python3 ./test.py -f 2-query/elapsed.py -Q 2
,,
y,system-test,./pytest.sh
python3 ./test.py -f 2-query/csum.py -Q 2
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/mavg.py -Q 2
,,
,system-test,
python3 ./test.py -f 2-query/sample.py -Q 2
,,
,system-test,
python3 ./test.py -f 2-query/function_diff.py -Q 2
,,
y,system-test,./pytest.sh
python3 ./test.py -f 2-query/sample.py -Q 2
,,
y,system-test,./pytest.sh
python3 ./test.py -f 2-query/function_diff.py -Q 2
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/unique.py -Q 2
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/stateduration.py -Q 2
,,
,system-test,
python3 ./test.py -f 2-query/function_stateduration.py -Q 2
,,
,system-test,
python3 ./test.py -f 2-query/statecount.py -Q 2
,,
y,system-test,./pytest.sh
python3 ./test.py -f 2-query/function_stateduration.py -Q 2
,,
y,system-test,./pytest.sh
python3 ./test.py -f 2-query/statecount.py -Q 2
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/tail.py -Q 2
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/ttl_comment.py -Q 2
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/distribute_agg_count.py -Q 2
...
...
@@ -848,7 +850,7 @@
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/Today.py -Q 3
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/max.py -Q 3
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/min.py -Q 3
,,
,system-test,
python3 ./test.py -f 2-query/mode.py -Q 3
,,
y,system-test,./pytest.sh
python3 ./test.py -f 2-query/mode.py -Q 3
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/count.py -Q 3
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/countAlwaysReturnValue.py -Q 3
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/last.py -Q 3
...
...
@@ -884,15 +886,15 @@
,,,system-test,python3 ./test.py -f 2-query/stablity.py -Q 3
,,,system-test,python3 ./test.py -f 2-query/stablity_1.py -Q 3
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/avg.py -Q 3
,,
,system-test,
python3 ./test.py -f 2-query/elapsed.py -Q 3
,,
,system-test,
python3 ./test.py -f 2-query/csum.py -Q 3
,,
y,system-test,./pytest.sh
python3 ./test.py -f 2-query/elapsed.py -Q 3
,,
y,system-test,./pytest.sh
python3 ./test.py -f 2-query/csum.py -Q 3
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/mavg.py -Q 3
,,
,system-test,
python3 ./test.py -f 2-query/sample.py -Q 3
,,
,system-test,
python3 ./test.py -f 2-query/function_diff.py -Q 3
,,
y,system-test,./pytest.sh
python3 ./test.py -f 2-query/sample.py -Q 3
,,
y,system-test,./pytest.sh
python3 ./test.py -f 2-query/function_diff.py -Q 3
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/unique.py -Q 3
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/stateduration.py -Q 3
,,
,system-test,
python3 ./test.py -f 2-query/function_stateduration.py -Q 3
,,
,system-test,
python3 ./test.py -f 2-query/statecount.py -Q 3
,,
y,system-test,./pytest.sh
python3 ./test.py -f 2-query/function_stateduration.py -Q 3
,,
y,system-test,./pytest.sh
python3 ./test.py -f 2-query/statecount.py -Q 3
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/tail.py -Q 3
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/ttl_comment.py -Q 3
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/distribute_agg_count.py -Q 3
...
...
@@ -941,7 +943,7 @@
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/Today.py -Q 4
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/max.py -Q 4
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/min.py -Q 4
,,
,system-test,
python3 ./test.py -f 2-query/mode.py -Q 4
,,
y,system-test,./pytest.sh
python3 ./test.py -f 2-query/mode.py -Q 4
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/count.py -Q 4
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/countAlwaysReturnValue.py -Q 4
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/last.py -Q 4
...
...
@@ -977,16 +979,16 @@
,,,system-test,python3 ./test.py -f 2-query/stablity.py -Q 4
,,,system-test,python3 ./test.py -f 2-query/stablity_1.py -Q 4
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/avg.py -Q 4
,,
,system-test,
python3 ./test.py -f 2-query/elapsed.py -Q 4
,,
,system-test,
python3 ./test.py -f 2-query/csum.py -Q 4
,,
y,system-test,./pytest.sh
python3 ./test.py -f 2-query/elapsed.py -Q 4
,,
y,system-test,./pytest.sh
python3 ./test.py -f 2-query/csum.py -Q 4
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/mavg.py -Q 4
,,
,system-test,
python3 ./test.py -f 2-query/sample.py -Q 4
,,
y,system-test,./pytest.sh
python3 ./test.py -f 2-query/sample.py -Q 4
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/cast.py -Q 4
,,
,system-test,
python3 ./test.py -f 2-query/function_diff.py -Q 4
,,
y,system-test,./pytest.sh
python3 ./test.py -f 2-query/function_diff.py -Q 4
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/unique.py -Q 4
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/stateduration.py -Q 4
,,
,system-test,
python3 ./test.py -f 2-query/function_stateduration.py -Q 4
,,
,system-test,
python3 ./test.py -f 2-query/statecount.py -Q 4
,,
y,system-test,./pytest.sh
python3 ./test.py -f 2-query/function_stateduration.py -Q 4
,,
y,system-test,./pytest.sh
python3 ./test.py -f 2-query/statecount.py -Q 4
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/tail.py -Q 4
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/ttl_comment.py -Q 4
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/distribute_agg_count.py -Q 4
...
...
@@ -1003,24 +1005,29 @@
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/count_partition.py -Q 4
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/max_partition.py -Q 4
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/last_row.py -Q 4
,,
,system-test,
python3 ./test.py -f 2-query/tsbsQuery.py -Q 4
,,
y,system-test,./pytest.sh
python3 ./test.py -f 2-query/tsbsQuery.py -Q 4
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/sml.py -Q 4
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/interp.py -Q 4
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/case_when.py -Q 4
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/insert_select.py
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/insert_select.py -R
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/insert_select.py -Q 2
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/insert_select.py -Q 3
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/insert_select.py -Q 4
#develop test
,,,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/auto_create_table_json.py
,,,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/custom_col_tag.py
,,,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/default_json.py
,,,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/demo.py
,,,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/insert_alltypes_json.py
,,,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/invalid_commandline.py
,,,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/json_tag.py
,,,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/query_json.py
,,,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/sample_csv_json.py
,,,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/sml_json_alltypes.py
,,,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/taosdemoTestQueryWithJson.py -R
,,,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/telnet_tcp.py -R
,,
n
,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/auto_create_table_json.py
,,
n
,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/custom_col_tag.py
,,
n
,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/default_json.py
,,
n
,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/demo.py
,,
n
,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/insert_alltypes_json.py
,,
n
,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/invalid_commandline.py
,,
n
,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/json_tag.py
,,
n
,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/query_json.py
,,
n
,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/sample_csv_json.py
,,
n
,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/sml_json_alltypes.py
,,
n
,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/taosdemoTestQueryWithJson.py -R
,,
n
,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/telnet_tcp.py -R
#docs-examples test
,,n,docs-examples-test,bash python.sh
...
...
tests/system-test/1-insert/test_stmt_muti_insert_query.py
浏览文件 @
91a5f895
...
...
@@ -165,6 +165,7 @@ class TDTestCase:
# conn.execute("drop database if exists %s" % dbname)
conn
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
except
Exception
as
err
:
# conn.execute("drop database if exists %s" % dbname)
...
...
tests/system-test/1-insert/test_stmt_set_tbname_tag.py
浏览文件 @
91a5f895
...
...
@@ -239,6 +239,7 @@ class TDTestCase:
# conn.execute("drop database if exists %s" % dbname)
conn
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
except
Exception
as
err
:
# conn.execute("drop database if exists %s" % dbname)
...
...
tests/system-test/2-query/insert_select.py
0 → 100644
浏览文件 @
91a5f895
###################################################################
# Copyright (c) 2016 by TAOS Technologies, Inc.
# All rights reserved.
#
# This file is proprietary and confidential to TAOS Technologies.
# No part of this file may be reproduced, stored, transmitted,
# disclosed or used in any form or by any means other than as
# expressly provided by the written permission from Jianhui Tao
#
###################################################################
# -*- coding: utf-8 -*-
import
random
import
os
import
time
import
subprocess
from
util.log
import
tdLog
from
util.cases
import
tdCases
from
util.sql
import
tdSql
class
TDTestCase
:
updatecfgDict
=
{
'maxSQLLength'
:
1048576
,
'debugFlag'
:
143
,
"querySmaOptimize"
:
1
}
def
init
(
self
,
conn
,
logSql
,
replicaVar
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
(),
logSql
)
self
.
testcasePath
=
os
.
path
.
split
(
__file__
)[
0
]
self
.
testcaseFilename
=
os
.
path
.
split
(
__file__
)[
-
1
]
os
.
system
(
"rm -rf %s/%s.sql"
%
(
self
.
testcasePath
,
self
.
testcaseFilename
))
self
.
db
=
"insert_select"
def
dropandcreateDB_random
(
self
,
database
,
n
):
ts
=
1604298064000
tdSql
.
execute
(
'''drop database if exists %s ;'''
%
database
)
tdSql
.
execute
(
'''create database %s keep 36500 ;'''
%
(
database
))
tdSql
.
execute
(
'''use %s;'''
%
database
)
tdSql
.
execute
(
'''create table %s.tb (ts timestamp , i tinyint );'''
%
database
)
tdSql
.
execute
(
'''create table %s.tb1 (speed timestamp , c1 int , c2 int , c3 int );'''
%
database
)
sql_before
=
"insert into %s.tb1 values"
%
database
sql_value
=
''
for
i
in
range
(
n
):
sql_value
=
sql_value
+
"(%d, %d, %d, %d)"
%
(
ts
+
i
,
i
,
i
,
i
)
sql
=
sql_before
+
sql_value
tdSql
.
execute
(
sql
)
tdSql
.
query
(
"select count(*) from %s.tb1;"
%
database
)
sql_result
=
tdSql
.
getData
(
0
,
0
)
tdLog
.
info
(
"result: %s"
%
(
sql_result
))
tdSql
.
query
(
"reset query cache;"
)
tdSql
.
query
(
"insert into %s.tb1 select * from %s.tb1;"
%
(
database
,
database
))
tdSql
.
query
(
"select count(*) from %s.tb1;"
%
database
)
sql_result
=
tdSql
.
getData
(
0
,
0
)
tdLog
.
info
(
"result: %s"
%
(
sql_result
))
def
users_bug_TD_20592
(
self
,
database
):
tdSql
.
execute
(
'''drop database if exists %s ;'''
%
database
)
tdSql
.
execute
(
'''create database %s keep 36500 ;'''
%
(
database
))
tdSql
.
execute
(
'''use %s;'''
%
database
)
tdSql
.
execute
(
'''create table %s.sav_stb (ts timestamp, c1 int, c2 bigint, c3 float, c4 double, c5 smallint, c6 tinyint, c7 bool, c8 binary(10), c9 nchar(10)) tags(t1 int, t2 int);'''
%
database
)
tdSql
.
execute
(
'''create table %s.tb1 using %s.sav_stb tags( 9 , 0);'''
%
(
database
,
database
))
tdSql
.
error
(
'''insert into %s.tb1 (c8, c9) values(now, 1);'''
%
(
database
))
def
run
(
self
):
startTime
=
time
.
time
()
os
.
system
(
"rm -rf %s/%s.sql"
%
(
self
.
testcasePath
,
self
.
testcaseFilename
))
self
.
dropandcreateDB_random
(
"%s"
%
self
.
db
,
random
.
randint
(
10000
,
30000
))
#taos -f sql
print
(
"taos -f sql start!"
)
taos_cmd1
=
"taos -f %s/%s.sql"
%
(
self
.
testcasePath
,
self
.
testcaseFilename
)
_
=
subprocess
.
check_output
(
taos_cmd1
,
shell
=
True
)
print
(
"taos -f sql over!"
)
self
.
users_bug_TD_20592
(
"%s"
%
self
.
db
)
#taos -f sql
print
(
"taos -f sql start!"
)
taos_cmd1
=
"taos -f %s/%s.sql"
%
(
self
.
testcasePath
,
self
.
testcaseFilename
)
_
=
subprocess
.
check_output
(
taos_cmd1
,
shell
=
True
)
print
(
"taos -f sql over!"
)
endTime
=
time
.
time
()
print
(
"total time %ds"
%
(
endTime
-
startTime
))
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/system-test/2-query/select_index.py
浏览文件 @
91a5f895
...
...
@@ -26,7 +26,7 @@ from util.dnodes import *
class
TDTestCase
:
updatecfgDict
=
{
'maxSQLLength'
:
1048576
,
'debugFlag'
:
143
,
"querySmaOptimize"
:
1
}
def
init
(
self
,
conn
,
logSql
):
def
init
(
self
,
conn
,
logSql
,
replicaVar
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
(),
logSql
)
...
...
@@ -109,7 +109,7 @@ class TDTestCase:
q_binary1 , q_nchar1 , q_binary2 , q_nchar2 , q_binary3 , q_nchar3 , q_binary4 , q_nchar4 , q_binary5 , q_nchar5 , q_binary6 , q_nchar6 , q_binary7 , q_nchar7, q_binary8 , q_nchar8)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d, 'binary1.%s', 'nchar1.%s', 'binary2.%s', 'nchar2.%s', 'binary3.%s', 'nchar3.%s',
\
'binary4.%s', 'nchar4.%s', 'binary5.%s', 'nchar5.%s', 'binary6.%s', 'nchar6.%s', 'binary7.%s', 'nchar7.%s', 'binary8.%s', 'nchar8.%s') ;'''
%
(
database
,
ts
+
i
*
1000
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
%
(
database
,
ts
+
i
*
1000
+
1
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
9223372036854775807
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
,
fake
.
pystr
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
...
...
@@ -118,7 +118,7 @@ class TDTestCase:
q_binary1 , q_nchar1 , q_binary2 , q_nchar2 , q_binary3 , q_nchar3 , q_binary4 , q_nchar4 , q_binary5 , q_nchar5 , q_binary6 , q_nchar6 , q_binary7 , q_nchar7, q_binary8 , q_nchar8)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d, 'binary1.%s', 'nchar1.%s', 'binary2.%s', 'nchar2.%s', 'binary3.%s', 'nchar3.%s',
\
'binary4.%s', 'nchar4.%s', 'binary5.%s', 'nchar5.%s', 'binary6.%s', 'nchar6.%s', 'binary7.%s', 'nchar7.%s', 'binary8.%s', 'nchar8.%s') ;'''
%
(
database
,
ts
+
i
*
1000
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
)
,
%
(
database
,
ts
+
i
*
1000
+
1
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
)
,
fake
.
random_int
(
min
=-
9223372036854775807
,
max
=
9223372036854775807
,
step
=
1
)
,
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
,
fake
.
pystr
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
...
...
@@ -128,7 +128,7 @@ class TDTestCase:
q_binary1 , q_nchar1 , q_binary2 , q_nchar2 , q_binary3 , q_nchar3 , q_binary4 , q_nchar4 , q_binary5 , q_nchar5 , q_binary6 , q_nchar6 , q_binary7 , q_nchar7, q_binary8 , q_nchar8)
\
values(%d, %d, %d, %d, %d, %f, %f, 1, 'binary.%s', 'nchar.%s', %d, 'binary1.%s', 'nchar1.%s', 'binary2.%s', 'nchar2.%s', 'binary3.%s', 'nchar3.%s',
\
'binary4.%s', 'nchar4.%s', 'binary5.%s', 'nchar5.%s', 'binary6.%s', 'nchar6.%s', 'binary7.%s', 'nchar7.%s', 'binary8.%s', 'nchar8.%s') ;'''
%
(
database
,
ts
+
i
*
1000
,
fake
.
random_int
(
min
=
0
,
max
=
2147483647
,
step
=
1
),
%
(
database
,
ts
+
i
*
1000
+
2
,
fake
.
random_int
(
min
=
0
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=
0
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=
0
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=
0
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
,
fake
.
pystr
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
...
...
@@ -137,7 +137,7 @@ class TDTestCase:
q_binary1 , q_nchar1 , q_binary2 , q_nchar2 , q_binary3 , q_nchar3 , q_binary4 , q_nchar4 , q_binary5 , q_nchar5 , q_binary6 , q_nchar6 , q_binary7 , q_nchar7, q_binary8 , q_nchar8)
\
values(%d, %d, %d, %d, %d, %f, %f, 1, 'binary.%s', 'nchar.%s', %d, 'binary1.%s', 'nchar1.%s', 'binary2.%s', 'nchar2.%s', 'binary3.%s', 'nchar3.%s',
\
'binary4.%s', 'nchar4.%s', 'binary5.%s', 'nchar5.%s', 'binary6.%s', 'nchar6.%s', 'binary7.%s', 'nchar7.%s', 'binary8.%s', 'nchar8.%s') ;'''
%
(
database
,
ts
+
i
*
1000
,
fake
.
random_int
(
min
=
0
,
max
=
2147483647
,
step
=
1
),
%
(
database
,
ts
+
i
*
1000
+
2
,
fake
.
random_int
(
min
=
0
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=
0
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=
0
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=
0
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
,
fake
.
pystr
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
...
...
@@ -147,7 +147,7 @@ class TDTestCase:
q_binary1 , q_nchar1 , q_binary2 , q_nchar2 , q_binary3 , q_nchar3 , q_binary4 , q_nchar4 , q_binary5 , q_nchar5 , q_binary6 , q_nchar6 , q_binary7 , q_nchar7, q_binary8 , q_nchar8)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d, 'binary1.%s', 'nchar1.%s', 'binary2.%s', 'nchar2.%s', 'binary3.%s', 'nchar3.%s',
\
'binary4.%s', 'nchar4.%s', 'binary5.%s', 'nchar5.%s', 'binary6.%s', 'nchar6.%s', 'binary7.%s', 'nchar7.%s', 'binary8.%s', 'nchar8.%s') ;'''
%
(
database
,
ts
+
i
*
1000
,
fake
.
random_int
(
min
=-
0
,
max
=
2147483647
,
step
=
1
),
%
(
database
,
ts
+
i
*
1000
+
3
,
fake
.
random_int
(
min
=-
0
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
0
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=-
0
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
0
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
,
fake
.
pystr
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
...
...
@@ -157,7 +157,7 @@ class TDTestCase:
q_binary1 , q_nchar1 , q_binary2 , q_nchar2 , q_binary3 , q_nchar3 , q_binary4 , q_nchar4 , q_binary5 , q_nchar5 , q_binary6 , q_nchar6 , q_binary7 , q_nchar7, q_binary8 , q_nchar8)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d, 'binary1.%s', 'nchar1.%s', 'binary2.%s', 'nchar2.%s', 'binary3.%s', 'nchar3.%s',
\
'binary4.%s', 'nchar4.%s', 'binary5.%s', 'nchar5.%s', 'binary6.%s', 'nchar6.%s', 'binary7.%s', 'nchar7.%s', 'binary8.%s', 'nchar8.%s') ;'''
%
(
database
,
ts
+
i
*
1000
+
1
,
fake
.
random_int
(
min
=-
0
,
max
=
2147483647
,
step
=
1
),
%
(
database
,
ts
+
i
*
1000
+
4
,
fake
.
random_int
(
min
=-
0
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
0
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=-
0
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
0
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
,
fake
.
pystr
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
...
...
@@ -167,7 +167,7 @@ class TDTestCase:
q_binary1 , q_nchar1 , q_binary2 , q_nchar2 , q_binary3 , q_nchar3 , q_binary4 , q_nchar4 , q_binary5 , q_nchar5 , q_binary6 , q_nchar6 , q_binary7 , q_nchar7, q_binary8 , q_nchar8)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d, 'binary1.%s', 'nchar1.%s', 'binary2.%s', 'nchar2.%s', 'binary3.%s', 'nchar3.%s',
\
'binary4.%s', 'nchar4.%s', 'binary5.%s', 'nchar5.%s', 'binary6.%s', 'nchar6.%s', 'binary7.%s', 'nchar7.%s', 'binary8.%s', 'nchar8.%s') ;'''
%
(
database
,
ts
+
i
*
1000
+
10
,
fake
.
random_int
(
min
=-
0
,
max
=
2147483647
,
step
=
1
),
%
(
database
,
ts
+
i
*
1000
+
5
,
fake
.
random_int
(
min
=-
0
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
0
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=-
0
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
0
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
,
fake
.
pystr
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
...
...
@@ -182,7 +182,7 @@ class TDTestCase:
fake
=
Faker
(
'zh_CN'
)
fake_data
=
fake
.
random_int
(
min
=
1
,
max
=
20
,
step
=
1
)
tdLog
.
info
(
"
\n
=============constant(%s)_check ====================
\n
"
%
func
)
tdSql
.
execute
(
" create sma index
sma_index_name1 on stable_1 function(%s(%s)) interval(%dm); "
%
(
func
,
column
,
fake_data
))
tdSql
.
execute
(
" create sma index
%s.sma_index_name1 on %s.stable_1 function(%s(%s)) interval(%dm); "
%
(
database
,
database
,
func
,
column
,
fake_data
))
sql
=
" select %s(%s) from %s.stable_1 interval(1m) "
%
(
func
,
column
,
database
)
tdLog
.
info
(
sql
)
tdSql
.
query
(
sql
)
...
...
@@ -205,7 +205,7 @@ class TDTestCase:
tdLog
.
info
(
"
\n
=============drop index ====================
\n
"
)
tdSql
.
execute
(
" drop index
sma_index_name1;"
)
tdSql
.
execute
(
" drop index
%s.sma_index_name1;"
%
database
)
tdSql
.
query
(
sql
)
queryRows
=
len
(
tdSql
.
queryResult
)
...
...
@@ -214,7 +214,30 @@ class TDTestCase:
drop_index_value
=
tdSql
.
queryResult
[
i
][
0
]
self
.
value_check
(
flush_before_value
,
drop_index_value
)
def
constant_speical_check
(
self
,
database
,
func
,
column
):
tdLog
.
info
(
"
\n
=============constant(%s)_check ====================
\n
"
%
column
)
sql_no_from
=
" select %s(%s) ; "
%
(
func
,
column
)
tdLog
.
info
(
sql_no_from
)
tdSql
.
query
(
sql_no_from
)
queryRows
=
len
(
tdSql
.
queryResult
)
for
i
in
range
(
queryRows
):
print
(
"row=%d, result=%s "
%
(
i
,
tdSql
.
queryResult
[
i
][
0
]))
flush_before_value_no_from
=
tdSql
.
queryResult
[
i
][
0
]
tdLog
.
info
(
"
\n
=============flush database ====================
\n
"
)
tdSql
.
execute
(
" flush database %s;"
%
database
)
tdSql
.
query
(
sql_no_from
)
queryRows
=
len
(
tdSql
.
queryResult
)
for
i
in
range
(
queryRows
):
print
(
"row=%d, result=%s "
%
(
i
,
tdSql
.
queryResult
[
i
][
0
]))
flush_after_value_no_from
=
tdSql
.
queryResult
[
i
][
0
]
self
.
value_check
(
flush_before_value_no_from
,
flush_after_value_no_from
)
def
constant_check
(
self
,
database
,
func
,
column
):
tdLog
.
info
(
"
\n
=============constant(%s)_check ====================
\n
"
%
column
)
...
...
@@ -253,7 +276,7 @@ class TDTestCase:
print
(
"row=%d, result=%s "
%
(
i
,
tdSql
.
queryResult
[
i
][
0
]))
flush_after_value_no_from
=
tdSql
.
queryResult
[
i
][
0
]
self
.
value_check
(
flush_before_value_no_from
,
flush_after_value_no_from
)
#self.value_check(flush_before_value_no_from,flush_after_value_no_from)#越界后值不唯一
def
constant_table_check
(
self
,
database
,
func
,
column
):
tdLog
.
info
(
"
\n
=============constant(%s)_check ====================
\n
"
%
column
)
...
...
@@ -292,7 +315,7 @@ class TDTestCase:
print
(
"row=%d, result=%s "
%
(
i
,
tdSql
.
queryResult
[
i
][
0
]))
flush_after_value_no_from
=
tdSql
.
queryResult
[
i
][
0
]
self
.
value_check
(
flush_before_value_no_from
,
flush_after_value_no_from
)
#self.value_check(flush_before_value_no_from,flush_after_value_no_from)#越界后值不唯一
def
constant_str_check
(
self
,
database
,
func
,
column
):
tdLog
.
info
(
"
\n
=============constant(%s)_check ====================
\n
"
%
column
)
...
...
@@ -338,7 +361,7 @@ class TDTestCase:
def
derivative_sql
(
self
,
database
):
fake
=
Faker
(
'zh_CN'
)
fake_data
=
fake
.
random_int
(
min
=
-
9223372036854775807
,
max
=
9223372036854775807
,
step
=
1
)
fake_data
=
fake
.
random_int
(
min
=
1
,
max
=
10000000000000
,
step
=
1
)
tdLog
.
info
(
"
\n
=============derivative sql ====================
\n
"
)
sql
=
" select derivative(%s,%ds,0) from %s.stable_1 "
%
(
'q_smallint'
,
fake_data
,
database
)
self
.
derivative_data_check
(
"%s"
%
self
.
db
,
"%s"
%
sql
)
...
...
@@ -493,11 +516,11 @@ class TDTestCase:
def
value_check
(
self
,
flush_before_value
,
flush_after_value
):
#
if flush_before_value==flush_after_value:
#
tdLog.info(f"checkEqual success, flush_before_value={flush_before_value},flush_after_value={flush_after_value}")
#
else :
#
tdLog.exit(f"checkEqual error, flush_before_value=={flush_before_value},flush_after_value={flush_after_value}")
pass
if
flush_before_value
==
flush_after_value
:
tdLog
.
info
(
f
"checkEqual success, flush_before_value=
{
flush_before_value
}
,flush_after_value=
{
flush_after_value
}
"
)
else
:
tdLog
.
exit
(
f
"checkEqual error, flush_before_value==
{
flush_before_value
}
,flush_after_value=
{
flush_after_value
}
"
)
#
pass
def
run
(
self
):
fake
=
Faker
(
'zh_CN'
)
...
...
@@ -511,6 +534,11 @@ class TDTestCase:
self
.
dropandcreateDB_random
(
"%s"
%
self
.
db
,
1
,
2
)
self
.
constant_speical_check
(
"%s"
%
self
.
db
,
''
,
'%d'
%
fake_data
)
self
.
constant_speical_check
(
"%s"
%
self
.
db
,
''
,
'%f'
%
fake_float
)
self
.
constant_speical_check
(
"%s"
%
self
.
db
,
''
,
'
\'
%s
\'
'
%
fake_str
)
self
.
constant_speical_check
(
"%s"
%
self
.
db
,
''
,
'NULL'
)
#TD-19818
self
.
func_index_check
(
"%s"
%
self
.
db
,
'max'
,
'q_int'
)
self
.
func_index_check
(
"%s"
%
self
.
db
,
'max'
,
'q_bigint'
)
...
...
tests/system-test/2-query/sml.py
浏览文件 @
91a5f895
...
...
@@ -27,7 +27,7 @@ class TDTestCase:
tdLog
.
info
(
cmdStr
)
ret
=
os
.
system
(
cmdStr
)
if
ret
!=
0
:
tdLog
.
exit
(
"sml_test failed
"
)
tdLog
.
info
(
"sml_test ret != 0
"
)
# tdSql.execute('use sml_db')
tdSql
.
query
(
f
"select * from
{
dbname
}
.t_b7d815c9222ca64cdf2614c61de8f211"
)
...
...
tests/system-test/7-tmq/tmq3mnodeSwitch.py
浏览文件 @
91a5f895
...
...
@@ -54,9 +54,9 @@ class TDTestCase:
time
.
sleep
(
1
)
tdLog
.
debug
(
"............... waiting for all dnodes ready!"
)
tdLog
.
info
(
"==============create two new mnodes ========"
)
tdSql
.
execute
(
"create mnode on dnode 2"
)
tdSql
.
execute
(
"create mnode on dnode 3"
)
#
tdLog.info("==============create two new mnodes ========")
#
tdSql.execute("create mnode on dnode 2")
#
tdSql.execute("create mnode on dnode 3")
self
.
check3mnode
()
return
...
...
@@ -179,17 +179,20 @@ class TDTestCase:
'tagSchema'
:
[{
'type'
:
'INT'
,
'count'
:
1
},
{
'type'
:
'binary'
,
'len'
:
20
,
'count'
:
1
}],
'ctbPrefix'
:
'ctb'
,
'ctbNum'
:
1
,
'rowsPerTbl'
:
10
0000
,
'rowsPerTbl'
:
4
0000
,
'batchNum'
:
10
,
'startTs'
:
1640966400000
,
# 2022-01-01 00:00:00.000
'pollDelay'
:
1
0
,
'pollDelay'
:
3
0
,
'showMsg'
:
1
,
'showRow'
:
1
}
if
self
.
replicaVar
==
3
:
paraDict
[
"rowsPerTbl"
]
=
20000
topicNameList
=
[
'topic1'
]
expectRowsList
=
[]
tmqCom
.
initConsumerTable
()
tdCom
.
create_database
(
tdSql
,
paraDict
[
"dbName"
],
paraDict
[
"dropFlag"
],
vgroups
=
4
,
replica
=
1
)
tdCom
.
create_database
(
tdSql
,
paraDict
[
"dbName"
],
paraDict
[
"dropFlag"
],
vgroups
=
4
,
replica
=
self
.
replicaVar
)
tdLog
.
info
(
"create stb"
)
tdCom
.
create_stable
(
tdSql
,
dbname
=
paraDict
[
"dbName"
],
stbname
=
paraDict
[
"stbName"
],
column_elm_list
=
paraDict
[
'colSchema'
],
tag_elm_list
=
paraDict
[
'tagSchema'
])
tdLog
.
info
(
"create ctb"
)
...
...
@@ -198,7 +201,9 @@ class TDTestCase:
pThread
=
tmqCom
.
asyncInsertData
(
paraDict
)
tdLog
.
info
(
"create topics from stb with filter"
)
queryString
=
"select ts, log(c1), ceil(pow(c1,3)) from %s.%s where c1 %% 7 == 0"
%
(
paraDict
[
'dbName'
],
paraDict
[
'stbName'
])
# queryString = "select ts, log(c1), ceil(pow(c1,3)) from %s.%s where c1 %% 7 == 0" %(paraDict['dbName'], paraDict['stbName'])
queryString
=
"select ts, log(c1), ceil(pow(c1,3)) from %s.%s"
%
(
paraDict
[
'dbName'
],
paraDict
[
'stbName'
])
sqlString
=
"create topic %s as %s"
%
(
topicNameList
[
0
],
queryString
)
tdLog
.
info
(
"create topic sql: %s"
%
sqlString
)
tdSql
.
execute
(
sqlString
)
...
...
tests/system-test/pytest.sh
浏览文件 @
91a5f895
...
...
@@ -84,6 +84,7 @@ do
if
[
$AsanFileLen
-gt
10
]
;
then
break
fi
sleep
1
done
AsanFileSuccessLen
=
`
grep
-w
successfully
$AsanFile
|
wc
-l
`
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录