Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
76e36a8d
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
76e36a8d
编写于
7月 21, 2020
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix defect found in coverity scan
上级
3f8c0b07
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
36 addition
and
13 deletion
+36
-13
src/mnode/src/mnodeDb.c
src/mnode/src/mnodeDb.c
+13
-5
src/mnode/src/mnodeSdb.c
src/mnode/src/mnodeSdb.c
+1
-1
src/mnode/src/mnodeVgroup.c
src/mnode/src/mnodeVgroup.c
+12
-5
src/plugins/http/src/gcJson.c
src/plugins/http/src/gcJson.c
+4
-0
src/plugins/http/src/httpContext.c
src/plugins/http/src/httpContext.c
+1
-1
src/plugins/http/src/restJson.c
src/plugins/http/src/restJson.c
+4
-0
src/plugins/mqtt/src/mqttSystem.c
src/plugins/mqtt/src/mqttSystem.c
+1
-1
未找到文件。
src/mnode/src/mnodeDb.c
浏览文件 @
76e36a8d
...
...
@@ -67,8 +67,11 @@ static int32_t mnodeDbActionInsert(SSdbOper *pOper) {
SAcctObj
*
pAcct
=
mnodeGetAcct
(
pDb
->
acct
);
pthread_mutex_init
(
&
pDb
->
mutex
,
NULL
);
pthread_mutex_lock
(
&
pDb
->
mutex
);
pDb
->
vgListSize
=
VG_LIST_SIZE
;
pDb
->
vgList
=
calloc
(
pDb
->
vgListSize
,
sizeof
(
SVgObj
*
));
pthread_mutex_unlock
(
&
pDb
->
mutex
);
pDb
->
numOfVgroups
=
0
;
pDb
->
numOfTables
=
0
;
pDb
->
numOfSuperTables
=
0
;
...
...
@@ -395,8 +398,8 @@ static int32_t mnodeCreateDb(SAcctObj *pAcct, SCMCreateDbMsg *pCreate, void *pMs
code
=
sdbInsertRow
(
&
oper
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
mnodeDestroyDb
(
pDb
);
mLInfo
(
"db:%s, failed to create, reason:%s"
,
pDb
->
name
,
tstrerror
(
code
));
mnodeDestroyDb
(
pDb
);
return
code
;
}
else
{
return
TSDB_CODE_MND_ACTION_IN_PROGRESS
;
...
...
@@ -605,7 +608,9 @@ static int32_t mnodeGetDbMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pConn
static
char
*
mnodeGetDbStr
(
char
*
src
)
{
char
*
pos
=
strstr
(
src
,
TS_PATH_DELIMITER
);
return
++
pos
;
if
(
pos
!=
NULL
)
++
pos
;
return
pos
;
}
static
int32_t
mnodeRetrieveDbs
(
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
,
void
*
pConn
)
{
...
...
@@ -622,10 +627,13 @@ static int32_t mnodeRetrieveDbs(SShowObj *pShow, char *data, int32_t rows, void
cols
=
0
;
pWrite
=
data
+
pShow
->
offset
[
cols
]
*
rows
+
pShow
->
bytes
[
cols
]
*
numOfRows
;
pWrite
=
data
+
pShow
->
offset
[
cols
]
*
rows
+
pShow
->
bytes
[
cols
]
*
numOfRows
;
char
*
name
=
mnodeGetDbStr
(
pDb
->
name
);
STR_WITH_MAXSIZE_TO_VARSTR
(
pWrite
,
name
,
pShow
->
bytes
[
cols
]);
if
(
name
!=
NULL
)
{
STR_WITH_MAXSIZE_TO_VARSTR
(
pWrite
,
name
,
pShow
->
bytes
[
cols
]);
}
else
{
STR_TO_VARSTR
(
pWrite
,
"NULL"
);
}
cols
++
;
pWrite
=
data
+
pShow
->
offset
[
cols
]
*
rows
+
pShow
->
bytes
[
cols
]
*
numOfRows
;
...
...
src/mnode/src/mnodeSdb.c
浏览文件 @
76e36a8d
...
...
@@ -453,7 +453,7 @@ static int32_t sdbInsertHash(SSdbTable *pTable, SSdbOper *pOper) {
keySize
=
strlen
((
char
*
)
key
);
}
taosHashPut
(
pTable
->
iHandle
,
key
,
keySize
,
&
pOper
->
pObj
,
sizeof
(
void
**
));
taosHashPut
(
pTable
->
iHandle
,
key
,
keySize
,
&
pOper
->
pObj
,
sizeof
(
int64_t
));
sdbIncRef
(
pTable
,
pOper
->
pObj
);
atomic_add_fetch_32
(
&
pTable
->
numOfRows
,
1
);
...
...
src/mnode/src/mnodeVgroup.c
浏览文件 @
76e36a8d
...
...
@@ -434,15 +434,22 @@ int32_t mnodeGetAvailableVgroup(SMnodeMsg *pMsg, SVgObj **ppVgroup, int32_t *pSi
}
if
(
pDb
->
numOfVgroups
<
maxVgroupsPerDb
)
{
mDebug
(
"app:%p:%p, db:%s, try to create a new vgroup, numOfVgroups:%d maxVgroupsPerDb:%d"
,
pMsg
->
rpcMsg
.
ahandle
,
pMsg
,
pDb
->
name
,
pDb
->
numOfVgroups
,
maxVgroupsPerDb
);
mDebug
(
"app:%p:%p, db:%s, try to create a new vgroup, numOfVgroups:%d maxVgroupsPerDb:%d"
,
pMsg
->
rpcMsg
.
ahandle
,
p
Msg
,
p
Db
->
name
,
pDb
->
numOfVgroups
,
maxVgroupsPerDb
);
pthread_mutex_unlock
(
&
pDb
->
mutex
);
int32_t
code
=
mnodeCreateVgroup
(
pMsg
);
if
(
code
==
TSDB_CODE_MND_ACTION_IN_PROGRESS
)
return
code
;
if
(
code
==
TSDB_CODE_MND_ACTION_IN_PROGRESS
)
{
return
code
;
}
else
{
pthread_mutex_lock
(
&
pDb
->
mutex
);
}
}
SVgObj
*
pVgroup
=
pDb
->
vgList
[
0
];
if
(
pVgroup
==
NULL
)
return
TSDB_CODE_MND_NO_ENOUGH_DNODES
;
if
(
pVgroup
==
NULL
)
{
pthread_mutex_unlock
(
&
pDb
->
mutex
);
return
TSDB_CODE_MND_NO_ENOUGH_DNODES
;
}
int32_t
code
=
mnodeAllocVgroupIdPool
(
pVgroup
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
...
...
@@ -483,7 +490,7 @@ static int32_t mnodeCreateVgroupCb(SMnodeMsg *pMsg, int32_t code) {
}
else
{
pVgroup
->
status
=
TAOS_VG_STATUS_READY
;
SSdbOper
desc
=
{.
type
=
SDB_OPER_GLOBAL
,
.
pObj
=
pVgroup
,
.
table
=
tsVgroupSdb
};
sdbUpdateRow
(
&
desc
);
(
void
)
sdbUpdateRow
(
&
desc
);
}
mInfo
(
"app:%p:%p, vgId:%d, is created in mnode, db:%s replica:%d"
,
pMsg
->
rpcMsg
.
ahandle
,
pMsg
,
pVgroup
->
vgId
,
...
...
src/plugins/http/src/gcJson.c
浏览文件 @
76e36a8d
...
...
@@ -121,6 +121,10 @@ bool gcBuildQueryJson(HttpContext *pContext, HttpSqlCmd *cmd, TAOS_RES *result,
for
(
int
k
=
0
;
k
<
numOfRows
;
++
k
)
{
TAOS_ROW
row
=
taos_fetch_row
(
result
);
if
(
row
==
NULL
)
{
cmd
->
numOfRows
--
;
continue
;
}
int32_t
*
length
=
taos_fetch_lengths
(
result
);
// for group by
...
...
src/plugins/http/src/httpContext.c
浏览文件 @
76e36a8d
...
...
@@ -108,7 +108,7 @@ HttpContext *httpCreateContext(int32_t fd) {
pContext
->
lastAccessTime
=
taosGetTimestampSec
();
pContext
->
state
=
HTTP_CONTEXT_STATE_READY
;
HttpContext
**
ppContext
=
taosCachePut
(
tsHttpServer
.
contextCache
,
&
pContext
,
sizeof
(
void
*
),
&
pContext
,
sizeof
(
void
*
),
3
);
HttpContext
**
ppContext
=
taosCachePut
(
tsHttpServer
.
contextCache
,
&
pContext
,
sizeof
(
int64_t
),
&
pContext
,
sizeof
(
int64_t
),
3
);
pContext
->
ppContext
=
ppContext
;
httpDebug
(
"context:%p, fd:%d, is created, data:%p"
,
pContext
,
fd
,
ppContext
);
...
...
src/plugins/http/src/restJson.c
浏览文件 @
76e36a8d
...
...
@@ -94,6 +94,10 @@ bool restBuildSqlJson(HttpContext *pContext, HttpSqlCmd *cmd, TAOS_RES *result,
for
(
int
k
=
0
;
k
<
numOfRows
;
++
k
)
{
TAOS_ROW
row
=
taos_fetch_row
(
result
);
if
(
row
==
NULL
)
{
cmd
->
numOfRows
--
;
continue
;
}
int32_t
*
length
=
taos_fetch_lengths
(
result
);
// data row array begin
...
...
src/plugins/mqtt/src/mqttSystem.c
浏览文件 @
76e36a8d
...
...
@@ -64,7 +64,7 @@ int32_t mqttInitSystem() {
}
char
*
_begin_hostname
=
strstr
(
url
,
recntStatus
.
hostname
);
if
(
strstr
(
_begin_hostname
,
":"
)
!=
NULL
)
{
if
(
_begin_hostname
!=
NULL
&&
strstr
(
_begin_hostname
,
":"
)
!=
NULL
)
{
recntStatus
.
port
=
strbetween
(
_begin_hostname
,
":"
,
"/"
);
}
else
{
recntStatus
.
port
=
strbetween
(
"'1883'"
,
"'"
,
"'"
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录