Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
3878af10
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
3878af10
编写于
11月 28, 2022
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor: do some internal refactor.
上级
e802fb47
变更
16
隐藏空白更改
内联
并排
Showing
16 changed file
with
45 addition
and
51 deletion
+45
-51
include/util/talgo.h
include/util/talgo.h
+2
-2
include/util/tarray.h
include/util/tarray.h
+1
-7
source/client/src/clientImpl.c
source/client/src/clientImpl.c
+4
-4
source/dnode/mgmt/node_util/src/dmEps.c
source/dnode/mgmt/node_util/src/dmEps.c
+1
-1
source/dnode/mnode/impl/src/mndDb.c
source/dnode/mnode/impl/src/mndDb.c
+1
-1
source/dnode/mnode/impl/src/mndDef.c
source/dnode/mnode/impl/src/mndDef.c
+5
-5
source/dnode/mnode/impl/src/mndStb.c
source/dnode/mnode/impl/src/mndStb.c
+1
-1
source/libs/catalog/src/ctgUtil.c
source/libs/catalog/src/ctgUtil.c
+5
-5
source/libs/executor/src/executorimpl.c
source/libs/executor/src/executorimpl.c
+3
-1
source/libs/monitor/src/monMain.c
source/libs/monitor/src/monMain.c
+1
-1
source/libs/parser/src/parCalcConst.c
source/libs/parser/src/parCalcConst.c
+1
-1
source/libs/parser/src/parInsertUtil.c
source/libs/parser/src/parInsertUtil.c
+1
-1
source/libs/parser/src/parTranslater.c
source/libs/parser/src/parTranslater.c
+1
-1
source/libs/parser/src/parUtil.c
source/libs/parser/src/parUtil.c
+4
-4
source/libs/scheduler/src/schJob.c
source/libs/scheduler/src/schJob.c
+1
-1
source/util/src/tarray.c
source/util/src/tarray.c
+13
-15
未找到文件。
include/util/talgo.h
浏览文件 @
3878af10
...
@@ -27,7 +27,8 @@ extern "C" {
...
@@ -27,7 +27,8 @@ extern "C" {
typedef
int32_t
(
*
__compar_fn_t
)(
const
void
*
,
const
void
*
);
typedef
int32_t
(
*
__compar_fn_t
)(
const
void
*
,
const
void
*
);
#endif
#endif
typedef
void
*
(
*
FCopy
)(
void
*
);
typedef
void
*
(
*
__array_item_dup_fn_t
)(
void
*
);
typedef
void
(
*
FDelete
)(
void
*
);
typedef
void
(
*
FDelete
)(
void
*
);
typedef
int32_t
(
*
FEncode
)(
void
**
buf
,
const
void
*
dst
);
typedef
int32_t
(
*
FEncode
)(
void
**
buf
,
const
void
*
dst
);
typedef
void
*
(
*
FDecode
)(
const
void
*
buf
,
void
*
dst
);
typedef
void
*
(
*
FDecode
)(
const
void
*
buf
,
void
*
dst
);
...
@@ -41,7 +42,6 @@ typedef void *(*FDecode)(const void *buf, void *dst);
...
@@ -41,7 +42,6 @@ typedef void *(*FDecode)(const void *buf, void *dst);
#define elePtrAt(base, size, idx) (void *)((char *)(base) + (size) * (idx))
#define elePtrAt(base, size, idx) (void *)((char *)(base) + (size) * (idx))
typedef
int32_t
(
*
__ext_compar_fn_t
)(
const
void
*
p1
,
const
void
*
p2
,
const
void
*
param
);
typedef
int32_t
(
*
__ext_compar_fn_t
)(
const
void
*
p1
,
const
void
*
p2
,
const
void
*
param
);
typedef
void
(
*
__ext_swap_fn_t
)(
void
*
p1
,
void
*
p2
,
const
void
*
param
);
/**
/**
* quick sort, with the compare function requiring additional parameters support
* quick sort, with the compare function requiring additional parameters support
...
...
include/util/tarray.h
浏览文件 @
3878af10
...
@@ -205,13 +205,7 @@ SArray* taosArrayFromList(const void* src, size_t size, size_t elemSize);
...
@@ -205,13 +205,7 @@ SArray* taosArrayFromList(const void* src, size_t size, size_t elemSize);
* clone a new array
* clone a new array
* @param pSrc
* @param pSrc
*/
*/
SArray
*
taosArrayDup
(
const
SArray
*
pSrc
);
SArray
*
taosArrayDup
(
const
SArray
*
pSrc
,
__array_item_dup_fn_t
fn
);
/**
* deep copy a new array
* @param pSrc
*/
SArray
*
taosArrayDeepCopy
(
const
SArray
*
pSrc
,
FCopy
deepCopy
);
/**
/**
* clear the array (remove all element)
* clear the array (remove all element)
...
...
source/client/src/clientImpl.c
浏览文件 @
3878af10
...
@@ -373,7 +373,7 @@ int32_t updateQnodeList(SAppInstInfo* pInfo, SArray* pNodeList) {
...
@@ -373,7 +373,7 @@ int32_t updateQnodeList(SAppInstInfo* pInfo, SArray* pNodeList) {
}
}
if
(
pNodeList
)
{
if
(
pNodeList
)
{
pInfo
->
pQnodeList
=
taosArrayDup
(
pNodeList
);
pInfo
->
pQnodeList
=
taosArrayDup
(
pNodeList
,
NULL
);
taosArraySort
(
pInfo
->
pQnodeList
,
compareQueryNodeLoad
);
taosArraySort
(
pInfo
->
pQnodeList
,
compareQueryNodeLoad
);
tscDebug
(
"QnodeList updated in cluster 0x%"
PRIx64
", num:%ld"
,
pInfo
->
clusterId
,
tscDebug
(
"QnodeList updated in cluster 0x%"
PRIx64
", num:%ld"
,
pInfo
->
clusterId
,
taosArrayGetSize
(
pInfo
->
pQnodeList
));
taosArrayGetSize
(
pInfo
->
pQnodeList
));
...
@@ -404,7 +404,7 @@ int32_t getQnodeList(SRequestObj* pRequest, SArray** pNodeList) {
...
@@ -404,7 +404,7 @@ int32_t getQnodeList(SRequestObj* pRequest, SArray** pNodeList) {
taosThreadMutexLock
(
&
pInfo
->
qnodeMutex
);
taosThreadMutexLock
(
&
pInfo
->
qnodeMutex
);
if
(
pInfo
->
pQnodeList
)
{
if
(
pInfo
->
pQnodeList
)
{
*
pNodeList
=
taosArrayDup
(
pInfo
->
pQnodeList
);
*
pNodeList
=
taosArrayDup
(
pInfo
->
pQnodeList
,
NULL
);
}
}
taosThreadMutexUnlock
(
&
pInfo
->
qnodeMutex
);
taosThreadMutexUnlock
(
&
pInfo
->
qnodeMutex
);
...
@@ -593,13 +593,13 @@ int32_t buildAsyncExecNodeList(SRequestObj* pRequest, SArray** pNodeList, SArray
...
@@ -593,13 +593,13 @@ int32_t buildAsyncExecNodeList(SRequestObj* pRequest, SArray** pNodeList, SArray
if
(
pRes
->
code
)
{
if
(
pRes
->
code
)
{
pQnodeList
=
NULL
;
pQnodeList
=
NULL
;
}
else
{
}
else
{
pQnodeList
=
taosArrayDup
((
SArray
*
)
pRes
->
pRes
);
pQnodeList
=
taosArrayDup
((
SArray
*
)
pRes
->
pRes
,
NULL
);
}
}
}
else
{
}
else
{
SAppInstInfo
*
pInst
=
pRequest
->
pTscObj
->
pAppInfo
;
SAppInstInfo
*
pInst
=
pRequest
->
pTscObj
->
pAppInfo
;
taosThreadMutexLock
(
&
pInst
->
qnodeMutex
);
taosThreadMutexLock
(
&
pInst
->
qnodeMutex
);
if
(
pInst
->
pQnodeList
)
{
if
(
pInst
->
pQnodeList
)
{
pQnodeList
=
taosArrayDup
(
pInst
->
pQnodeList
);
pQnodeList
=
taosArrayDup
(
pInst
->
pQnodeList
,
NULL
);
}
}
taosThreadMutexUnlock
(
&
pInst
->
qnodeMutex
);
taosThreadMutexUnlock
(
&
pInst
->
qnodeMutex
);
}
}
...
...
source/dnode/mgmt/node_util/src/dmEps.c
浏览文件 @
3878af10
...
@@ -248,7 +248,7 @@ void dmUpdateEps(SDnodeData *pData, SArray *eps) {
...
@@ -248,7 +248,7 @@ void dmUpdateEps(SDnodeData *pData, SArray *eps) {
static
void
dmResetEps
(
SDnodeData
*
pData
,
SArray
*
dnodeEps
)
{
static
void
dmResetEps
(
SDnodeData
*
pData
,
SArray
*
dnodeEps
)
{
if
(
pData
->
dnodeEps
!=
dnodeEps
)
{
if
(
pData
->
dnodeEps
!=
dnodeEps
)
{
SArray
*
tmp
=
pData
->
dnodeEps
;
SArray
*
tmp
=
pData
->
dnodeEps
;
pData
->
dnodeEps
=
taosArrayDup
(
dnodeEps
);
pData
->
dnodeEps
=
taosArrayDup
(
dnodeEps
,
NULL
);
taosArrayDestroy
(
tmp
);
taosArrayDestroy
(
tmp
);
}
}
...
...
source/dnode/mnode/impl/src/mndDb.c
浏览文件 @
3878af10
...
@@ -810,7 +810,7 @@ static int32_t mndProcessAlterDbReq(SRpcMsg *pReq) {
...
@@ -810,7 +810,7 @@ static int32_t mndProcessAlterDbReq(SRpcMsg *pReq) {
memcpy
(
&
dbObj
,
pDb
,
sizeof
(
SDbObj
));
memcpy
(
&
dbObj
,
pDb
,
sizeof
(
SDbObj
));
if
(
dbObj
.
cfg
.
pRetensions
!=
NULL
)
{
if
(
dbObj
.
cfg
.
pRetensions
!=
NULL
)
{
dbObj
.
cfg
.
pRetensions
=
taosArrayDup
(
pDb
->
cfg
.
pRetensions
);
dbObj
.
cfg
.
pRetensions
=
taosArrayDup
(
pDb
->
cfg
.
pRetensions
,
NULL
);
if
(
dbObj
.
cfg
.
pRetensions
==
NULL
)
goto
_OVER
;
if
(
dbObj
.
cfg
.
pRetensions
==
NULL
)
goto
_OVER
;
}
}
...
...
source/dnode/mnode/impl/src/mndDef.c
浏览文件 @
3878af10
...
@@ -361,7 +361,7 @@ SMqConsumerEp *tCloneSMqConsumerEp(const SMqConsumerEp *pConsumerEpOld) {
...
@@ -361,7 +361,7 @@ SMqConsumerEp *tCloneSMqConsumerEp(const SMqConsumerEp *pConsumerEpOld) {
SMqConsumerEp
*
pConsumerEpNew
=
taosMemoryMalloc
(
sizeof
(
SMqConsumerEp
));
SMqConsumerEp
*
pConsumerEpNew
=
taosMemoryMalloc
(
sizeof
(
SMqConsumerEp
));
if
(
pConsumerEpNew
==
NULL
)
return
NULL
;
if
(
pConsumerEpNew
==
NULL
)
return
NULL
;
pConsumerEpNew
->
consumerId
=
pConsumerEpOld
->
consumerId
;
pConsumerEpNew
->
consumerId
=
pConsumerEpOld
->
consumerId
;
pConsumerEpNew
->
vgs
=
taosArrayD
eepCopy
(
pConsumerEpOld
->
vgs
,
(
FCopy
)
tCloneSMqVgEp
);
pConsumerEpNew
->
vgs
=
taosArrayD
up
(
pConsumerEpOld
->
vgs
,
(
__array_item_dup_fn_t
)
tCloneSMqVgEp
);
return
pConsumerEpNew
;
return
pConsumerEpNew
;
}
}
...
@@ -440,11 +440,11 @@ SMqSubscribeObj *tCloneSubscribeObj(const SMqSubscribeObj *pSub) {
...
@@ -440,11 +440,11 @@ SMqSubscribeObj *tCloneSubscribeObj(const SMqSubscribeObj *pSub) {
pConsumerEp
=
(
SMqConsumerEp
*
)
pIter
;
pConsumerEp
=
(
SMqConsumerEp
*
)
pIter
;
SMqConsumerEp
newEp
=
{
SMqConsumerEp
newEp
=
{
.
consumerId
=
pConsumerEp
->
consumerId
,
.
consumerId
=
pConsumerEp
->
consumerId
,
.
vgs
=
taosArrayD
eepCopy
(
pConsumerEp
->
vgs
,
(
FCopy
)
tCloneSMqVgEp
),
.
vgs
=
taosArrayD
up
(
pConsumerEp
->
vgs
,
(
__array_item_dup_fn_t
)
tCloneSMqVgEp
),
};
};
taosHashPut
(
pSubNew
->
consumerHash
,
&
newEp
.
consumerId
,
sizeof
(
int64_t
),
&
newEp
,
sizeof
(
SMqConsumerEp
));
taosHashPut
(
pSubNew
->
consumerHash
,
&
newEp
.
consumerId
,
sizeof
(
int64_t
),
&
newEp
,
sizeof
(
SMqConsumerEp
));
}
}
pSubNew
->
unassignedVgs
=
taosArrayD
eepCopy
(
pSub
->
unassignedVgs
,
(
FCopy
)
tCloneSMqVgEp
);
pSubNew
->
unassignedVgs
=
taosArrayD
up
(
pSub
->
unassignedVgs
,
(
__array_item_dup_fn_t
)
tCloneSMqVgEp
);
memcpy
(
pSubNew
->
dbName
,
pSub
->
dbName
,
TSDB_DB_FNAME_LEN
);
memcpy
(
pSubNew
->
dbName
,
pSub
->
dbName
,
TSDB_DB_FNAME_LEN
);
return
pSubNew
;
return
pSubNew
;
}
}
...
@@ -516,7 +516,7 @@ SMqSubActionLogEntry *tCloneSMqSubActionLogEntry(SMqSubActionLogEntry *pEntry) {
...
@@ -516,7 +516,7 @@ SMqSubActionLogEntry *tCloneSMqSubActionLogEntry(SMqSubActionLogEntry *pEntry) {
SMqSubActionLogEntry
*
pEntryNew
=
taosMemoryMalloc
(
sizeof
(
SMqSubActionLogEntry
));
SMqSubActionLogEntry
*
pEntryNew
=
taosMemoryMalloc
(
sizeof
(
SMqSubActionLogEntry
));
if
(
pEntryNew
==
NULL
)
return
NULL
;
if
(
pEntryNew
==
NULL
)
return
NULL
;
pEntryNew
->
epoch
=
pEntry
->
epoch
;
pEntryNew
->
epoch
=
pEntry
->
epoch
;
pEntryNew
->
consumers
=
taosArrayD
eepCopy
(
pEntry
->
consumers
,
(
FCopy
)
tCloneSMqConsumerEp
);
pEntryNew
->
consumers
=
taosArrayD
up
(
pEntry
->
consumers
,
(
__array_item_dup_fn_t
)
tCloneSMqConsumerEp
);
return
pEntryNew
;
return
pEntryNew
;
}
}
...
@@ -541,7 +541,7 @@ SMqSubActionLogObj *tCloneSMqSubActionLogObj(SMqSubActionLogObj *pLog) {
...
@@ -541,7 +541,7 @@ SMqSubActionLogObj *tCloneSMqSubActionLogObj(SMqSubActionLogObj *pLog) {
SMqSubActionLogObj
*
pLogNew
=
taosMemoryMalloc
(
sizeof
(
SMqSubActionLogObj
));
SMqSubActionLogObj
*
pLogNew
=
taosMemoryMalloc
(
sizeof
(
SMqSubActionLogObj
));
if
(
pLogNew
==
NULL
)
return
pLogNew
;
if
(
pLogNew
==
NULL
)
return
pLogNew
;
memcpy
(
pLogNew
->
key
,
pLog
->
key
,
TSDB_SUBSCRIBE_KEY_LEN
);
memcpy
(
pLogNew
->
key
,
pLog
->
key
,
TSDB_SUBSCRIBE_KEY_LEN
);
pLogNew
->
logs
=
taosArrayD
eepCopy
(
pLog
->
logs
,
(
FCopy
)
tCloneSMqConsumerEp
);
pLogNew
->
logs
=
taosArrayD
up
(
pLog
->
logs
,
(
__array_item_dup_fn_t
)
tCloneSMqConsumerEp
);
return
pLogNew
;
return
pLogNew
;
}
}
...
...
source/dnode/mnode/impl/src/mndStb.c
浏览文件 @
3878af10
...
@@ -1684,7 +1684,7 @@ static int32_t mndBuildStbCfgImp(SDbObj *pDb, SStbObj *pStb, const char *tbName,
...
@@ -1684,7 +1684,7 @@ static int32_t mndBuildStbCfgImp(SDbObj *pDb, SStbObj *pStb, const char *tbName,
}
}
if
(
pStb
->
numOfFuncs
>
0
)
{
if
(
pStb
->
numOfFuncs
>
0
)
{
pRsp
->
pFuncs
=
taosArrayDup
(
pStb
->
pFuncs
);
pRsp
->
pFuncs
=
taosArrayDup
(
pStb
->
pFuncs
,
NULL
);
}
}
taosRUnLockLatch
(
&
pStb
->
lock
);
taosRUnLockLatch
(
&
pStb
->
lock
);
...
...
source/libs/catalog/src/ctgUtil.c
浏览文件 @
3878af10
...
@@ -1188,7 +1188,7 @@ SName* ctgGetFetchName(SArray* pNames, SCtgFetch* pFetch) {
...
@@ -1188,7 +1188,7 @@ SName* ctgGetFetchName(SArray* pNames, SCtgFetch* pFetch) {
return
(
SName
*
)
taosArrayGet
(
pReq
->
pTables
,
pFetch
->
tbIdx
);
return
(
SName
*
)
taosArrayGet
(
pReq
->
pTables
,
pFetch
->
tbIdx
);
}
}
static
void
*
ctgCloneDbVgroup
(
void
*
pSrc
)
{
return
taosArrayDup
((
const
SArray
*
)
pSrc
);
}
static
void
*
ctgCloneDbVgroup
(
void
*
pSrc
)
{
return
taosArrayDup
((
const
SArray
*
)
pSrc
,
NULL
);
}
static
void
ctgFreeDbVgroup
(
void
*
p
)
{
taosArrayDestroy
((
SArray
*
)((
SMetaRes
*
)
p
)
->
pRes
);
}
static
void
ctgFreeDbVgroup
(
void
*
p
)
{
taosArrayDestroy
((
SArray
*
)((
SMetaRes
*
)
p
)
->
pRes
);
}
...
@@ -1238,7 +1238,7 @@ static void* ctgCloneVgroupInfo(void* pSrc) {
...
@@ -1238,7 +1238,7 @@ static void* ctgCloneVgroupInfo(void* pSrc) {
static
void
ctgFreeVgroupInfo
(
void
*
p
)
{
taosMemoryFree
(((
SMetaRes
*
)
p
)
->
pRes
);
}
static
void
ctgFreeVgroupInfo
(
void
*
p
)
{
taosMemoryFree
(((
SMetaRes
*
)
p
)
->
pRes
);
}
static
void
*
ctgCloneTableIndices
(
void
*
pSrc
)
{
return
taosArrayDup
((
const
SArray
*
)
pSrc
);
}
static
void
*
ctgCloneTableIndices
(
void
*
pSrc
)
{
return
taosArrayDup
((
const
SArray
*
)
pSrc
,
NULL
);
}
static
void
ctgFreeTableIndices
(
void
*
p
)
{
taosArrayDestroy
((
SArray
*
)((
SMetaRes
*
)
p
)
->
pRes
);
}
static
void
ctgFreeTableIndices
(
void
*
p
)
{
taosArrayDestroy
((
SArray
*
)((
SMetaRes
*
)
p
)
->
pRes
);
}
...
@@ -1275,7 +1275,7 @@ static void* ctgCloneUserAuth(void* pSrc) {
...
@@ -1275,7 +1275,7 @@ static void* ctgCloneUserAuth(void* pSrc) {
static
void
ctgFreeUserAuth
(
void
*
p
)
{
taosMemoryFree
(((
SMetaRes
*
)
p
)
->
pRes
);
}
static
void
ctgFreeUserAuth
(
void
*
p
)
{
taosMemoryFree
(((
SMetaRes
*
)
p
)
->
pRes
);
}
static
void
*
ctgCloneQnodeList
(
void
*
pSrc
)
{
return
taosArrayDup
((
const
SArray
*
)
pSrc
);
}
static
void
*
ctgCloneQnodeList
(
void
*
pSrc
)
{
return
taosArrayDup
((
const
SArray
*
)
pSrc
,
NULL
);
}
static
void
ctgFreeQnodeList
(
void
*
p
)
{
taosArrayDestroy
((
SArray
*
)((
SMetaRes
*
)
p
)
->
pRes
);
}
static
void
ctgFreeQnodeList
(
void
*
p
)
{
taosArrayDestroy
((
SArray
*
)((
SMetaRes
*
)
p
)
->
pRes
);
}
...
@@ -1290,11 +1290,11 @@ static void* ctgCloneTableCfg(void* pSrc) {
...
@@ -1290,11 +1290,11 @@ static void* ctgCloneTableCfg(void* pSrc) {
static
void
ctgFreeTableCfg
(
void
*
p
)
{
taosMemoryFree
(((
SMetaRes
*
)
p
)
->
pRes
);
}
static
void
ctgFreeTableCfg
(
void
*
p
)
{
taosMemoryFree
(((
SMetaRes
*
)
p
)
->
pRes
);
}
static
void
*
ctgCloneDnodeList
(
void
*
pSrc
)
{
return
taosArrayDup
((
const
SArray
*
)
pSrc
);
}
static
void
*
ctgCloneDnodeList
(
void
*
pSrc
)
{
return
taosArrayDup
((
const
SArray
*
)
pSrc
,
NULL
);
}
static
void
ctgFreeDnodeList
(
void
*
p
)
{
taosArrayDestroy
((
SArray
*
)((
SMetaRes
*
)
p
)
->
pRes
);
}
static
void
ctgFreeDnodeList
(
void
*
p
)
{
taosArrayDestroy
((
SArray
*
)((
SMetaRes
*
)
p
)
->
pRes
);
}
static
int32_t
ctgCloneMetaDataArray
(
SArray
*
pSrc
,
FCopy
copyFunc
,
SArray
**
pDst
)
{
static
int32_t
ctgCloneMetaDataArray
(
SArray
*
pSrc
,
__array_item_dup_fn_t
copyFunc
,
SArray
**
pDst
)
{
if
(
NULL
==
pSrc
)
{
if
(
NULL
==
pSrc
)
{
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
...
...
source/libs/executor/src/executorimpl.c
浏览文件 @
3878af10
...
@@ -2355,10 +2355,12 @@ SOperatorInfo* createOperatorTree(SPhysiNode* pPhyNode, SExecTaskInfo* pTaskInfo
...
@@ -2355,10 +2355,12 @@ SOperatorInfo* createOperatorTree(SPhysiNode* pPhyNode, SExecTaskInfo* pTaskInfo
return
NULL
;
return
NULL
;
}
}
for
(
int32_t
i
=
0
;
i
<
tableListGetSize
(
pTableListInfo
);
++
i
)
{
size_t
num
=
taosArrayGetSize
(
pList
);
for
(
int32_t
i
=
0
;
i
<
num
;
++
i
)
{
STableKeyInfo
*
p
=
taosArrayGet
(
pList
,
i
);
STableKeyInfo
*
p
=
taosArrayGet
(
pList
,
i
);
tableListAddTableInfo
(
pTableListInfo
,
p
->
uid
,
0
);
tableListAddTableInfo
(
pTableListInfo
,
p
->
uid
,
0
);
}
}
taosArrayDestroy
(
pList
);
taosArrayDestroy
(
pList
);
}
else
{
// Create group with only one table
}
else
{
// Create group with only one table
tableListAddTableInfo
(
pTableListInfo
,
pBlockNode
->
uid
,
0
);
tableListAddTableInfo
(
pTableListInfo
,
pBlockNode
->
uid
,
0
);
...
...
source/libs/monitor/src/monMain.c
浏览文件 @
3878af10
...
@@ -36,7 +36,7 @@ void monRecordLog(int64_t ts, ELogLevel level, const char *content) {
...
@@ -36,7 +36,7 @@ void monRecordLog(int64_t ts, ELogLevel level, const char *content) {
int32_t
monGetLogs
(
SMonLogs
*
logs
)
{
int32_t
monGetLogs
(
SMonLogs
*
logs
)
{
taosThreadMutexLock
(
&
tsMonitor
.
lock
);
taosThreadMutexLock
(
&
tsMonitor
.
lock
);
logs
->
logs
=
taosArrayDup
(
tsMonitor
.
logs
);
logs
->
logs
=
taosArrayDup
(
tsMonitor
.
logs
,
NULL
);
logs
->
numOfInfoLogs
=
tsNumOfInfoLogs
;
logs
->
numOfInfoLogs
=
tsNumOfInfoLogs
;
logs
->
numOfErrorLogs
=
tsNumOfErrorLogs
;
logs
->
numOfErrorLogs
=
tsNumOfErrorLogs
;
logs
->
numOfDebugLogs
=
tsNumOfDebugLogs
;
logs
->
numOfDebugLogs
=
tsNumOfDebugLogs
;
...
...
source/libs/parser/src/parCalcConst.c
浏览文件 @
3878af10
...
@@ -169,7 +169,7 @@ static int32_t calcConstStmtCondition(SCalcConstContext* pCxt, SNode** pCond, bo
...
@@ -169,7 +169,7 @@ static int32_t calcConstStmtCondition(SCalcConstContext* pCxt, SNode** pCond, bo
static
int32_t
calcConstProject
(
SNode
*
pProject
,
bool
dual
,
SNode
**
pNew
)
{
static
int32_t
calcConstProject
(
SNode
*
pProject
,
bool
dual
,
SNode
**
pNew
)
{
SArray
*
pAssociation
=
NULL
;
SArray
*
pAssociation
=
NULL
;
if
(
NULL
!=
((
SExprNode
*
)
pProject
)
->
pAssociation
)
{
if
(
NULL
!=
((
SExprNode
*
)
pProject
)
->
pAssociation
)
{
pAssociation
=
taosArrayDup
(((
SExprNode
*
)
pProject
)
->
pAssociation
);
pAssociation
=
taosArrayDup
(((
SExprNode
*
)
pProject
)
->
pAssociation
,
NULL
);
if
(
NULL
==
pAssociation
)
{
if
(
NULL
==
pAssociation
)
{
return
TSDB_CODE_OUT_OF_MEMORY
;
return
TSDB_CODE_OUT_OF_MEMORY
;
}
}
...
...
source/libs/parser/src/parInsertUtil.c
浏览文件 @
3878af10
...
@@ -857,7 +857,7 @@ void insBuildCreateTbReq(SVCreateTbReq* pTbReq, const char* tname, STag* pTag, i
...
@@ -857,7 +857,7 @@ void insBuildCreateTbReq(SVCreateTbReq* pTbReq, const char* tname, STag* pTag, i
pTbReq
->
ctb
.
tagNum
=
tagNum
;
pTbReq
->
ctb
.
tagNum
=
tagNum
;
if
(
sname
)
pTbReq
->
ctb
.
stbName
=
strdup
(
sname
);
if
(
sname
)
pTbReq
->
ctb
.
stbName
=
strdup
(
sname
);
pTbReq
->
ctb
.
pTag
=
(
uint8_t
*
)
pTag
;
pTbReq
->
ctb
.
pTag
=
(
uint8_t
*
)
pTag
;
pTbReq
->
ctb
.
tagName
=
taosArrayDup
(
tagName
);
pTbReq
->
ctb
.
tagName
=
taosArrayDup
(
tagName
,
NULL
);
pTbReq
->
ttl
=
TSDB_DEFAULT_TABLE_TTL
;
pTbReq
->
ttl
=
TSDB_DEFAULT_TABLE_TTL
;
pTbReq
->
commentLen
=
-
1
;
pTbReq
->
commentLen
=
-
1
;
...
...
source/libs/parser/src/parTranslater.c
浏览文件 @
3878af10
...
@@ -6625,7 +6625,7 @@ static void addCreateTbReqIntoVgroup(int32_t acctId, SHashObj* pVgroupHashmap, S
...
@@ -6625,7 +6625,7 @@ static void addCreateTbReqIntoVgroup(int32_t acctId, SHashObj* pVgroupHashmap, S
req
.
ctb
.
tagNum
=
tagNum
;
req
.
ctb
.
tagNum
=
tagNum
;
req
.
ctb
.
stbName
=
strdup
(
sTableNmae
);
req
.
ctb
.
stbName
=
strdup
(
sTableNmae
);
req
.
ctb
.
pTag
=
(
uint8_t
*
)
pTag
;
req
.
ctb
.
pTag
=
(
uint8_t
*
)
pTag
;
req
.
ctb
.
tagName
=
taosArrayDup
(
tagName
);
req
.
ctb
.
tagName
=
taosArrayDup
(
tagName
,
NULL
);
if
(
pStmt
->
ignoreExists
)
{
if
(
pStmt
->
ignoreExists
)
{
req
.
flags
|=
TD_CREATE_IF_NOT_EXISTS
;
req
.
flags
|=
TD_CREATE_IF_NOT_EXISTS
;
}
}
...
...
source/libs/parser/src/parUtil.c
浏览文件 @
3878af10
...
@@ -844,7 +844,7 @@ int32_t getDbVgInfoFromCache(SParseMetaCache* pMetaCache, const char* pDbFName,
...
@@ -844,7 +844,7 @@ int32_t getDbVgInfoFromCache(SParseMetaCache* pMetaCache, const char* pDbFName,
int32_t
code
=
getMetaDataFromHash
(
pDbFName
,
strlen
(
pDbFName
),
pMetaCache
->
pDbVgroup
,
(
void
**
)
&
pVgList
);
int32_t
code
=
getMetaDataFromHash
(
pDbFName
,
strlen
(
pDbFName
),
pMetaCache
->
pDbVgroup
,
(
void
**
)
&
pVgList
);
// pVgList is null, which is a legal value, indicating that the user DB has not been created
// pVgList is null, which is a legal value, indicating that the user DB has not been created
if
(
TSDB_CODE_SUCCESS
==
code
&&
NULL
!=
pVgList
)
{
if
(
TSDB_CODE_SUCCESS
==
code
&&
NULL
!=
pVgList
)
{
*
pVgInfo
=
taosArrayDup
(
pVgList
);
*
pVgInfo
=
taosArrayDup
(
pVgList
,
NULL
);
if
(
NULL
==
*
pVgInfo
)
{
if
(
NULL
==
*
pVgInfo
)
{
code
=
TSDB_CODE_OUT_OF_MEMORY
;
code
=
TSDB_CODE_OUT_OF_MEMORY
;
}
}
...
@@ -961,7 +961,7 @@ int32_t getUdfInfoFromCache(SParseMetaCache* pMetaCache, const char* pFunc, SFun
...
@@ -961,7 +961,7 @@ int32_t getUdfInfoFromCache(SParseMetaCache* pMetaCache, const char* pFunc, SFun
static
void
destroySmaIndex
(
void
*
p
)
{
taosMemoryFree
(((
STableIndexInfo
*
)
p
)
->
expr
);
}
static
void
destroySmaIndex
(
void
*
p
)
{
taosMemoryFree
(((
STableIndexInfo
*
)
p
)
->
expr
);
}
static
SArray
*
smaIndexesDup
(
SArray
*
pSrc
)
{
static
SArray
*
smaIndexesDup
(
SArray
*
pSrc
)
{
SArray
*
pDst
=
taosArrayDup
(
pSrc
);
SArray
*
pDst
=
taosArrayDup
(
pSrc
,
NULL
);
if
(
NULL
==
pDst
)
{
if
(
NULL
==
pDst
)
{
return
NULL
;
return
NULL
;
}
}
...
@@ -1011,7 +1011,7 @@ STableCfg* tableCfgDup(STableCfg* pCfg) {
...
@@ -1011,7 +1011,7 @@ STableCfg* tableCfgDup(STableCfg* pCfg) {
memcpy
(
pNew
->
pComment
,
pCfg
->
pComment
,
pNew
->
commentLen
);
memcpy
(
pNew
->
pComment
,
pCfg
->
pComment
,
pNew
->
commentLen
);
}
}
if
(
NULL
!=
pNew
->
pFuncs
)
{
if
(
NULL
!=
pNew
->
pFuncs
)
{
pNew
->
pFuncs
=
taosArrayDup
(
pNew
->
pFuncs
);
pNew
->
pFuncs
=
taosArrayDup
(
pNew
->
pFuncs
,
NULL
);
}
}
if
(
NULL
!=
pNew
->
pTags
)
{
if
(
NULL
!=
pNew
->
pTags
)
{
pNew
->
pTags
=
taosMemoryCalloc
(
pNew
->
tagsLen
+
1
,
1
);
pNew
->
pTags
=
taosMemoryCalloc
(
pNew
->
tagsLen
+
1
,
1
);
...
@@ -1053,7 +1053,7 @@ int32_t getDnodeListFromCache(SParseMetaCache* pMetaCache, SArray** pDnodes) {
...
@@ -1053,7 +1053,7 @@ int32_t getDnodeListFromCache(SParseMetaCache* pMetaCache, SArray** pDnodes) {
return
pRes
->
code
;
return
pRes
->
code
;
}
}
*
pDnodes
=
taosArrayDup
((
SArray
*
)
pRes
->
pRes
);
*
pDnodes
=
taosArrayDup
((
SArray
*
)
pRes
->
pRes
,
NULL
);
if
(
NULL
==
*
pDnodes
)
{
if
(
NULL
==
*
pDnodes
)
{
return
TSDB_CODE_OUT_OF_MEMORY
;
return
TSDB_CODE_OUT_OF_MEMORY
;
}
}
...
...
source/libs/scheduler/src/schJob.c
浏览文件 @
3878af10
...
@@ -721,7 +721,7 @@ int32_t schInitJob(int64_t *pJobId, SSchedulerReq *pReq) {
...
@@ -721,7 +721,7 @@ int32_t schInitJob(int64_t *pJobId, SSchedulerReq *pReq) {
if
(
pReq
->
pNodeList
==
NULL
||
taosArrayGetSize
(
pReq
->
pNodeList
)
<=
0
)
{
if
(
pReq
->
pNodeList
==
NULL
||
taosArrayGetSize
(
pReq
->
pNodeList
)
<=
0
)
{
qDebug
(
"QID:0x%"
PRIx64
" input exec nodeList is empty"
,
pReq
->
pDag
->
queryId
);
qDebug
(
"QID:0x%"
PRIx64
" input exec nodeList is empty"
,
pReq
->
pDag
->
queryId
);
}
else
{
}
else
{
pJob
->
nodeList
=
taosArrayDup
(
pReq
->
pNodeList
);
pJob
->
nodeList
=
taosArrayDup
(
pReq
->
pNodeList
,
NULL
);
}
}
pJob
->
taskList
=
taosHashInit
(
pReq
->
pDag
->
numOfSubplans
,
taosGetDefaultHashFunction
(
TSDB_DATA_TYPE_UBIGINT
),
false
,
pJob
->
taskList
=
taosHashInit
(
pReq
->
pDag
->
numOfSubplans
,
taosGetDefaultHashFunction
(
TSDB_DATA_TYPE_UBIGINT
),
false
,
...
...
source/util/src/tarray.c
浏览文件 @
3878af10
...
@@ -302,7 +302,7 @@ SArray* taosArrayFromList(const void* src, size_t size, size_t elemSize) {
...
@@ -302,7 +302,7 @@ SArray* taosArrayFromList(const void* src, size_t size, size_t elemSize) {
return
pDst
;
return
pDst
;
}
}
SArray
*
taosArrayDup
(
const
SArray
*
pSrc
)
{
SArray
*
taosArrayDup
(
const
SArray
*
pSrc
,
__array_item_dup_fn_t
fn
)
{
assert
(
pSrc
!=
NULL
);
assert
(
pSrc
!=
NULL
);
if
(
pSrc
->
size
==
0
)
{
// empty array list
if
(
pSrc
->
size
==
0
)
{
// empty array list
...
@@ -311,8 +311,19 @@ SArray* taosArrayDup(const SArray* pSrc) {
...
@@ -311,8 +311,19 @@ SArray* taosArrayDup(const SArray* pSrc) {
SArray
*
dst
=
taosArrayInit
(
pSrc
->
size
,
pSrc
->
elemSize
);
SArray
*
dst
=
taosArrayInit
(
pSrc
->
size
,
pSrc
->
elemSize
);
memcpy
(
dst
->
pData
,
pSrc
->
pData
,
pSrc
->
elemSize
*
pSrc
->
size
);
if
(
fn
==
NULL
)
{
memcpy
(
dst
->
pData
,
pSrc
->
pData
,
pSrc
->
elemSize
*
pSrc
->
size
);
}
else
{
ASSERT
(
pSrc
->
elemSize
==
sizeof
(
void
*
));
for
(
int32_t
i
=
0
;
i
<
pSrc
->
size
;
++
i
)
{
void
*
p
=
fn
(
taosArrayGetP
(
pSrc
,
i
));
memcpy
(
dst
->
pData
+
i
*
dst
->
elemSize
,
&
p
,
dst
->
elemSize
);
}
}
dst
->
size
=
pSrc
->
size
;
dst
->
size
=
pSrc
->
size
;
return
dst
;
return
dst
;
}
}
...
@@ -464,19 +475,6 @@ static void taosArrayInsertSort(SArray* pArray, __ext_compar_fn_t fn, const void
...
@@ -464,19 +475,6 @@ static void taosArrayInsertSort(SArray* pArray, __ext_compar_fn_t fn, const void
return
;
return
;
}
}
SArray
*
taosArrayDeepCopy
(
const
SArray
*
pSrc
,
FCopy
deepCopy
)
{
if
(
NULL
==
pSrc
)
{
return
NULL
;
}
ASSERT
(
pSrc
->
elemSize
==
sizeof
(
void
*
));
SArray
*
pArray
=
taosArrayInit
(
pSrc
->
size
,
sizeof
(
void
*
));
for
(
int32_t
i
=
0
;
i
<
pSrc
->
size
;
i
++
)
{
void
*
clone
=
deepCopy
(
taosArrayGetP
(
pSrc
,
i
));
taosArrayPush
(
pArray
,
&
clone
);
}
return
pArray
;
}
int32_t
taosEncodeArray
(
void
**
buf
,
const
SArray
*
pArray
,
FEncode
encode
)
{
int32_t
taosEncodeArray
(
void
**
buf
,
const
SArray
*
pArray
,
FEncode
encode
)
{
int32_t
tlen
=
0
;
int32_t
tlen
=
0
;
int32_t
sz
=
pArray
->
size
;
int32_t
sz
=
pArray
->
size
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录