Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
e3771119
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看板
提交
e3771119
编写于
2月 21, 2022
作者:
H
Hongze Cheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
start to integrate pager of sqlite
上级
44b30074
变更
3
展开全部
隐藏空白更改
内联
并排
Showing
3 changed file
with
7801 addition
and
7801 deletion
+7801
-7801
source/libs/tdb/src/sqlite/pager.c
source/libs/tdb/src/sqlite/pager.c
+7674
-7677
source/libs/tdb/src/sqliteinc/pager.h
source/libs/tdb/src/sqliteinc/pager.h
+124
-124
source/libs/tdb/src/sqliteinc/sqliteInt.h
source/libs/tdb/src/sqliteinc/sqliteInt.h
+3
-0
未找到文件。
source/libs/tdb/src/sqlite/pager.c
浏览文件 @
e3771119
此差异已折叠。
点击以展开。
source/libs/tdb/src/sqliteinc/pager.h
浏览文件 @
e3771119
...
...
@@ -42,15 +42,15 @@ typedef struct Pager Pager;
*/
typedef
struct
PgHdr
DbPage
;
/*
** Page number PAGER_MJ_PGNO is never used in an SQLite database (it is
** reserved for working around a windows/posix incompatibility). It is
** used in the journal to signify that the remainder of the journal file
** is devoted to storing a super-journal name - there are no more pages to
** roll back. See comments for function writeSuperJournal() in pager.c
** for details.
*/
#define PAGER_MJ_PGNO(x) ((Pgno)((PENDING_BYTE/((x)->pageSize))+1))
/
/ /
*
//
** Page number PAGER_MJ_PGNO is never used in an SQLite database (it is
//
** reserved for working around a windows/posix incompatibility). It is
//
** used in the journal to signify that the remainder of the journal file
//
** is devoted to storing a super-journal name - there are no more pages to
//
** roll back. See comments for function writeSuperJournal() in pager.c
//
** for details.
//
*/
//
#define PAGER_MJ_PGNO(x) ((Pgno)((PENDING_BYTE/((x)->pageSize))+1))
/*
** Allowed values for the flags parameter to sqlite3PagerOpen().
...
...
@@ -123,120 +123,120 @@ int sqlite3PagerOpen(
void
(
*
)(
DbPage
*
)
);
int
sqlite3PagerClose
(
Pager
*
pPager
,
sqlite3
*
);
int
sqlite3PagerReadFileheader
(
Pager
*
,
int
,
unsigned
char
*
);
/* Functions used to configure a Pager object. */
void
sqlite3PagerSetBusyHandler
(
Pager
*
,
int
(
*
)(
void
*
),
void
*
);
int
sqlite3PagerSetPagesize
(
Pager
*
,
u32
*
,
int
);
Pgno
sqlite3PagerMaxPageCount
(
Pager
*
,
Pgno
);
void
sqlite3PagerSetCachesize
(
Pager
*
,
int
);
int
sqlite3PagerSetSpillsize
(
Pager
*
,
int
);
void
sqlite3PagerSetMmapLimit
(
Pager
*
,
sqlite3_int64
);
void
sqlite3PagerShrink
(
Pager
*
);
void
sqlite3PagerSetFlags
(
Pager
*
,
unsigned
);
int
sqlite3PagerLockingMode
(
Pager
*
,
int
);
int
sqlite3PagerSetJournalMode
(
Pager
*
,
int
);
int
sqlite3PagerGetJournalMode
(
Pager
*
);
int
sqlite3PagerOkToChangeJournalMode
(
Pager
*
);
i64
sqlite3PagerJournalSizeLimit
(
Pager
*
,
i64
);
sqlite3_backup
**
sqlite3PagerBackupPtr
(
Pager
*
);
int
sqlite3PagerFlush
(
Pager
*
);
/* Functions used to obtain and release page references. */
int
sqlite3PagerGet
(
Pager
*
pPager
,
Pgno
pgno
,
DbPage
**
ppPage
,
int
clrFlag
);
DbPage
*
sqlite3PagerLookup
(
Pager
*
pPager
,
Pgno
pgno
);
void
sqlite3PagerRef
(
DbPage
*
);
void
sqlite3PagerUnref
(
DbPage
*
);
void
sqlite3PagerUnrefNotNull
(
DbPage
*
);
void
sqlite3PagerUnrefPageOne
(
DbPage
*
);
/* Operations on page references. */
int
sqlite3PagerWrite
(
DbPage
*
);
void
sqlite3PagerDontWrite
(
DbPage
*
);
int
sqlite3PagerMovepage
(
Pager
*
,
DbPage
*
,
Pgno
,
int
);
int
sqlite3PagerPageRefcount
(
DbPage
*
);
void
*
sqlite3PagerGetData
(
DbPage
*
);
void
*
sqlite3PagerGetExtra
(
DbPage
*
);
/* Functions used to manage pager transactions and savepoints. */
void
sqlite3PagerPagecount
(
Pager
*
,
int
*
);
int
sqlite3PagerBegin
(
Pager
*
,
int
exFlag
,
int
);
int
sqlite3PagerCommitPhaseOne
(
Pager
*
,
const
char
*
zSuper
,
int
);
int
sqlite3PagerExclusiveLock
(
Pager
*
);
int
sqlite3PagerSync
(
Pager
*
pPager
,
const
char
*
zSuper
);
int
sqlite3PagerCommitPhaseTwo
(
Pager
*
);
int
sqlite3PagerRollback
(
Pager
*
);
int
sqlite3PagerOpenSavepoint
(
Pager
*
pPager
,
int
n
);
int
sqlite3PagerSavepoint
(
Pager
*
pPager
,
int
op
,
int
iSavepoint
);
int
sqlite3PagerSharedLock
(
Pager
*
pPager
);
#ifndef SQLITE_OMIT_WAL
int
sqlite3PagerCheckpoint
(
Pager
*
pPager
,
sqlite3
*
,
int
,
int
*
,
int
*
);
int
sqlite3PagerWalSupported
(
Pager
*
pPager
);
int
sqlite3PagerWalCallback
(
Pager
*
pPager
);
int
sqlite3PagerOpenWal
(
Pager
*
pPager
,
int
*
pisOpen
);
int
sqlite3PagerCloseWal
(
Pager
*
pPager
,
sqlite3
*
);
# ifdef SQLITE_ENABLE_SNAPSHOT
int
sqlite3PagerSnapshotGet
(
Pager
*
,
sqlite3_snapshot
**
ppSnapshot
);
int
sqlite3PagerSnapshotOpen
(
Pager
*
,
sqlite3_snapshot
*
pSnapshot
);
int
sqlite3PagerSnapshotRecover
(
Pager
*
pPager
);
int
sqlite3PagerSnapshotCheck
(
Pager
*
pPager
,
sqlite3_snapshot
*
pSnapshot
);
void
sqlite3PagerSnapshotUnlock
(
Pager
*
pPager
);
# endif
#endif
#if !defined(SQLITE_OMIT_WAL) && defined(SQLITE_ENABLE_SETLK_TIMEOUT)
int
sqlite3PagerWalWriteLock
(
Pager
*
,
int
);
void
sqlite3PagerWalDb
(
Pager
*
,
sqlite3
*
);
#else
# define sqlite3PagerWalWriteLock(y,z) SQLITE_OK
# define sqlite3PagerWalDb(x,y)
#endif
#ifdef SQLITE_DIRECT_OVERFLOW_READ
int
sqlite3PagerDirectReadOk
(
Pager
*
pPager
,
Pgno
pgno
);
#endif
#ifdef SQLITE_ENABLE_ZIPVFS
int
sqlite3PagerWalFramesize
(
Pager
*
pPager
);
#endif
/* Functions used to query pager state and configuration. */
u8
sqlite3PagerIsreadonly
(
Pager
*
);
u32
sqlite3PagerDataVersion
(
Pager
*
);
#ifdef SQLITE_DEBUG
int
sqlite3PagerRefcount
(
Pager
*
);
#endif
int
sqlite3PagerMemUsed
(
Pager
*
);
const
char
*
sqlite3PagerFilename
(
const
Pager
*
,
int
);
sqlite3_vfs
*
sqlite3PagerVfs
(
Pager
*
);
sqlite3_file
*
sqlite3PagerFile
(
Pager
*
);
sqlite3_file
*
sqlite3PagerJrnlFile
(
Pager
*
);
const
char
*
sqlite3PagerJournalname
(
Pager
*
);
void
*
sqlite3PagerTempSpace
(
Pager
*
);
int
sqlite3PagerIsMemdb
(
Pager
*
);
void
sqlite3PagerCacheStat
(
Pager
*
,
int
,
int
,
int
*
);
void
sqlite3PagerClearCache
(
Pager
*
);
int
sqlite3SectorSize
(
sqlite3_file
*
);
/* Functions used to truncate the database file. */
void
sqlite3PagerTruncateImage
(
Pager
*
,
Pgno
);
void
sqlite3PagerRekey
(
DbPage
*
,
Pgno
,
u16
);
/* Functions to support testing and debugging. */
#if !defined(NDEBUG) || defined(SQLITE_TEST)
Pgno
sqlite3PagerPagenumber
(
DbPage
*
);
int
sqlite3PagerIswriteable
(
DbPage
*
);
#endif
#ifdef SQLITE_TEST
int
*
sqlite3PagerStats
(
Pager
*
);
void
sqlite3PagerRefdump
(
Pager
*
);
void
disable_simulated_io_errors
(
void
);
void
enable_simulated_io_errors
(
void
);
#else
# define disable_simulated_io_errors()
# define enable_simulated_io_errors()
#endif
//
int sqlite3PagerReadFileheader(Pager*, int, unsigned char*);
/
/ /
* Functions used to configure a Pager object. */
//
void sqlite3PagerSetBusyHandler(Pager*, int(*)(void *), void *);
//
int sqlite3PagerSetPagesize(Pager*, u32*, int);
//
Pgno sqlite3PagerMaxPageCount(Pager*, Pgno);
//
void sqlite3PagerSetCachesize(Pager*, int);
//
int sqlite3PagerSetSpillsize(Pager*, int);
//
void sqlite3PagerSetMmapLimit(Pager *, sqlite3_int64);
//
void sqlite3PagerShrink(Pager*);
//
void sqlite3PagerSetFlags(Pager*,unsigned);
//
int sqlite3PagerLockingMode(Pager *, int);
//
int sqlite3PagerSetJournalMode(Pager *, int);
//
int sqlite3PagerGetJournalMode(Pager*);
//
int sqlite3PagerOkToChangeJournalMode(Pager*);
//
i64 sqlite3PagerJournalSizeLimit(Pager *, i64);
//
sqlite3_backup **sqlite3PagerBackupPtr(Pager*);
//
int sqlite3PagerFlush(Pager*);
/
/ /
* Functions used to obtain and release page references. */
//
int sqlite3PagerGet(Pager *pPager, Pgno pgno, DbPage **ppPage, int clrFlag);
//
DbPage *sqlite3PagerLookup(Pager *pPager, Pgno pgno);
//
void sqlite3PagerRef(DbPage*);
//
void sqlite3PagerUnref(DbPage*);
//
void sqlite3PagerUnrefNotNull(DbPage*);
//
void sqlite3PagerUnrefPageOne(DbPage*);
/
/ /
* Operations on page references. */
//
int sqlite3PagerWrite(DbPage*);
//
void sqlite3PagerDontWrite(DbPage*);
//
int sqlite3PagerMovepage(Pager*,DbPage*,Pgno,int);
//
int sqlite3PagerPageRefcount(DbPage*);
//
void *sqlite3PagerGetData(DbPage *);
//
void *sqlite3PagerGetExtra(DbPage *);
/
/ /
* Functions used to manage pager transactions and savepoints. */
//
void sqlite3PagerPagecount(Pager*, int*);
//
int sqlite3PagerBegin(Pager*, int exFlag, int);
//
int sqlite3PagerCommitPhaseOne(Pager*,const char *zSuper, int);
//
int sqlite3PagerExclusiveLock(Pager*);
//
int sqlite3PagerSync(Pager *pPager, const char *zSuper);
//
int sqlite3PagerCommitPhaseTwo(Pager*);
//
int sqlite3PagerRollback(Pager*);
//
int sqlite3PagerOpenSavepoint(Pager *pPager, int n);
//
int sqlite3PagerSavepoint(Pager *pPager, int op, int iSavepoint);
//
int sqlite3PagerSharedLock(Pager *pPager);
//
#ifndef SQLITE_OMIT_WAL
//
int sqlite3PagerCheckpoint(Pager *pPager, sqlite3*, int, int*, int*);
//
int sqlite3PagerWalSupported(Pager *pPager);
//
int sqlite3PagerWalCallback(Pager *pPager);
//
int sqlite3PagerOpenWal(Pager *pPager, int *pisOpen);
//
int sqlite3PagerCloseWal(Pager *pPager, sqlite3*);
//
# ifdef SQLITE_ENABLE_SNAPSHOT
//
int sqlite3PagerSnapshotGet(Pager*, sqlite3_snapshot **ppSnapshot);
//
int sqlite3PagerSnapshotOpen(Pager*, sqlite3_snapshot *pSnapshot);
//
int sqlite3PagerSnapshotRecover(Pager *pPager);
//
int sqlite3PagerSnapshotCheck(Pager *pPager, sqlite3_snapshot *pSnapshot);
//
void sqlite3PagerSnapshotUnlock(Pager *pPager);
//
# endif
//
#endif
//
#if !defined(SQLITE_OMIT_WAL) && defined(SQLITE_ENABLE_SETLK_TIMEOUT)
//
int sqlite3PagerWalWriteLock(Pager*, int);
//
void sqlite3PagerWalDb(Pager*, sqlite3*);
//
#else
//
# define sqlite3PagerWalWriteLock(y,z) SQLITE_OK
//
# define sqlite3PagerWalDb(x,y)
//
#endif
//
#ifdef SQLITE_DIRECT_OVERFLOW_READ
//
int sqlite3PagerDirectReadOk(Pager *pPager, Pgno pgno);
//
#endif
//
#ifdef SQLITE_ENABLE_ZIPVFS
//
int sqlite3PagerWalFramesize(Pager *pPager);
//
#endif
/
/ /
* Functions used to query pager state and configuration. */
//
u8 sqlite3PagerIsreadonly(Pager*);
//
u32 sqlite3PagerDataVersion(Pager*);
//
#ifdef SQLITE_DEBUG
//
int sqlite3PagerRefcount(Pager*);
//
#endif
//
int sqlite3PagerMemUsed(Pager*);
//
const char *sqlite3PagerFilename(const Pager*, int);
//
sqlite3_vfs *sqlite3PagerVfs(Pager*);
//
sqlite3_file *sqlite3PagerFile(Pager*);
//
sqlite3_file *sqlite3PagerJrnlFile(Pager*);
//
const char *sqlite3PagerJournalname(Pager*);
//
void *sqlite3PagerTempSpace(Pager*);
//
int sqlite3PagerIsMemdb(Pager*);
//
void sqlite3PagerCacheStat(Pager *, int, int, int *);
//
void sqlite3PagerClearCache(Pager*);
//
int sqlite3SectorSize(sqlite3_file *);
/
/ /
* Functions used to truncate the database file. */
//
void sqlite3PagerTruncateImage(Pager*,Pgno);
//
void sqlite3PagerRekey(DbPage*, Pgno, u16);
/
/ /
* Functions to support testing and debugging. */
//
#if !defined(NDEBUG) || defined(SQLITE_TEST)
//
Pgno sqlite3PagerPagenumber(DbPage*);
//
int sqlite3PagerIswriteable(DbPage*);
//
#endif
//
#ifdef SQLITE_TEST
//
int *sqlite3PagerStats(Pager*);
//
void sqlite3PagerRefdump(Pager*);
//
void disable_simulated_io_errors(void);
//
void enable_simulated_io_errors(void);
//
#else
//
# define disable_simulated_io_errors()
//
# define enable_simulated_io_errors()
//
#endif
#endif
/* SQLITE_PAGER_H */
source/libs/tdb/src/sqliteinc/sqliteInt.h
浏览文件 @
e3771119
...
...
@@ -43,6 +43,9 @@ typedef struct sqlite3_pcache_page {
#define ROUND8(x) (((x) + 7) & ~7)
typedef
struct
sqlite3_vfs
sqlite3_vfs
;
typedef
struct
sqlite3
sqlite3
;
#include "pager.h"
#include "pcache.h"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录