Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
6f5de819
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1187
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看板
提交
6f5de819
编写于
6月 23, 2022
作者:
M
Minglei Jin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix/ofp: use btree's pager instead of page's which may be null
上级
90128345
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
15 addition
and
15 deletion
+15
-15
source/libs/tdb/src/db/tdbBtree.c
source/libs/tdb/src/db/tdbBtree.c
+15
-15
未找到文件。
source/libs/tdb/src/db/tdbBtree.c
浏览文件 @
6f5de819
...
...
@@ -857,20 +857,20 @@ static int tdbBtreeBalance(SBTC *pBtc) {
}
// TDB_BTREE_BALANCE
static
int
tdbFetchOvflPage
(
SP
ager
*
pPager
,
SP
gno
*
pPgno
,
SPage
**
ppOfp
,
TXN
*
pTxn
,
SBTree
*
pBt
)
{
static
int
tdbFetchOvflPage
(
SPgno
*
pPgno
,
SPage
**
ppOfp
,
TXN
*
pTxn
,
SBTree
*
pBt
)
{
int
ret
=
0
;
*
pPgno
=
0
;
SBtreeInitPageArg
iArg
;
iArg
.
pBt
=
pBt
;
iArg
.
flags
=
TDB_FLAG_ADD
(
0
,
TDB_BTREE_OVFL
);
ret
=
tdbPagerFetchPage
(
pPager
,
pPgno
,
ppOfp
,
tdbBtreeInitPage
,
&
iArg
,
pTxn
);
ret
=
tdbPagerFetchPage
(
p
Bt
->
p
Pager
,
pPgno
,
ppOfp
,
tdbBtreeInitPage
,
&
iArg
,
pTxn
);
if
(
ret
<
0
)
{
return
-
1
;
}
// mark dirty
ret
=
tdbPagerWrite
(
pPager
,
*
ppOfp
);
ret
=
tdbPagerWrite
(
p
Bt
->
p
Pager
,
*
ppOfp
);
if
(
ret
<
0
)
{
ASSERT
(
0
);
return
-
1
;
...
...
@@ -879,13 +879,13 @@ static int tdbFetchOvflPage(SPager *pPager, SPgno *pPgno, SPage **ppOfp, TXN *pT
return
ret
;
}
static
int
tdbLoadOvflPage
(
SP
ager
*
pPager
,
SP
gno
*
pPgno
,
SPage
**
ppOfp
,
TXN
*
pTxn
,
SBTree
*
pBt
)
{
static
int
tdbLoadOvflPage
(
SPgno
*
pPgno
,
SPage
**
ppOfp
,
TXN
*
pTxn
,
SBTree
*
pBt
)
{
int
ret
=
0
;
SBtreeInitPageArg
iArg
;
iArg
.
pBt
=
pBt
;
iArg
.
flags
=
TDB_FLAG_ADD
(
0
,
TDB_BTREE_OVFL
);
ret
=
tdbPagerFetchPage
(
pPager
,
pPgno
,
ppOfp
,
tdbBtreeInitPage
,
&
iArg
,
pTxn
);
ret
=
tdbPagerFetchPage
(
p
Bt
->
p
Pager
,
pPgno
,
ppOfp
,
tdbBtreeInitPage
,
&
iArg
,
pTxn
);
if
(
ret
<
0
)
{
return
-
1
;
}
...
...
@@ -922,7 +922,7 @@ static int tdbBtreeEncodePayload(SPage *pPage, SCell *pCell, int nHeader, const
SPgno
pgno
=
0
;
SPage
*
ofp
,
*
nextOfp
;
ret
=
tdbFetchOvflPage
(
pPage
->
pPager
,
&
pgno
,
&
ofp
,
pTxn
,
pBt
);
ret
=
tdbFetchOvflPage
(
&
pgno
,
&
ofp
,
pTxn
,
pBt
);
if
(
ret
<
0
)
{
return
-
1
;
}
...
...
@@ -962,7 +962,7 @@ static int tdbBtreeEncodePayload(SPage *pPage, SCell *pCell, int nHeader, const
// fetch next ofp if not last page
if
(
!
lastPage
)
{
// fetch a new ofp and make it dirty
ret
=
tdbFetchOvflPage
(
pPage
->
pPager
,
&
pgno
,
&
nextOfp
,
pTxn
,
pBt
);
ret
=
tdbFetchOvflPage
(
&
pgno
,
&
nextOfp
,
pTxn
,
pBt
);
if
(
ret
<
0
)
{
tdbFree
(
pBuf
);
return
-
1
;
...
...
@@ -1019,14 +1019,14 @@ static int tdbBtreeEncodePayload(SPage *pPage, SCell *pCell, int nHeader, const
nLeft
-=
lastKeyPageSpace
;
// fetch next ofp, a new ofp and make it dirty
ret
=
tdbFetchOvflPage
(
pPage
->
pPager
,
&
pgno
,
&
nextOfp
,
pTxn
,
pBt
);
ret
=
tdbFetchOvflPage
(
&
pgno
,
&
nextOfp
,
pTxn
,
pBt
);
if
(
ret
<
0
)
{
return
-
1
;
}
}
}
else
{
// fetch next ofp, a new ofp and make it dirty
ret
=
tdbFetchOvflPage
(
pPage
->
pPager
,
&
pgno
,
&
nextOfp
,
pTxn
,
pBt
);
ret
=
tdbFetchOvflPage
(
&
pgno
,
&
nextOfp
,
pTxn
,
pBt
);
if
(
ret
<
0
)
{
return
-
1
;
}
...
...
@@ -1057,7 +1057,7 @@ static int tdbBtreeEncodePayload(SPage *pPage, SCell *pCell, int nHeader, const
// fetch next ofp if not last page
if
(
!
lastPage
)
{
// fetch a new ofp and make it dirty
ret
=
tdbFetchOvflPage
(
pPage
->
pPager
,
&
pgno
,
&
nextOfp
,
pTxn
,
pBt
);
ret
=
tdbFetchOvflPage
(
&
pgno
,
&
nextOfp
,
pTxn
,
pBt
);
if
(
ret
<
0
)
{
tdbFree
(
pBuf
);
return
-
1
;
...
...
@@ -1198,7 +1198,7 @@ static int tdbBtreeDecodePayload(SPage *pPage, const SCell *pCell, int nHeader,
// unpack left val data from ovpages
while
(
pgno
!=
0
)
{
ret
=
tdbLoadOvflPage
(
pPage
->
pPager
,
&
pgno
,
&
ofp
,
pTxn
,
pBt
);
ret
=
tdbLoadOvflPage
(
&
pgno
,
&
ofp
,
pTxn
,
pBt
);
if
(
ret
<
0
)
{
return
-
1
;
}
...
...
@@ -1235,7 +1235,7 @@ static int tdbBtreeDecodePayload(SPage *pPage, const SCell *pCell, int nHeader,
int
lastKeyPageSpace
=
0
;
// load left key & val to ovpages
while
(
pgno
!=
0
)
{
ret
=
tdbLoadOvflPage
(
pPage
->
pPager
,
&
pgno
,
&
ofp
,
pTxn
,
pBt
);
ret
=
tdbLoadOvflPage
(
&
pgno
,
&
ofp
,
pTxn
,
pBt
);
if
(
ret
<
0
)
{
return
-
1
;
}
...
...
@@ -1280,7 +1280,7 @@ static int tdbBtreeDecodePayload(SPage *pPage, const SCell *pCell, int nHeader,
}
while
(
nLeft
>
0
)
{
ret
=
tdbLoadOvflPage
(
pPage
->
pPager
,
&
pgno
,
&
ofp
,
pTxn
,
pBt
);
ret
=
tdbLoadOvflPage
(
&
pgno
,
&
ofp
,
pTxn
,
pBt
);
if
(
ret
<
0
)
{
return
-
1
;
}
...
...
@@ -1411,7 +1411,7 @@ static int tdbBtreeCellSize(const SPage *pPage, SCell *pCell, int dropOfp, TXN *
int
bytes
;
while
(
pgno
!=
0
)
{
ret
=
tdbLoadOvflPage
(
pPage
->
pPager
,
&
pgno
,
&
ofp
,
pTxn
,
pBt
);
ret
=
tdbLoadOvflPage
(
&
pgno
,
&
ofp
,
pTxn
,
pBt
);
if
(
ret
<
0
)
{
return
-
1
;
}
...
...
@@ -2023,7 +2023,7 @@ int tdbBtcMoveTo(SBTC *pBtc, const void *pKey, int kLen, int *pCRst) {
// check if key <= current position
if (idx < nCells) {
pCell = tdbPageGetCell(pPage, idx);
tdbBtreeDecodeCell(pPage, pCell, &cd
, pBtc->pTxn, pBtc->pBt
);
tdbBtreeDecodeCell(pPage, pCell, &cd);
c = pBt->kcmpr(pKey, kLen, cd.pKey, cd.kLen);
if (c > 0) break;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录