Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
22aa0330
T
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1192
Star
22018
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看板
提交
22aa0330
编写于
2月 24, 2023
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(query): fix syntax errors on centos.
上级
97024f14
变更
69
隐藏空白更改
内联
并排
Showing
69 changed file
with
153 addition
and
152 deletion
+153
-152
include/os/osMemory.h
include/os/osMemory.h
+2
-1
source/client/src/clientHb.c
source/client/src/clientHb.c
+2
-2
source/client/src/clientImpl.c
source/client/src/clientImpl.c
+1
-1
source/client/src/clientTmq.c
source/client/src/clientTmq.c
+5
-5
source/common/src/tvariant.c
source/common/src/tvariant.c
+1
-1
source/dnode/mgmt/mgmt_vnode/src/vmInt.c
source/dnode/mgmt/mgmt_vnode/src/vmInt.c
+1
-1
source/dnode/mgmt/node_mgmt/src/dmMgmt.c
source/dnode/mgmt/node_mgmt/src/dmMgmt.c
+1
-1
source/dnode/mnode/impl/src/mndConsumer.c
source/dnode/mnode/impl/src/mndConsumer.c
+9
-9
source/dnode/mnode/impl/src/mndDef.c
source/dnode/mnode/impl/src/mndDef.c
+1
-1
source/dnode/mnode/impl/src/mndMain.c
source/dnode/mnode/impl/src/mndMain.c
+1
-1
source/dnode/mnode/impl/src/mndScheduler.c
source/dnode/mnode/impl/src/mndScheduler.c
+1
-1
source/dnode/mnode/impl/src/mndSma.c
source/dnode/mnode/impl/src/mndSma.c
+2
-2
source/dnode/mnode/impl/src/mndStb.c
source/dnode/mnode/impl/src/mndStb.c
+1
-1
source/dnode/mnode/impl/src/mndTopic.c
source/dnode/mnode/impl/src/mndTopic.c
+2
-2
source/dnode/mnode/impl/test/trans/trans2.cpp
source/dnode/mnode/impl/test/trans/trans2.cpp
+3
-3
source/dnode/mnode/sdb/src/sdb.c
source/dnode/mnode/sdb/src/sdb.c
+2
-2
source/dnode/mnode/sdb/src/sdbFile.c
source/dnode/mnode/sdb/src/sdbFile.c
+1
-1
source/dnode/snode/src/snode.c
source/dnode/snode/src/snode.c
+1
-1
source/dnode/vnode/src/meta/metaSnapshot.c
source/dnode/vnode/src/meta/metaSnapshot.c
+1
-1
source/dnode/vnode/src/sma/smaRollup.c
source/dnode/vnode/src/sma/smaRollup.c
+1
-1
source/dnode/vnode/src/sma/smaTimeRange.c
source/dnode/vnode/src/sma/smaTimeRange.c
+2
-2
source/dnode/vnode/src/tq/tq.c
source/dnode/vnode/src/tq/tq.c
+1
-1
source/dnode/vnode/src/tq/tqExec.c
source/dnode/vnode/src/tq/tqExec.c
+2
-2
source/dnode/vnode/src/tq/tqSink.c
source/dnode/vnode/src/tq/tqSink.c
+5
-5
source/dnode/vnode/src/tsdb/tsdbCacheRead.c
source/dnode/vnode/src/tsdb/tsdbCacheRead.c
+1
-1
source/dnode/vnode/src/tsdb/tsdbRead.c
source/dnode/vnode/src/tsdb/tsdbRead.c
+1
-1
source/dnode/vnode/src/vnd/vnodeQuery.c
source/dnode/vnode/src/vnd/vnodeQuery.c
+2
-2
source/libs/catalog/src/ctgDbg.c
source/libs/catalog/src/ctgDbg.c
+1
-1
source/libs/catalog/src/ctgUtil.c
source/libs/catalog/src/ctgUtil.c
+4
-4
source/libs/executor/src/executil.c
source/libs/executor/src/executil.c
+1
-1
source/libs/executor/src/executorimpl.c
source/libs/executor/src/executorimpl.c
+2
-2
source/libs/executor/src/scanoperator.c
source/libs/executor/src/scanoperator.c
+1
-1
source/libs/executor/src/sysscanoperator.c
source/libs/executor/src/sysscanoperator.c
+1
-1
source/libs/executor/src/tsort.c
source/libs/executor/src/tsort.c
+1
-1
source/libs/index/src/index.c
source/libs/index/src/index.c
+1
-1
source/libs/index/src/indexCache.c
source/libs/index/src/indexCache.c
+2
-2
source/libs/index/src/indexFstAutomation.c
source/libs/index/src/indexFstAutomation.c
+1
-1
source/libs/index/src/indexFstRegex.c
source/libs/index/src/indexFstRegex.c
+1
-1
source/libs/index/src/indexTfile.c
source/libs/index/src/indexTfile.c
+1
-1
source/libs/index/test/fstTest.cc
source/libs/index/test/fstTest.cc
+1
-1
source/libs/nodes/src/nodesCloneFuncs.c
source/libs/nodes/src/nodesCloneFuncs.c
+1
-1
source/libs/nodes/test/nodesTestMain.cpp
source/libs/nodes/test/nodesTestMain.cpp
+4
-4
source/libs/parser/src/parAstCreater.c
source/libs/parser/src/parAstCreater.c
+1
-1
source/libs/parser/src/parInsertSql.c
source/libs/parser/src/parInsertSql.c
+1
-1
source/libs/parser/src/parInsertUtil.c
source/libs/parser/src/parInsertUtil.c
+2
-2
source/libs/parser/src/parTranslater.c
source/libs/parser/src/parTranslater.c
+23
-23
source/libs/parser/src/parUtil.c
source/libs/parser/src/parUtil.c
+1
-1
source/libs/parser/test/mockCatalogService.cpp
source/libs/parser/test/mockCatalogService.cpp
+2
-2
source/libs/parser/test/parAlterToBalanceTest.cpp
source/libs/parser/test/parAlterToBalanceTest.cpp
+1
-1
source/libs/parser/test/parInitialCTest.cpp
source/libs/parser/test/parInitialCTest.cpp
+4
-4
source/libs/qcom/src/queryUtil.c
source/libs/qcom/src/queryUtil.c
+4
-4
source/libs/qcom/src/querymsg.c
source/libs/qcom/src/querymsg.c
+1
-1
source/libs/scheduler/src/schJob.c
source/libs/scheduler/src/schJob.c
+1
-1
source/libs/scheduler/src/schRemote.c
source/libs/scheduler/src/schRemote.c
+1
-1
source/libs/stream/src/streamMeta.c
source/libs/stream/src/streamMeta.c
+1
-1
source/libs/tfs/src/tfs.c
source/libs/tfs/src/tfs.c
+2
-2
source/libs/tfs/src/tfsDisk.c
source/libs/tfs/src/tfsDisk.c
+1
-1
source/libs/transport/src/thttp.c
source/libs/transport/src/thttp.c
+2
-2
source/libs/transport/src/transCli.c
source/libs/transport/src/transCli.c
+4
-4
source/os/src/osFile.c
source/os/src/osFile.c
+1
-1
source/os/src/osLocale.c
source/os/src/osLocale.c
+2
-2
source/os/src/osMemory.c
source/os/src/osMemory.c
+2
-2
source/util/src/tcache.c
source/util/src/tcache.c
+1
-1
source/util/src/tconfig.c
source/util/src/tconfig.c
+7
-7
source/util/src/tjson.c
source/util/src/tjson.c
+1
-1
source/util/src/tpagedbuf.c
source/util/src/tpagedbuf.c
+2
-2
tools/shell/src/shellAuto.c
tools/shell/src/shellAuto.c
+4
-4
tools/shell/src/shellEngine.c
tools/shell/src/shellEngine.c
+3
-3
tools/shell/src/shellTire.c
tools/shell/src/shellTire.c
+2
-2
未找到文件。
include/os/osMemory.h
浏览文件 @
22aa0330
...
@@ -29,6 +29,7 @@ extern "C" {
...
@@ -29,6 +29,7 @@ extern "C" {
#define calloc CALLOC_FUNC_TAOS_FORBID
#define calloc CALLOC_FUNC_TAOS_FORBID
#define realloc REALLOC_FUNC_TAOS_FORBID
#define realloc REALLOC_FUNC_TAOS_FORBID
#define free FREE_FUNC_TAOS_FORBID
#define free FREE_FUNC_TAOS_FORBID
#define strdup STRDUP_FUNC_TAOS_FORBID
#endif // ifndef ALLOW_FORBID_FUNC
#endif // ifndef ALLOW_FORBID_FUNC
#endif // if !defined(WINDOWS)
#endif // if !defined(WINDOWS)
...
@@ -38,7 +39,7 @@ int32_t taosMemoryDbgInitRestore();
...
@@ -38,7 +39,7 @@ int32_t taosMemoryDbgInitRestore();
void
*
taosMemoryMalloc
(
int64_t
size
);
void
*
taosMemoryMalloc
(
int64_t
size
);
void
*
taosMemoryCalloc
(
int64_t
num
,
int64_t
size
);
void
*
taosMemoryCalloc
(
int64_t
num
,
int64_t
size
);
void
*
taosMemoryRealloc
(
void
*
ptr
,
int64_t
size
);
void
*
taosMemoryRealloc
(
void
*
ptr
,
int64_t
size
);
void
*
taos
MemoryStrD
up
(
const
char
*
ptr
);
void
*
taos
Strd
up
(
const
char
*
ptr
);
void
taosMemoryFree
(
void
*
ptr
);
void
taosMemoryFree
(
void
*
ptr
);
int64_t
taosMemorySize
(
void
*
ptr
);
int64_t
taosMemorySize
(
void
*
ptr
);
void
taosPrintBackTrace
();
void
taosPrintBackTrace
();
...
...
source/client/src/clientHb.c
浏览文件 @
22aa0330
...
@@ -758,7 +758,7 @@ static void *hbThreadFunc(void *param) {
...
@@ -758,7 +758,7 @@ static void *hbThreadFunc(void *param) {
pInfo
->
msgInfo
.
pData
=
buf
;
pInfo
->
msgInfo
.
pData
=
buf
;
pInfo
->
msgInfo
.
len
=
tlen
;
pInfo
->
msgInfo
.
len
=
tlen
;
pInfo
->
msgType
=
TDMT_MND_HEARTBEAT
;
pInfo
->
msgType
=
TDMT_MND_HEARTBEAT
;
pInfo
->
param
=
s
trdup
(
pAppHbMgr
->
key
);
pInfo
->
param
=
taosS
trdup
(
pAppHbMgr
->
key
);
pInfo
->
paramFreeFp
=
taosMemoryFree
;
pInfo
->
paramFreeFp
=
taosMemoryFree
;
pInfo
->
requestId
=
generateRequestId
();
pInfo
->
requestId
=
generateRequestId
();
pInfo
->
requestObjRefId
=
0
;
pInfo
->
requestObjRefId
=
0
;
...
@@ -826,7 +826,7 @@ SAppHbMgr *appHbMgrInit(SAppInstInfo *pAppInstInfo, char *key) {
...
@@ -826,7 +826,7 @@ SAppHbMgr *appHbMgrInit(SAppInstInfo *pAppInstInfo, char *key) {
pAppHbMgr
->
connKeyCnt
=
0
;
pAppHbMgr
->
connKeyCnt
=
0
;
pAppHbMgr
->
reportCnt
=
0
;
pAppHbMgr
->
reportCnt
=
0
;
pAppHbMgr
->
reportBytes
=
0
;
pAppHbMgr
->
reportBytes
=
0
;
pAppHbMgr
->
key
=
s
trdup
(
key
);
pAppHbMgr
->
key
=
taosS
trdup
(
key
);
// init app info
// init app info
pAppHbMgr
->
pAppInstInfo
=
pAppInstInfo
;
pAppHbMgr
->
pAppInstInfo
=
pAppInstInfo
;
...
...
source/client/src/clientImpl.c
浏览文件 @
22aa0330
...
@@ -52,7 +52,7 @@ static bool validateDbName(const char* db) { return stringLengthCheck(db, TSDB_D
...
@@ -52,7 +52,7 @@ static bool validateDbName(const char* db) { return stringLengthCheck(db, TSDB_D
static
char
*
getClusterKey
(
const
char
*
user
,
const
char
*
auth
,
const
char
*
ip
,
int32_t
port
)
{
static
char
*
getClusterKey
(
const
char
*
user
,
const
char
*
auth
,
const
char
*
ip
,
int32_t
port
)
{
char
key
[
512
]
=
{
0
};
char
key
[
512
]
=
{
0
};
snprintf
(
key
,
sizeof
(
key
),
"%s:%s:%s:%d"
,
user
,
auth
,
ip
,
port
);
snprintf
(
key
,
sizeof
(
key
),
"%s:%s:%s:%d"
,
user
,
auth
,
ip
,
port
);
return
s
trdup
(
key
);
return
taosS
trdup
(
key
);
}
}
bool
chkRequestKilled
(
void
*
param
)
{
bool
chkRequestKilled
(
void
*
param
)
{
...
...
source/client/src/clientTmq.c
浏览文件 @
22aa0330
...
@@ -330,15 +330,15 @@ tmq_conf_res_t tmq_conf_set(tmq_conf_t* conf, const char* key, const char* value
...
@@ -330,15 +330,15 @@ tmq_conf_res_t tmq_conf_set(tmq_conf_t* conf, const char* key, const char* value
}
}
if
(
strcmp
(
key
,
"td.connect.ip"
)
==
0
)
{
if
(
strcmp
(
key
,
"td.connect.ip"
)
==
0
)
{
conf
->
ip
=
s
trdup
(
value
);
conf
->
ip
=
taosS
trdup
(
value
);
return
TMQ_CONF_OK
;
return
TMQ_CONF_OK
;
}
}
if
(
strcmp
(
key
,
"td.connect.user"
)
==
0
)
{
if
(
strcmp
(
key
,
"td.connect.user"
)
==
0
)
{
conf
->
user
=
s
trdup
(
value
);
conf
->
user
=
taosS
trdup
(
value
);
return
TMQ_CONF_OK
;
return
TMQ_CONF_OK
;
}
}
if
(
strcmp
(
key
,
"td.connect.pass"
)
==
0
)
{
if
(
strcmp
(
key
,
"td.connect.pass"
)
==
0
)
{
conf
->
pass
=
s
trdup
(
value
);
conf
->
pass
=
taosS
trdup
(
value
);
return
TMQ_CONF_OK
;
return
TMQ_CONF_OK
;
}
}
if
(
strcmp
(
key
,
"td.connect.port"
)
==
0
)
{
if
(
strcmp
(
key
,
"td.connect.port"
)
==
0
)
{
...
@@ -346,7 +346,7 @@ tmq_conf_res_t tmq_conf_set(tmq_conf_t* conf, const char* key, const char* value
...
@@ -346,7 +346,7 @@ tmq_conf_res_t tmq_conf_set(tmq_conf_t* conf, const char* key, const char* value
return
TMQ_CONF_OK
;
return
TMQ_CONF_OK
;
}
}
if
(
strcmp
(
key
,
"td.connect.db"
)
==
0
)
{
if
(
strcmp
(
key
,
"td.connect.db"
)
==
0
)
{
/*conf->db =
s
trdup(value);*/
/*conf->db =
taosS
trdup(value);*/
return
TMQ_CONF_OK
;
return
TMQ_CONF_OK
;
}
}
...
@@ -361,7 +361,7 @@ tmq_list_t* tmq_list_new() {
...
@@ -361,7 +361,7 @@ tmq_list_t* tmq_list_new() {
int32_t
tmq_list_append
(
tmq_list_t
*
list
,
const
char
*
src
)
{
int32_t
tmq_list_append
(
tmq_list_t
*
list
,
const
char
*
src
)
{
SArray
*
container
=
&
list
->
container
;
SArray
*
container
=
&
list
->
container
;
if
(
src
==
NULL
||
src
[
0
]
==
0
)
return
-
1
;
if
(
src
==
NULL
||
src
[
0
]
==
0
)
return
-
1
;
char
*
topic
=
s
trdup
(
src
);
char
*
topic
=
taosS
trdup
(
src
);
if
(
topic
[
0
]
!=
'`'
)
{
if
(
topic
[
0
]
!=
'`'
)
{
strtolower
(
topic
,
src
);
strtolower
(
topic
,
src
);
}
}
...
...
source/common/src/tvariant.c
浏览文件 @
22aa0330
...
@@ -185,7 +185,7 @@ void taosVariantAssign(SVariant *pDst, const SVariant *pSrc) {
...
@@ -185,7 +185,7 @@ void taosVariantAssign(SVariant *pDst, const SVariant *pSrc) {
pDst
->
arr
=
taosArrayInit
(
num
,
sizeof
(
char
*
));
pDst
->
arr
=
taosArrayInit
(
num
,
sizeof
(
char
*
));
for
(
size_t
i
=
0
;
i
<
num
;
i
++
)
{
for
(
size_t
i
=
0
;
i
<
num
;
i
++
)
{
char
*
p
=
(
char
*
)
taosArrayGetP
(
pSrc
->
arr
,
i
);
char
*
p
=
(
char
*
)
taosArrayGetP
(
pSrc
->
arr
,
i
);
char
*
n
=
s
trdup
(
p
);
char
*
n
=
taosS
trdup
(
p
);
taosArrayPush
(
pDst
->
arr
,
&
n
);
taosArrayPush
(
pDst
->
arr
,
&
n
);
}
}
}
else
if
(
pSrc
->
nType
==
TSDB_DATA_TYPE_VALUE_ARRAY
)
{
}
else
if
(
pSrc
->
nType
==
TSDB_DATA_TYPE_VALUE_ARRAY
)
{
...
...
source/dnode/mgmt/mgmt_vnode/src/vmInt.c
浏览文件 @
22aa0330
...
@@ -53,7 +53,7 @@ int32_t vmOpenVnode(SVnodeMgmt *pMgmt, SWrapperCfg *pCfg, SVnode *pImpl) {
...
@@ -53,7 +53,7 @@ int32_t vmOpenVnode(SVnodeMgmt *pMgmt, SWrapperCfg *pCfg, SVnode *pImpl) {
pVnode
->
vgVersion
=
pCfg
->
vgVersion
;
pVnode
->
vgVersion
=
pCfg
->
vgVersion
;
pVnode
->
refCount
=
0
;
pVnode
->
refCount
=
0
;
pVnode
->
dropped
=
0
;
pVnode
->
dropped
=
0
;
pVnode
->
path
=
t
s
trdup
(
pCfg
->
path
);
pVnode
->
path
=
t
aosS
trdup
(
pCfg
->
path
);
pVnode
->
pImpl
=
pImpl
;
pVnode
->
pImpl
=
pImpl
;
if
(
pVnode
->
path
==
NULL
)
{
if
(
pVnode
->
path
==
NULL
)
{
...
...
source/dnode/mgmt/node_mgmt/src/dmMgmt.c
浏览文件 @
22aa0330
...
@@ -124,7 +124,7 @@ int32_t dmInitDnode(SDnode *pDnode) {
...
@@ -124,7 +124,7 @@ int32_t dmInitDnode(SDnode *pDnode) {
taosThreadRwlockInit
(
&
pWrapper
->
lock
,
NULL
);
taosThreadRwlockInit
(
&
pWrapper
->
lock
,
NULL
);
snprintf
(
path
,
sizeof
(
path
),
"%s%s%s"
,
tsDataDir
,
TD_DIRSEP
,
pWrapper
->
name
);
snprintf
(
path
,
sizeof
(
path
),
"%s%s%s"
,
tsDataDir
,
TD_DIRSEP
,
pWrapper
->
name
);
pWrapper
->
path
=
s
trdup
(
path
);
pWrapper
->
path
=
taosS
trdup
(
path
);
if
(
pWrapper
->
path
==
NULL
)
{
if
(
pWrapper
->
path
==
NULL
)
{
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
goto
_OVER
;
goto
_OVER
;
...
...
source/dnode/mnode/impl/src/mndConsumer.c
浏览文件 @
22aa0330
...
@@ -577,7 +577,7 @@ static int32_t mndProcessSubscribeReq(SRpcMsg *pMsg) {
...
@@ -577,7 +577,7 @@ static int32_t mndProcessSubscribeReq(SRpcMsg *pMsg) {
subscribe
.
topicNames
=
NULL
;
subscribe
.
topicNames
=
NULL
;
for
(
int32_t
i
=
0
;
i
<
newTopicNum
;
i
++
)
{
for
(
int32_t
i
=
0
;
i
<
newTopicNum
;
i
++
)
{
char
*
newTopicCopy
=
s
trdup
(
taosArrayGetP
(
newSub
,
i
));
char
*
newTopicCopy
=
taosS
trdup
(
taosArrayGetP
(
newSub
,
i
));
taosArrayPush
(
pConsumerNew
->
assignedTopics
,
&
newTopicCopy
);
taosArrayPush
(
pConsumerNew
->
assignedTopics
,
&
newTopicCopy
);
}
}
...
@@ -605,7 +605,7 @@ static int32_t mndProcessSubscribeReq(SRpcMsg *pMsg) {
...
@@ -605,7 +605,7 @@ static int32_t mndProcessSubscribeReq(SRpcMsg *pMsg) {
pConsumerNew
->
updateType
=
CONSUMER_UPDATE__MODIFY
;
pConsumerNew
->
updateType
=
CONSUMER_UPDATE__MODIFY
;
for
(
int32_t
i
=
0
;
i
<
newTopicNum
;
i
++
)
{
for
(
int32_t
i
=
0
;
i
<
newTopicNum
;
i
++
)
{
char
*
newTopicCopy
=
s
trdup
(
taosArrayGetP
(
newSub
,
i
));
char
*
newTopicCopy
=
taosS
trdup
(
taosArrayGetP
(
newSub
,
i
));
taosArrayPush
(
pConsumerNew
->
assignedTopics
,
&
newTopicCopy
);
taosArrayPush
(
pConsumerNew
->
assignedTopics
,
&
newTopicCopy
);
}
}
...
@@ -617,12 +617,12 @@ static int32_t mndProcessSubscribeReq(SRpcMsg *pMsg) {
...
@@ -617,12 +617,12 @@ static int32_t mndProcessSubscribeReq(SRpcMsg *pMsg) {
int32_t
i
=
0
,
j
=
0
;
int32_t
i
=
0
,
j
=
0
;
while
(
i
<
oldTopicNum
||
j
<
newTopicNum
)
{
while
(
i
<
oldTopicNum
||
j
<
newTopicNum
)
{
if
(
i
>=
oldTopicNum
)
{
if
(
i
>=
oldTopicNum
)
{
char
*
newTopicCopy
=
s
trdup
(
taosArrayGetP
(
newSub
,
j
));
char
*
newTopicCopy
=
taosS
trdup
(
taosArrayGetP
(
newSub
,
j
));
taosArrayPush
(
pConsumerNew
->
rebNewTopics
,
&
newTopicCopy
);
taosArrayPush
(
pConsumerNew
->
rebNewTopics
,
&
newTopicCopy
);
j
++
;
j
++
;
continue
;
continue
;
}
else
if
(
j
>=
newTopicNum
)
{
}
else
if
(
j
>=
newTopicNum
)
{
char
*
oldTopicCopy
=
s
trdup
(
taosArrayGetP
(
pConsumerOld
->
currentTopics
,
i
));
char
*
oldTopicCopy
=
taosS
trdup
(
taosArrayGetP
(
pConsumerOld
->
currentTopics
,
i
));
taosArrayPush
(
pConsumerNew
->
rebRemovedTopics
,
&
oldTopicCopy
);
taosArrayPush
(
pConsumerNew
->
rebRemovedTopics
,
&
oldTopicCopy
);
i
++
;
i
++
;
continue
;
continue
;
...
@@ -635,12 +635,12 @@ static int32_t mndProcessSubscribeReq(SRpcMsg *pMsg) {
...
@@ -635,12 +635,12 @@ static int32_t mndProcessSubscribeReq(SRpcMsg *pMsg) {
j
++
;
j
++
;
continue
;
continue
;
}
else
if
(
comp
<
0
)
{
}
else
if
(
comp
<
0
)
{
char
*
oldTopicCopy
=
s
trdup
(
oldTopic
);
char
*
oldTopicCopy
=
taosS
trdup
(
oldTopic
);
taosArrayPush
(
pConsumerNew
->
rebRemovedTopics
,
&
oldTopicCopy
);
taosArrayPush
(
pConsumerNew
->
rebRemovedTopics
,
&
oldTopicCopy
);
i
++
;
i
++
;
continue
;
continue
;
}
else
{
}
else
{
char
*
newTopicCopy
=
s
trdup
(
newTopic
);
char
*
newTopicCopy
=
taosS
trdup
(
newTopic
);
taosArrayPush
(
pConsumerNew
->
rebNewTopics
,
&
newTopicCopy
);
taosArrayPush
(
pConsumerNew
->
rebNewTopics
,
&
newTopicCopy
);
j
++
;
j
++
;
continue
;
continue
;
...
@@ -808,7 +808,7 @@ static int32_t mndConsumerActionUpdate(SSdb *pSdb, SMqConsumerObj *pOldConsumer,
...
@@ -808,7 +808,7 @@ static int32_t mndConsumerActionUpdate(SSdb *pSdb, SMqConsumerObj *pOldConsumer,
int32_t
sz
=
taosArrayGetSize
(
pOldConsumer
->
currentTopics
);
int32_t
sz
=
taosArrayGetSize
(
pOldConsumer
->
currentTopics
);
/*pOldConsumer->rebRemovedTopics = taosArrayInit(sz, sizeof(void *));*/
/*pOldConsumer->rebRemovedTopics = taosArrayInit(sz, sizeof(void *));*/
for
(
int32_t
i
=
0
;
i
<
sz
;
i
++
)
{
for
(
int32_t
i
=
0
;
i
<
sz
;
i
++
)
{
char
*
topic
=
s
trdup
(
taosArrayGetP
(
pOldConsumer
->
currentTopics
,
i
));
char
*
topic
=
taosS
trdup
(
taosArrayGetP
(
pOldConsumer
->
currentTopics
,
i
));
taosArrayPush
(
pOldConsumer
->
rebRemovedTopics
,
&
topic
);
taosArrayPush
(
pOldConsumer
->
rebRemovedTopics
,
&
topic
);
}
}
...
@@ -821,7 +821,7 @@ static int32_t mndConsumerActionUpdate(SSdb *pSdb, SMqConsumerObj *pOldConsumer,
...
@@ -821,7 +821,7 @@ static int32_t mndConsumerActionUpdate(SSdb *pSdb, SMqConsumerObj *pOldConsumer,
int32_t
sz
=
taosArrayGetSize
(
pOldConsumer
->
assignedTopics
);
int32_t
sz
=
taosArrayGetSize
(
pOldConsumer
->
assignedTopics
);
for
(
int32_t
i
=
0
;
i
<
sz
;
i
++
)
{
for
(
int32_t
i
=
0
;
i
<
sz
;
i
++
)
{
char
*
topic
=
s
trdup
(
taosArrayGetP
(
pOldConsumer
->
assignedTopics
,
i
));
char
*
topic
=
taosS
trdup
(
taosArrayGetP
(
pOldConsumer
->
assignedTopics
,
i
));
taosArrayPush
(
pOldConsumer
->
rebNewTopics
,
&
topic
);
taosArrayPush
(
pOldConsumer
->
rebNewTopics
,
&
topic
);
}
}
...
@@ -837,7 +837,7 @@ static int32_t mndConsumerActionUpdate(SSdb *pSdb, SMqConsumerObj *pOldConsumer,
...
@@ -837,7 +837,7 @@ static int32_t mndConsumerActionUpdate(SSdb *pSdb, SMqConsumerObj *pOldConsumer,
/*A(taosArrayGetSize(pNewConsumer->rebNewTopics) == 1);*/
/*A(taosArrayGetSize(pNewConsumer->rebNewTopics) == 1);*/
/*A(taosArrayGetSize(pNewConsumer->rebRemovedTopics) == 0);*/
/*A(taosArrayGetSize(pNewConsumer->rebRemovedTopics) == 0);*/
char
*
addedTopic
=
s
trdup
(
taosArrayGetP
(
pNewConsumer
->
rebNewTopics
,
0
));
char
*
addedTopic
=
taosS
trdup
(
taosArrayGetP
(
pNewConsumer
->
rebNewTopics
,
0
));
// not exist in current topic
// not exist in current topic
bool
existing
=
false
;
bool
existing
=
false
;
...
...
source/dnode/mnode/impl/src/mndDef.c
浏览文件 @
22aa0330
...
@@ -181,7 +181,7 @@ SMqVgEp *tCloneSMqVgEp(const SMqVgEp *pVgEp) {
...
@@ -181,7 +181,7 @@ SMqVgEp *tCloneSMqVgEp(const SMqVgEp *pVgEp) {
SMqVgEp
*
pVgEpNew
=
taosMemoryMalloc
(
sizeof
(
SMqVgEp
));
SMqVgEp
*
pVgEpNew
=
taosMemoryMalloc
(
sizeof
(
SMqVgEp
));
if
(
pVgEpNew
==
NULL
)
return
NULL
;
if
(
pVgEpNew
==
NULL
)
return
NULL
;
pVgEpNew
->
vgId
=
pVgEp
->
vgId
;
pVgEpNew
->
vgId
=
pVgEp
->
vgId
;
pVgEpNew
->
qmsg
=
s
trdup
(
pVgEp
->
qmsg
);
pVgEpNew
->
qmsg
=
taosS
trdup
(
pVgEp
->
qmsg
);
pVgEpNew
->
epSet
=
pVgEp
->
epSet
;
pVgEpNew
->
epSet
=
pVgEp
->
epSet
;
return
pVgEpNew
;
return
pVgEpNew
;
}
}
...
...
source/dnode/mnode/impl/src/mndMain.c
浏览文件 @
22aa0330
...
@@ -322,7 +322,7 @@ static void mndCleanupTimer(SMnode *pMnode) {
...
@@ -322,7 +322,7 @@ static void mndCleanupTimer(SMnode *pMnode) {
}
}
static
int32_t
mndCreateDir
(
SMnode
*
pMnode
,
const
char
*
path
)
{
static
int32_t
mndCreateDir
(
SMnode
*
pMnode
,
const
char
*
path
)
{
pMnode
->
path
=
s
trdup
(
path
);
pMnode
->
path
=
taosS
trdup
(
path
);
if
(
pMnode
->
path
==
NULL
)
{
if
(
pMnode
->
path
==
NULL
)
{
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
return
-
1
;
return
-
1
;
...
...
source/dnode/mnode/impl/src/mndScheduler.c
浏览文件 @
22aa0330
...
@@ -587,7 +587,7 @@ int32_t mndSchedInitSubEp(SMnode* pMnode, const SMqTopicObj* pTopic, SMqSubscrib
...
@@ -587,7 +587,7 @@ int32_t mndSchedInitSubEp(SMnode* pMnode, const SMqTopicObj* pTopic, SMqSubscrib
return
-
1
;
return
-
1
;
}
}
}
else
{
}
else
{
pVgEp
->
qmsg
=
s
trdup
(
""
);
pVgEp
->
qmsg
=
taosS
trdup
(
""
);
}
}
sdbRelease
(
pSdb
,
pVgroup
);
sdbRelease
(
pSdb
,
pVgroup
);
...
...
source/dnode/mnode/impl/src/mndSma.c
浏览文件 @
22aa0330
...
@@ -552,14 +552,14 @@ static int32_t mndCreateSma(SMnode *pMnode, SRpcMsg *pReq, SMCreateSmaReq *pCrea
...
@@ -552,14 +552,14 @@ static int32_t mndCreateSma(SMnode *pMnode, SRpcMsg *pReq, SMCreateSmaReq *pCrea
streamObj
.
sourceDbUid
=
pDb
->
uid
;
streamObj
.
sourceDbUid
=
pDb
->
uid
;
streamObj
.
targetDbUid
=
pDb
->
uid
;
streamObj
.
targetDbUid
=
pDb
->
uid
;
streamObj
.
version
=
1
;
streamObj
.
version
=
1
;
streamObj
.
sql
=
s
trdup
(
pCreate
->
sql
);
streamObj
.
sql
=
taosS
trdup
(
pCreate
->
sql
);
streamObj
.
smaId
=
smaObj
.
uid
;
streamObj
.
smaId
=
smaObj
.
uid
;
streamObj
.
watermark
=
pCreate
->
watermark
;
streamObj
.
watermark
=
pCreate
->
watermark
;
streamObj
.
deleteMark
=
pCreate
->
deleteMark
;
streamObj
.
deleteMark
=
pCreate
->
deleteMark
;
streamObj
.
fillHistory
=
STREAM_FILL_HISTORY_ON
;
streamObj
.
fillHistory
=
STREAM_FILL_HISTORY_ON
;
streamObj
.
trigger
=
STREAM_TRIGGER_WINDOW_CLOSE
;
streamObj
.
trigger
=
STREAM_TRIGGER_WINDOW_CLOSE
;
streamObj
.
triggerParam
=
pCreate
->
maxDelay
;
streamObj
.
triggerParam
=
pCreate
->
maxDelay
;
streamObj
.
ast
=
s
trdup
(
smaObj
.
ast
);
streamObj
.
ast
=
taosS
trdup
(
smaObj
.
ast
);
// check the maxDelay
// check the maxDelay
if
(
streamObj
.
triggerParam
<
TSDB_MIN_ROLLUP_MAX_DELAY
)
{
if
(
streamObj
.
triggerParam
<
TSDB_MIN_ROLLUP_MAX_DELAY
)
{
...
...
source/dnode/mnode/impl/src/mndStb.c
浏览文件 @
22aa0330
...
@@ -1734,7 +1734,7 @@ static int32_t mndBuildStbCfgImp(SDbObj *pDb, SStbObj *pStb, const char *tbName,
...
@@ -1734,7 +1734,7 @@ static int32_t mndBuildStbCfgImp(SDbObj *pDb, SStbObj *pStb, const char *tbName,
pRsp
->
ttl
=
pStb
->
ttl
;
pRsp
->
ttl
=
pStb
->
ttl
;
pRsp
->
commentLen
=
pStb
->
commentLen
;
pRsp
->
commentLen
=
pStb
->
commentLen
;
if
(
pStb
->
commentLen
>
0
)
{
if
(
pStb
->
commentLen
>
0
)
{
pRsp
->
pComment
=
s
trdup
(
pStb
->
comment
);
pRsp
->
pComment
=
taosS
trdup
(
pStb
->
comment
);
}
}
for
(
int32_t
i
=
0
;
i
<
pStb
->
numOfColumns
;
++
i
)
{
for
(
int32_t
i
=
0
;
i
<
pStb
->
numOfColumns
;
++
i
)
{
...
...
source/dnode/mnode/impl/src/mndTopic.c
浏览文件 @
22aa0330
...
@@ -379,7 +379,7 @@ static int32_t mndCreateTopic(SMnode *pMnode, SRpcMsg *pReq, SCMCreateTopicReq *
...
@@ -379,7 +379,7 @@ static int32_t mndCreateTopic(SMnode *pMnode, SRpcMsg *pReq, SCMCreateTopicReq *
topicObj
.
uid
=
mndGenerateUid
(
pCreate
->
name
,
strlen
(
pCreate
->
name
));
topicObj
.
uid
=
mndGenerateUid
(
pCreate
->
name
,
strlen
(
pCreate
->
name
));
topicObj
.
dbUid
=
pDb
->
uid
;
topicObj
.
dbUid
=
pDb
->
uid
;
topicObj
.
version
=
1
;
topicObj
.
version
=
1
;
topicObj
.
sql
=
s
trdup
(
pCreate
->
sql
);
topicObj
.
sql
=
taosS
trdup
(
pCreate
->
sql
);
topicObj
.
sqlLen
=
strlen
(
pCreate
->
sql
)
+
1
;
topicObj
.
sqlLen
=
strlen
(
pCreate
->
sql
)
+
1
;
topicObj
.
subType
=
pCreate
->
subType
;
topicObj
.
subType
=
pCreate
->
subType
;
topicObj
.
withMeta
=
pCreate
->
withMeta
;
topicObj
.
withMeta
=
pCreate
->
withMeta
;
...
@@ -392,7 +392,7 @@ static int32_t mndCreateTopic(SMnode *pMnode, SRpcMsg *pReq, SCMCreateTopicReq *
...
@@ -392,7 +392,7 @@ static int32_t mndCreateTopic(SMnode *pMnode, SRpcMsg *pReq, SCMCreateTopicReq *
}
}
if
(
pCreate
->
subType
==
TOPIC_SUB_TYPE__COLUMN
)
{
if
(
pCreate
->
subType
==
TOPIC_SUB_TYPE__COLUMN
)
{
topicObj
.
ast
=
s
trdup
(
pCreate
->
ast
);
topicObj
.
ast
=
taosS
trdup
(
pCreate
->
ast
);
topicObj
.
astLen
=
strlen
(
pCreate
->
ast
)
+
1
;
topicObj
.
astLen
=
strlen
(
pCreate
->
ast
)
+
1
;
qDebugL
(
"ast %s"
,
topicObj
.
ast
);
qDebugL
(
"ast %s"
,
topicObj
.
ast
);
...
...
source/dnode/mnode/impl/test/trans/trans2.cpp
浏览文件 @
22aa0330
...
@@ -124,7 +124,7 @@ class MndTestTrans2 : public ::testing::Test {
...
@@ -124,7 +124,7 @@ class MndTestTrans2 : public ::testing::Test {
mndTransAppendUndolog(pTrans, pUndoRaw);
mndTransAppendUndolog(pTrans, pUndoRaw);
sdbSetRawStatus(pUndoRaw, SDB_STATUS_DROPPED);
sdbSetRawStatus(pUndoRaw, SDB_STATUS_DROPPED);
char *param =
s
trdup("====> test log <=====");
char *param =
taosS
trdup("====> test log <=====");
mndTransSetCb(pTrans, TRANS_START_FUNC_TEST, TRANS_STOP_FUNC_TEST, param, strlen(param) + 1);
mndTransSetCb(pTrans, TRANS_START_FUNC_TEST, TRANS_STOP_FUNC_TEST, param, strlen(param) + 1);
if (pDb != NULL) {
if (pDb != NULL) {
...
@@ -157,7 +157,7 @@ class MndTestTrans2 : public ::testing::Test {
...
@@ -157,7 +157,7 @@ class MndTestTrans2 : public ::testing::Test {
mndTransAppendUndolog(pTrans, pUndoRaw);
mndTransAppendUndolog(pTrans, pUndoRaw);
sdbSetRawStatus(pUndoRaw, SDB_STATUS_DROPPED);
sdbSetRawStatus(pUndoRaw, SDB_STATUS_DROPPED);
char *param =
s
trdup("====> test action <=====");
char *param =
taosS
trdup("====> test action <=====");
mndTransSetCb(pTrans, TRANS_START_FUNC_TEST, TRANS_STOP_FUNC_TEST, param, strlen(param) + 1);
mndTransSetCb(pTrans, TRANS_START_FUNC_TEST, TRANS_STOP_FUNC_TEST, param, strlen(param) + 1);
{
{
...
@@ -229,7 +229,7 @@ class MndTestTrans2 : public ::testing::Test {
...
@@ -229,7 +229,7 @@ class MndTestTrans2 : public ::testing::Test {
mndTransAppendUndolog(pTrans, pUndoRaw);
mndTransAppendUndolog(pTrans, pUndoRaw);
sdbSetRawStatus(pUndoRaw, SDB_STATUS_DROPPED);
sdbSetRawStatus(pUndoRaw, SDB_STATUS_DROPPED);
char *param =
s
trdup("====> test log <=====");
char *param =
taosS
trdup("====> test log <=====");
mndTransSetCb(pTrans, TRANS_START_FUNC_TEST, TRANS_STOP_FUNC_TEST, param, strlen(param) + 1);
mndTransSetCb(pTrans, TRANS_START_FUNC_TEST, TRANS_STOP_FUNC_TEST, param, strlen(param) + 1);
int32_t code = mndTransPrepare(pMnode, pTrans);
int32_t code = mndTransPrepare(pMnode, pTrans);
...
...
source/dnode/mnode/sdb/src/sdb.c
浏览文件 @
22aa0330
...
@@ -30,9 +30,9 @@ SSdb *sdbInit(SSdbOpt *pOption) {
...
@@ -30,9 +30,9 @@ SSdb *sdbInit(SSdbOpt *pOption) {
char
path
[
PATH_MAX
+
100
]
=
{
0
};
char
path
[
PATH_MAX
+
100
]
=
{
0
};
snprintf
(
path
,
sizeof
(
path
),
"%s%sdata"
,
pOption
->
path
,
TD_DIRSEP
);
snprintf
(
path
,
sizeof
(
path
),
"%s%sdata"
,
pOption
->
path
,
TD_DIRSEP
);
pSdb
->
currDir
=
s
trdup
(
path
);
pSdb
->
currDir
=
taosS
trdup
(
path
);
snprintf
(
path
,
sizeof
(
path
),
"%s%stmp"
,
pOption
->
path
,
TD_DIRSEP
);
snprintf
(
path
,
sizeof
(
path
),
"%s%stmp"
,
pOption
->
path
,
TD_DIRSEP
);
pSdb
->
tmpDir
=
s
trdup
(
path
);
pSdb
->
tmpDir
=
taosS
trdup
(
path
);
if
(
pSdb
->
currDir
==
NULL
||
pSdb
->
tmpDir
==
NULL
)
{
if
(
pSdb
->
currDir
==
NULL
||
pSdb
->
tmpDir
==
NULL
)
{
sdbCleanup
(
pSdb
);
sdbCleanup
(
pSdb
);
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
...
...
source/dnode/mnode/sdb/src/sdbFile.c
浏览文件 @
22aa0330
...
@@ -521,7 +521,7 @@ static SSdbIter *sdbCreateIter(SSdb *pSdb) {
...
@@ -521,7 +521,7 @@ static SSdbIter *sdbCreateIter(SSdb *pSdb) {
char
name
[
PATH_MAX
+
100
]
=
{
0
};
char
name
[
PATH_MAX
+
100
]
=
{
0
};
snprintf
(
name
,
sizeof
(
name
),
"%s%ssdb.data.%"
PRIu64
,
pSdb
->
tmpDir
,
TD_DIRSEP
,
(
uint64_t
)
pIter
);
snprintf
(
name
,
sizeof
(
name
),
"%s%ssdb.data.%"
PRIu64
,
pSdb
->
tmpDir
,
TD_DIRSEP
,
(
uint64_t
)
pIter
);
pIter
->
name
=
s
trdup
(
name
);
pIter
->
name
=
taosS
trdup
(
name
);
if
(
pIter
->
name
==
NULL
)
{
if
(
pIter
->
name
==
NULL
)
{
taosMemoryFree
(
pIter
);
taosMemoryFree
(
pIter
);
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
...
...
source/dnode/snode/src/snode.c
浏览文件 @
22aa0330
...
@@ -104,7 +104,7 @@ SSnode *sndOpen(const char *path, const SSnodeOpt *pOption) {
...
@@ -104,7 +104,7 @@ SSnode *sndOpen(const char *path, const SSnodeOpt *pOption) {
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
return
NULL
;
return
NULL
;
}
}
pSnode
->
path
=
s
trdup
(
path
);
pSnode
->
path
=
taosS
trdup
(
path
);
if
(
pSnode
->
path
==
NULL
)
{
if
(
pSnode
->
path
==
NULL
)
{
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
goto
FAIL
;
goto
FAIL
;
...
...
source/dnode/vnode/src/meta/metaSnapshot.c
浏览文件 @
22aa0330
...
@@ -252,7 +252,7 @@ static void saveSuperTableInfoForChildTable(SMetaEntry* me, SHashObj* suidInfo)
...
@@ -252,7 +252,7 @@ static void saveSuperTableInfoForChildTable(SMetaEntry* me, SHashObj* suidInfo)
return
;
return
;
}
}
STableInfoForChildTable
dataTmp
=
{
0
};
STableInfoForChildTable
dataTmp
=
{
0
};
dataTmp
.
tableName
=
s
trdup
(
me
->
name
);
dataTmp
.
tableName
=
taosS
trdup
(
me
->
name
);
dataTmp
.
schemaRow
=
tCloneSSchemaWrapper
(
&
me
->
stbEntry
.
schemaRow
);
dataTmp
.
schemaRow
=
tCloneSSchemaWrapper
(
&
me
->
stbEntry
.
schemaRow
);
dataTmp
.
tagRow
=
tCloneSSchemaWrapper
(
&
me
->
stbEntry
.
schemaTag
);
dataTmp
.
tagRow
=
tCloneSSchemaWrapper
(
&
me
->
stbEntry
.
schemaTag
);
...
...
source/dnode/vnode/src/sma/smaRollup.c
浏览文件 @
22aa0330
...
@@ -262,7 +262,7 @@ static int32_t tdSetRSmaInfoItemParams(SSma *pSma, SRSmaParam *param, SRSmaStat
...
@@ -262,7 +262,7 @@ static int32_t tdSetRSmaInfoItemParams(SSma *pSma, SRSmaParam *param, SRSmaStat
// set the backend of stream state
// set the backend of stream state
tdRSmaQTaskInfoGetFullPathEx
(
TD_VID
(
pVnode
),
pRSmaInfo
->
suid
,
idx
+
1
,
tfsGetPrimaryPath
(
pVnode
->
pTfs
),
taskInfDir
);
tdRSmaQTaskInfoGetFullPathEx
(
TD_VID
(
pVnode
),
pRSmaInfo
->
suid
,
idx
+
1
,
tfsGetPrimaryPath
(
pVnode
->
pTfs
),
taskInfDir
);
if
(
!
taosCheckExistFile
(
taskInfDir
))
{
if
(
!
taosCheckExistFile
(
taskInfDir
))
{
char
*
s
=
s
trdup
(
taskInfDir
);
char
*
s
=
taosS
trdup
(
taskInfDir
);
if
(
taosMulMkDir
(
taosDirName
(
s
))
!=
0
)
{
if
(
taosMulMkDir
(
taosDirName
(
s
))
!=
0
)
{
terrno
=
TAOS_SYSTEM_ERROR
(
errno
);
terrno
=
TAOS_SYSTEM_ERROR
(
errno
);
taosMemoryFree
(
s
);
taosMemoryFree
(
s
);
...
...
source/dnode/vnode/src/sma/smaTimeRange.c
浏览文件 @
22aa0330
...
@@ -208,7 +208,7 @@ int32_t smaBlockToSubmit(SVnode *pVnode, const SArray *pBlocks, const STSchema *
...
@@ -208,7 +208,7 @@ int32_t smaBlockToSubmit(SVnode *pVnode, const SArray *pBlocks, const STSchema *
// set super table name
// set super table name
SName
name
=
{
0
};
SName
name
=
{
0
};
tNameFromString
(
&
name
,
stbFullName
,
T_NAME_ACCT
|
T_NAME_DB
|
T_NAME_TABLE
);
tNameFromString
(
&
name
,
stbFullName
,
T_NAME_ACCT
|
T_NAME_DB
|
T_NAME_TABLE
);
pCreateTbReq
->
ctb
.
stbName
=
strdup
((
char
*
)
tNameGetTableName
(
&
name
));
// s
trdup(stbFullName);
pCreateTbReq
->
ctb
.
stbName
=
taosStrdup
((
char
*
)
tNameGetTableName
(
&
name
));
// taosS
trdup(stbFullName);
// set tag content
// set tag content
taosArrayClear
(
tagArray
);
taosArrayClear
(
tagArray
);
...
@@ -237,7 +237,7 @@ int32_t smaBlockToSubmit(SVnode *pVnode, const SArray *pBlocks, const STSchema *
...
@@ -237,7 +237,7 @@ int32_t smaBlockToSubmit(SVnode *pVnode, const SArray *pBlocks, const STSchema *
// set table name
// set table name
if
(
pDataBlock
->
info
.
parTbName
[
0
])
{
if
(
pDataBlock
->
info
.
parTbName
[
0
])
{
pCreateTbReq
->
name
=
s
trdup
(
pDataBlock
->
info
.
parTbName
);
pCreateTbReq
->
name
=
taosS
trdup
(
pDataBlock
->
info
.
parTbName
);
}
else
{
}
else
{
pCreateTbReq
->
name
=
buildCtbNameByGroupId
(
stbFullName
,
pDataBlock
->
info
.
id
.
groupId
);
pCreateTbReq
->
name
=
buildCtbNameByGroupId
(
stbFullName
,
pDataBlock
->
info
.
id
.
groupId
);
}
}
...
...
source/dnode/vnode/src/tq/tq.c
浏览文件 @
22aa0330
...
@@ -78,7 +78,7 @@ STQ* tqOpen(const char* path, SVnode* pVnode) {
...
@@ -78,7 +78,7 @@ STQ* tqOpen(const char* path, SVnode* pVnode) {
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
return
NULL
;
return
NULL
;
}
}
pTq
->
path
=
s
trdup
(
path
);
pTq
->
path
=
taosS
trdup
(
path
);
pTq
->
pVnode
=
pVnode
;
pTq
->
pVnode
=
pVnode
;
pTq
->
walLogLastVer
=
pVnode
->
pWal
->
vers
.
lastVer
;
pTq
->
walLogLastVer
=
pVnode
->
pWal
->
vers
.
lastVer
;
...
...
source/dnode/vnode/src/tq/tqExec.c
浏览文件 @
22aa0330
...
@@ -52,7 +52,7 @@ static int32_t tqAddTbNameToRsp(const STQ* pTq, int64_t uid, STaosxRsp* pRsp, in
...
@@ -52,7 +52,7 @@ static int32_t tqAddTbNameToRsp(const STQ* pTq, int64_t uid, STaosxRsp* pRsp, in
return
-
1
;
return
-
1
;
}
}
for
(
int32_t
i
=
0
;
i
<
n
;
i
++
)
{
for
(
int32_t
i
=
0
;
i
<
n
;
i
++
)
{
char
*
tbName
=
s
trdup
(
mr
.
me
.
name
);
char
*
tbName
=
taosS
trdup
(
mr
.
me
.
name
);
taosArrayPush
(
pRsp
->
blockTbName
,
&
tbName
);
taosArrayPush
(
pRsp
->
blockTbName
,
&
tbName
);
}
}
metaReaderClear
(
&
mr
);
metaReaderClear
(
&
mr
);
...
@@ -157,7 +157,7 @@ int32_t tqScanTaosx(STQ* pTq, const STqHandle* pHandle, STaosxRsp* pRsp, SMqMeta
...
@@ -157,7 +157,7 @@ int32_t tqScanTaosx(STQ* pTq, const STqHandle* pHandle, STaosxRsp* pRsp, SMqMeta
continue
;
continue
;
}
}
}
else
{
}
else
{
char
*
tbName
=
s
trdup
(
qExtractTbnameFromTask
(
task
));
char
*
tbName
=
taosS
trdup
(
qExtractTbnameFromTask
(
task
));
taosArrayPush
(
pRsp
->
blockTbName
,
&
tbName
);
taosArrayPush
(
pRsp
->
blockTbName
,
&
tbName
);
}
}
}
}
...
...
source/dnode/vnode/src/tq/tqSink.c
浏览文件 @
22aa0330
...
@@ -130,7 +130,7 @@ void tqSinkToTablePipeline(SStreamTask* pTask, void* vnode, int64_t ver, void* d
...
@@ -130,7 +130,7 @@ void tqSinkToTablePipeline(SStreamTask* pTask, void* vnode, int64_t ver, void* d
char
*
ctbName
=
NULL
;
char
*
ctbName
=
NULL
;
// set child table name
// set child table name
if
(
pDataBlock
->
info
.
parTbName
[
0
])
{
if
(
pDataBlock
->
info
.
parTbName
[
0
])
{
ctbName
=
s
trdup
(
pDataBlock
->
info
.
parTbName
);
ctbName
=
taosS
trdup
(
pDataBlock
->
info
.
parTbName
);
}
else
{
}
else
{
ctbName
=
buildCtbNameByGroupId
(
stbFullName
,
pDataBlock
->
info
.
id
.
groupId
);
ctbName
=
buildCtbNameByGroupId
(
stbFullName
,
pDataBlock
->
info
.
id
.
groupId
);
}
}
...
@@ -155,7 +155,7 @@ void tqSinkToTablePipeline(SStreamTask* pTask, void* vnode, int64_t ver, void* d
...
@@ -155,7 +155,7 @@ void tqSinkToTablePipeline(SStreamTask* pTask, void* vnode, int64_t ver, void* d
// set super table name
// set super table name
SName
name
=
{
0
};
SName
name
=
{
0
};
tNameFromString
(
&
name
,
stbFullName
,
T_NAME_ACCT
|
T_NAME_DB
|
T_NAME_TABLE
);
tNameFromString
(
&
name
,
stbFullName
,
T_NAME_ACCT
|
T_NAME_DB
|
T_NAME_TABLE
);
createTbReq
.
ctb
.
stbName
=
strdup
((
char
*
)
tNameGetTableName
(
&
name
));
// s
trdup(stbFullName);
createTbReq
.
ctb
.
stbName
=
taosStrdup
((
char
*
)
tNameGetTableName
(
&
name
));
// taosS
trdup(stbFullName);
createTbReq
.
name
=
ctbName
;
createTbReq
.
name
=
ctbName
;
ctbName
=
NULL
;
ctbName
=
NULL
;
...
@@ -453,7 +453,7 @@ void tqSinkToTablePipeline2(SStreamTask* pTask, void* vnode, int64_t ver, void*
...
@@ -453,7 +453,7 @@ void tqSinkToTablePipeline2(SStreamTask* pTask, void* vnode, int64_t ver, void*
// set super table name
// set super table name
SName
name
=
{
0
};
SName
name
=
{
0
};
tNameFromString
(
&
name
,
stbFullName
,
T_NAME_ACCT
|
T_NAME_DB
|
T_NAME_TABLE
);
tNameFromString
(
&
name
,
stbFullName
,
T_NAME_ACCT
|
T_NAME_DB
|
T_NAME_TABLE
);
pCreateTbReq
->
ctb
.
stbName
=
strdup
((
char
*
)
tNameGetTableName
(
&
name
));
// s
trdup(stbFullName);
pCreateTbReq
->
ctb
.
stbName
=
taosStrdup
((
char
*
)
tNameGetTableName
(
&
name
));
// taosS
trdup(stbFullName);
// set tag content
// set tag content
int32_t
size
=
taosArrayGetSize
(
pDataBlock
->
pDataBlock
);
int32_t
size
=
taosArrayGetSize
(
pDataBlock
->
pDataBlock
);
...
@@ -544,7 +544,7 @@ void tqSinkToTablePipeline2(SStreamTask* pTask, void* vnode, int64_t ver, void*
...
@@ -544,7 +544,7 @@ void tqSinkToTablePipeline2(SStreamTask* pTask, void* vnode, int64_t ver, void*
char
*
ctbName
=
NULL
;
char
*
ctbName
=
NULL
;
tqDebug
(
"vgId:%d, stream write into %s, table auto created"
,
TD_VID
(
pVnode
),
pDataBlock
->
info
.
parTbName
);
tqDebug
(
"vgId:%d, stream write into %s, table auto created"
,
TD_VID
(
pVnode
),
pDataBlock
->
info
.
parTbName
);
if
(
pDataBlock
->
info
.
parTbName
[
0
])
{
if
(
pDataBlock
->
info
.
parTbName
[
0
])
{
ctbName
=
s
trdup
(
pDataBlock
->
info
.
parTbName
);
ctbName
=
taosS
trdup
(
pDataBlock
->
info
.
parTbName
);
}
else
{
}
else
{
ctbName
=
buildCtbNameByGroupId
(
stbFullName
,
pDataBlock
->
info
.
id
.
groupId
);
ctbName
=
buildCtbNameByGroupId
(
stbFullName
,
pDataBlock
->
info
.
id
.
groupId
);
}
}
...
@@ -569,7 +569,7 @@ void tqSinkToTablePipeline2(SStreamTask* pTask, void* vnode, int64_t ver, void*
...
@@ -569,7 +569,7 @@ void tqSinkToTablePipeline2(SStreamTask* pTask, void* vnode, int64_t ver, void*
// set super table name
// set super table name
SName
name
=
{
0
};
SName
name
=
{
0
};
tNameFromString
(
&
name
,
stbFullName
,
T_NAME_ACCT
|
T_NAME_DB
|
T_NAME_TABLE
);
tNameFromString
(
&
name
,
stbFullName
,
T_NAME_ACCT
|
T_NAME_DB
|
T_NAME_TABLE
);
pCreateTbReq
->
ctb
.
stbName
=
strdup
((
char
*
)
tNameGetTableName
(
&
name
));
// s
trdup(stbFullName);
pCreateTbReq
->
ctb
.
stbName
=
taosStrdup
((
char
*
)
tNameGetTableName
(
&
name
));
// taosS
trdup(stbFullName);
// set tag content
// set tag content
tagArray
=
taosArrayInit
(
1
,
sizeof
(
STagVal
));
tagArray
=
taosArrayInit
(
1
,
sizeof
(
STagVal
));
...
...
source/dnode/vnode/src/tsdb/tsdbCacheRead.c
浏览文件 @
22aa0330
...
@@ -190,7 +190,7 @@ int32_t tsdbCacherowsReaderOpen(void* pVnode, int32_t type, void* pTableIdList,
...
@@ -190,7 +190,7 @@ int32_t tsdbCacherowsReaderOpen(void* pVnode, int32_t type, void* pTableIdList,
return
TSDB_CODE_OUT_OF_MEMORY
;
return
TSDB_CODE_OUT_OF_MEMORY
;
}
}
p
->
idstr
=
taos
MemoryStrD
up
(
idstr
);
p
->
idstr
=
taos
Strd
up
(
idstr
);
taosThreadMutexInit
(
&
p
->
readerMutex
,
NULL
);
taosThreadMutexInit
(
&
p
->
readerMutex
,
NULL
);
*
pReader
=
p
;
*
pReader
=
p
;
...
...
source/dnode/vnode/src/tsdb/tsdbRead.c
浏览文件 @
22aa0330
...
@@ -677,7 +677,7 @@ static int32_t tsdbReaderCreate(SVnode* pVnode, SQueryTableDataCond* pCond, STsd
...
@@ -677,7 +677,7 @@ static int32_t tsdbReaderCreate(SVnode* pVnode, SQueryTableDataCond* pCond, STsd
pReader
->
order
=
pCond
->
order
;
pReader
->
order
=
pCond
->
order
;
pReader
->
capacity
=
capacity
;
pReader
->
capacity
=
capacity
;
pReader
->
pResBlock
=
pResBlock
;
pReader
->
pResBlock
=
pResBlock
;
pReader
->
idStr
=
(
idstr
!=
NULL
)
?
s
trdup
(
idstr
)
:
NULL
;
pReader
->
idStr
=
(
idstr
!=
NULL
)
?
taosS
trdup
(
idstr
)
:
NULL
;
pReader
->
verRange
=
getQueryVerRange
(
pVnode
,
pCond
,
level
);
pReader
->
verRange
=
getQueryVerRange
(
pVnode
,
pCond
,
level
);
pReader
->
type
=
pCond
->
type
;
pReader
->
type
=
pCond
->
type
;
pReader
->
window
=
updateQueryTimeWindow
(
pReader
->
pTsdb
,
&
pCond
->
twindows
);
pReader
->
window
=
updateQueryTimeWindow
(
pReader
->
pTsdb
,
&
pCond
->
twindows
);
...
...
source/dnode/vnode/src/vnd/vnodeQuery.c
浏览文件 @
22aa0330
...
@@ -197,7 +197,7 @@ int vnodeGetTableCfg(SVnode *pVnode, SRpcMsg *pMsg, bool direct) {
...
@@ -197,7 +197,7 @@ int vnodeGetTableCfg(SVnode *pVnode, SRpcMsg *pMsg, bool direct) {
cfgRsp
.
ttl
=
mer1
.
me
.
ctbEntry
.
ttlDays
;
cfgRsp
.
ttl
=
mer1
.
me
.
ctbEntry
.
ttlDays
;
cfgRsp
.
commentLen
=
mer1
.
me
.
ctbEntry
.
commentLen
;
cfgRsp
.
commentLen
=
mer1
.
me
.
ctbEntry
.
commentLen
;
if
(
mer1
.
me
.
ctbEntry
.
commentLen
>
0
)
{
if
(
mer1
.
me
.
ctbEntry
.
commentLen
>
0
)
{
cfgRsp
.
pComment
=
s
trdup
(
mer1
.
me
.
ctbEntry
.
comment
);
cfgRsp
.
pComment
=
taosS
trdup
(
mer1
.
me
.
ctbEntry
.
comment
);
}
}
STag
*
pTag
=
(
STag
*
)
mer1
.
me
.
ctbEntry
.
pTags
;
STag
*
pTag
=
(
STag
*
)
mer1
.
me
.
ctbEntry
.
pTags
;
cfgRsp
.
tagsLen
=
pTag
->
len
;
cfgRsp
.
tagsLen
=
pTag
->
len
;
...
@@ -208,7 +208,7 @@ int vnodeGetTableCfg(SVnode *pVnode, SRpcMsg *pMsg, bool direct) {
...
@@ -208,7 +208,7 @@ int vnodeGetTableCfg(SVnode *pVnode, SRpcMsg *pMsg, bool direct) {
cfgRsp
.
ttl
=
mer1
.
me
.
ntbEntry
.
ttlDays
;
cfgRsp
.
ttl
=
mer1
.
me
.
ntbEntry
.
ttlDays
;
cfgRsp
.
commentLen
=
mer1
.
me
.
ntbEntry
.
commentLen
;
cfgRsp
.
commentLen
=
mer1
.
me
.
ntbEntry
.
commentLen
;
if
(
mer1
.
me
.
ntbEntry
.
commentLen
>
0
)
{
if
(
mer1
.
me
.
ntbEntry
.
commentLen
>
0
)
{
cfgRsp
.
pComment
=
s
trdup
(
mer1
.
me
.
ntbEntry
.
comment
);
cfgRsp
.
pComment
=
taosS
trdup
(
mer1
.
me
.
ntbEntry
.
comment
);
}
}
}
else
{
}
else
{
ASSERT
(
0
);
ASSERT
(
0
);
...
...
source/libs/catalog/src/ctgDbg.c
浏览文件 @
22aa0330
...
@@ -281,7 +281,7 @@ int32_t ctgdHandleDbgCommand(char *command) {
...
@@ -281,7 +281,7 @@ int32_t ctgdHandleDbgCommand(char *command) {
CTG_RET
(
TSDB_CODE_INVALID_PARA
);
CTG_RET
(
TSDB_CODE_INVALID_PARA
);
}
}
char
*
dup
=
s
trdup
(
command
);
char
*
dup
=
taosS
trdup
(
command
);
char
*
option
=
NULL
;
char
*
option
=
NULL
;
char
*
param
=
NULL
;
char
*
param
=
NULL
;
...
...
source/libs/catalog/src/ctgUtil.c
浏览文件 @
22aa0330
...
@@ -742,7 +742,7 @@ int32_t ctgUpdateMsgCtx(SCtgMsgCtx* pCtx, int32_t reqType, void* out, char* targ
...
@@ -742,7 +742,7 @@ int32_t ctgUpdateMsgCtx(SCtgMsgCtx* pCtx, int32_t reqType, void* out, char* targ
pCtx
->
reqType
=
reqType
;
pCtx
->
reqType
=
reqType
;
pCtx
->
out
=
out
;
pCtx
->
out
=
out
;
if
(
target
)
{
if
(
target
)
{
pCtx
->
target
=
s
trdup
(
target
);
pCtx
->
target
=
taosS
trdup
(
target
);
if
(
NULL
==
pCtx
->
target
)
{
if
(
NULL
==
pCtx
->
target
)
{
CTG_ERR_RET
(
TSDB_CODE_OUT_OF_MEMORY
);
CTG_ERR_RET
(
TSDB_CODE_OUT_OF_MEMORY
);
}
}
...
@@ -759,7 +759,7 @@ int32_t ctgAddMsgCtx(SArray* pCtxs, int32_t reqType, void* out, char* target) {
...
@@ -759,7 +759,7 @@ int32_t ctgAddMsgCtx(SArray* pCtxs, int32_t reqType, void* out, char* target) {
ctx
.
reqType
=
reqType
;
ctx
.
reqType
=
reqType
;
ctx
.
out
=
out
;
ctx
.
out
=
out
;
if
(
target
)
{
if
(
target
)
{
ctx
.
target
=
s
trdup
(
target
);
ctx
.
target
=
taosS
trdup
(
target
);
if
(
NULL
==
ctx
.
target
)
{
if
(
NULL
==
ctx
.
target
)
{
CTG_ERR_RET
(
TSDB_CODE_OUT_OF_MEMORY
);
CTG_ERR_RET
(
TSDB_CODE_OUT_OF_MEMORY
);
}
}
...
@@ -1169,7 +1169,7 @@ int32_t ctgCloneTableIndex(SArray* pIndex, SArray** pRes) {
...
@@ -1169,7 +1169,7 @@ int32_t ctgCloneTableIndex(SArray* pIndex, SArray** pRes) {
for
(
int32_t
i
=
0
;
i
<
num
;
++
i
)
{
for
(
int32_t
i
=
0
;
i
<
num
;
++
i
)
{
STableIndexInfo
*
pInfo
=
taosArrayGet
(
pIndex
,
i
);
STableIndexInfo
*
pInfo
=
taosArrayGet
(
pIndex
,
i
);
pInfo
=
taosArrayPush
(
*
pRes
,
pInfo
);
pInfo
=
taosArrayPush
(
*
pRes
,
pInfo
);
pInfo
->
expr
=
s
trdup
(
pInfo
->
expr
);
pInfo
->
expr
=
taosS
trdup
(
pInfo
->
expr
);
}
}
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
...
@@ -1179,7 +1179,7 @@ int32_t ctgUpdateSendTargetInfo(SMsgSendInfo* pMsgSendInfo, int32_t msgType, cha
...
@@ -1179,7 +1179,7 @@ int32_t ctgUpdateSendTargetInfo(SMsgSendInfo* pMsgSendInfo, int32_t msgType, cha
if
(
msgType
==
TDMT_VND_TABLE_META
||
msgType
==
TDMT_VND_TABLE_CFG
||
msgType
==
TDMT_VND_BATCH_META
)
{
if
(
msgType
==
TDMT_VND_TABLE_META
||
msgType
==
TDMT_VND_TABLE_CFG
||
msgType
==
TDMT_VND_BATCH_META
)
{
pMsgSendInfo
->
target
.
type
=
TARGET_TYPE_VNODE
;
pMsgSendInfo
->
target
.
type
=
TARGET_TYPE_VNODE
;
pMsgSendInfo
->
target
.
vgId
=
vgId
;
pMsgSendInfo
->
target
.
vgId
=
vgId
;
pMsgSendInfo
->
target
.
dbFName
=
s
trdup
(
dbFName
);
pMsgSendInfo
->
target
.
dbFName
=
taosS
trdup
(
dbFName
);
}
else
{
}
else
{
pMsgSendInfo
->
target
.
type
=
TARGET_TYPE_MNODE
;
pMsgSendInfo
->
target
.
type
=
TARGET_TYPE_MNODE
;
}
}
...
...
source/libs/executor/src/executil.c
浏览文件 @
22aa0330
...
@@ -1529,7 +1529,7 @@ SqlFunctionCtx* createSqlFunctionCtx(SExprInfo* pExprInfo, int32_t numOfOutput,
...
@@ -1529,7 +1529,7 @@ SqlFunctionCtx* createSqlFunctionCtx(SExprInfo* pExprInfo, int32_t numOfOutput,
fmGetFuncExecFuncs
(
pCtx
->
functionId
,
&
pCtx
->
fpSet
);
fmGetFuncExecFuncs
(
pCtx
->
functionId
,
&
pCtx
->
fpSet
);
}
else
{
}
else
{
char
*
udfName
=
pExpr
->
pExpr
->
_function
.
pFunctNode
->
functionName
;
char
*
udfName
=
pExpr
->
pExpr
->
_function
.
pFunctNode
->
functionName
;
pCtx
->
udfName
=
s
trdup
(
udfName
);
pCtx
->
udfName
=
taosS
trdup
(
udfName
);
fmGetUdafExecFuncs
(
pCtx
->
functionId
,
&
pCtx
->
fpSet
);
fmGetUdafExecFuncs
(
pCtx
->
functionId
,
&
pCtx
->
fpSet
);
}
}
pCtx
->
fpSet
.
getEnv
(
pExpr
->
pExpr
->
_function
.
pFunctNode
,
&
env
);
pCtx
->
fpSet
.
getEnv
(
pExpr
->
pExpr
->
_function
.
pFunctNode
,
&
env
);
...
...
source/libs/executor/src/executorimpl.c
浏览文件 @
22aa0330
...
@@ -2000,7 +2000,7 @@ static SExecTaskInfo* createExecTaskInfo(uint64_t queryId, uint64_t taskId, EOPT
...
@@ -2000,7 +2000,7 @@ static SExecTaskInfo* createExecTaskInfo(uint64_t queryId, uint64_t taskId, EOPT
setTaskStatus
(
pTaskInfo
,
TASK_NOT_COMPLETED
);
setTaskStatus
(
pTaskInfo
,
TASK_NOT_COMPLETED
);
pTaskInfo
->
schemaInfo
.
dbname
=
s
trdup
(
dbFName
);
pTaskInfo
->
schemaInfo
.
dbname
=
taosS
trdup
(
dbFName
);
pTaskInfo
->
execModel
=
model
;
pTaskInfo
->
execModel
=
model
;
pTaskInfo
->
pTableInfoList
=
tableListCreate
();
pTaskInfo
->
pTableInfoList
=
tableListCreate
();
pTaskInfo
->
stopInfo
.
pStopInfo
=
taosArrayInit
(
4
,
sizeof
(
SExchangeOpStopInfo
));
pTaskInfo
->
stopInfo
.
pStopInfo
=
taosArrayInit
(
4
,
sizeof
(
SExchangeOpStopInfo
));
...
@@ -2026,7 +2026,7 @@ int32_t extractTableSchemaInfo(SReadHandle* pHandle, SScanPhysiNode* pScanNode,
...
@@ -2026,7 +2026,7 @@ int32_t extractTableSchemaInfo(SReadHandle* pHandle, SScanPhysiNode* pScanNode,
}
}
SSchemaInfo
*
pSchemaInfo
=
&
pTaskInfo
->
schemaInfo
;
SSchemaInfo
*
pSchemaInfo
=
&
pTaskInfo
->
schemaInfo
;
pSchemaInfo
->
tablename
=
s
trdup
(
mr
.
me
.
name
);
pSchemaInfo
->
tablename
=
taosS
trdup
(
mr
.
me
.
name
);
if
(
mr
.
me
.
type
==
TSDB_SUPER_TABLE
)
{
if
(
mr
.
me
.
type
==
TSDB_SUPER_TABLE
)
{
pSchemaInfo
->
sw
=
tCloneSSchemaWrapper
(
&
mr
.
me
.
stbEntry
.
schemaRow
);
pSchemaInfo
->
sw
=
tCloneSSchemaWrapper
(
&
mr
.
me
.
stbEntry
.
schemaRow
);
...
...
source/libs/executor/src/scanoperator.c
浏览文件 @
22aa0330
...
@@ -434,7 +434,7 @@ static void freeTableCachedVal(void* param) {
...
@@ -434,7 +434,7 @@ static void freeTableCachedVal(void* param) {
static
STableCachedVal
*
createTableCacheVal
(
const
SMetaReader
*
pMetaReader
)
{
static
STableCachedVal
*
createTableCacheVal
(
const
SMetaReader
*
pMetaReader
)
{
STableCachedVal
*
pVal
=
taosMemoryMalloc
(
sizeof
(
STableCachedVal
));
STableCachedVal
*
pVal
=
taosMemoryMalloc
(
sizeof
(
STableCachedVal
));
pVal
->
pName
=
s
trdup
(
pMetaReader
->
me
.
name
);
pVal
->
pName
=
taosS
trdup
(
pMetaReader
->
me
.
name
);
pVal
->
pTags
=
NULL
;
pVal
->
pTags
=
NULL
;
// only child table has tag value
// only child table has tag value
...
...
source/libs/executor/src/sysscanoperator.c
浏览文件 @
22aa0330
...
@@ -1709,7 +1709,7 @@ SOperatorInfo* createSysTableScanOperatorInfo(void* readHandle, SSystemTableScan
...
@@ -1709,7 +1709,7 @@ SOperatorInfo* createSysTableScanOperatorInfo(void* readHandle, SSystemTableScan
extractTbnameSlotId
(
pInfo
,
pScanNode
);
extractTbnameSlotId
(
pInfo
,
pScanNode
);
pInfo
->
accountId
=
pScanPhyNode
->
accountId
;
pInfo
->
accountId
=
pScanPhyNode
->
accountId
;
pInfo
->
pUser
=
taos
MemoryStrD
up
((
void
*
)
pUser
);
pInfo
->
pUser
=
taos
Strd
up
((
void
*
)
pUser
);
pInfo
->
sysInfo
=
pScanPhyNode
->
sysInfo
;
pInfo
->
sysInfo
=
pScanPhyNode
->
sysInfo
;
pInfo
->
showRewrite
=
pScanPhyNode
->
showRewrite
;
pInfo
->
showRewrite
=
pScanPhyNode
->
showRewrite
;
pInfo
->
pRes
=
createDataBlockFromDescNode
(
pDescNode
);
pInfo
->
pRes
=
createDataBlockFromDescNode
(
pDescNode
);
...
...
source/libs/executor/src/tsort.c
浏览文件 @
22aa0330
...
@@ -90,7 +90,7 @@ SSortHandle* tsortCreateSortHandle(SArray* pSortInfo, int32_t type, int32_t page
...
@@ -90,7 +90,7 @@ SSortHandle* tsortCreateSortHandle(SArray* pSortInfo, int32_t type, int32_t page
tsortSetComparFp
(
pSortHandle
,
msortComparFn
);
tsortSetComparFp
(
pSortHandle
,
msortComparFn
);
if
(
idstr
!=
NULL
)
{
if
(
idstr
!=
NULL
)
{
pSortHandle
->
idStr
=
s
trdup
(
idstr
);
pSortHandle
->
idStr
=
taosS
trdup
(
idstr
);
}
}
return
pSortHandle
;
return
pSortHandle
;
...
...
source/libs/index/src/index.c
浏览文件 @
22aa0330
...
@@ -126,7 +126,7 @@ int indexOpen(SIndexOpts* opts, const char* path, SIndex** index) {
...
@@ -126,7 +126,7 @@ int indexOpen(SIndexOpts* opts, const char* path, SIndex** index) {
idx
->
colObj
=
taosHashInit
(
8
,
taosGetDefaultHashFunction
(
TSDB_DATA_TYPE_BINARY
),
true
,
HASH_ENTRY_LOCK
);
idx
->
colObj
=
taosHashInit
(
8
,
taosGetDefaultHashFunction
(
TSDB_DATA_TYPE_BINARY
),
true
,
HASH_ENTRY_LOCK
);
idx
->
version
=
1
;
idx
->
version
=
1
;
idx
->
path
=
t
s
trdup
(
path
);
idx
->
path
=
t
aosS
trdup
(
path
);
taosThreadMutexInit
(
&
idx
->
mtx
,
NULL
);
taosThreadMutexInit
(
&
idx
->
mtx
,
NULL
);
tsem_init
(
&
idx
->
sem
,
0
,
0
);
tsem_init
(
&
idx
->
sem
,
0
,
0
);
...
...
source/libs/index/src/indexCache.c
浏览文件 @
22aa0330
...
@@ -340,7 +340,7 @@ IndexCache* idxCacheCreate(SIndex* idx, uint64_t suid, const char* colName, int8
...
@@ -340,7 +340,7 @@ IndexCache* idxCacheCreate(SIndex* idx, uint64_t suid, const char* colName, int8
cache
->
mem
=
idxInternalCacheCreate
(
type
);
cache
->
mem
=
idxInternalCacheCreate
(
type
);
cache
->
mem
->
pCache
=
cache
;
cache
->
mem
->
pCache
=
cache
;
cache
->
colName
=
IDX_TYPE_CONTAIN_EXTERN_TYPE
(
type
,
TSDB_DATA_TYPE_JSON
)
?
t
strdup
(
JSON_COLUMN
)
:
ts
trdup
(
colName
);
cache
->
colName
=
IDX_TYPE_CONTAIN_EXTERN_TYPE
(
type
,
TSDB_DATA_TYPE_JSON
)
?
t
aosStrdup
(
JSON_COLUMN
)
:
taosS
trdup
(
colName
);
cache
->
type
=
type
;
cache
->
type
=
type
;
cache
->
index
=
idx
;
cache
->
index
=
idx
;
cache
->
version
=
0
;
cache
->
version
=
0
;
...
@@ -767,7 +767,7 @@ static bool idxCacheIteratorNext(Iterate* itera) {
...
@@ -767,7 +767,7 @@ static bool idxCacheIteratorNext(Iterate* itera) {
iv
->
type
=
ct
->
operaType
;
iv
->
type
=
ct
->
operaType
;
iv
->
ver
=
ct
->
version
;
iv
->
ver
=
ct
->
version
;
iv
->
colVal
=
t
s
trdup
(
ct
->
colVal
);
iv
->
colVal
=
t
aosS
trdup
(
ct
->
colVal
);
taosArrayPush
(
iv
->
val
,
&
ct
->
uid
);
taosArrayPush
(
iv
->
val
,
&
ct
->
uid
);
}
}
return
next
;
return
next
;
...
...
source/libs/index/src/indexFstAutomation.c
浏览文件 @
22aa0330
...
@@ -164,7 +164,7 @@ FAutoCtx* automCtxCreate(void* data, AutomationType atype) {
...
@@ -164,7 +164,7 @@ FAutoCtx* automCtxCreate(void* data, AutomationType atype) {
// add more search type
// add more search type
}
}
ctx
->
data
=
(
data
!=
NULL
?
s
trdup
((
char
*
)
data
)
:
NULL
);
ctx
->
data
=
(
data
!=
NULL
?
taosS
trdup
((
char
*
)
data
)
:
NULL
);
ctx
->
type
=
atype
;
ctx
->
type
=
atype
;
ctx
->
stdata
=
(
void
*
)
sv
;
ctx
->
stdata
=
(
void
*
)
sv
;
return
ctx
;
return
ctx
;
...
...
source/libs/index/src/indexFstRegex.c
浏览文件 @
22aa0330
...
@@ -23,7 +23,7 @@ FstRegex *regexCreate(const char *str) {
...
@@ -23,7 +23,7 @@ FstRegex *regexCreate(const char *str) {
return
NULL
;
return
NULL
;
}
}
regex
->
orig
=
t
s
trdup
(
str
);
regex
->
orig
=
t
aosS
trdup
(
str
);
// construct insts based on str
// construct insts based on str
SArray
*
insts
=
taosArrayInit
(
256
,
sizeof
(
uint8_t
));
SArray
*
insts
=
taosArrayInit
(
256
,
sizeof
(
uint8_t
));
...
...
source/libs/index/src/indexTfile.c
浏览文件 @
22aa0330
...
@@ -804,7 +804,7 @@ TFileValue* tfileValueCreate(char* val) {
...
@@ -804,7 +804,7 @@ TFileValue* tfileValueCreate(char* val) {
if
(
tf
==
NULL
)
{
if
(
tf
==
NULL
)
{
return
NULL
;
return
NULL
;
}
}
tf
->
colVal
=
t
s
trdup
(
val
);
tf
->
colVal
=
t
aosS
trdup
(
val
);
tf
->
tableId
=
taosArrayInit
(
32
,
sizeof
(
uint64_t
));
tf
->
tableId
=
taosArrayInit
(
32
,
sizeof
(
uint64_t
));
return
tf
;
return
tf
;
}
}
...
...
source/libs/index/test/fstTest.cc
浏览文件 @
22aa0330
...
@@ -599,7 +599,7 @@ void validateTFile(char* arg) {
...
@@ -599,7 +599,7 @@ void validateTFile(char* arg) {
std
::
thread
threads
[
NUM_OF_THREAD
];
std
::
thread
threads
[
NUM_OF_THREAD
];
// std::vector<std::thread> threads;
// std::vector<std::thread> threads;
SIndex
*
index
=
(
SIndex
*
)
taosMemoryCalloc
(
1
,
sizeof
(
SIndex
));
SIndex
*
index
=
(
SIndex
*
)
taosMemoryCalloc
(
1
,
sizeof
(
SIndex
));
index
->
path
=
s
trdup
(
arg
);
index
->
path
=
taosS
trdup
(
arg
);
TFileReader
*
reader
=
tfileReaderOpen
(
index
,
0
,
20000000
,
"tag1"
);
TFileReader
*
reader
=
tfileReaderOpen
(
index
,
0
,
20000000
,
"tag1"
);
for
(
int
i
=
0
;
i
<
NUM_OF_THREAD
;
i
++
)
{
for
(
int
i
=
0
;
i
<
NUM_OF_THREAD
;
i
++
)
{
...
...
source/libs/nodes/src/nodesCloneFuncs.c
浏览文件 @
22aa0330
...
@@ -40,7 +40,7 @@
...
@@ -40,7 +40,7 @@
if (NULL == (pSrc)->fldname) { \
if (NULL == (pSrc)->fldname) { \
break; \
break; \
} \
} \
(pDst)->fldname =
s
trdup((pSrc)->fldname); \
(pDst)->fldname =
taosS
trdup((pSrc)->fldname); \
if (NULL == (pDst)->fldname) { \
if (NULL == (pDst)->fldname) { \
return TSDB_CODE_OUT_OF_MEMORY; \
return TSDB_CODE_OUT_OF_MEMORY; \
} \
} \
...
...
source/libs/nodes/test/nodesTestMain.cpp
浏览文件 @
22aa0330
...
@@ -28,7 +28,7 @@ static EDealRes rewriterTest(SNode** pNode, void* pContext) {
...
@@ -28,7 +28,7 @@ static EDealRes rewriterTest(SNode** pNode, void* pContext) {
}
}
SValueNode
*
pVal
=
(
SValueNode
*
)
nodesMakeNode
(
QUERY_NODE_VALUE
);
SValueNode
*
pVal
=
(
SValueNode
*
)
nodesMakeNode
(
QUERY_NODE_VALUE
);
string
tmp
=
to_string
(
stoi
(((
SValueNode
*
)(
pOp
->
pLeft
))
->
literal
)
+
stoi
(((
SValueNode
*
)(
pOp
->
pRight
))
->
literal
));
string
tmp
=
to_string
(
stoi
(((
SValueNode
*
)(
pOp
->
pLeft
))
->
literal
)
+
stoi
(((
SValueNode
*
)(
pOp
->
pRight
))
->
literal
));
pVal
->
literal
=
s
trdup
(
tmp
.
c_str
());
pVal
->
literal
=
taosS
trdup
(
tmp
.
c_str
());
nodesDestroyNode
(
*
pNode
);
nodesDestroyNode
(
*
pNode
);
*
pNode
=
(
SNode
*
)
pVal
;
*
pNode
=
(
SNode
*
)
pVal
;
}
}
...
@@ -40,12 +40,12 @@ TEST(NodesTest, traverseTest) {
...
@@ -40,12 +40,12 @@ TEST(NodesTest, traverseTest) {
SOperatorNode
*
pOp
=
(
SOperatorNode
*
)
pRoot
;
SOperatorNode
*
pOp
=
(
SOperatorNode
*
)
pRoot
;
SOperatorNode
*
pLeft
=
(
SOperatorNode
*
)
nodesMakeNode
(
QUERY_NODE_OPERATOR
);
SOperatorNode
*
pLeft
=
(
SOperatorNode
*
)
nodesMakeNode
(
QUERY_NODE_OPERATOR
);
pLeft
->
pLeft
=
(
SNode
*
)
nodesMakeNode
(
QUERY_NODE_VALUE
);
pLeft
->
pLeft
=
(
SNode
*
)
nodesMakeNode
(
QUERY_NODE_VALUE
);
((
SValueNode
*
)(
pLeft
->
pLeft
))
->
literal
=
s
trdup
(
"10"
);
((
SValueNode
*
)(
pLeft
->
pLeft
))
->
literal
=
taosS
trdup
(
"10"
);
pLeft
->
pRight
=
(
SNode
*
)
nodesMakeNode
(
QUERY_NODE_VALUE
);
pLeft
->
pRight
=
(
SNode
*
)
nodesMakeNode
(
QUERY_NODE_VALUE
);
((
SValueNode
*
)(
pLeft
->
pRight
))
->
literal
=
s
trdup
(
"5"
);
((
SValueNode
*
)(
pLeft
->
pRight
))
->
literal
=
taosS
trdup
(
"5"
);
pOp
->
pLeft
=
(
SNode
*
)
pLeft
;
pOp
->
pLeft
=
(
SNode
*
)
pLeft
;
pOp
->
pRight
=
(
SNode
*
)
nodesMakeNode
(
QUERY_NODE_VALUE
);
pOp
->
pRight
=
(
SNode
*
)
nodesMakeNode
(
QUERY_NODE_VALUE
);
((
SValueNode
*
)(
pOp
->
pRight
))
->
literal
=
s
trdup
(
"3"
);
((
SValueNode
*
)(
pOp
->
pRight
))
->
literal
=
taosS
trdup
(
"3"
);
EXPECT_EQ
(
nodeType
(
pRoot
),
QUERY_NODE_OPERATOR
);
EXPECT_EQ
(
nodeType
(
pRoot
),
QUERY_NODE_OPERATOR
);
EDealRes
res
=
DEAL_RES_CONTINUE
;
EDealRes
res
=
DEAL_RES_CONTINUE
;
...
...
source/libs/parser/src/parAstCreater.c
浏览文件 @
22aa0330
...
@@ -355,7 +355,7 @@ SNode* createDefaultDatabaseCondValue(SAstCreateContext* pCxt) {
...
@@ -355,7 +355,7 @@ SNode* createDefaultDatabaseCondValue(SAstCreateContext* pCxt) {
SValueNode
*
val
=
(
SValueNode
*
)
nodesMakeNode
(
QUERY_NODE_VALUE
);
SValueNode
*
val
=
(
SValueNode
*
)
nodesMakeNode
(
QUERY_NODE_VALUE
);
CHECK_OUT_OF_MEM
(
val
);
CHECK_OUT_OF_MEM
(
val
);
val
->
literal
=
s
trdup
(
pCxt
->
pQueryCxt
->
db
);
val
->
literal
=
taosS
trdup
(
pCxt
->
pQueryCxt
->
db
);
CHECK_OUT_OF_MEM
(
val
->
literal
);
CHECK_OUT_OF_MEM
(
val
->
literal
);
val
->
isDuration
=
false
;
val
->
isDuration
=
false
;
val
->
translate
=
false
;
val
->
translate
=
false
;
...
...
source/libs/parser/src/parInsertSql.c
浏览文件 @
22aa0330
...
@@ -449,7 +449,7 @@ static int32_t parseTagToken(const char** end, SToken* pToken, SSchema* pSchema,
...
@@ -449,7 +449,7 @@ static int32_t parseTagToken(const char** end, SToken* pToken, SSchema* pSchema,
if
(
pToken
->
n
+
VARSTR_HEADER_SIZE
>
pSchema
->
bytes
)
{
if
(
pToken
->
n
+
VARSTR_HEADER_SIZE
>
pSchema
->
bytes
)
{
return
generateSyntaxErrMsg
(
pMsgBuf
,
TSDB_CODE_PAR_VALUE_TOO_LONG
,
pSchema
->
name
);
return
generateSyntaxErrMsg
(
pMsgBuf
,
TSDB_CODE_PAR_VALUE_TOO_LONG
,
pSchema
->
name
);
}
}
val
->
pData
=
s
trdup
(
pToken
->
z
);
val
->
pData
=
taosS
trdup
(
pToken
->
z
);
val
->
nData
=
pToken
->
n
;
val
->
nData
=
pToken
->
n
;
break
;
break
;
}
}
...
...
source/libs/parser/src/parInsertUtil.c
浏览文件 @
22aa0330
...
@@ -144,10 +144,10 @@ int16_t insFindCol(SToken* pColname, int16_t start, int16_t end, SSchema* pSchem
...
@@ -144,10 +144,10 @@ int16_t insFindCol(SToken* pColname, int16_t start, int16_t end, SSchema* pSchem
void
insBuildCreateTbReq
(
SVCreateTbReq
*
pTbReq
,
const
char
*
tname
,
STag
*
pTag
,
int64_t
suid
,
const
char
*
sname
,
void
insBuildCreateTbReq
(
SVCreateTbReq
*
pTbReq
,
const
char
*
tname
,
STag
*
pTag
,
int64_t
suid
,
const
char
*
sname
,
SArray
*
tagName
,
uint8_t
tagNum
,
int32_t
ttl
)
{
SArray
*
tagName
,
uint8_t
tagNum
,
int32_t
ttl
)
{
pTbReq
->
type
=
TD_CHILD_TABLE
;
pTbReq
->
type
=
TD_CHILD_TABLE
;
pTbReq
->
name
=
s
trdup
(
tname
);
pTbReq
->
name
=
taosS
trdup
(
tname
);
pTbReq
->
ctb
.
suid
=
suid
;
pTbReq
->
ctb
.
suid
=
suid
;
pTbReq
->
ctb
.
tagNum
=
tagNum
;
pTbReq
->
ctb
.
tagNum
=
tagNum
;
if
(
sname
)
pTbReq
->
ctb
.
stbName
=
s
trdup
(
sname
);
if
(
sname
)
pTbReq
->
ctb
.
stbName
=
taosS
trdup
(
sname
);
pTbReq
->
ctb
.
pTag
=
(
uint8_t
*
)
pTag
;
pTbReq
->
ctb
.
pTag
=
(
uint8_t
*
)
pTag
;
pTbReq
->
ctb
.
tagName
=
taosArrayDup
(
tagName
,
NULL
);
pTbReq
->
ctb
.
tagName
=
taosArrayDup
(
tagName
,
NULL
);
pTbReq
->
ttl
=
ttl
;
pTbReq
->
ttl
=
ttl
;
...
...
source/libs/parser/src/parTranslater.c
浏览文件 @
22aa0330
...
@@ -1692,7 +1692,7 @@ static int32_t rewriteFuncToValue(STranslateContext* pCxt, char* pLiteral, SNode
...
@@ -1692,7 +1692,7 @@ static int32_t rewriteFuncToValue(STranslateContext* pCxt, char* pLiteral, SNode
static
int32_t
rewriteDatabaseFunc
(
STranslateContext
*
pCxt
,
SNode
**
pNode
)
{
static
int32_t
rewriteDatabaseFunc
(
STranslateContext
*
pCxt
,
SNode
**
pNode
)
{
char
*
pCurrDb
=
NULL
;
char
*
pCurrDb
=
NULL
;
if
(
NULL
!=
pCxt
->
pParseCxt
->
db
)
{
if
(
NULL
!=
pCxt
->
pParseCxt
->
db
)
{
pCurrDb
=
taos
MemoryStrD
up
((
void
*
)
pCxt
->
pParseCxt
->
db
);
pCurrDb
=
taos
Strd
up
((
void
*
)
pCxt
->
pParseCxt
->
db
);
if
(
NULL
==
pCurrDb
)
{
if
(
NULL
==
pCurrDb
)
{
return
TSDB_CODE_OUT_OF_MEMORY
;
return
TSDB_CODE_OUT_OF_MEMORY
;
}
}
...
@@ -1701,7 +1701,7 @@ static int32_t rewriteDatabaseFunc(STranslateContext* pCxt, SNode** pNode) {
...
@@ -1701,7 +1701,7 @@ static int32_t rewriteDatabaseFunc(STranslateContext* pCxt, SNode** pNode) {
}
}
static
int32_t
rewriteClentVersionFunc
(
STranslateContext
*
pCxt
,
SNode
**
pNode
)
{
static
int32_t
rewriteClentVersionFunc
(
STranslateContext
*
pCxt
,
SNode
**
pNode
)
{
char
*
pVer
=
taos
MemoryStrD
up
((
void
*
)
version
);
char
*
pVer
=
taos
Strd
up
((
void
*
)
version
);
if
(
NULL
==
pVer
)
{
if
(
NULL
==
pVer
)
{
return
TSDB_CODE_OUT_OF_MEMORY
;
return
TSDB_CODE_OUT_OF_MEMORY
;
}
}
...
@@ -1709,7 +1709,7 @@ static int32_t rewriteClentVersionFunc(STranslateContext* pCxt, SNode** pNode) {
...
@@ -1709,7 +1709,7 @@ static int32_t rewriteClentVersionFunc(STranslateContext* pCxt, SNode** pNode) {
}
}
static
int32_t
rewriteServerVersionFunc
(
STranslateContext
*
pCxt
,
SNode
**
pNode
)
{
static
int32_t
rewriteServerVersionFunc
(
STranslateContext
*
pCxt
,
SNode
**
pNode
)
{
char
*
pVer
=
taos
MemoryStrD
up
((
void
*
)
pCxt
->
pParseCxt
->
svrVer
);
char
*
pVer
=
taos
Strd
up
((
void
*
)
pCxt
->
pParseCxt
->
svrVer
);
if
(
NULL
==
pVer
)
{
if
(
NULL
==
pVer
)
{
return
TSDB_CODE_OUT_OF_MEMORY
;
return
TSDB_CODE_OUT_OF_MEMORY
;
}
}
...
@@ -1720,7 +1720,7 @@ static int32_t rewriteServerStatusFunc(STranslateContext* pCxt, SNode** pNode) {
...
@@ -1720,7 +1720,7 @@ static int32_t rewriteServerStatusFunc(STranslateContext* pCxt, SNode** pNode) {
if
(
pCxt
->
pParseCxt
->
nodeOffline
)
{
if
(
pCxt
->
pParseCxt
->
nodeOffline
)
{
return
TSDB_CODE_RPC_NETWORK_UNAVAIL
;
return
TSDB_CODE_RPC_NETWORK_UNAVAIL
;
}
}
char
*
pStatus
=
taos
MemoryStrD
up
((
void
*
)
"1"
);
char
*
pStatus
=
taos
Strd
up
((
void
*
)
"1"
);
return
rewriteFuncToValue
(
pCxt
,
pStatus
,
pNode
);
return
rewriteFuncToValue
(
pCxt
,
pStatus
,
pNode
);
}
}
...
@@ -1728,7 +1728,7 @@ static int32_t rewriteUserFunc(STranslateContext* pCxt, SNode** pNode) {
...
@@ -1728,7 +1728,7 @@ static int32_t rewriteUserFunc(STranslateContext* pCxt, SNode** pNode) {
char
userConn
[
TSDB_USER_LEN
+
1
+
TSDB_FQDN_LEN
]
=
{
0
};
// format 'user@host'
char
userConn
[
TSDB_USER_LEN
+
1
+
TSDB_FQDN_LEN
]
=
{
0
};
// format 'user@host'
int32_t
len
=
snprintf
(
userConn
,
sizeof
(
userConn
),
"%s@"
,
pCxt
->
pParseCxt
->
pUser
);
int32_t
len
=
snprintf
(
userConn
,
sizeof
(
userConn
),
"%s@"
,
pCxt
->
pParseCxt
->
pUser
);
taosGetFqdn
(
userConn
+
len
);
taosGetFqdn
(
userConn
+
len
);
char
*
pUserConn
=
taos
MemoryStrD
up
((
void
*
)
userConn
);
char
*
pUserConn
=
taos
Strd
up
((
void
*
)
userConn
);
if
(
NULL
==
pUserConn
)
{
if
(
NULL
==
pUserConn
)
{
return
TSDB_CODE_OUT_OF_MEMORY
;
return
TSDB_CODE_OUT_OF_MEMORY
;
}
}
...
@@ -4910,7 +4910,7 @@ static int32_t buildCreateStbReq(STranslateContext* pCxt, SCreateTableStmt* pStm
...
@@ -4910,7 +4910,7 @@ static int32_t buildCreateStbReq(STranslateContext* pCxt, SCreateTableStmt* pStm
pReq
->
numOfColumns
=
LIST_LENGTH
(
pStmt
->
pCols
);
pReq
->
numOfColumns
=
LIST_LENGTH
(
pStmt
->
pCols
);
pReq
->
numOfTags
=
LIST_LENGTH
(
pStmt
->
pTags
);
pReq
->
numOfTags
=
LIST_LENGTH
(
pStmt
->
pTags
);
if
(
pStmt
->
pOptions
->
commentNull
==
false
)
{
if
(
pStmt
->
pOptions
->
commentNull
==
false
)
{
pReq
->
pComment
=
s
trdup
(
pStmt
->
pOptions
->
comment
);
pReq
->
pComment
=
taosS
trdup
(
pStmt
->
pOptions
->
comment
);
if
(
NULL
==
pReq
->
pComment
)
{
if
(
NULL
==
pReq
->
pComment
)
{
return
TSDB_CODE_OUT_OF_MEMORY
;
return
TSDB_CODE_OUT_OF_MEMORY
;
}
}
...
@@ -4978,7 +4978,7 @@ static int32_t buildAlterSuperTableReq(STranslateContext* pCxt, SAlterTableStmt*
...
@@ -4978,7 +4978,7 @@ static int32_t buildAlterSuperTableReq(STranslateContext* pCxt, SAlterTableStmt*
if
(
TSDB_ALTER_TABLE_UPDATE_OPTIONS
==
pStmt
->
alterType
)
{
if
(
TSDB_ALTER_TABLE_UPDATE_OPTIONS
==
pStmt
->
alterType
)
{
// pAlterReq->ttl = pStmt->pOptions->ttl;
// pAlterReq->ttl = pStmt->pOptions->ttl;
if
(
pStmt
->
pOptions
->
commentNull
==
false
)
{
if
(
pStmt
->
pOptions
->
commentNull
==
false
)
{
pAlterReq
->
comment
=
s
trdup
(
pStmt
->
pOptions
->
comment
);
pAlterReq
->
comment
=
taosS
trdup
(
pStmt
->
pOptions
->
comment
);
if
(
NULL
==
pAlterReq
->
comment
)
{
if
(
NULL
==
pAlterReq
->
comment
)
{
return
TSDB_CODE_OUT_OF_MEMORY
;
return
TSDB_CODE_OUT_OF_MEMORY
;
}
}
...
@@ -5267,7 +5267,7 @@ static int32_t getSmaIndexDstVgId(STranslateContext* pCxt, const char* pDbName,
...
@@ -5267,7 +5267,7 @@ static int32_t getSmaIndexDstVgId(STranslateContext* pCxt, const char* pDbName,
}
}
static
int32_t
getSmaIndexSql
(
STranslateContext
*
pCxt
,
char
**
pSql
,
int32_t
*
pLen
)
{
static
int32_t
getSmaIndexSql
(
STranslateContext
*
pCxt
,
char
**
pSql
,
int32_t
*
pLen
)
{
*
pSql
=
s
trdup
(
pCxt
->
pParseCxt
->
pSql
);
*
pSql
=
taosS
trdup
(
pCxt
->
pParseCxt
->
pSql
);
if
(
NULL
==
*
pSql
)
{
if
(
NULL
==
*
pSql
)
{
return
TSDB_CODE_OUT_OF_MEMORY
;
return
TSDB_CODE_OUT_OF_MEMORY
;
}
}
...
@@ -5505,7 +5505,7 @@ static int32_t buildCreateTopicReq(STranslateContext* pCxt, SCreateTopicStmt* pS
...
@@ -5505,7 +5505,7 @@ static int32_t buildCreateTopicReq(STranslateContext* pCxt, SCreateTopicStmt* pS
pReq
->
igExists
=
pStmt
->
ignoreExists
;
pReq
->
igExists
=
pStmt
->
ignoreExists
;
pReq
->
withMeta
=
pStmt
->
withMeta
;
pReq
->
withMeta
=
pStmt
->
withMeta
;
pReq
->
sql
=
s
trdup
(
pCxt
->
pParseCxt
->
pSql
);
pReq
->
sql
=
taosS
trdup
(
pCxt
->
pParseCxt
->
pSql
);
if
(
NULL
==
pReq
->
sql
)
{
if
(
NULL
==
pReq
->
sql
)
{
return
TSDB_CODE_OUT_OF_MEMORY
;
return
TSDB_CODE_OUT_OF_MEMORY
;
}
}
...
@@ -6252,7 +6252,7 @@ static int32_t buildCreateStreamReq(STranslateContext* pCxt, SCreateStreamStmt*
...
@@ -6252,7 +6252,7 @@ static int32_t buildCreateStreamReq(STranslateContext* pCxt, SCreateStreamStmt*
int32_t
code
=
buildCreateStreamQuery
(
pCxt
,
pStmt
,
pReq
);
int32_t
code
=
buildCreateStreamQuery
(
pCxt
,
pStmt
,
pReq
);
if
(
TSDB_CODE_SUCCESS
==
code
)
{
if
(
TSDB_CODE_SUCCESS
==
code
)
{
pReq
->
sql
=
s
trdup
(
pCxt
->
pParseCxt
->
pSql
);
pReq
->
sql
=
taosS
trdup
(
pCxt
->
pParseCxt
->
pSql
);
if
(
NULL
==
pReq
->
sql
)
{
if
(
NULL
==
pReq
->
sql
)
{
code
=
TSDB_CODE_OUT_OF_MEMORY
;
code
=
TSDB_CODE_OUT_OF_MEMORY
;
}
}
...
@@ -7144,10 +7144,10 @@ static int32_t buildNormalTableBatchReq(int32_t acctId, const SCreateTableStmt*
...
@@ -7144,10 +7144,10 @@ static int32_t buildNormalTableBatchReq(int32_t acctId, const SCreateTableStmt*
SVCreateTbReq
req
=
{
0
};
SVCreateTbReq
req
=
{
0
};
req
.
type
=
TD_NORMAL_TABLE
;
req
.
type
=
TD_NORMAL_TABLE
;
req
.
name
=
s
trdup
(
pStmt
->
tableName
);
req
.
name
=
taosS
trdup
(
pStmt
->
tableName
);
req
.
ttl
=
pStmt
->
pOptions
->
ttl
;
req
.
ttl
=
pStmt
->
pOptions
->
ttl
;
if
(
pStmt
->
pOptions
->
commentNull
==
false
)
{
if
(
pStmt
->
pOptions
->
commentNull
==
false
)
{
req
.
comment
=
s
trdup
(
pStmt
->
pOptions
->
comment
);
req
.
comment
=
taosS
trdup
(
pStmt
->
pOptions
->
comment
);
if
(
NULL
==
req
.
comment
)
{
if
(
NULL
==
req
.
comment
)
{
tdDestroySVCreateTbReq
(
&
req
);
tdDestroySVCreateTbReq
(
&
req
);
return
TSDB_CODE_OUT_OF_MEMORY
;
return
TSDB_CODE_OUT_OF_MEMORY
;
...
@@ -7306,17 +7306,17 @@ static void addCreateTbReqIntoVgroup(int32_t acctId, SHashObj* pVgroupHashmap, S
...
@@ -7306,17 +7306,17 @@ static void addCreateTbReqIntoVgroup(int32_t acctId, SHashObj* pVgroupHashmap, S
struct
SVCreateTbReq
req
=
{
0
};
struct
SVCreateTbReq
req
=
{
0
};
req
.
type
=
TD_CHILD_TABLE
;
req
.
type
=
TD_CHILD_TABLE
;
req
.
name
=
s
trdup
(
pStmt
->
tableName
);
req
.
name
=
taosS
trdup
(
pStmt
->
tableName
);
req
.
ttl
=
pStmt
->
pOptions
->
ttl
;
req
.
ttl
=
pStmt
->
pOptions
->
ttl
;
if
(
pStmt
->
pOptions
->
commentNull
==
false
)
{
if
(
pStmt
->
pOptions
->
commentNull
==
false
)
{
req
.
comment
=
s
trdup
(
pStmt
->
pOptions
->
comment
);
req
.
comment
=
taosS
trdup
(
pStmt
->
pOptions
->
comment
);
req
.
commentLen
=
strlen
(
pStmt
->
pOptions
->
comment
);
req
.
commentLen
=
strlen
(
pStmt
->
pOptions
->
comment
);
}
else
{
}
else
{
req
.
commentLen
=
-
1
;
req
.
commentLen
=
-
1
;
}
}
req
.
ctb
.
suid
=
suid
;
req
.
ctb
.
suid
=
suid
;
req
.
ctb
.
tagNum
=
tagNum
;
req
.
ctb
.
tagNum
=
tagNum
;
req
.
ctb
.
stbName
=
s
trdup
(
sTableNmae
);
req
.
ctb
.
stbName
=
taosS
trdup
(
sTableNmae
);
req
.
ctb
.
pTag
=
(
uint8_t
*
)
pTag
;
req
.
ctb
.
pTag
=
(
uint8_t
*
)
pTag
;
req
.
ctb
.
tagName
=
taosArrayDup
(
tagName
,
NULL
);
req
.
ctb
.
tagName
=
taosArrayDup
(
tagName
,
NULL
);
if
(
pStmt
->
ignoreExists
)
{
if
(
pStmt
->
ignoreExists
)
{
...
@@ -7798,7 +7798,7 @@ static int32_t buildUpdateTagValReq(STranslateContext* pCxt, SAlterTableStmt* pS
...
@@ -7798,7 +7798,7 @@ static int32_t buildUpdateTagValReq(STranslateContext* pCxt, SAlterTableStmt* pS
pStmt
->
colName
);
pStmt
->
colName
);
}
}
pReq
->
tagName
=
s
trdup
(
pStmt
->
colName
);
pReq
->
tagName
=
taosS
trdup
(
pStmt
->
colName
);
if
(
NULL
==
pReq
->
tagName
)
{
if
(
NULL
==
pReq
->
tagName
)
{
return
TSDB_CODE_OUT_OF_MEMORY
;
return
TSDB_CODE_OUT_OF_MEMORY
;
}
}
...
@@ -7871,7 +7871,7 @@ static int32_t buildAddColReq(STranslateContext* pCxt, SAlterTableStmt* pStmt, S
...
@@ -7871,7 +7871,7 @@ static int32_t buildAddColReq(STranslateContext* pCxt, SAlterTableStmt* pStmt, S
return
generateSyntaxErrMsg
(
&
pCxt
->
msgBuf
,
TSDB_CODE_PAR_INVALID_ROW_LENGTH
,
TSDB_MAX_BYTES_PER_ROW
);
return
generateSyntaxErrMsg
(
&
pCxt
->
msgBuf
,
TSDB_CODE_PAR_INVALID_ROW_LENGTH
,
TSDB_MAX_BYTES_PER_ROW
);
}
}
pReq
->
colName
=
s
trdup
(
pStmt
->
colName
);
pReq
->
colName
=
taosS
trdup
(
pStmt
->
colName
);
if
(
NULL
==
pReq
->
colName
)
{
if
(
NULL
==
pReq
->
colName
)
{
return
TSDB_CODE_OUT_OF_MEMORY
;
return
TSDB_CODE_OUT_OF_MEMORY
;
}
}
...
@@ -7894,7 +7894,7 @@ static int32_t buildDropColReq(STranslateContext* pCxt, SAlterTableStmt* pStmt,
...
@@ -7894,7 +7894,7 @@ static int32_t buildDropColReq(STranslateContext* pCxt, SAlterTableStmt* pStmt,
return
generateSyntaxErrMsg
(
&
pCxt
->
msgBuf
,
TSDB_CODE_PAR_CANNOT_DROP_PRIMARY_KEY
);
return
generateSyntaxErrMsg
(
&
pCxt
->
msgBuf
,
TSDB_CODE_PAR_CANNOT_DROP_PRIMARY_KEY
);
}
}
pReq
->
colName
=
s
trdup
(
pStmt
->
colName
);
pReq
->
colName
=
taosS
trdup
(
pStmt
->
colName
);
if
(
NULL
==
pReq
->
colName
)
{
if
(
NULL
==
pReq
->
colName
)
{
return
TSDB_CODE_OUT_OF_MEMORY
;
return
TSDB_CODE_OUT_OF_MEMORY
;
}
}
...
@@ -7919,7 +7919,7 @@ static int32_t buildUpdateColReq(STranslateContext* pCxt, SAlterTableStmt* pStmt
...
@@ -7919,7 +7919,7 @@ static int32_t buildUpdateColReq(STranslateContext* pCxt, SAlterTableStmt* pStmt
return
generateSyntaxErrMsg
(
&
pCxt
->
msgBuf
,
TSDB_CODE_PAR_INVALID_ROW_LENGTH
,
TSDB_MAX_BYTES_PER_ROW
);
return
generateSyntaxErrMsg
(
&
pCxt
->
msgBuf
,
TSDB_CODE_PAR_INVALID_ROW_LENGTH
,
TSDB_MAX_BYTES_PER_ROW
);
}
}
pReq
->
colName
=
s
trdup
(
pStmt
->
colName
);
pReq
->
colName
=
taosS
trdup
(
pStmt
->
colName
);
if
(
NULL
==
pReq
->
colName
)
{
if
(
NULL
==
pReq
->
colName
)
{
return
TSDB_CODE_OUT_OF_MEMORY
;
return
TSDB_CODE_OUT_OF_MEMORY
;
}
}
...
@@ -7937,8 +7937,8 @@ static int32_t buildRenameColReq(STranslateContext* pCxt, SAlterTableStmt* pStmt
...
@@ -7937,8 +7937,8 @@ static int32_t buildRenameColReq(STranslateContext* pCxt, SAlterTableStmt* pStmt
return
generateSyntaxErrMsg
(
&
pCxt
->
msgBuf
,
TSDB_CODE_PAR_DUPLICATED_COLUMN
);
return
generateSyntaxErrMsg
(
&
pCxt
->
msgBuf
,
TSDB_CODE_PAR_DUPLICATED_COLUMN
);
}
}
pReq
->
colName
=
s
trdup
(
pStmt
->
colName
);
pReq
->
colName
=
taosS
trdup
(
pStmt
->
colName
);
pReq
->
colNewName
=
s
trdup
(
pStmt
->
newColName
);
pReq
->
colNewName
=
taosS
trdup
(
pStmt
->
newColName
);
if
(
NULL
==
pReq
->
colName
||
NULL
==
pReq
->
colNewName
)
{
if
(
NULL
==
pReq
->
colName
||
NULL
==
pReq
->
colNewName
)
{
return
TSDB_CODE_OUT_OF_MEMORY
;
return
TSDB_CODE_OUT_OF_MEMORY
;
}
}
...
@@ -7955,7 +7955,7 @@ static int32_t buildUpdateOptionsReq(STranslateContext* pCxt, SAlterTableStmt* p
...
@@ -7955,7 +7955,7 @@ static int32_t buildUpdateOptionsReq(STranslateContext* pCxt, SAlterTableStmt* p
if
(
TSDB_CODE_SUCCESS
==
code
)
{
if
(
TSDB_CODE_SUCCESS
==
code
)
{
if
(
pStmt
->
pOptions
->
commentNull
==
false
)
{
if
(
pStmt
->
pOptions
->
commentNull
==
false
)
{
pReq
->
newComment
=
s
trdup
(
pStmt
->
pOptions
->
comment
);
pReq
->
newComment
=
taosS
trdup
(
pStmt
->
pOptions
->
comment
);
if
(
NULL
==
pReq
->
newComment
)
{
if
(
NULL
==
pReq
->
newComment
)
{
code
=
TSDB_CODE_OUT_OF_MEMORY
;
code
=
TSDB_CODE_OUT_OF_MEMORY
;
}
else
{
}
else
{
...
@@ -7971,7 +7971,7 @@ static int32_t buildUpdateOptionsReq(STranslateContext* pCxt, SAlterTableStmt* p
...
@@ -7971,7 +7971,7 @@ static int32_t buildUpdateOptionsReq(STranslateContext* pCxt, SAlterTableStmt* p
static
int32_t
buildAlterTbReq
(
STranslateContext
*
pCxt
,
SAlterTableStmt
*
pStmt
,
STableMeta
*
pTableMeta
,
static
int32_t
buildAlterTbReq
(
STranslateContext
*
pCxt
,
SAlterTableStmt
*
pStmt
,
STableMeta
*
pTableMeta
,
SVAlterTbReq
*
pReq
)
{
SVAlterTbReq
*
pReq
)
{
pReq
->
tbName
=
s
trdup
(
pStmt
->
tableName
);
pReq
->
tbName
=
taosS
trdup
(
pStmt
->
tableName
);
if
(
NULL
==
pReq
->
tbName
)
{
if
(
NULL
==
pReq
->
tbName
)
{
return
TSDB_CODE_OUT_OF_MEMORY
;
return
TSDB_CODE_OUT_OF_MEMORY
;
}
}
...
...
source/libs/parser/src/parUtil.c
浏览文件 @
22aa0330
...
@@ -971,7 +971,7 @@ static SArray* smaIndexesDup(SArray* pSrc) {
...
@@ -971,7 +971,7 @@ static SArray* smaIndexesDup(SArray* pSrc) {
}
}
for
(
int32_t
i
=
0
;
i
<
size
;
++
i
)
{
for
(
int32_t
i
=
0
;
i
<
size
;
++
i
)
{
STableIndexInfo
*
pIndex
=
taosArrayGet
(
pDst
,
i
);
STableIndexInfo
*
pIndex
=
taosArrayGet
(
pDst
,
i
);
pIndex
->
expr
=
taos
MemoryStrD
up
(((
STableIndexInfo
*
)
taosArrayGet
(
pSrc
,
i
))
->
expr
);
pIndex
->
expr
=
taos
Strd
up
(((
STableIndexInfo
*
)
taosArrayGet
(
pSrc
,
i
))
->
expr
);
if
(
NULL
==
pIndex
->
expr
)
{
if
(
NULL
==
pIndex
->
expr
)
{
taosArrayDestroyEx
(
pDst
,
destroySmaIndex
);
taosArrayDestroyEx
(
pDst
,
destroySmaIndex
);
return
NULL
;
return
NULL
;
...
...
source/libs/parser/test/mockCatalogService.cpp
浏览文件 @
22aa0330
...
@@ -331,7 +331,7 @@ class MockCatalogServiceImpl {
...
@@ -331,7 +331,7 @@ class MockCatalogServiceImpl {
info
.
dstTbUid
=
getNextId
();
info
.
dstTbUid
=
getNextId
();
info
.
dstVgId
=
pReq
->
dstVgId
;
info
.
dstVgId
=
pReq
->
dstVgId
;
genEpSet
(
&
info
.
epSet
);
genEpSet
(
&
info
.
epSet
);
info
.
expr
=
s
trdup
(
pReq
->
expr
);
info
.
expr
=
taosS
trdup
(
pReq
->
expr
);
auto
it
=
index_
.
find
(
pReq
->
stb
);
auto
it
=
index_
.
find
(
pReq
->
stb
);
if
(
index_
.
end
()
==
it
)
{
if
(
index_
.
end
()
==
it
)
{
index_
.
insert
(
std
::
make_pair
(
string
(
pReq
->
stb
),
std
::
vector
<
STableIndexInfo
>
{
info
}));
index_
.
insert
(
std
::
make_pair
(
string
(
pReq
->
stb
),
std
::
vector
<
STableIndexInfo
>
{
info
}));
...
@@ -374,7 +374,7 @@ class MockCatalogServiceImpl {
...
@@ -374,7 +374,7 @@ class MockCatalogServiceImpl {
STableIndexInfo
*
copyTableIndexInfo
(
STableIndexInfo
*
pDst
,
const
STableIndexInfo
*
pSrc
)
const
{
STableIndexInfo
*
copyTableIndexInfo
(
STableIndexInfo
*
pDst
,
const
STableIndexInfo
*
pSrc
)
const
{
memcpy
(
pDst
,
pSrc
,
sizeof
(
STableIndexInfo
));
memcpy
(
pDst
,
pSrc
,
sizeof
(
STableIndexInfo
));
pDst
->
expr
=
s
trdup
(
pSrc
->
expr
);
pDst
->
expr
=
taosS
trdup
(
pSrc
->
expr
);
return
pDst
;
return
pDst
;
}
}
...
...
source/libs/parser/test/parAlterToBalanceTest.cpp
浏览文件 @
22aa0330
...
@@ -382,7 +382,7 @@ TEST_F(ParserInitialATest, alterSTable) {
...
@@ -382,7 +382,7 @@ TEST_F(ParserInitialATest, alterSTable) {
expect
.
name
[
len
]
=
'\0'
;
expect
.
name
[
len
]
=
'\0'
;
expect
.
alterType
=
alterType
;
expect
.
alterType
=
alterType
;
if
(
nullptr
!=
pComment
)
{
if
(
nullptr
!=
pComment
)
{
expect
.
comment
=
s
trdup
(
pComment
);
expect
.
comment
=
taosS
trdup
(
pComment
);
expect
.
commentLen
=
strlen
(
pComment
);
expect
.
commentLen
=
strlen
(
pComment
);
}
}
...
...
source/libs/parser/test/parInitialCTest.cpp
浏览文件 @
22aa0330
...
@@ -603,7 +603,7 @@ TEST_F(ParserInitialCTest, createStable) {
...
@@ -603,7 +603,7 @@ TEST_F(ParserInitialCTest, createStable) {
expect
.
deleteMark2
=
deleteMark2
;
expect
.
deleteMark2
=
deleteMark2
;
// expect.ttl = ttl;
// expect.ttl = ttl;
if
(
nullptr
!=
pComment
)
{
if
(
nullptr
!=
pComment
)
{
expect
.
pComment
=
s
trdup
(
pComment
);
expect
.
pComment
=
taosS
trdup
(
pComment
);
expect
.
commentLen
=
strlen
(
pComment
);
expect
.
commentLen
=
strlen
(
pComment
);
}
}
};
};
...
@@ -780,7 +780,7 @@ TEST_F(ParserInitialCTest, createStream) {
...
@@ -780,7 +780,7 @@ TEST_F(ParserInitialCTest, createStream) {
snprintf
(
expect
.
sourceDB
,
sizeof
(
expect
.
sourceDB
),
"0.%s"
,
pSrcDb
);
snprintf
(
expect
.
sourceDB
,
sizeof
(
expect
.
sourceDB
),
"0.%s"
,
pSrcDb
);
snprintf
(
expect
.
targetStbFullName
,
sizeof
(
expect
.
targetStbFullName
),
"0.test.%s"
,
pDstStb
);
snprintf
(
expect
.
targetStbFullName
,
sizeof
(
expect
.
targetStbFullName
),
"0.test.%s"
,
pDstStb
);
expect
.
igExists
=
igExists
;
expect
.
igExists
=
igExists
;
expect
.
sql
=
s
trdup
(
pSql
);
expect
.
sql
=
taosS
trdup
(
pSql
);
expect
.
createStb
=
STREAM_CREATE_STABLE_TRUE
;
expect
.
createStb
=
STREAM_CREATE_STABLE_TRUE
;
expect
.
triggerType
=
STREAM_TRIGGER_AT_ONCE
;
expect
.
triggerType
=
STREAM_TRIGGER_AT_ONCE
;
expect
.
maxDelay
=
0
;
expect
.
maxDelay
=
0
;
...
@@ -934,13 +934,13 @@ TEST_F(ParserInitialCTest, createTable) {
...
@@ -934,13 +934,13 @@ TEST_F(ParserInitialCTest, createTable) {
auto
addCreateTbReq
=
[
&
](
const
char
*
pName
,
bool
ignoreExists
=
false
,
int32_t
ttl
=
TSDB_DEFAULT_TABLE_TTL
,
auto
addCreateTbReq
=
[
&
](
const
char
*
pName
,
bool
ignoreExists
=
false
,
int32_t
ttl
=
TSDB_DEFAULT_TABLE_TTL
,
const
char
*
pComment
=
nullptr
)
{
const
char
*
pComment
=
nullptr
)
{
SVCreateTbReq
req
=
{
0
};
SVCreateTbReq
req
=
{
0
};
req
.
name
=
s
trdup
(
pName
);
req
.
name
=
taosS
trdup
(
pName
);
if
(
ignoreExists
)
{
if
(
ignoreExists
)
{
req
.
flags
|=
TD_CREATE_IF_NOT_EXISTS
;
req
.
flags
|=
TD_CREATE_IF_NOT_EXISTS
;
}
}
req
.
ttl
=
ttl
;
req
.
ttl
=
ttl
;
if
(
nullptr
!=
pComment
)
{
if
(
nullptr
!=
pComment
)
{
req
.
comment
=
s
trdup
(
pComment
);
req
.
comment
=
taosS
trdup
(
pComment
);
req
.
commentLen
=
strlen
(
pComment
);
req
.
commentLen
=
strlen
(
pComment
);
}
}
++
expect
.
nReqs
;
++
expect
.
nReqs
;
...
...
source/libs/qcom/src/queryUtil.c
浏览文件 @
22aa0330
...
@@ -420,7 +420,7 @@ end:
...
@@ -420,7 +420,7 @@ end:
cJSON_Delete
(
json
);
cJSON_Delete
(
json
);
taosArrayDestroy
(
pTagVals
);
taosArrayDestroy
(
pTagVals
);
if
(
string
==
NULL
)
{
if
(
string
==
NULL
)
{
string
=
s
trdup
(
TSDB_DATA_NULL_STR_L
);
string
=
taosS
trdup
(
TSDB_DATA_NULL_STR_L
);
}
}
return
string
;
return
string
;
}
}
...
@@ -510,20 +510,20 @@ int32_t cloneSVreateTbReq(SVCreateTbReq* pSrc, SVCreateTbReq** pDst) {
...
@@ -510,20 +510,20 @@ int32_t cloneSVreateTbReq(SVCreateTbReq* pSrc, SVCreateTbReq** pDst) {
(
*
pDst
)
->
flags
=
pSrc
->
flags
;
(
*
pDst
)
->
flags
=
pSrc
->
flags
;
if
(
pSrc
->
name
)
{
if
(
pSrc
->
name
)
{
(
*
pDst
)
->
name
=
s
trdup
(
pSrc
->
name
);
(
*
pDst
)
->
name
=
taosS
trdup
(
pSrc
->
name
);
}
}
(
*
pDst
)
->
uid
=
pSrc
->
uid
;
(
*
pDst
)
->
uid
=
pSrc
->
uid
;
(
*
pDst
)
->
ctime
=
pSrc
->
ctime
;
(
*
pDst
)
->
ctime
=
pSrc
->
ctime
;
(
*
pDst
)
->
ttl
=
pSrc
->
ttl
;
(
*
pDst
)
->
ttl
=
pSrc
->
ttl
;
(
*
pDst
)
->
commentLen
=
pSrc
->
commentLen
;
(
*
pDst
)
->
commentLen
=
pSrc
->
commentLen
;
if
(
pSrc
->
comment
)
{
if
(
pSrc
->
comment
)
{
(
*
pDst
)
->
comment
=
s
trdup
(
pSrc
->
comment
);
(
*
pDst
)
->
comment
=
taosS
trdup
(
pSrc
->
comment
);
}
}
(
*
pDst
)
->
type
=
pSrc
->
type
;
(
*
pDst
)
->
type
=
pSrc
->
type
;
if
(
pSrc
->
type
==
TSDB_CHILD_TABLE
)
{
if
(
pSrc
->
type
==
TSDB_CHILD_TABLE
)
{
if
(
pSrc
->
ctb
.
stbName
)
{
if
(
pSrc
->
ctb
.
stbName
)
{
(
*
pDst
)
->
ctb
.
stbName
=
s
trdup
(
pSrc
->
ctb
.
stbName
);
(
*
pDst
)
->
ctb
.
stbName
=
taosS
trdup
(
pSrc
->
ctb
.
stbName
);
}
}
(
*
pDst
)
->
ctb
.
tagNum
=
pSrc
->
ctb
.
tagNum
;
(
*
pDst
)
->
ctb
.
tagNum
=
pSrc
->
ctb
.
tagNum
;
(
*
pDst
)
->
ctb
.
suid
=
pSrc
->
ctb
.
suid
;
(
*
pDst
)
->
ctb
.
suid
=
pSrc
->
ctb
.
suid
;
...
...
source/libs/qcom/src/querymsg.c
浏览文件 @
22aa0330
...
@@ -527,7 +527,7 @@ int32_t queryProcessGetSerVerRsp(void *output, char *msg, int32_t msgSize) {
...
@@ -527,7 +527,7 @@ int32_t queryProcessGetSerVerRsp(void *output, char *msg, int32_t msgSize) {
return
code
;
return
code
;
}
}
*
(
char
**
)
output
=
s
trdup
(
out
.
ver
);
*
(
char
**
)
output
=
taosS
trdup
(
out
.
ver
);
return
code
;
return
code
;
}
}
...
...
source/libs/scheduler/src/schJob.c
浏览文件 @
22aa0330
...
@@ -716,7 +716,7 @@ int32_t schInitJob(int64_t *pJobId, SSchedulerReq *pReq) {
...
@@ -716,7 +716,7 @@ int32_t schInitJob(int64_t *pJobId, SSchedulerReq *pReq) {
pJob
->
attr
.
localExec
=
pReq
->
localReq
;
pJob
->
attr
.
localExec
=
pReq
->
localReq
;
pJob
->
conn
=
*
pReq
->
pConn
;
pJob
->
conn
=
*
pReq
->
pConn
;
if
(
pReq
->
sql
)
{
if
(
pReq
->
sql
)
{
pJob
->
sql
=
s
trdup
(
pReq
->
sql
);
pJob
->
sql
=
taosS
trdup
(
pReq
->
sql
);
}
}
pJob
->
pDag
=
pReq
->
pDag
;
pJob
->
pDag
=
pReq
->
pDag
;
pJob
->
allocatorRefId
=
nodesMakeAllocatorWeakRef
(
pReq
->
allocatorRefId
);
pJob
->
allocatorRefId
=
nodesMakeAllocatorWeakRef
(
pReq
->
allocatorRefId
);
...
...
source/libs/scheduler/src/schRemote.c
浏览文件 @
22aa0330
...
@@ -887,7 +887,7 @@ int32_t schUpdateSendTargetInfo(SMsgSendInfo *pMsgSendInfo, SQueryNodeAddr *addr
...
@@ -887,7 +887,7 @@ int32_t schUpdateSendTargetInfo(SMsgSendInfo *pMsgSendInfo, SQueryNodeAddr *addr
}
else
{
}
else
{
pMsgSendInfo
->
target
.
type
=
TARGET_TYPE_VNODE
;
pMsgSendInfo
->
target
.
type
=
TARGET_TYPE_VNODE
;
pMsgSendInfo
->
target
.
vgId
=
addr
->
nodeId
;
pMsgSendInfo
->
target
.
vgId
=
addr
->
nodeId
;
pMsgSendInfo
->
target
.
dbFName
=
s
trdup
(
pTask
->
plan
->
dbFName
);
pMsgSendInfo
->
target
.
dbFName
=
taosS
trdup
(
pTask
->
plan
->
dbFName
);
}
}
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
...
...
source/libs/stream/src/streamMeta.c
浏览文件 @
22aa0330
...
@@ -26,7 +26,7 @@ SStreamMeta* streamMetaOpen(const char* path, void* ahandle, FTaskExpand expandF
...
@@ -26,7 +26,7 @@ SStreamMeta* streamMetaOpen(const char* path, void* ahandle, FTaskExpand expandF
int32_t
len
=
strlen
(
path
)
+
20
;
int32_t
len
=
strlen
(
path
)
+
20
;
char
*
streamPath
=
taosMemoryCalloc
(
1
,
len
);
char
*
streamPath
=
taosMemoryCalloc
(
1
,
len
);
sprintf
(
streamPath
,
"%s/%s"
,
path
,
"stream"
);
sprintf
(
streamPath
,
"%s/%s"
,
path
,
"stream"
);
pMeta
->
path
=
s
trdup
(
streamPath
);
pMeta
->
path
=
taosS
trdup
(
streamPath
);
if
(
tdbOpen
(
pMeta
->
path
,
16
*
1024
,
1
,
&
pMeta
->
db
,
0
)
<
0
)
{
if
(
tdbOpen
(
pMeta
->
path
,
16
*
1024
,
1
,
&
pMeta
->
db
,
0
)
<
0
)
{
taosMemoryFree
(
streamPath
);
taosMemoryFree
(
streamPath
);
goto
_err
;
goto
_err
;
...
...
source/libs/tfs/src/tfs.c
浏览文件 @
22aa0330
...
@@ -240,7 +240,7 @@ int32_t tfsMkdirRecurAt(STfs *pTfs, const char *rname, SDiskID diskId) {
...
@@ -240,7 +240,7 @@ int32_t tfsMkdirRecurAt(STfs *pTfs, const char *rname, SDiskID diskId) {
if
(
tfsMkdirAt
(
pTfs
,
rname
,
diskId
)
<
0
)
{
if
(
tfsMkdirAt
(
pTfs
,
rname
,
diskId
)
<
0
)
{
if
(
errno
==
ENOENT
)
{
if
(
errno
==
ENOENT
)
{
// Try to create upper
// Try to create upper
char
*
s
=
s
trdup
(
rname
);
char
*
s
=
taosS
trdup
(
rname
);
// Make a copy of dirname(s) because the implementation of 'dirname' differs on different platforms.
// Make a copy of dirname(s) because the implementation of 'dirname' differs on different platforms.
// Some platform may modify the contents of the string passed into dirname(). Others may return a pointer to
// Some platform may modify the contents of the string passed into dirname(). Others may return a pointer to
...
@@ -248,7 +248,7 @@ int32_t tfsMkdirRecurAt(STfs *pTfs, const char *rname, SDiskID diskId) {
...
@@ -248,7 +248,7 @@ int32_t tfsMkdirRecurAt(STfs *pTfs, const char *rname, SDiskID diskId) {
// the pointer directly in this recursion.
// the pointer directly in this recursion.
// See
// See
// https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man3/dirname.3.html
// https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man3/dirname.3.html
char
*
dir
=
s
trdup
(
taosDirName
(
s
));
char
*
dir
=
taosS
trdup
(
taosDirName
(
s
));
if
(
tfsMkdirRecurAt
(
pTfs
,
dir
,
diskId
)
<
0
)
{
if
(
tfsMkdirRecurAt
(
pTfs
,
dir
,
diskId
)
<
0
)
{
taosMemoryFree
(
s
);
taosMemoryFree
(
s
);
...
...
source/libs/tfs/src/tfsDisk.c
浏览文件 @
22aa0330
...
@@ -23,7 +23,7 @@ STfsDisk *tfsNewDisk(int32_t level, int32_t id, const char *path) {
...
@@ -23,7 +23,7 @@ STfsDisk *tfsNewDisk(int32_t level, int32_t id, const char *path) {
return
NULL
;
return
NULL
;
}
}
pDisk
->
path
=
s
trdup
(
path
);
pDisk
->
path
=
taosS
trdup
(
path
);
if
(
pDisk
->
path
==
NULL
)
{
if
(
pDisk
->
path
==
NULL
)
{
taosMemoryFree
(
pDisk
);
taosMemoryFree
(
pDisk
);
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
...
...
source/libs/transport/src/thttp.c
浏览文件 @
22aa0330
...
@@ -298,8 +298,8 @@ int32_t httpSendQuit() {
...
@@ -298,8 +298,8 @@ int32_t httpSendQuit() {
static
int32_t
taosSendHttpReportImpl
(
const
char
*
server
,
const
char
*
uri
,
uint16_t
port
,
char
*
pCont
,
int32_t
contLen
,
static
int32_t
taosSendHttpReportImpl
(
const
char
*
server
,
const
char
*
uri
,
uint16_t
port
,
char
*
pCont
,
int32_t
contLen
,
EHttpCompFlag
flag
)
{
EHttpCompFlag
flag
)
{
SHttpMsg
*
msg
=
taosMemoryMalloc
(
sizeof
(
SHttpMsg
));
SHttpMsg
*
msg
=
taosMemoryMalloc
(
sizeof
(
SHttpMsg
));
msg
->
server
=
s
trdup
(
server
);
msg
->
server
=
taosS
trdup
(
server
);
msg
->
uri
=
s
trdup
(
uri
);
msg
->
uri
=
taosS
trdup
(
uri
);
msg
->
port
=
port
;
msg
->
port
=
port
;
msg
->
cont
=
taosMemoryMalloc
(
contLen
);
msg
->
cont
=
taosMemoryMalloc
(
contLen
);
memcpy
(
msg
->
cont
,
pCont
,
contLen
);
memcpy
(
msg
->
cont
,
pCont
,
contLen
);
...
...
source/libs/transport/src/transCli.c
浏览文件 @
22aa0330
...
@@ -1014,7 +1014,7 @@ static void cliHandleBatchReq(SCliBatch* pBatch, SCliThrd* pThrd) {
...
@@ -1014,7 +1014,7 @@ static void cliHandleBatchReq(SCliBatch* pBatch, SCliThrd* pThrd) {
if
(
conn
==
NULL
)
{
if
(
conn
==
NULL
)
{
conn
=
cliCreateConn
(
pThrd
);
conn
=
cliCreateConn
(
pThrd
);
conn
->
pBatch
=
pBatch
;
conn
->
pBatch
=
pBatch
;
conn
->
ip
=
s
trdup
(
pList
->
dst
);
conn
->
ip
=
taosS
trdup
(
pList
->
dst
);
uint32_t
ipaddr
=
cliGetIpFromFqdnCache
(
pThrd
->
fqdn2ipCache
,
pList
->
ip
);
uint32_t
ipaddr
=
cliGetIpFromFqdnCache
(
pThrd
->
fqdn2ipCache
,
pList
->
ip
);
if
(
ipaddr
==
0xffffffff
)
{
if
(
ipaddr
==
0xffffffff
)
{
...
@@ -1391,7 +1391,7 @@ void cliHandleReq(SCliMsg* pMsg, SCliThrd* pThrd) {
...
@@ -1391,7 +1391,7 @@ void cliHandleReq(SCliMsg* pMsg, SCliThrd* pThrd) {
uint16_t
port
=
EPSET_GET_INUSE_PORT
(
&
pCtx
->
epSet
);
uint16_t
port
=
EPSET_GET_INUSE_PORT
(
&
pCtx
->
epSet
);
CONN_CONSTRUCT_HASH_KEY
(
key
,
fqdn
,
port
);
CONN_CONSTRUCT_HASH_KEY
(
key
,
fqdn
,
port
);
conn
->
ip
=
s
trdup
(
key
);
conn
->
ip
=
taosS
trdup
(
key
);
uint32_t
ipaddr
=
cliGetIpFromFqdnCache
(
pThrd
->
fqdn2ipCache
,
fqdn
);
uint32_t
ipaddr
=
cliGetIpFromFqdnCache
(
pThrd
->
fqdn2ipCache
,
fqdn
);
if
(
ipaddr
==
0xffffffff
)
{
if
(
ipaddr
==
0xffffffff
)
{
...
@@ -1503,8 +1503,8 @@ static void cliBatchDealReq(queue* wq, SCliThrd* pThrd) {
...
@@ -1503,8 +1503,8 @@ static void cliBatchDealReq(queue* wq, SCliThrd* pThrd) {
pBatchList
->
batchLenLimit
=
pInst
->
batchSize
;
pBatchList
->
batchLenLimit
=
pInst
->
batchSize
;
pBatchList
->
len
+=
1
;
pBatchList
->
len
+=
1
;
pBatchList
->
ip
=
s
trdup
(
ip
);
pBatchList
->
ip
=
taosS
trdup
(
ip
);
pBatchList
->
dst
=
s
trdup
(
key
);
pBatchList
->
dst
=
taosS
trdup
(
key
);
pBatchList
->
port
=
port
;
pBatchList
->
port
=
port
;
SCliBatch
*
pBatch
=
taosMemoryCalloc
(
1
,
sizeof
(
SCliBatch
));
SCliBatch
*
pBatch
=
taosMemoryCalloc
(
1
,
sizeof
(
SCliBatch
));
...
...
source/os/src/osFile.c
浏览文件 @
22aa0330
...
@@ -151,7 +151,7 @@ TdFilePtr taosCreateFile(const char *path, int32_t tdFileOptions) {
...
@@ -151,7 +151,7 @@ TdFilePtr taosCreateFile(const char *path, int32_t tdFileOptions) {
if
(
!
fp
)
{
if
(
!
fp
)
{
if
(
errno
==
ENOENT
)
{
if
(
errno
==
ENOENT
)
{
// Try to create directory recursively
// Try to create directory recursively
char
*
s
=
s
trdup
(
path
);
char
*
s
=
taosS
trdup
(
path
);
if
(
taosMulMkDir
(
taosDirName
(
s
))
!=
0
)
{
if
(
taosMulMkDir
(
taosDirName
(
s
))
!=
0
)
{
taosMemoryFree
(
s
);
taosMemoryFree
(
s
);
return
NULL
;
return
NULL
;
...
...
source/os/src/osLocale.c
浏览文件 @
22aa0330
...
@@ -59,11 +59,11 @@ char *taosCharsetReplace(char *charsetstr) {
...
@@ -59,11 +59,11 @@ char *taosCharsetReplace(char *charsetstr) {
for
(
int32_t
i
=
0
;
i
<
tListLen
(
charsetRep
);
++
i
)
{
for
(
int32_t
i
=
0
;
i
<
tListLen
(
charsetRep
);
++
i
)
{
if
(
strcasecmp
(
charsetRep
[
i
].
oldCharset
,
charsetstr
)
==
0
)
{
if
(
strcasecmp
(
charsetRep
[
i
].
oldCharset
,
charsetstr
)
==
0
)
{
return
s
trdup
(
charsetRep
[
i
].
newCharset
);
return
taosS
trdup
(
charsetRep
[
i
].
newCharset
);
}
}
}
}
return
s
trdup
(
charsetstr
);
return
taosS
trdup
(
charsetstr
);
}
}
/**
/**
...
...
source/os/src/osMemory.c
浏览文件 @
22aa0330
...
@@ -87,7 +87,7 @@ void taosPrintBackTrace() {
...
@@ -87,7 +87,7 @@ void taosPrintBackTrace() {
}
}
#endif
#endif
#else
#else
#define tstrdup(str)
s
trdup(str)
#define tstrdup(str)
taosS
trdup(str)
#include <execinfo.h>
#include <execinfo.h>
...
@@ -312,7 +312,7 @@ void *taosMemoryRealloc(void *ptr, int64_t size) {
...
@@ -312,7 +312,7 @@ void *taosMemoryRealloc(void *ptr, int64_t size) {
#endif
#endif
}
}
void
*
taos
MemoryStrD
up
(
const
char
*
ptr
)
{
void
*
taos
Strd
up
(
const
char
*
ptr
)
{
#ifdef USE_TD_MEMORY
#ifdef USE_TD_MEMORY
if
(
ptr
==
NULL
)
return
NULL
;
if
(
ptr
==
NULL
)
return
NULL
;
...
...
source/util/src/tcache.c
浏览文件 @
22aa0330
...
@@ -391,7 +391,7 @@ SCacheObj *taosCacheInit(int32_t keyType, int64_t refreshTimeInMs, bool extendLi
...
@@ -391,7 +391,7 @@ SCacheObj *taosCacheInit(int32_t keyType, int64_t refreshTimeInMs, bool extendLi
return
NULL
;
return
NULL
;
}
}
pCacheObj
->
name
=
s
trdup
(
cacheName
);
pCacheObj
->
name
=
taosS
trdup
(
cacheName
);
doRegisterCacheObj
(
pCacheObj
);
doRegisterCacheObj
(
pCacheObj
);
return
pCacheObj
;
return
pCacheObj
;
}
}
...
...
source/util/src/tconfig.c
浏览文件 @
22aa0330
...
@@ -109,7 +109,7 @@ int32_t cfgGetSize(SConfig *pCfg) { return taosArrayGetSize(pCfg->array); }
...
@@ -109,7 +109,7 @@ int32_t cfgGetSize(SConfig *pCfg) { return taosArrayGetSize(pCfg->array); }
static
int32_t
cfgCheckAndSetTimezone
(
SConfigItem
*
pItem
,
const
char
*
timezone
)
{
static
int32_t
cfgCheckAndSetTimezone
(
SConfigItem
*
pItem
,
const
char
*
timezone
)
{
cfgFreeItem
(
pItem
);
cfgFreeItem
(
pItem
);
pItem
->
str
=
s
trdup
(
timezone
);
pItem
->
str
=
taosS
trdup
(
timezone
);
if
(
pItem
->
str
==
NULL
)
{
if
(
pItem
->
str
==
NULL
)
{
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
return
-
1
;
return
-
1
;
...
@@ -120,7 +120,7 @@ static int32_t cfgCheckAndSetTimezone(SConfigItem *pItem, const char *timezone)
...
@@ -120,7 +120,7 @@ static int32_t cfgCheckAndSetTimezone(SConfigItem *pItem, const char *timezone)
static
int32_t
cfgCheckAndSetCharset
(
SConfigItem
*
pItem
,
const
char
*
charset
)
{
static
int32_t
cfgCheckAndSetCharset
(
SConfigItem
*
pItem
,
const
char
*
charset
)
{
cfgFreeItem
(
pItem
);
cfgFreeItem
(
pItem
);
pItem
->
str
=
s
trdup
(
charset
);
pItem
->
str
=
taosS
trdup
(
charset
);
if
(
pItem
->
str
==
NULL
)
{
if
(
pItem
->
str
==
NULL
)
{
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
return
-
1
;
return
-
1
;
...
@@ -131,7 +131,7 @@ static int32_t cfgCheckAndSetCharset(SConfigItem *pItem, const char *charset) {
...
@@ -131,7 +131,7 @@ static int32_t cfgCheckAndSetCharset(SConfigItem *pItem, const char *charset) {
static
int32_t
cfgCheckAndSetLocale
(
SConfigItem
*
pItem
,
const
char
*
locale
)
{
static
int32_t
cfgCheckAndSetLocale
(
SConfigItem
*
pItem
,
const
char
*
locale
)
{
cfgFreeItem
(
pItem
);
cfgFreeItem
(
pItem
);
pItem
->
str
=
s
trdup
(
locale
);
pItem
->
str
=
taosS
trdup
(
locale
);
if
(
pItem
->
str
==
NULL
)
{
if
(
pItem
->
str
==
NULL
)
{
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
return
-
1
;
return
-
1
;
...
@@ -149,7 +149,7 @@ static int32_t cfgCheckAndSetDir(SConfigItem *pItem, const char *inputDir) {
...
@@ -149,7 +149,7 @@ static int32_t cfgCheckAndSetDir(SConfigItem *pItem, const char *inputDir) {
}
}
taosMemoryFreeClear
(
pItem
->
str
);
taosMemoryFreeClear
(
pItem
->
str
);
pItem
->
str
=
s
trdup
(
fullDir
);
pItem
->
str
=
taosS
trdup
(
fullDir
);
if
(
pItem
->
str
==
NULL
)
{
if
(
pItem
->
str
==
NULL
)
{
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
return
-
1
;
return
-
1
;
...
@@ -215,7 +215,7 @@ static int32_t cfgSetFloat(SConfigItem *pItem, const char *value, ECfgSrcType st
...
@@ -215,7 +215,7 @@ static int32_t cfgSetFloat(SConfigItem *pItem, const char *value, ECfgSrcType st
}
}
static
int32_t
cfgSetString
(
SConfigItem
*
pItem
,
const
char
*
value
,
ECfgSrcType
stype
)
{
static
int32_t
cfgSetString
(
SConfigItem
*
pItem
,
const
char
*
value
,
ECfgSrcType
stype
)
{
char
*
tmp
=
s
trdup
(
value
);
char
*
tmp
=
taosS
trdup
(
value
);
if
(
tmp
==
NULL
)
{
if
(
tmp
==
NULL
)
{
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
uError
(
"cfg:%s, type:%s src:%s value:%s failed to dup since %s"
,
pItem
->
name
,
cfgDtypeStr
(
pItem
->
dtype
),
uError
(
"cfg:%s, type:%s src:%s value:%s failed to dup since %s"
,
pItem
->
name
,
cfgDtypeStr
(
pItem
->
dtype
),
...
@@ -358,7 +358,7 @@ SConfigItem *cfgGetItem(SConfig *pCfg, const char *name) {
...
@@ -358,7 +358,7 @@ SConfigItem *cfgGetItem(SConfig *pCfg, const char *name) {
static
int32_t
cfgAddItem
(
SConfig
*
pCfg
,
SConfigItem
*
pItem
,
const
char
*
name
)
{
static
int32_t
cfgAddItem
(
SConfig
*
pCfg
,
SConfigItem
*
pItem
,
const
char
*
name
)
{
pItem
->
stype
=
CFG_STYPE_DEFAULT
;
pItem
->
stype
=
CFG_STYPE_DEFAULT
;
pItem
->
name
=
s
trdup
(
name
);
pItem
->
name
=
taosS
trdup
(
name
);
if
(
pItem
->
name
==
NULL
)
{
if
(
pItem
->
name
==
NULL
)
{
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
return
-
1
;
return
-
1
;
...
@@ -417,7 +417,7 @@ int32_t cfgAddFloat(SConfig *pCfg, const char *name, float defaultVal, double mi
...
@@ -417,7 +417,7 @@ int32_t cfgAddFloat(SConfig *pCfg, const char *name, float defaultVal, double mi
int32_t
cfgAddString
(
SConfig
*
pCfg
,
const
char
*
name
,
const
char
*
defaultVal
,
bool
tsc
)
{
int32_t
cfgAddString
(
SConfig
*
pCfg
,
const
char
*
name
,
const
char
*
defaultVal
,
bool
tsc
)
{
SConfigItem
item
=
{.
dtype
=
CFG_DTYPE_STRING
,
.
tsc
=
tsc
};
SConfigItem
item
=
{.
dtype
=
CFG_DTYPE_STRING
,
.
tsc
=
tsc
};
item
.
str
=
s
trdup
(
defaultVal
);
item
.
str
=
taosS
trdup
(
defaultVal
);
if
(
item
.
str
==
NULL
)
{
if
(
item
.
str
==
NULL
)
{
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
return
-
1
;
return
-
1
;
...
...
source/util/src/tjson.c
浏览文件 @
22aa0330
...
@@ -192,7 +192,7 @@ int32_t tjsonDupStringValue(const SJson* pJson, const char* pName, char** pVal)
...
@@ -192,7 +192,7 @@ int32_t tjsonDupStringValue(const SJson* pJson, const char* pName, char** pVal)
if
(
NULL
==
p
)
{
if
(
NULL
==
p
)
{
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
*
pVal
=
s
trdup
(
p
);
*
pVal
=
taosS
trdup
(
p
);
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
...
...
source/util/src/tpagedbuf.c
浏览文件 @
22aa0330
...
@@ -55,7 +55,7 @@ static int32_t createDiskFile(SDiskbasedBuf* pBuf) {
...
@@ -55,7 +55,7 @@ static int32_t createDiskFile(SDiskbasedBuf* pBuf) {
if
(
pBuf
->
path
==
NULL
)
{
// prepare the file name when needed it
if
(
pBuf
->
path
==
NULL
)
{
// prepare the file name when needed it
char
path
[
PATH_MAX
]
=
{
0
};
char
path
[
PATH_MAX
]
=
{
0
};
taosGetTmpfilePath
(
pBuf
->
prefix
,
"paged-buf"
,
path
);
taosGetTmpfilePath
(
pBuf
->
prefix
,
"paged-buf"
,
path
);
pBuf
->
path
=
taos
MemoryStrD
up
(
path
);
pBuf
->
path
=
taos
Strd
up
(
path
);
if
(
pBuf
->
path
==
NULL
)
{
if
(
pBuf
->
path
==
NULL
)
{
return
TSDB_CODE_OUT_OF_MEMORY
;
return
TSDB_CODE_OUT_OF_MEMORY
;
}
}
...
@@ -351,7 +351,7 @@ int32_t createDiskbasedBuf(SDiskbasedBuf** pBuf, int32_t pagesize, int32_t inMem
...
@@ -351,7 +351,7 @@ int32_t createDiskbasedBuf(SDiskbasedBuf** pBuf, int32_t pagesize, int32_t inMem
pPBuf
->
totalBufSize
=
0
;
pPBuf
->
totalBufSize
=
0
;
pPBuf
->
allocateId
=
-
1
;
pPBuf
->
allocateId
=
-
1
;
pPBuf
->
pFile
=
NULL
;
pPBuf
->
pFile
=
NULL
;
pPBuf
->
id
=
s
trdup
(
id
);
pPBuf
->
id
=
taosS
trdup
(
id
);
pPBuf
->
fileSize
=
0
;
pPBuf
->
fileSize
=
0
;
pPBuf
->
pFree
=
taosArrayInit
(
4
,
sizeof
(
SFreeListItem
));
pPBuf
->
pFree
=
taosArrayInit
(
4
,
sizeof
(
SFreeListItem
));
pPBuf
->
freePgList
=
tdListNew
(
POINTER_BYTES
);
pPBuf
->
freePgList
=
tdListNew
(
POINTER_BYTES
);
...
...
tools/shell/src/shellAuto.c
浏览文件 @
22aa0330
...
@@ -911,7 +911,7 @@ char* matchNextPrefix(STire* tire, char* pre) {
...
@@ -911,7 +911,7 @@ char* matchNextPrefix(STire* tire, char* pre) {
if
(
cursorVar
==
-
1
)
{
if
(
cursorVar
==
-
1
)
{
// first
// first
cursorVar
=
0
;
cursorVar
=
0
;
return
s
trdup
(
match
->
head
->
word
);
return
taosS
trdup
(
match
->
head
->
word
);
}
}
// according to cursorVar , calculate next one
// according to cursorVar , calculate next one
...
@@ -927,7 +927,7 @@ char* matchNextPrefix(STire* tire, char* pre) {
...
@@ -927,7 +927,7 @@ char* matchNextPrefix(STire* tire, char* pre) {
cursorVar
=
i
;
cursorVar
=
i
;
}
}
return
s
trdup
(
item
->
word
);
return
taosS
trdup
(
item
->
word
);
}
}
// check end item
// check end item
...
@@ -935,7 +935,7 @@ char* matchNextPrefix(STire* tire, char* pre) {
...
@@ -935,7 +935,7 @@ char* matchNextPrefix(STire* tire, char* pre) {
// if cursorVar > var list count, return last and reset cursorVar
// if cursorVar > var list count, return last and reset cursorVar
cursorVar
=
-
1
;
cursorVar
=
-
1
;
return
s
trdup
(
item
->
word
);
return
taosS
trdup
(
item
->
word
);
}
}
// move next
// move next
...
@@ -1536,7 +1536,7 @@ bool matchSelectQuery(TAOS* con, SShellCmd* cmd) {
...
@@ -1536,7 +1536,7 @@ bool matchSelectQuery(TAOS* con, SShellCmd* cmd) {
// if is input create fields or tags area, return true
// if is input create fields or tags area, return true
bool
isCreateFieldsArea
(
char
*
p
)
{
bool
isCreateFieldsArea
(
char
*
p
)
{
// put to while, support like create table st(ts timestamp, bin1 binary(16), bin2 + blank + TAB
// put to while, support like create table st(ts timestamp, bin1 binary(16), bin2 + blank + TAB
char
*
p1
=
s
trdup
(
p
);
char
*
p1
=
taosS
trdup
(
p
);
bool
ret
=
false
;
bool
ret
=
false
;
while
(
1
)
{
while
(
1
)
{
char
*
left
=
strrchr
(
p1
,
'('
);
char
*
left
=
strrchr
(
p1
,
'('
);
...
...
tools/shell/src/shellEngine.c
浏览文件 @
22aa0330
...
@@ -127,7 +127,7 @@ void shellRecordCommandToHistory(char *command) {
...
@@ -127,7 +127,7 @@ void shellRecordCommandToHistory(char *command) {
if
(
pHistory
->
hist
[
pHistory
->
hend
]
!=
NULL
)
{
if
(
pHistory
->
hist
[
pHistory
->
hend
]
!=
NULL
)
{
taosMemoryFreeClear
(
pHistory
->
hist
[
pHistory
->
hend
]);
taosMemoryFreeClear
(
pHistory
->
hist
[
pHistory
->
hend
]);
}
}
pHistory
->
hist
[
pHistory
->
hend
]
=
s
trdup
(
command
);
pHistory
->
hist
[
pHistory
->
hend
]
=
taosS
trdup
(
command
);
pHistory
->
hend
=
(
pHistory
->
hend
+
1
)
%
SHELL_MAX_HISTORY_SIZE
;
pHistory
->
hend
=
(
pHistory
->
hend
+
1
)
%
SHELL_MAX_HISTORY_SIZE
;
if
(
pHistory
->
hend
==
pHistory
->
hstart
)
{
if
(
pHistory
->
hend
==
pHistory
->
hstart
)
{
...
@@ -821,7 +821,7 @@ void shellReadHistory() {
...
@@ -821,7 +821,7 @@ void shellReadHistory() {
while
((
read_size
=
taosGetsFile
(
pFile
,
TSDB_MAX_ALLOWED_SQL_LEN
,
line
))
!=
-
1
)
{
while
((
read_size
=
taosGetsFile
(
pFile
,
TSDB_MAX_ALLOWED_SQL_LEN
,
line
))
!=
-
1
)
{
line
[
read_size
-
1
]
=
'\0'
;
line
[
read_size
-
1
]
=
'\0'
;
taosMemoryFree
(
pHistory
->
hist
[
pHistory
->
hend
]);
taosMemoryFree
(
pHistory
->
hist
[
pHistory
->
hend
]);
pHistory
->
hist
[
pHistory
->
hend
]
=
s
trdup
(
line
);
pHistory
->
hist
[
pHistory
->
hend
]
=
taosS
trdup
(
line
);
pHistory
->
hend
=
(
pHistory
->
hend
+
1
)
%
SHELL_MAX_HISTORY_SIZE
;
pHistory
->
hend
=
(
pHistory
->
hend
+
1
)
%
SHELL_MAX_HISTORY_SIZE
;
...
@@ -1105,7 +1105,7 @@ int32_t shellExecute() {
...
@@ -1105,7 +1105,7 @@ int32_t shellExecute() {
if
(
runOnce
)
{
if
(
runOnce
)
{
if
(
pArgs
->
commands
!=
NULL
)
{
if
(
pArgs
->
commands
!=
NULL
)
{
printf
(
"%s%s
\r\n
"
,
shell
.
info
.
promptHeader
,
pArgs
->
commands
);
printf
(
"%s%s
\r\n
"
,
shell
.
info
.
promptHeader
,
pArgs
->
commands
);
char
*
cmd
=
s
trdup
(
pArgs
->
commands
);
char
*
cmd
=
taosS
trdup
(
pArgs
->
commands
);
shellRunCommand
(
cmd
,
true
);
shellRunCommand
(
cmd
,
true
);
taosMemoryFree
(
cmd
);
taosMemoryFree
(
cmd
);
}
}
...
...
tools/shell/src/shellTire.c
浏览文件 @
22aa0330
...
@@ -75,7 +75,7 @@ void freeTire(STire* tire) {
...
@@ -75,7 +75,7 @@ void freeTire(STire* tire) {
// insert a new word to list
// insert a new word to list
bool
insertToList
(
STire
*
tire
,
char
*
word
)
{
bool
insertToList
(
STire
*
tire
,
char
*
word
)
{
StrName
*
p
=
(
StrName
*
)
taosMemoryMalloc
(
sizeof
(
StrName
));
StrName
*
p
=
(
StrName
*
)
taosMemoryMalloc
(
sizeof
(
StrName
));
p
->
name
=
s
trdup
(
word
);
p
->
name
=
taosS
trdup
(
word
);
p
->
next
=
NULL
;
p
->
next
=
NULL
;
if
(
tire
->
head
==
NULL
)
{
if
(
tire
->
head
==
NULL
)
{
...
@@ -218,7 +218,7 @@ void addWordToMatch(SMatch* match, char* word) {
...
@@ -218,7 +218,7 @@ void addWordToMatch(SMatch* match, char* word) {
// malloc new
// malloc new
SMatchNode
*
node
=
(
SMatchNode
*
)
taosMemoryMalloc
(
sizeof
(
SMatchNode
));
SMatchNode
*
node
=
(
SMatchNode
*
)
taosMemoryMalloc
(
sizeof
(
SMatchNode
));
memset
(
node
,
0
,
sizeof
(
SMatchNode
));
memset
(
node
,
0
,
sizeof
(
SMatchNode
));
node
->
word
=
s
trdup
(
word
);
node
->
word
=
taosS
trdup
(
word
);
// append to match
// append to match
if
(
match
->
head
==
NULL
)
{
if
(
match
->
head
==
NULL
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录