Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
933660ae
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,发现更多精彩内容 >>
提交
933660ae
编写于
4月 12, 2023
作者:
X
Xiaoyu Wang
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/main' into fix/3.0_merge_main
上级
e67b7842
9c0027cb
变更
15
隐藏空白更改
内联
并排
Showing
15 changed file
with
168 addition
and
163 deletion
+168
-163
source/dnode/mgmt/mgmt_vnode/src/vmWorker.c
source/dnode/mgmt/mgmt_vnode/src/vmWorker.c
+2
-2
source/dnode/mnode/impl/src/mndUser.c
source/dnode/mnode/impl/src/mndUser.c
+7
-9
source/dnode/vnode/src/tsdb/tsdbCache.c
source/dnode/vnode/src/tsdb/tsdbCache.c
+14
-8
source/libs/function/test/udf1.c
source/libs/function/test/udf1.c
+1
-1
source/libs/sync/inc/syncPipeline.h
source/libs/sync/inc/syncPipeline.h
+8
-6
source/libs/sync/inc/syncRaftEntry.h
source/libs/sync/inc/syncRaftEntry.h
+1
-1
source/libs/sync/src/syncMain.c
source/libs/sync/src/syncMain.c
+1
-1
source/libs/sync/src/syncPipeline.c
source/libs/sync/src/syncPipeline.c
+22
-23
source/libs/sync/src/syncReplication.c
source/libs/sync/src/syncReplication.c
+1
-1
source/util/src/terror.c
source/util/src/terror.c
+1
-1
tests/script/tsim/valgrind/checkUdf.sim
tests/script/tsim/valgrind/checkUdf.sim
+8
-8
tests/system-test/0-others/udfTest.py
tests/system-test/0-others/udfTest.py
+25
-25
tests/system-test/0-others/udf_cfg2.py
tests/system-test/0-others/udf_cfg2.py
+25
-25
tests/system-test/0-others/udf_create.py
tests/system-test/0-others/udf_create.py
+25
-25
tests/system-test/0-others/udf_restart_taosd.py
tests/system-test/0-others/udf_restart_taosd.py
+27
-27
未找到文件。
source/dnode/mgmt/mgmt_vnode/src/vmWorker.c
浏览文件 @
933660ae
...
...
@@ -163,8 +163,8 @@ static int32_t vmPutMsgToQueue(SVnodeMgmt *pMgmt, SRpcMsg *pMsg, EQueueType qtyp
SVnodeObj
*
pVnode
=
vmAcquireVnode
(
pMgmt
,
pHead
->
vgId
);
if
(
pVnode
==
NULL
)
{
dG
Error
(
"vgId:%d, msg:%p failed to put into vnode queue since %s, type:%s qtype:%d contLen:%d"
,
pHead
->
vgId
,
pMsg
,
terrstr
(),
TMSG_INFO
(
pMsg
->
msgType
),
qtype
,
pHead
->
contLen
);
dG
Warn
(
"vgId:%d, msg:%p failed to put into vnode queue since %s, type:%s qtype:%d contLen:%d"
,
pHead
->
vgId
,
pMsg
,
terrstr
(),
TMSG_INFO
(
pMsg
->
msgType
),
qtype
,
pHead
->
contLen
);
terrno
=
(
terrno
!=
0
)
?
terrno
:
-
1
;
return
terrno
;
}
...
...
source/dnode/mnode/impl/src/mndUser.c
浏览文件 @
933660ae
...
...
@@ -1168,15 +1168,13 @@ static void mndLoopHash(SHashObj *hash, char *priType, SSDataBlock *pBlock, int3
sprintf
(
sql
,
"error"
);
}
// char *obj = taosMemoryMalloc(sqlLen + VARSTR_HEADER_SIZE + 1);
char
obj
[
TSDB_PRIVILEDGE_CONDITION_LEN
+
VARSTR_HEADER_SIZE
]
=
{
0
};
STR_WITH_MAXSIZE_TO_VARSTR
(
obj
,
sql
,
pShow
->
pMeta
->
pSchemas
[
cols
].
bytes
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataSetVal
(
pColInfo
,
*
numOfRows
,
(
const
char
*
)
obj
,
false
);
// taosMemoryFree(obj);
}
else
{
char
condition
[
20
]
=
{
0
};
char
condition
[
TSDB_PRIVILEDGE_CONDITION_LEN
+
VARSTR_HEADER_SIZE
]
=
{
0
};
STR_WITH_MAXSIZE_TO_VARSTR
(
condition
,
""
,
pShow
->
pMeta
->
pSchemas
[
cols
].
bytes
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataSetVal
(
pColInfo
,
*
numOfRows
,
(
const
char
*
)
condition
,
false
);
...
...
@@ -1257,12 +1255,12 @@ static int32_t mndRetrievePrivileges(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataSetVal
(
pColInfo
,
numOfRows
,
(
const
char
*
)
objName
,
false
);
char
tableName
[
20
]
=
{
0
};
char
tableName
[
TSDB_TABLE_NAME_LEN
+
VARSTR_HEADER_SIZE
]
=
{
0
};
STR_WITH_MAXSIZE_TO_VARSTR
(
tableName
,
""
,
pShow
->
pMeta
->
pSchemas
[
cols
].
bytes
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataSetVal
(
pColInfo
,
numOfRows
,
(
const
char
*
)
tableName
,
false
);
char
condition
[
20
]
=
{
0
};
char
condition
[
TSDB_PRIVILEDGE_CONDITION_LEN
+
VARSTR_HEADER_SIZE
]
=
{
0
};
STR_WITH_MAXSIZE_TO_VARSTR
(
condition
,
""
,
pShow
->
pMeta
->
pSchemas
[
cols
].
bytes
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataSetVal
(
pColInfo
,
numOfRows
,
(
const
char
*
)
condition
,
false
);
...
...
@@ -1292,12 +1290,12 @@ static int32_t mndRetrievePrivileges(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataSetVal
(
pColInfo
,
numOfRows
,
(
const
char
*
)
objName
,
false
);
char
tableName
[
20
]
=
{
0
};
char
tableName
[
TSDB_TABLE_NAME_LEN
+
VARSTR_HEADER_SIZE
]
=
{
0
};
STR_WITH_MAXSIZE_TO_VARSTR
(
tableName
,
""
,
pShow
->
pMeta
->
pSchemas
[
cols
].
bytes
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataSetVal
(
pColInfo
,
numOfRows
,
(
const
char
*
)
tableName
,
false
);
char
condition
[
20
]
=
{
0
};
char
condition
[
TSDB_PRIVILEDGE_CONDITION_LEN
+
VARSTR_HEADER_SIZE
]
=
{
0
};
STR_WITH_MAXSIZE_TO_VARSTR
(
condition
,
""
,
pShow
->
pMeta
->
pSchemas
[
cols
].
bytes
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataSetVal
(
pColInfo
,
numOfRows
,
(
const
char
*
)
condition
,
false
);
...
...
@@ -1329,12 +1327,12 @@ static int32_t mndRetrievePrivileges(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataSetVal
(
pColInfo
,
numOfRows
,
(
const
char
*
)
topicName
,
false
);
char
tableName
[
20
]
=
{
0
};
char
tableName
[
TSDB_TABLE_NAME_LEN
+
VARSTR_HEADER_SIZE
]
=
{
0
};
STR_WITH_MAXSIZE_TO_VARSTR
(
tableName
,
""
,
pShow
->
pMeta
->
pSchemas
[
cols
].
bytes
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataSetVal
(
pColInfo
,
numOfRows
,
(
const
char
*
)
tableName
,
false
);
char
condition
[
20
]
=
{
0
};
char
condition
[
TSDB_PRIVILEDGE_CONDITION_LEN
+
VARSTR_HEADER_SIZE
]
=
{
0
};
STR_WITH_MAXSIZE_TO_VARSTR
(
condition
,
""
,
pShow
->
pMeta
->
pSchemas
[
cols
].
bytes
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataSetVal
(
pColInfo
,
numOfRows
,
(
const
char
*
)
condition
,
false
);
...
...
source/dnode/vnode/src/tsdb/tsdbCache.c
浏览文件 @
933660ae
...
...
@@ -1469,11 +1469,14 @@ static int32_t mergeLastRow(tb_uid_t uid, STsdb *pTsdb, bool *dup, SArray **ppCo
hasRow
=
true
;
code
=
updateTSchema
(
TSDBROW_SVERSION
(
pRow
),
pr
,
uid
);
if
(
TSDB_CODE_SUCCESS
!=
code
)
{
goto
_err
;
int32_t
sversion
=
TSDBROW_SVERSION
(
pRow
);
if
(
sversion
!=
-
1
)
{
code
=
updateTSchema
(
sversion
,
pr
,
uid
);
if
(
TSDB_CODE_SUCCESS
!=
code
)
{
goto
_err
;
}
pTSchema
=
pr
->
pCurrSchema
;
}
pTSchema
=
pr
->
pCurrSchema
;
int16_t
nCol
=
pTSchema
->
numOfCols
;
TSKEY
rowTs
=
TSDBROW_TS
(
pRow
);
...
...
@@ -1623,11 +1626,14 @@ static int32_t mergeLast(tb_uid_t uid, STsdb *pTsdb, SArray **ppLastArray, SCach
hasRow
=
true
;
code
=
updateTSchema
(
TSDBROW_SVERSION
(
pRow
),
pr
,
uid
);
if
(
TSDB_CODE_SUCCESS
!=
code
)
{
goto
_err
;
int32_t
sversion
=
TSDBROW_SVERSION
(
pRow
);
if
(
sversion
!=
-
1
)
{
code
=
updateTSchema
(
sversion
,
pr
,
uid
);
if
(
TSDB_CODE_SUCCESS
!=
code
)
{
goto
_err
;
}
pTSchema
=
pr
->
pCurrSchema
;
}
pTSchema
=
pr
->
pCurrSchema
;
int16_t
nCol
=
pTSchema
->
numOfCols
;
TSKEY
rowTs
=
TSDBROW_TS
(
pRow
);
...
...
source/libs/function/test/udf1.c
浏览文件 @
933660ae
...
...
@@ -24,7 +24,7 @@ DLL_EXPORT int32_t udf1(SUdfDataBlock *block, SUdfColumn *resultCol) {
}
}
if
(
j
==
block
->
numOfCols
)
{
int32_t
luckyNum
=
88
;
int32_t
luckyNum
=
1
;
udfColDataSet
(
resultCol
,
i
,
(
char
*
)
&
luckyNum
,
false
);
}
}
...
...
source/libs/sync/inc/syncPipeline.h
浏览文件 @
933660ae
...
...
@@ -77,18 +77,19 @@ static FORCE_INLINE int32_t syncLogReplGetNextRetryBackoff(SSyncLogReplMgr* pMgr
SyncTerm
syncLogReplGetPrevLogTerm
(
SSyncLogReplMgr
*
pMgr
,
SSyncNode
*
pNode
,
SyncIndex
index
);
int32_t
syncLogReplReplicateOnce
(
SSyncLogReplMgr
*
pMgr
,
SSyncNode
*
pNode
);
int32_t
syncLogReplReplicateOneTo
(
SSyncLogReplMgr
*
pMgr
,
SSyncNode
*
pNode
,
SyncIndex
index
,
SyncTerm
*
pTerm
,
SRaftId
*
pDestId
,
bool
*
pBarrier
);
int32_t
syncLogReplReplicateAttempt
(
SSyncLogReplMgr
*
pMgr
,
SSyncNode
*
pNode
);
int32_t
syncLogReplReplicateProbe
(
SSyncLogReplMgr
*
pMgr
,
SSyncNode
*
pNode
,
SyncIndex
index
);
int32_t
syncLogReplDoOnce
(
SSyncLogReplMgr
*
pMgr
,
SSyncNode
*
pNode
);
int32_t
syncLogReplAttempt
(
SSyncLogReplMgr
*
pMgr
,
SSyncNode
*
pNode
);
int32_t
syncLogReplProbe
(
SSyncLogReplMgr
*
pMgr
,
SSyncNode
*
pNode
,
SyncIndex
index
);
int32_t
syncLogReplRetryOnNeed
(
SSyncLogReplMgr
*
pMgr
,
SSyncNode
*
pNode
);
int32_t
syncLogReplSendTo
(
SSyncLogReplMgr
*
pMgr
,
SSyncNode
*
pNode
,
SyncIndex
index
,
SyncTerm
*
pTerm
,
SRaftId
*
pDestId
,
bool
*
pBarrier
);
int32_t
syncLogReplProcessReply
(
SSyncLogReplMgr
*
pMgr
,
SSyncNode
*
pNode
,
SyncAppendEntriesReply
*
pMsg
);
int32_t
syncLogReplProcessReplyAsRecovery
(
SSyncLogReplMgr
*
pMgr
,
SSyncNode
*
pNode
,
SyncAppendEntriesReply
*
pMsg
);
int32_t
syncLogReplProcessReplyAsNormal
(
SSyncLogReplMgr
*
pMgr
,
SSyncNode
*
pNode
,
SyncAppendEntriesReply
*
pMsg
);
int32_t
syncLogReplProcessHeartbeatReply
(
SSyncLogReplMgr
*
pMgr
,
SSyncNode
*
pNode
,
SyncHeartbeatReply
*
pMsg
);
int32_t
syncLogReplRetryOnNeed
(
SSyncLogReplMgr
*
pMgr
,
SSyncNode
*
pNode
);
// SSyncLogBuffer
SSyncLogBuffer
*
syncLogBufferCreate
();
...
...
@@ -100,6 +101,7 @@ int32_t syncLogBufferReInit(SSyncLogBuffer* pBuf, SSyncNode* pNode);
int64_t
syncLogBufferGetEndIndex
(
SSyncLogBuffer
*
pBuf
);
SyncTerm
syncLogBufferGetLastMatchTerm
(
SSyncLogBuffer
*
pBuf
);
bool
syncLogBufferIsEmpty
(
SSyncLogBuffer
*
pBuf
);
int32_t
syncLogBufferAppend
(
SSyncLogBuffer
*
pBuf
,
SSyncNode
*
pNode
,
SSyncRaftEntry
*
pEntry
);
int32_t
syncLogBufferAccept
(
SSyncLogBuffer
*
pBuf
,
SSyncNode
*
pNode
,
SSyncRaftEntry
*
pEntry
,
SyncTerm
prevTerm
);
int64_t
syncLogBufferProceed
(
SSyncLogBuffer
*
pBuf
,
SSyncNode
*
pNode
,
SyncTerm
*
pMatchTerm
);
...
...
source/libs/sync/inc/syncRaftEntry.h
浏览文件 @
933660ae
...
...
@@ -45,7 +45,7 @@ SSyncRaftEntry* syncEntryBuildNoop(SyncTerm term, SyncIndex index, int32_t vgId)
void
syncEntryDestroy
(
SSyncRaftEntry
*
pEntry
);
void
syncEntry2OriginalRpc
(
const
SSyncRaftEntry
*
pEntry
,
SRpcMsg
*
pRpcMsg
);
// step 7
static
FORCE_INLINE
bool
syncLog
IsReplication
Barrier
(
SSyncRaftEntry
*
pEntry
)
{
static
FORCE_INLINE
bool
syncLog
Repl
Barrier
(
SSyncRaftEntry
*
pEntry
)
{
return
pEntry
->
originalRpcType
==
TDMT_SYNC_NOOP
;
}
...
...
source/libs/sync/src/syncMain.c
浏览文件 @
933660ae
...
...
@@ -617,7 +617,7 @@ int32_t syncNodePropose(SSyncNode* pSyncNode, SRpcMsg* pMsg, bool isWeak, int64_
sNTrace
(
pSyncNode
,
"propose msg, type:%s"
,
TMSG_INFO
(
pMsg
->
msgType
));
code
=
(
*
pSyncNode
->
syncEqMsg
)(
pSyncNode
->
msgcb
,
&
rpcMsg
);
if
(
code
!=
0
)
{
s
Error
(
"vgId:%d, failed to propose msg while enqueue since %s"
,
pSyncNode
->
vgId
,
terrstr
());
s
Warn
(
"vgId:%d, failed to propose msg while enqueue since %s"
,
pSyncNode
->
vgId
,
terrstr
());
(
void
)
syncRespMgrDel
(
pSyncNode
->
pSyncRespMgr
,
seqNum
);
}
...
...
source/libs/sync/src/syncPipeline.c
浏览文件 @
933660ae
...
...
@@ -633,7 +633,7 @@ int32_t syncLogReplRetryOnNeed(SSyncLogReplMgr* pMgr, SSyncNode* pNode) {
SRaftId
*
pDestId
=
&
pNode
->
replicasId
[
pMgr
->
peerId
];
if
(
pMgr
->
retryBackoff
==
SYNC_MAX_RETRY_BACKOFF
)
{
syncLogReplReset
(
pMgr
);
sWarn
(
"vgId:%d, reset sync log repl
mgr
since retry backoff exceeding limit. peer:%"
PRIx64
,
pNode
->
vgId
,
sWarn
(
"vgId:%d, reset sync log repl since retry backoff exceeding limit. peer:%"
PRIx64
,
pNode
->
vgId
,
pDestId
->
addr
);
return
-
1
;
}
...
...
@@ -658,15 +658,15 @@ int32_t syncLogReplRetryOnNeed(SSyncLogReplMgr* pMgr, SSyncNode* pNode) {
if
(
pMgr
->
states
[
pos
].
acked
)
{
if
(
pMgr
->
matchIndex
<
index
&&
pMgr
->
states
[
pos
].
timeMs
+
(
syncGetRetryMaxWaitMs
()
<<
3
)
<
nowMs
)
{
syncLogReplReset
(
pMgr
);
sWarn
(
"vgId:%d, reset sync log repl
mgr since stagnation. index:%"
PRId64
", peer:%"
PRIx64
,
pNode
->
vgId
,
index
,
pDestId
->
addr
);
sWarn
(
"vgId:%d, reset sync log repl
since stagnation. index:%"
PRId64
", peer:%"
PRIx64
,
pNode
->
vgId
,
index
,
pDestId
->
addr
);
goto
_out
;
}
continue
;
}
bool
barrier
=
false
;
if
(
syncLogRepl
ReplicateOne
To
(
pMgr
,
pNode
,
index
,
&
term
,
pDestId
,
&
barrier
)
<
0
)
{
if
(
syncLogRepl
Send
To
(
pMgr
,
pNode
,
index
,
&
term
,
pDestId
,
&
barrier
)
<
0
)
{
sError
(
"vgId:%d, failed to replicate sync log entry since %s. index:%"
PRId64
", dest:%"
PRIx64
""
,
pNode
->
vgId
,
terrstr
(),
index
,
pDestId
->
addr
);
goto
_out
;
...
...
@@ -708,7 +708,7 @@ int32_t syncLogReplProcessReplyAsRecovery(SSyncLogReplMgr* pMgr, SSyncNode* pNod
ASSERT
(
pMgr
->
matchIndex
==
0
);
if
(
pMsg
->
matchIndex
<
0
)
{
pMgr
->
restored
=
true
;
sInfo
(
"vgId:%d, sync log repl
mgr
restored. peer: dnode:%d (%"
PRIx64
"), mgr: rs(%d) [%"
PRId64
" %"
PRId64
sInfo
(
"vgId:%d, sync log repl restored. peer: dnode:%d (%"
PRIx64
"), mgr: rs(%d) [%"
PRId64
" %"
PRId64
", %"
PRId64
"), buffer: [%"
PRId64
" %"
PRId64
" %"
PRId64
", %"
PRId64
")"
,
pNode
->
vgId
,
DID
(
&
destId
),
destId
.
addr
,
pMgr
->
restored
,
pMgr
->
startIndex
,
pMgr
->
matchIndex
,
pMgr
->
endIndex
,
pBuf
->
startIndex
,
pBuf
->
commitIndex
,
pBuf
->
matchIndex
,
pBuf
->
endIndex
);
...
...
@@ -725,7 +725,7 @@ int32_t syncLogReplProcessReplyAsRecovery(SSyncLogReplMgr* pMgr, SSyncNode* pNod
if
(
pMsg
->
success
&&
pMsg
->
matchIndex
==
pMsg
->
lastSendIndex
)
{
pMgr
->
matchIndex
=
pMsg
->
matchIndex
;
pMgr
->
restored
=
true
;
sInfo
(
"vgId:%d, sync log repl
mgr
restored. peer: dnode:%d (%"
PRIx64
"), mgr: rs(%d) [%"
PRId64
" %"
PRId64
sInfo
(
"vgId:%d, sync log repl restored. peer: dnode:%d (%"
PRIx64
"), mgr: rs(%d) [%"
PRId64
" %"
PRId64
", %"
PRId64
"), buffer: [%"
PRId64
" %"
PRId64
" %"
PRId64
", %"
PRId64
")"
,
pNode
->
vgId
,
DID
(
&
destId
),
destId
.
addr
,
pMgr
->
restored
,
pMgr
->
startIndex
,
pMgr
->
matchIndex
,
pMgr
->
endIndex
,
pBuf
->
startIndex
,
pBuf
->
commitIndex
,
pBuf
->
matchIndex
,
pBuf
->
endIndex
);
...
...
@@ -774,14 +774,14 @@ int32_t syncLogReplProcessReplyAsRecovery(SSyncLogReplMgr* pMgr, SSyncNode* pNod
// attempt to replicate the raft log at index
(
void
)
syncLogReplReset
(
pMgr
);
return
syncLogRepl
Replicate
Probe
(
pMgr
,
pNode
,
index
);
return
syncLogReplProbe
(
pMgr
,
pNode
,
index
);
}
int32_t
syncLogReplProcessHeartbeatReply
(
SSyncLogReplMgr
*
pMgr
,
SSyncNode
*
pNode
,
SyncHeartbeatReply
*
pMsg
)
{
SSyncLogBuffer
*
pBuf
=
pNode
->
pLogBuf
;
taosThreadMutexLock
(
&
pBuf
->
mutex
);
if
(
pMsg
->
startTime
!=
0
&&
pMsg
->
startTime
!=
pMgr
->
peerStartTime
)
{
sInfo
(
"vgId:%d, reset sync log repl
mgr
in heartbeat. peer:%"
PRIx64
", start time:%"
PRId64
", old:%"
PRId64
""
,
sInfo
(
"vgId:%d, reset sync log repl in heartbeat. peer:%"
PRIx64
", start time:%"
PRId64
", old:%"
PRId64
""
,
pNode
->
vgId
,
pMsg
->
srcId
.
addr
,
pMsg
->
startTime
,
pMgr
->
peerStartTime
);
syncLogReplReset
(
pMgr
);
pMgr
->
peerStartTime
=
pMsg
->
startTime
;
...
...
@@ -794,8 +794,7 @@ int32_t syncLogReplProcessReply(SSyncLogReplMgr* pMgr, SSyncNode* pNode, SyncApp
SSyncLogBuffer
*
pBuf
=
pNode
->
pLogBuf
;
taosThreadMutexLock
(
&
pBuf
->
mutex
);
if
(
pMsg
->
startTime
!=
pMgr
->
peerStartTime
)
{
sInfo
(
"vgId:%d, reset sync log repl mgr in appendlog reply. peer:%"
PRIx64
", start time:%"
PRId64
", old:%"
PRId64
,
sInfo
(
"vgId:%d, reset sync log repl in appendlog reply. peer:%"
PRIx64
", start time:%"
PRId64
", old:%"
PRId64
,
pNode
->
vgId
,
pMsg
->
srcId
.
addr
,
pMsg
->
startTime
,
pMgr
->
peerStartTime
);
syncLogReplReset
(
pMgr
);
pMgr
->
peerStartTime
=
pMsg
->
startTime
;
...
...
@@ -810,16 +809,16 @@ int32_t syncLogReplProcessReply(SSyncLogReplMgr* pMgr, SSyncNode* pNode, SyncApp
return
0
;
}
int32_t
syncLogRepl
Replicate
Once
(
SSyncLogReplMgr
*
pMgr
,
SSyncNode
*
pNode
)
{
int32_t
syncLogRepl
Do
Once
(
SSyncLogReplMgr
*
pMgr
,
SSyncNode
*
pNode
)
{
if
(
pMgr
->
restored
)
{
(
void
)
syncLogRepl
Replicate
Attempt
(
pMgr
,
pNode
);
(
void
)
syncLogReplAttempt
(
pMgr
,
pNode
);
}
else
{
(
void
)
syncLogRepl
Replicate
Probe
(
pMgr
,
pNode
,
pNode
->
pLogBuf
->
matchIndex
);
(
void
)
syncLogReplProbe
(
pMgr
,
pNode
,
pNode
->
pLogBuf
->
matchIndex
);
}
return
0
;
}
int32_t
syncLogRepl
Replicate
Probe
(
SSyncLogReplMgr
*
pMgr
,
SSyncNode
*
pNode
,
SyncIndex
index
)
{
int32_t
syncLogReplProbe
(
SSyncLogReplMgr
*
pMgr
,
SSyncNode
*
pNode
,
SyncIndex
index
)
{
ASSERT
(
!
pMgr
->
restored
);
ASSERT
(
pMgr
->
startIndex
>=
0
);
int64_t
retryMaxWaitMs
=
syncGetRetryMaxWaitMs
();
...
...
@@ -834,7 +833,7 @@ int32_t syncLogReplReplicateProbe(SSyncLogReplMgr* pMgr, SSyncNode* pNode, SyncI
SRaftId
*
pDestId
=
&
pNode
->
replicasId
[
pMgr
->
peerId
];
bool
barrier
=
false
;
SyncTerm
term
=
-
1
;
if
(
syncLogRepl
ReplicateOne
To
(
pMgr
,
pNode
,
index
,
&
term
,
pDestId
,
&
barrier
)
<
0
)
{
if
(
syncLogRepl
Send
To
(
pMgr
,
pNode
,
index
,
&
term
,
pDestId
,
&
barrier
)
<
0
)
{
sError
(
"vgId:%d, failed to replicate log entry since %s. index:%"
PRId64
", dest: 0x%016"
PRIx64
""
,
pNode
->
vgId
,
terrstr
(),
index
,
pDestId
->
addr
);
return
-
1
;
...
...
@@ -857,7 +856,7 @@ int32_t syncLogReplReplicateProbe(SSyncLogReplMgr* pMgr, SSyncNode* pNode, SyncI
return
0
;
}
int32_t
syncLogRepl
Replicate
Attempt
(
SSyncLogReplMgr
*
pMgr
,
SSyncNode
*
pNode
)
{
int32_t
syncLogReplAttempt
(
SSyncLogReplMgr
*
pMgr
,
SSyncNode
*
pNode
)
{
ASSERT
(
pMgr
->
restored
);
SRaftId
*
pDestId
=
&
pNode
->
replicasId
[
pMgr
->
peerId
];
...
...
@@ -879,7 +878,7 @@ int32_t syncLogReplReplicateAttempt(SSyncLogReplMgr* pMgr, SSyncNode* pNode) {
SRaftId
*
pDestId
=
&
pNode
->
replicasId
[
pMgr
->
peerId
];
bool
barrier
=
false
;
SyncTerm
term
=
-
1
;
if
(
syncLogRepl
ReplicateOne
To
(
pMgr
,
pNode
,
index
,
&
term
,
pDestId
,
&
barrier
)
<
0
)
{
if
(
syncLogRepl
Send
To
(
pMgr
,
pNode
,
index
,
&
term
,
pDestId
,
&
barrier
)
<
0
)
{
sError
(
"vgId:%d, failed to replicate log entry since %s. index:%"
PRId64
", dest: 0x%016"
PRIx64
""
,
pNode
->
vgId
,
terrstr
(),
index
,
pDestId
->
addr
);
return
-
1
;
...
...
@@ -932,7 +931,7 @@ int32_t syncLogReplProcessReplyAsNormal(SSyncLogReplMgr* pMgr, SSyncNode* pNode,
pMgr
->
startIndex
=
pMgr
->
matchIndex
;
}
return
syncLogRepl
Replicate
Attempt
(
pMgr
,
pNode
);
return
syncLogReplAttempt
(
pMgr
,
pNode
);
}
SSyncLogReplMgr
*
syncLogReplCreate
()
{
...
...
@@ -1127,8 +1126,8 @@ SSyncRaftEntry* syncLogBufferGetOneEntry(SSyncLogBuffer* pBuf, SSyncNode* pNode,
return
pEntry
;
}
int32_t
syncLogRepl
ReplicateOneTo
(
SSyncLogReplMgr
*
pMgr
,
SSyncNode
*
pNode
,
SyncIndex
index
,
SyncTerm
*
pTerm
,
SRaftId
*
pDestId
,
bool
*
pBarrier
)
{
int32_t
syncLogRepl
SendTo
(
SSyncLogReplMgr
*
pMgr
,
SSyncNode
*
pNode
,
SyncIndex
index
,
SyncTerm
*
pTerm
,
SRaftId
*
pDestId
,
bool
*
pBarrier
)
{
SSyncRaftEntry
*
pEntry
=
NULL
;
SRpcMsg
msgOut
=
{
0
};
bool
inBuf
=
false
;
...
...
@@ -1141,14 +1140,14 @@ int32_t syncLogReplReplicateOneTo(SSyncLogReplMgr* pMgr, SSyncNode* pNode, SyncI
if
(
terrno
==
TSDB_CODE_WAL_LOG_NOT_EXIST
)
{
SSyncLogReplMgr
*
pMgr
=
syncNodeGetLogReplMgr
(
pNode
,
pDestId
);
if
(
pMgr
)
{
sInfo
(
"vgId:%d, reset sync log repl
mgr of peer:%"
PRIx64
" since %s. index:%"
PRId64
,
pNode
->
vgId
,
pDestId
->
addr
,
terrstr
(),
index
);
sInfo
(
"vgId:%d, reset sync log repl
of peer:%"
PRIx64
" since %s. index:%"
PRId64
,
pNode
->
vgId
,
pDestId
->
addr
,
terrstr
(),
index
);
(
void
)
syncLogReplReset
(
pMgr
);
}
}
goto
_err
;
}
*
pBarrier
=
syncLog
IsReplication
Barrier
(
pEntry
);
*
pBarrier
=
syncLog
Repl
Barrier
(
pEntry
);
prevLogTerm
=
syncLogReplGetPrevLogTerm
(
pMgr
,
pNode
,
index
);
if
(
prevLogTerm
<
0
)
{
...
...
source/libs/sync/src/syncReplication.c
浏览文件 @
933660ae
...
...
@@ -74,7 +74,7 @@ int32_t syncNodeReplicateWithoutLock(SSyncNode* pNode) {
continue
;
}
SSyncLogReplMgr
*
pMgr
=
pNode
->
logReplMgrs
[
i
];
(
void
)
syncLogRepl
Replicate
Once
(
pMgr
,
pNode
);
(
void
)
syncLogRepl
Do
Once
(
pMgr
,
pNode
);
}
return
0
;
}
...
...
source/util/src/terror.c
浏览文件 @
933660ae
...
...
@@ -321,7 +321,7 @@ TAOS_DEFINE_ERROR(TSDB_CODE_SNODE_ALREADY_DEPLOYED, "Snode already deploye
TAOS_DEFINE_ERROR
(
TSDB_CODE_SNODE_NOT_DEPLOYED
,
"Snode not deployed"
)
// vnode
TAOS_DEFINE_ERROR
(
TSDB_CODE_VND_INVALID_VGROUP_ID
,
"Vnode
moved to another dnode or was delet
ed"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_VND_INVALID_VGROUP_ID
,
"Vnode
is closed or remov
ed"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_VND_NO_WRITE_AUTH
,
"Database write operation denied"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_VND_NOT_EXIST
,
"Vnode not exist"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_VND_ALREADY_EXIST
,
"Vnode already exist"
)
...
...
tests/script/tsim/valgrind/checkUdf.sim
浏览文件 @
933660ae
...
...
@@ -29,10 +29,10 @@ sql select udf1(f) from t;
if $rows != 2 then
return -1
endi
if $data00 !=
88
then
if $data00 !=
1
then
return -1
endi
if $data10 !=
88
then
if $data10 !=
1
then
return -1
endi
...
...
@@ -51,10 +51,10 @@ sql select udf1(f1, f2) from t2;
if $rows != 2 then
return -1
endi
if $data00 !=
88
then
if $data00 !=
1
then
return -1
endi
if $data10 !=
88
then
if $data10 !=
1
then
return -1
endi
...
...
@@ -72,10 +72,10 @@ print $rows , $data00 , $data10 , $data20 , $data30
if $rows != 4 then
return -1
endi
if $data00 !=
88
then
if $data00 !=
1
then
return -1
endi
if $data10 !=
88
then
if $data10 !=
1
then
return -1
endi
...
...
@@ -114,10 +114,10 @@ print $rows , $data00 , $data01
if $rows != 1 then
return -1
endi
if $data00 !=
176
.000000000 then
if $data00 !=
2
.000000000 then
return -1
endi
if $data01 != 1
52.420471066
then
if $data01 != 1
.732050808
then
return -1
endi
...
...
tests/system-test/0-others/udfTest.py
浏览文件 @
933660ae
...
...
@@ -191,20 +191,20 @@ class TDTestCase:
tdSql
.
checkData
(
0
,
0
,
None
)
tdSql
.
checkData
(
0
,
1
,
None
)
tdSql
.
checkData
(
0
,
2
,
1
)
tdSql
.
checkData
(
0
,
3
,
88
)
tdSql
.
checkData
(
0
,
3
,
1
)
tdSql
.
checkData
(
0
,
4
,
1.000000000
)
tdSql
.
checkData
(
0
,
5
,
88
)
tdSql
.
checkData
(
0
,
5
,
1
)
tdSql
.
checkData
(
0
,
6
,
"binary1"
)
tdSql
.
checkData
(
0
,
7
,
88
)
tdSql
.
checkData
(
0
,
7
,
1
)
tdSql
.
checkData
(
3
,
0
,
3
)
tdSql
.
checkData
(
3
,
1
,
88
)
tdSql
.
checkData
(
3
,
1
,
1
)
tdSql
.
checkData
(
3
,
2
,
33333
)
tdSql
.
checkData
(
3
,
3
,
88
)
tdSql
.
checkData
(
3
,
3
,
1
)
tdSql
.
checkData
(
3
,
4
,
33.000000000
)
tdSql
.
checkData
(
3
,
5
,
88
)
tdSql
.
checkData
(
3
,
5
,
1
)
tdSql
.
checkData
(
3
,
6
,
"binary1"
)
tdSql
.
checkData
(
3
,
7
,
88
)
tdSql
.
checkData
(
3
,
7
,
1
)
tdSql
.
checkData
(
11
,
0
,
None
)
tdSql
.
checkData
(
11
,
1
,
None
)
...
...
@@ -213,7 +213,7 @@ class TDTestCase:
tdSql
.
checkData
(
11
,
4
,
None
)
tdSql
.
checkData
(
11
,
5
,
None
)
tdSql
.
checkData
(
11
,
6
,
"binary1"
)
tdSql
.
checkData
(
11
,
7
,
88
)
tdSql
.
checkData
(
11
,
7
,
1
)
tdSql
.
query
(
"select c1 , udf1(c1) ,c2 ,udf1(c2), c3 ,udf1(c3), c4 ,udf1(c4) from stb1 order by c1"
)
tdSql
.
checkData
(
0
,
0
,
None
)
...
...
@@ -226,13 +226,13 @@ class TDTestCase:
tdSql
.
checkData
(
0
,
7
,
None
)
tdSql
.
checkData
(
20
,
0
,
8
)
tdSql
.
checkData
(
20
,
1
,
88
)
tdSql
.
checkData
(
20
,
1
,
1
)
tdSql
.
checkData
(
20
,
2
,
88888
)
tdSql
.
checkData
(
20
,
3
,
88
)
tdSql
.
checkData
(
20
,
3
,
1
)
tdSql
.
checkData
(
20
,
4
,
888
)
tdSql
.
checkData
(
20
,
5
,
88
)
tdSql
.
checkData
(
20
,
5
,
1
)
tdSql
.
checkData
(
20
,
6
,
88
)
tdSql
.
checkData
(
20
,
7
,
88
)
tdSql
.
checkData
(
20
,
7
,
1
)
# aggregate functions
...
...
@@ -375,14 +375,14 @@ class TDTestCase:
tdSql
.
checkRows
(
25
)
tdSql
.
checkData
(
0
,
0
,
None
)
tdSql
.
checkData
(
0
,
1
,
None
)
tdSql
.
checkData
(
1
,
0
,
88
)
tdSql
.
checkData
(
1
,
0
,
1
)
tdSql
.
checkData
(
1
,
1
,
8
)
tdSql
.
query
(
"select abs(udf1(c1)) , abs(ceil(c1)) from ct1 order by ts;"
)
tdSql
.
checkRows
(
13
)
tdSql
.
checkData
(
0
,
0
,
88
)
tdSql
.
checkData
(
0
,
0
,
1
)
tdSql
.
checkData
(
0
,
1
,
8
)
tdSql
.
checkData
(
1
,
0
,
88
)
tdSql
.
checkData
(
1
,
0
,
1
)
tdSql
.
checkData
(
1
,
1
,
7
)
# bug fix for crash
...
...
@@ -401,9 +401,9 @@ class TDTestCase:
tdSql
.
query
(
"select c1 ,udf1(c1) , c6 ,udf1(c6) from stb1 where c1 > 8 order by ts"
)
tdSql
.
checkRows
(
3
)
tdSql
.
checkData
(
0
,
0
,
9
)
tdSql
.
checkData
(
0
,
1
,
88
)
tdSql
.
checkData
(
0
,
1
,
1
)
tdSql
.
checkData
(
0
,
2
,
-
99.990000000
)
tdSql
.
checkData
(
0
,
3
,
88
)
tdSql
.
checkData
(
0
,
3
,
1
)
tdSql
.
query
(
"select sub1.c1, sub2.c2 from sub1, sub2 where sub1.ts=sub2.ts and sub1.c1 is not null"
)
tdSql
.
checkData
(
0
,
0
,
0
)
...
...
@@ -412,20 +412,20 @@ class TDTestCase:
tdSql
.
checkData
(
1
,
1
,
10
)
tdSql
.
query
(
"select udf1(sub1.c1), udf1(sub2.c2) from sub1, sub2 where sub1.ts=sub2.ts and sub1.c1 is not null"
)
tdSql
.
checkData
(
0
,
0
,
88
)
tdSql
.
checkData
(
0
,
1
,
88
)
tdSql
.
checkData
(
1
,
0
,
88
)
tdSql
.
checkData
(
1
,
1
,
88
)
tdSql
.
checkData
(
0
,
0
,
1
)
tdSql
.
checkData
(
0
,
1
,
1
)
tdSql
.
checkData
(
1
,
0
,
1
)
tdSql
.
checkData
(
1
,
1
,
1
)
tdSql
.
query
(
"select sub1.c1 , udf1(sub1.c1), sub2.c2 ,udf1(sub2.c2) from sub1, sub2 where sub1.ts=sub2.ts and sub1.c1 is not null"
)
tdSql
.
checkData
(
0
,
0
,
0
)
tdSql
.
checkData
(
0
,
1
,
88
)
tdSql
.
checkData
(
0
,
1
,
1
)
tdSql
.
checkData
(
0
,
2
,
0
)
tdSql
.
checkData
(
0
,
3
,
88
)
tdSql
.
checkData
(
0
,
3
,
1
)
tdSql
.
checkData
(
1
,
0
,
1
)
tdSql
.
checkData
(
1
,
1
,
88
)
tdSql
.
checkData
(
1
,
1
,
1
)
tdSql
.
checkData
(
1
,
2
,
10
)
tdSql
.
checkData
(
1
,
3
,
88
)
tdSql
.
checkData
(
1
,
3
,
1
)
tdSql
.
query
(
"select udf2(sub1.c1), udf2(sub2.c2) from sub1, sub2 where sub1.ts=sub2.ts and sub1.c1 is not null"
)
tdSql
.
checkData
(
0
,
0
,
16.881943016
)
...
...
tests/system-test/0-others/udf_cfg2.py
浏览文件 @
933660ae
...
...
@@ -193,20 +193,20 @@ class TDTestCase:
tdSql
.
checkData
(
0
,
0
,
None
)
tdSql
.
checkData
(
0
,
1
,
None
)
tdSql
.
checkData
(
0
,
2
,
1
)
tdSql
.
checkData
(
0
,
3
,
88
)
tdSql
.
checkData
(
0
,
3
,
1
)
tdSql
.
checkData
(
0
,
4
,
1.000000000
)
tdSql
.
checkData
(
0
,
5
,
88
)
tdSql
.
checkData
(
0
,
5
,
1
)
tdSql
.
checkData
(
0
,
6
,
"binary1"
)
tdSql
.
checkData
(
0
,
7
,
88
)
tdSql
.
checkData
(
0
,
7
,
1
)
tdSql
.
checkData
(
3
,
0
,
3
)
tdSql
.
checkData
(
3
,
1
,
88
)
tdSql
.
checkData
(
3
,
1
,
1
)
tdSql
.
checkData
(
3
,
2
,
33333
)
tdSql
.
checkData
(
3
,
3
,
88
)
tdSql
.
checkData
(
3
,
3
,
1
)
tdSql
.
checkData
(
3
,
4
,
33.000000000
)
tdSql
.
checkData
(
3
,
5
,
88
)
tdSql
.
checkData
(
3
,
5
,
1
)
tdSql
.
checkData
(
3
,
6
,
"binary1"
)
tdSql
.
checkData
(
3
,
7
,
88
)
tdSql
.
checkData
(
3
,
7
,
1
)
tdSql
.
checkData
(
11
,
0
,
None
)
tdSql
.
checkData
(
11
,
1
,
None
)
...
...
@@ -215,7 +215,7 @@ class TDTestCase:
tdSql
.
checkData
(
11
,
4
,
None
)
tdSql
.
checkData
(
11
,
5
,
None
)
tdSql
.
checkData
(
11
,
6
,
"binary1"
)
tdSql
.
checkData
(
11
,
7
,
88
)
tdSql
.
checkData
(
11
,
7
,
1
)
tdSql
.
query
(
"select c1 , udf1(c1) ,c2 ,udf1(c2), c3 ,udf1(c3), c4 ,udf1(c4) from stb1 order by c1"
)
tdSql
.
checkData
(
0
,
0
,
None
)
...
...
@@ -228,13 +228,13 @@ class TDTestCase:
tdSql
.
checkData
(
0
,
7
,
None
)
tdSql
.
checkData
(
20
,
0
,
8
)
tdSql
.
checkData
(
20
,
1
,
88
)
tdSql
.
checkData
(
20
,
1
,
1
)
tdSql
.
checkData
(
20
,
2
,
88888
)
tdSql
.
checkData
(
20
,
3
,
88
)
tdSql
.
checkData
(
20
,
3
,
1
)
tdSql
.
checkData
(
20
,
4
,
888
)
tdSql
.
checkData
(
20
,
5
,
88
)
tdSql
.
checkData
(
20
,
5
,
1
)
tdSql
.
checkData
(
20
,
6
,
88
)
tdSql
.
checkData
(
20
,
7
,
88
)
tdSql
.
checkData
(
20
,
7
,
1
)
# aggregate functions
...
...
@@ -377,14 +377,14 @@ class TDTestCase:
tdSql
.
checkRows
(
25
)
tdSql
.
checkData
(
0
,
0
,
None
)
tdSql
.
checkData
(
0
,
1
,
None
)
tdSql
.
checkData
(
1
,
0
,
88
)
tdSql
.
checkData
(
1
,
0
,
1
)
tdSql
.
checkData
(
1
,
1
,
8
)
tdSql
.
query
(
"select abs(udf1(c1)) , abs(ceil(c1)) from ct1 order by ts;"
)
tdSql
.
checkRows
(
13
)
tdSql
.
checkData
(
0
,
0
,
88
)
tdSql
.
checkData
(
0
,
0
,
1
)
tdSql
.
checkData
(
0
,
1
,
8
)
tdSql
.
checkData
(
1
,
0
,
88
)
tdSql
.
checkData
(
1
,
0
,
1
)
tdSql
.
checkData
(
1
,
1
,
7
)
# bug fix for crash
...
...
@@ -403,9 +403,9 @@ class TDTestCase:
tdSql
.
query
(
"select c1 ,udf1(c1) , c6 ,udf1(c6) from stb1 where c1 > 8 order by ts"
)
tdSql
.
checkRows
(
3
)
tdSql
.
checkData
(
0
,
0
,
9
)
tdSql
.
checkData
(
0
,
1
,
88
)
tdSql
.
checkData
(
0
,
1
,
1
)
tdSql
.
checkData
(
0
,
2
,
-
99.990000000
)
tdSql
.
checkData
(
0
,
3
,
88
)
tdSql
.
checkData
(
0
,
3
,
1
)
tdSql
.
query
(
"select sub1.c1, sub2.c2 from sub1, sub2 where sub1.ts=sub2.ts and sub1.c1 is not null"
)
tdSql
.
checkData
(
0
,
0
,
0
)
...
...
@@ -414,20 +414,20 @@ class TDTestCase:
tdSql
.
checkData
(
1
,
1
,
10
)
tdSql
.
query
(
"select udf1(sub1.c1), udf1(sub2.c2) from sub1, sub2 where sub1.ts=sub2.ts and sub1.c1 is not null"
)
tdSql
.
checkData
(
0
,
0
,
88
)
tdSql
.
checkData
(
0
,
1
,
88
)
tdSql
.
checkData
(
1
,
0
,
88
)
tdSql
.
checkData
(
1
,
1
,
88
)
tdSql
.
checkData
(
0
,
0
,
1
)
tdSql
.
checkData
(
0
,
1
,
1
)
tdSql
.
checkData
(
1
,
0
,
1
)
tdSql
.
checkData
(
1
,
1
,
1
)
tdSql
.
query
(
"select sub1.c1 , udf1(sub1.c1), sub2.c2 ,udf1(sub2.c2) from sub1, sub2 where sub1.ts=sub2.ts and sub1.c1 is not null"
)
tdSql
.
checkData
(
0
,
0
,
0
)
tdSql
.
checkData
(
0
,
1
,
88
)
tdSql
.
checkData
(
0
,
1
,
1
)
tdSql
.
checkData
(
0
,
2
,
0
)
tdSql
.
checkData
(
0
,
3
,
88
)
tdSql
.
checkData
(
0
,
3
,
1
)
tdSql
.
checkData
(
1
,
0
,
1
)
tdSql
.
checkData
(
1
,
1
,
88
)
tdSql
.
checkData
(
1
,
1
,
1
)
tdSql
.
checkData
(
1
,
2
,
10
)
tdSql
.
checkData
(
1
,
3
,
88
)
tdSql
.
checkData
(
1
,
3
,
1
)
tdSql
.
query
(
"select udf2(sub1.c1), udf2(sub2.c2) from sub1, sub2 where sub1.ts=sub2.ts and sub1.c1 is not null"
)
tdSql
.
checkData
(
0
,
0
,
16.881943016
)
...
...
tests/system-test/0-others/udf_create.py
浏览文件 @
933660ae
...
...
@@ -193,20 +193,20 @@ class TDTestCase:
tdSql
.
checkData
(
0
,
0
,
None
)
tdSql
.
checkData
(
0
,
1
,
None
)
tdSql
.
checkData
(
0
,
2
,
1
)
tdSql
.
checkData
(
0
,
3
,
88
)
tdSql
.
checkData
(
0
,
3
,
1
)
tdSql
.
checkData
(
0
,
4
,
1.000000000
)
tdSql
.
checkData
(
0
,
5
,
88
)
tdSql
.
checkData
(
0
,
5
,
1
)
tdSql
.
checkData
(
0
,
6
,
"binary1"
)
tdSql
.
checkData
(
0
,
7
,
88
)
tdSql
.
checkData
(
0
,
7
,
1
)
tdSql
.
checkData
(
3
,
0
,
3
)
tdSql
.
checkData
(
3
,
1
,
88
)
tdSql
.
checkData
(
3
,
1
,
1
)
tdSql
.
checkData
(
3
,
2
,
33333
)
tdSql
.
checkData
(
3
,
3
,
88
)
tdSql
.
checkData
(
3
,
3
,
1
)
tdSql
.
checkData
(
3
,
4
,
33.000000000
)
tdSql
.
checkData
(
3
,
5
,
88
)
tdSql
.
checkData
(
3
,
5
,
1
)
tdSql
.
checkData
(
3
,
6
,
"binary1"
)
tdSql
.
checkData
(
3
,
7
,
88
)
tdSql
.
checkData
(
3
,
7
,
1
)
tdSql
.
checkData
(
11
,
0
,
None
)
tdSql
.
checkData
(
11
,
1
,
None
)
...
...
@@ -215,7 +215,7 @@ class TDTestCase:
tdSql
.
checkData
(
11
,
4
,
None
)
tdSql
.
checkData
(
11
,
5
,
None
)
tdSql
.
checkData
(
11
,
6
,
"binary1"
)
tdSql
.
checkData
(
11
,
7
,
88
)
tdSql
.
checkData
(
11
,
7
,
1
)
tdSql
.
query
(
"select c1 , udf1(c1) ,c2 ,udf1(c2), c3 ,udf1(c3), c4 ,udf1(c4) from stb1 order by c1"
)
tdSql
.
checkData
(
0
,
0
,
None
)
...
...
@@ -228,13 +228,13 @@ class TDTestCase:
tdSql
.
checkData
(
0
,
7
,
None
)
tdSql
.
checkData
(
20
,
0
,
8
)
tdSql
.
checkData
(
20
,
1
,
88
)
tdSql
.
checkData
(
20
,
1
,
1
)
tdSql
.
checkData
(
20
,
2
,
88888
)
tdSql
.
checkData
(
20
,
3
,
88
)
tdSql
.
checkData
(
20
,
3
,
1
)
tdSql
.
checkData
(
20
,
4
,
888
)
tdSql
.
checkData
(
20
,
5
,
88
)
tdSql
.
checkData
(
20
,
5
,
1
)
tdSql
.
checkData
(
20
,
6
,
88
)
tdSql
.
checkData
(
20
,
7
,
88
)
tdSql
.
checkData
(
20
,
7
,
1
)
# aggregate functions
...
...
@@ -377,14 +377,14 @@ class TDTestCase:
tdSql
.
checkRows
(
25
)
tdSql
.
checkData
(
0
,
0
,
None
)
tdSql
.
checkData
(
0
,
1
,
None
)
tdSql
.
checkData
(
1
,
0
,
88
)
tdSql
.
checkData
(
1
,
0
,
1
)
tdSql
.
checkData
(
1
,
1
,
8
)
tdSql
.
query
(
"select abs(udf1(c1)) , abs(ceil(c1)) from ct1 order by ts;"
)
tdSql
.
checkRows
(
13
)
tdSql
.
checkData
(
0
,
0
,
88
)
tdSql
.
checkData
(
0
,
0
,
1
)
tdSql
.
checkData
(
0
,
1
,
8
)
tdSql
.
checkData
(
1
,
0
,
88
)
tdSql
.
checkData
(
1
,
0
,
1
)
tdSql
.
checkData
(
1
,
1
,
7
)
# bug fix for crash
...
...
@@ -403,9 +403,9 @@ class TDTestCase:
tdSql
.
query
(
"select c1 ,udf1(c1) , c6 ,udf1(c6) from stb1 where c1 > 8 order by ts"
)
tdSql
.
checkRows
(
3
)
tdSql
.
checkData
(
0
,
0
,
9
)
tdSql
.
checkData
(
0
,
1
,
88
)
tdSql
.
checkData
(
0
,
1
,
1
)
tdSql
.
checkData
(
0
,
2
,
-
99.990000000
)
tdSql
.
checkData
(
0
,
3
,
88
)
tdSql
.
checkData
(
0
,
3
,
1
)
tdSql
.
query
(
"select sub1.c1, sub2.c2 from sub1, sub2 where sub1.ts=sub2.ts and sub1.c1 is not null"
)
tdSql
.
checkData
(
0
,
0
,
0
)
...
...
@@ -414,20 +414,20 @@ class TDTestCase:
tdSql
.
checkData
(
1
,
1
,
10
)
tdSql
.
query
(
"select udf1(sub1.c1), udf1(sub2.c2) from sub1, sub2 where sub1.ts=sub2.ts and sub1.c1 is not null"
)
tdSql
.
checkData
(
0
,
0
,
88
)
tdSql
.
checkData
(
0
,
1
,
88
)
tdSql
.
checkData
(
1
,
0
,
88
)
tdSql
.
checkData
(
1
,
1
,
88
)
tdSql
.
checkData
(
0
,
0
,
1
)
tdSql
.
checkData
(
0
,
1
,
1
)
tdSql
.
checkData
(
1
,
0
,
1
)
tdSql
.
checkData
(
1
,
1
,
1
)
tdSql
.
query
(
"select sub1.c1 , udf1(sub1.c1), sub2.c2 ,udf1(sub2.c2) from sub1, sub2 where sub1.ts=sub2.ts and sub1.c1 is not null"
)
tdSql
.
checkData
(
0
,
0
,
0
)
tdSql
.
checkData
(
0
,
1
,
88
)
tdSql
.
checkData
(
0
,
1
,
1
)
tdSql
.
checkData
(
0
,
2
,
0
)
tdSql
.
checkData
(
0
,
3
,
88
)
tdSql
.
checkData
(
0
,
3
,
1
)
tdSql
.
checkData
(
1
,
0
,
1
)
tdSql
.
checkData
(
1
,
1
,
88
)
tdSql
.
checkData
(
1
,
1
,
1
)
tdSql
.
checkData
(
1
,
2
,
10
)
tdSql
.
checkData
(
1
,
3
,
88
)
tdSql
.
checkData
(
1
,
3
,
1
)
tdSql
.
query
(
"select udf2(sub1.c1), udf2(sub2.c2) from sub1, sub2 where sub1.ts=sub2.ts and sub1.c1 is not null"
)
tdSql
.
checkData
(
0
,
0
,
16.881943016
)
...
...
tests/system-test/0-others/udf_restart_taosd.py
浏览文件 @
933660ae
...
...
@@ -190,20 +190,20 @@ class TDTestCase:
tdSql
.
checkData
(
0
,
0
,
None
)
tdSql
.
checkData
(
0
,
1
,
None
)
tdSql
.
checkData
(
0
,
2
,
1
)
tdSql
.
checkData
(
0
,
3
,
88
)
tdSql
.
checkData
(
0
,
3
,
1
)
tdSql
.
checkData
(
0
,
4
,
1.000000000
)
tdSql
.
checkData
(
0
,
5
,
88
)
tdSql
.
checkData
(
0
,
5
,
1
)
tdSql
.
checkData
(
0
,
6
,
"binary1"
)
tdSql
.
checkData
(
0
,
7
,
88
)
tdSql
.
checkData
(
0
,
7
,
1
)
tdSql
.
checkData
(
3
,
0
,
3
)
tdSql
.
checkData
(
3
,
1
,
88
)
tdSql
.
checkData
(
3
,
1
,
1
)
tdSql
.
checkData
(
3
,
2
,
33333
)
tdSql
.
checkData
(
3
,
3
,
88
)
tdSql
.
checkData
(
3
,
3
,
1
)
tdSql
.
checkData
(
3
,
4
,
33.000000000
)
tdSql
.
checkData
(
3
,
5
,
88
)
tdSql
.
checkData
(
3
,
5
,
1
)
tdSql
.
checkData
(
3
,
6
,
"binary1"
)
tdSql
.
checkData
(
3
,
7
,
88
)
tdSql
.
checkData
(
3
,
7
,
1
)
tdSql
.
checkData
(
11
,
0
,
None
)
tdSql
.
checkData
(
11
,
1
,
None
)
...
...
@@ -212,7 +212,7 @@ class TDTestCase:
tdSql
.
checkData
(
11
,
4
,
None
)
tdSql
.
checkData
(
11
,
5
,
None
)
tdSql
.
checkData
(
11
,
6
,
"binary1"
)
tdSql
.
checkData
(
11
,
7
,
88
)
tdSql
.
checkData
(
11
,
7
,
1
)
tdSql
.
query
(
"select c1 , udf1(c1) ,c2 ,udf1(c2), c3 ,udf1(c3), c4 ,udf1(c4) from stb1 order by c1"
)
tdSql
.
checkData
(
0
,
0
,
None
)
...
...
@@ -225,13 +225,13 @@ class TDTestCase:
tdSql
.
checkData
(
0
,
7
,
None
)
tdSql
.
checkData
(
20
,
0
,
8
)
tdSql
.
checkData
(
20
,
1
,
88
)
tdSql
.
checkData
(
20
,
1
,
1
)
tdSql
.
checkData
(
20
,
2
,
88888
)
tdSql
.
checkData
(
20
,
3
,
88
)
tdSql
.
checkData
(
20
,
3
,
1
)
tdSql
.
checkData
(
20
,
4
,
888
)
tdSql
.
checkData
(
20
,
5
,
88
)
tdSql
.
checkData
(
20
,
5
,
1
)
tdSql
.
checkData
(
20
,
6
,
88
)
tdSql
.
checkData
(
20
,
7
,
88
)
tdSql
.
checkData
(
20
,
7
,
1
)
# aggregate functions
...
...
@@ -374,14 +374,14 @@ class TDTestCase:
tdSql
.
checkRows
(
25
)
tdSql
.
checkData
(
0
,
0
,
None
)
tdSql
.
checkData
(
0
,
1
,
None
)
tdSql
.
checkData
(
1
,
0
,
88
)
tdSql
.
checkData
(
1
,
0
,
1
)
tdSql
.
checkData
(
1
,
1
,
8
)
tdSql
.
query
(
"select abs(udf1(c1)) , abs(ceil(c1)) from ct1 order by ts;"
)
tdSql
.
checkRows
(
13
)
tdSql
.
checkData
(
0
,
0
,
88
)
tdSql
.
checkData
(
0
,
0
,
1
)
tdSql
.
checkData
(
0
,
1
,
8
)
tdSql
.
checkData
(
1
,
0
,
88
)
tdSql
.
checkData
(
1
,
0
,
1
)
tdSql
.
checkData
(
1
,
1
,
7
)
# bug fix for crash
...
...
@@ -400,9 +400,9 @@ class TDTestCase:
tdSql
.
query
(
"select c1 ,udf1(c1) , c6 ,udf1(c6) from stb1 where c1 > 8 order by ts"
)
tdSql
.
checkRows
(
3
)
tdSql
.
checkData
(
0
,
0
,
9
)
tdSql
.
checkData
(
0
,
1
,
88
)
tdSql
.
checkData
(
0
,
1
,
1
)
tdSql
.
checkData
(
0
,
2
,
-
99.990000000
)
tdSql
.
checkData
(
0
,
3
,
88
)
tdSql
.
checkData
(
0
,
3
,
1
)
tdSql
.
query
(
"select sub1.c1, sub2.c2 from sub1, sub2 where sub1.ts=sub2.ts and sub1.c1 is not null"
)
tdSql
.
checkData
(
0
,
0
,
0
)
...
...
@@ -411,20 +411,20 @@ class TDTestCase:
tdSql
.
checkData
(
1
,
1
,
10
)
tdSql
.
query
(
"select udf1(sub1.c1), udf1(sub2.c2) from sub1, sub2 where sub1.ts=sub2.ts and sub1.c1 is not null"
)
tdSql
.
checkData
(
0
,
0
,
88
)
tdSql
.
checkData
(
0
,
1
,
88
)
tdSql
.
checkData
(
1
,
0
,
88
)
tdSql
.
checkData
(
1
,
1
,
88
)
tdSql
.
checkData
(
0
,
0
,
1
)
tdSql
.
checkData
(
0
,
1
,
1
)
tdSql
.
checkData
(
1
,
0
,
1
)
tdSql
.
checkData
(
1
,
1
,
1
)
tdSql
.
query
(
"select sub1.c1 , udf1(sub1.c1), sub2.c2 ,udf1(sub2.c2) from sub1, sub2 where sub1.ts=sub2.ts and sub1.c1 is not null"
)
tdSql
.
checkData
(
0
,
0
,
0
)
tdSql
.
checkData
(
0
,
1
,
88
)
tdSql
.
checkData
(
0
,
1
,
1
)
tdSql
.
checkData
(
0
,
2
,
0
)
tdSql
.
checkData
(
0
,
3
,
88
)
tdSql
.
checkData
(
0
,
3
,
1
)
tdSql
.
checkData
(
1
,
0
,
1
)
tdSql
.
checkData
(
1
,
1
,
88
)
tdSql
.
checkData
(
1
,
1
,
1
)
tdSql
.
checkData
(
1
,
2
,
10
)
tdSql
.
checkData
(
1
,
3
,
88
)
tdSql
.
checkData
(
1
,
3
,
1
)
tdSql
.
query
(
"select udf2(sub1.c1), udf2(sub2.c2) from sub1, sub2 where sub1.ts=sub2.ts and sub1.c1 is not null"
)
tdSql
.
checkData
(
0
,
0
,
16.881943016
)
...
...
@@ -468,12 +468,12 @@ class TDTestCase:
tdSql
.
checkData
(
1
,
0
,
1
)
tdSql
.
checkData
(
1
,
1
,
1
)
tdSql
.
checkData
(
1
,
2
,
1.110000000
)
tdSql
.
checkData
(
1
,
3
,
88
)
tdSql
.
checkData
(
1
,
3
,
1
)
tdSql
.
query
(
"select c1,c6,udf1(c1,c6) from stb1 order by ts"
)
tdSql
.
checkData
(
1
,
0
,
8
)
tdSql
.
checkData
(
1
,
1
,
88.880000000
)
tdSql
.
checkData
(
1
,
2
,
88
)
tdSql
.
checkData
(
1
,
2
,
1
)
tdSql
.
query
(
"select abs(udf1(c1,c6,c1,c6)) , abs(ceil(c1)) from stb1 where c1 is not null order by ts;"
)
tdSql
.
checkRows
(
22
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录