Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
09a77b3b
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1184
Star
22015
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
09a77b3b
编写于
10月 19, 2022
作者:
S
Shengliang Guan
提交者:
GitHub
10月 19, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #17474 from taosdata/fix/TD-19250-4
fix: coverity issues
上级
19dbc868
1fc3e07a
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
19 addition
and
7 deletion
+19
-7
include/common/tmsg.h
include/common/tmsg.h
+3
-0
source/dnode/vnode/src/meta/metaEntry.c
source/dnode/vnode/src/meta/metaEntry.c
+1
-1
source/libs/tdb/src/db/tdbBtree.c
source/libs/tdb/src/db/tdbBtree.c
+6
-0
source/libs/tdb/src/db/tdbDb.c
source/libs/tdb/src/db/tdbDb.c
+6
-3
source/libs/tdb/src/db/tdbPCache.c
source/libs/tdb/src/db/tdbPCache.c
+1
-1
source/libs/tdb/src/db/tdbPager.c
source/libs/tdb/src/db/tdbPager.c
+2
-2
未找到文件。
include/common/tmsg.h
浏览文件 @
09a77b3b
...
...
@@ -343,6 +343,8 @@ typedef struct {
}
SSchemaWrapper
;
static
FORCE_INLINE
SSchemaWrapper
*
tCloneSSchemaWrapper
(
const
SSchemaWrapper
*
pSchemaWrapper
)
{
if
(
pSchemaWrapper
->
pSchema
==
NULL
)
return
NULL
;
SSchemaWrapper
*
pSW
=
(
SSchemaWrapper
*
)
taosMemoryMalloc
(
sizeof
(
SSchemaWrapper
));
if
(
pSW
==
NULL
)
return
pSW
;
pSW
->
nCols
=
pSchemaWrapper
->
nCols
;
...
...
@@ -352,6 +354,7 @@ static FORCE_INLINE SSchemaWrapper* tCloneSSchemaWrapper(const SSchemaWrapper* p
taosMemoryFree
(
pSW
);
return
NULL
;
}
memcpy
(
pSW
->
pSchema
,
pSchemaWrapper
->
pSchema
,
pSW
->
nCols
*
sizeof
(
SSchema
));
return
pSW
;
}
...
...
source/dnode/vnode/src/meta/metaEntry.c
浏览文件 @
09a77b3b
...
...
@@ -21,7 +21,7 @@ int metaEncodeEntry(SEncoder *pCoder, const SMetaEntry *pME) {
if
(
tEncodeI64
(
pCoder
,
pME
->
version
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
pCoder
,
pME
->
type
)
<
0
)
return
-
1
;
if
(
tEncodeI64
(
pCoder
,
pME
->
uid
)
<
0
)
return
-
1
;
if
(
tEncodeCStr
(
pCoder
,
pME
->
name
)
<
0
)
return
-
1
;
if
(
pME
->
name
==
NULL
||
tEncodeCStr
(
pCoder
,
pME
->
name
)
<
0
)
return
-
1
;
if
(
pME
->
type
==
TSDB_SUPER_TABLE
)
{
if
(
tEncodeI8
(
pCoder
,
pME
->
flags
)
<
0
)
return
-
1
;
// TODO: need refactor?
...
...
source/libs/tdb/src/db/tdbBtree.c
浏览文件 @
09a77b3b
...
...
@@ -1094,6 +1094,7 @@ static int tdbBtreeEncodePayload(SPage *pPage, SCell *pCell, int nHeader, const
// fetch next ofp, a new ofp and make it dirty
ret
=
tdbFetchOvflPage
(
&
pgno
,
&
nextOfp
,
pTxn
,
pBt
);
if
(
ret
<
0
)
{
tdbFree
(
pBuf
);
return
-
1
;
}
}
...
...
@@ -1135,6 +1136,11 @@ static int tdbBtreeEncodePayload(SPage *pPage, SCell *pCell, int nHeader, const
memcpy
(
pBuf
,
((
SCell
*
)
pVal
)
+
vLen
-
nLeft
,
bytes
);
memcpy
(
pBuf
+
bytes
,
&
pgno
,
sizeof
(
pgno
));
if
(
ofp
==
NULL
)
{
tdbFree
(
pBuf
);
return
-
1
;
}
ret
=
tdbPageInsertCell
(
ofp
,
0
,
pBuf
,
bytes
+
sizeof
(
pgno
),
0
);
if
(
ret
<
0
)
{
tdbFree
(
pBuf
);
...
...
source/libs/tdb/src/db/tdbDb.c
浏览文件 @
09a77b3b
...
...
@@ -106,7 +106,8 @@ int32_t tdbBegin(TDB *pDb, TXN *pTxn) {
for
(
pPager
=
pDb
->
pgrList
;
pPager
;
pPager
=
pPager
->
pNext
)
{
ret
=
tdbPagerBegin
(
pPager
,
pTxn
);
if
(
ret
<
0
)
{
tdbError
(
"failed to begin pager since %s. dbName:%s, txnId:%ld"
,
tstrerror
(
terrno
),
pDb
->
dbName
,
pTxn
->
txnId
);
tdbError
(
"failed to begin pager since %s. dbName:%s, txnId:%"
PRId64
,
tstrerror
(
terrno
),
pDb
->
dbName
,
pTxn
->
txnId
);
return
-
1
;
}
}
...
...
@@ -121,7 +122,8 @@ int32_t tdbCommit(TDB *pDb, TXN *pTxn) {
for
(
pPager
=
pDb
->
pgrList
;
pPager
;
pPager
=
pPager
->
pNext
)
{
ret
=
tdbPagerCommit
(
pPager
,
pTxn
);
if
(
ret
<
0
)
{
tdbError
(
"failed to commit pager since %s. dbName:%s, txnId:%ld"
,
tstrerror
(
terrno
),
pDb
->
dbName
,
pTxn
->
txnId
);
tdbError
(
"failed to commit pager since %s. dbName:%s, txnId:%"
PRId64
,
tstrerror
(
terrno
),
pDb
->
dbName
,
pTxn
->
txnId
);
return
-
1
;
}
}
...
...
@@ -151,7 +153,8 @@ int32_t tdbAbort(TDB *pDb, TXN *pTxn) {
for
(
pPager
=
pDb
->
pgrList
;
pPager
;
pPager
=
pPager
->
pNext
)
{
ret
=
tdbPagerAbort
(
pPager
,
pTxn
);
if
(
ret
<
0
)
{
tdbError
(
"failed to abort pager since %s. dbName:%s, txnId:%ld"
,
tstrerror
(
terrno
),
pDb
->
dbName
,
pTxn
->
txnId
);
tdbError
(
"failed to abort pager since %s. dbName:%s, txnId:%"
PRId64
,
tstrerror
(
terrno
),
pDb
->
dbName
,
pTxn
->
txnId
);
return
-
1
;
}
}
...
...
source/libs/tdb/src/db/tdbPCache.c
浏览文件 @
09a77b3b
...
...
@@ -105,7 +105,7 @@ static int tdbPCacheAlterImpl(SPCache *pCache, int32_t nPage) {
for
(
int32_t
iPage
=
pCache
->
nPages
;
iPage
<
nPage
;
iPage
++
)
{
if
(
tdbPageCreate
(
pCache
->
szPage
,
&
aPage
[
iPage
],
tdbDefaultMalloc
,
NULL
)
<
0
)
{
// TODO: handle error
tdbOsFree
(
pCache
->
aPage
);
tdbOsFree
(
aPage
);
return
-
1
;
}
...
...
source/libs/tdb/src/db/tdbPager.c
浏览文件 @
09a77b3b
...
...
@@ -575,7 +575,7 @@ static int tdbPagerWritePageToDB(SPager *pPager, SPage *pPage) {
offset
=
(
i64
)
pPage
->
pageSize
*
(
TDB_PAGE_PGNO
(
pPage
)
-
1
);
if
(
tdbOsLSeek
(
pPager
->
fd
,
offset
,
SEEK_SET
)
<
0
)
{
tdbError
(
"failed to lseek due to %s. file:%s, offset:%
ld"
,
strerror
(
errno
),
pPager
->
dbFileName
,
offset
);
tdbError
(
"failed to lseek due to %s. file:%s, offset:%
"
PRId64
,
strerror
(
errno
),
pPager
->
dbFileName
,
offset
);
terrno
=
TAOS_SYSTEM_ERROR
(
errno
);
return
-
1
;
}
...
...
@@ -630,7 +630,7 @@ int tdbPagerRestore(SPager *pPager, SBTree *pBt) {
i64
offset
=
pPager
->
pageSize
*
(
pgno
-
1
);
if
(
tdbOsLSeek
(
pPager
->
fd
,
offset
,
SEEK_SET
)
<
0
)
{
tdbError
(
"failed to lseek fd due to %s. file:%s, offset:%
ld"
,
strerror
(
errno
),
pPager
->
dbFileName
,
offset
);
tdbError
(
"failed to lseek fd due to %s. file:%s, offset:%
"
PRId64
,
strerror
(
errno
),
pPager
->
dbFileName
,
offset
);
terrno
=
TAOS_SYSTEM_ERROR
(
errno
);
tdbOsFree
(
pageBuf
);
return
-
1
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录