mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-15 11:41:13 +03:00
Add xShmXXX() methods to the test VFS in test_devsym.test.
FossilOrigin-Name: 1d20342424b452ea96aaf161de1f98f26a9155a0
This commit is contained in:
24
manifest
24
manifest
@@ -1,8 +1,5 @@
|
|||||||
-----BEGIN PGP SIGNED MESSAGE-----
|
C Add\sxShmXXX()\smethods\sto\sthe\stest\sVFS\sin\stest_devsym.test.
|
||||||
Hash: SHA1
|
D 2010-04-30T16:19:40
|
||||||
|
|
||||||
C Correctly\srecord\sthe\sfact\sthat\sthe\sSHM\slock\sreached\sPENDING\sif\sit\sdid\sso\nbut\sfailed\sto\sreach\sCHECKPOINT.
|
|
||||||
D 2010-04-30T16:12:04
|
|
||||||
F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
|
F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
|
||||||
F Makefile.in d83a0ffef3dcbfb08b410a6c6dd6c009ec9167fb
|
F Makefile.in d83a0ffef3dcbfb08b410a6c6dd6c009ec9167fb
|
||||||
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
|
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
|
||||||
@@ -191,7 +188,7 @@ F src/test_backup.c c129c91127e9b46e335715ae2e75756e25ba27de
|
|||||||
F src/test_btree.c 47cd771250f09cdc6e12dda5bc71bc0b3abc96e2
|
F src/test_btree.c 47cd771250f09cdc6e12dda5bc71bc0b3abc96e2
|
||||||
F src/test_config.c 8c408fbffbe8082d1d3dc55044ddfd5580f3c9b9
|
F src/test_config.c 8c408fbffbe8082d1d3dc55044ddfd5580f3c9b9
|
||||||
F src/test_demovfs.c da81a5f7785bb352bda7911c332a983ec4f17f27
|
F src/test_demovfs.c da81a5f7785bb352bda7911c332a983ec4f17f27
|
||||||
F src/test_devsym.c 361d069bf74d4044bf53eb29dc0fa3709ed98baf
|
F src/test_devsym.c c05024cd179603181cde66d0ff83ce81e146f6de
|
||||||
F src/test_func.c 13b582345fb1185a93e46c53310fae8547dcce20
|
F src/test_func.c 13b582345fb1185a93e46c53310fae8547dcce20
|
||||||
F src/test_hexio.c 1237f000ec7a491009b1233f5c626ea71bce1ea2
|
F src/test_hexio.c 1237f000ec7a491009b1233f5c626ea71bce1ea2
|
||||||
F src/test_init.c 5d624ffd0409d424cf9adbfe1f056b200270077c
|
F src/test_init.c 5d624ffd0409d424cf9adbfe1f056b200270077c
|
||||||
@@ -811,14 +808,7 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
|
|||||||
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
|
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
|
||||||
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
|
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
|
||||||
F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
|
F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
|
||||||
P 69567c5fca9e30b7660e6f56350be929c3890d7e
|
P d9250e84ac1fc6590f8670e1d801630650c7846a
|
||||||
R f1e5ca7c2966e55a12226da1f0023970
|
R e706456f30289526a342dac546a83543
|
||||||
U drh
|
U dan
|
||||||
Z 994a305fc2d5c733b714331360471304
|
Z 9513429a159541b5d8980cb57914a083
|
||||||
-----BEGIN PGP SIGNATURE-----
|
|
||||||
Version: GnuPG v1.4.6 (GNU/Linux)
|
|
||||||
|
|
||||||
iD8DBQFL2wFboxKgR168RlERAtivAJ421LoVOiKR0QgB26iqLm0H6jPUVQCfaTeL
|
|
||||||
mXtGX6pDDXUBVGxSGpeJW2k=
|
|
||||||
=Sf6+
|
|
||||||
-----END PGP SIGNATURE-----
|
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
d9250e84ac1fc6590f8670e1d801630650c7846a
|
1d20342424b452ea96aaf161de1f98f26a9155a0
|
||||||
@@ -68,8 +68,16 @@ static int devsymRandomness(sqlite3_vfs*, int nByte, char *zOut);
|
|||||||
static int devsymSleep(sqlite3_vfs*, int microseconds);
|
static int devsymSleep(sqlite3_vfs*, int microseconds);
|
||||||
static int devsymCurrentTime(sqlite3_vfs*, double*);
|
static int devsymCurrentTime(sqlite3_vfs*, double*);
|
||||||
|
|
||||||
|
static int devsymShmOpen(sqlite3_vfs *, const char *, sqlite3_shm **);
|
||||||
|
static int devsymShmSize(sqlite3_shm *, int , int *);
|
||||||
|
static int devsymShmGet(sqlite3_shm *, int , int *, void **);
|
||||||
|
static int devsymShmRelease(sqlite3_shm *);
|
||||||
|
static int devsymShmLock(sqlite3_shm *, int , int *);
|
||||||
|
static int devsymShmClose(sqlite3_shm *);
|
||||||
|
static int devsymShmDelete(sqlite3_vfs *, const char *);
|
||||||
|
|
||||||
static sqlite3_vfs devsym_vfs = {
|
static sqlite3_vfs devsym_vfs = {
|
||||||
1, /* iVersion */
|
2, /* iVersion */
|
||||||
sizeof(devsym_file), /* szOsFile */
|
sizeof(devsym_file), /* szOsFile */
|
||||||
DEVSYM_MAX_PATHNAME, /* mxPathname */
|
DEVSYM_MAX_PATHNAME, /* mxPathname */
|
||||||
0, /* pNext */
|
0, /* pNext */
|
||||||
@@ -93,6 +101,18 @@ static sqlite3_vfs devsym_vfs = {
|
|||||||
devsymRandomness, /* xRandomness */
|
devsymRandomness, /* xRandomness */
|
||||||
devsymSleep, /* xSleep */
|
devsymSleep, /* xSleep */
|
||||||
devsymCurrentTime, /* xCurrentTime */
|
devsymCurrentTime, /* xCurrentTime */
|
||||||
|
0, /* xGetLastError */
|
||||||
|
devsymShmOpen,
|
||||||
|
devsymShmSize,
|
||||||
|
devsymShmGet,
|
||||||
|
devsymShmRelease,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
devsymShmLock,
|
||||||
|
devsymShmClose,
|
||||||
|
devsymShmDelete,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
};
|
};
|
||||||
|
|
||||||
static sqlite3_io_methods devsym_io_methods = {
|
static sqlite3_io_methods devsym_io_methods = {
|
||||||
@@ -333,6 +353,38 @@ static int devsymCurrentTime(sqlite3_vfs *pVfs, double *pTimeOut){
|
|||||||
return sqlite3OsCurrentTime(g.pVfs, pTimeOut);
|
return sqlite3OsCurrentTime(g.pVfs, pTimeOut);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static int devsymShmOpen(
|
||||||
|
sqlite3_vfs *pVfs,
|
||||||
|
const char *zName,
|
||||||
|
sqlite3_shm **pp
|
||||||
|
){
|
||||||
|
return g.pVfs->xShmOpen(g.pVfs, zName, pp);
|
||||||
|
}
|
||||||
|
static int devsymShmSize(sqlite3_shm *p, int reqSize, int *pNewSize){
|
||||||
|
return g.pVfs->xShmSize(p, reqSize, pNewSize);
|
||||||
|
}
|
||||||
|
static int devsymShmGet(
|
||||||
|
sqlite3_shm *p,
|
||||||
|
int reqMapSize,
|
||||||
|
int *pMapSize,
|
||||||
|
void **pp
|
||||||
|
){
|
||||||
|
return g.pVfs->xShmGet(p, reqMapSize, pMapSize, pp);
|
||||||
|
}
|
||||||
|
static int devsymShmRelease(sqlite3_shm *p){
|
||||||
|
return g.pVfs->xShmRelease(p);
|
||||||
|
}
|
||||||
|
static int devsymShmLock(sqlite3_shm *p, int desiredLock, int *gotLock){
|
||||||
|
return g.pVfs->xShmLock(p, desiredLock, gotLock);
|
||||||
|
}
|
||||||
|
static int devsymShmClose(sqlite3_shm *p){
|
||||||
|
return g.pVfs->xShmClose(p);
|
||||||
|
}
|
||||||
|
static int devsymShmDelete(sqlite3_vfs *pVfs, const char *zName){
|
||||||
|
return g.pVfs->xShmDelete(g.pVfs, zName);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** This procedure registers the devsym vfs with SQLite. If the argument is
|
** This procedure registers the devsym vfs with SQLite. If the argument is
|
||||||
** true, the devsym vfs becomes the new default vfs. It is the only publicly
|
** true, the devsym vfs becomes the new default vfs. It is the only publicly
|
||||||
@@ -342,6 +394,13 @@ void devsym_register(int iDeviceChar, int iSectorSize){
|
|||||||
if( g.pVfs==0 ){
|
if( g.pVfs==0 ){
|
||||||
g.pVfs = sqlite3_vfs_find(0);
|
g.pVfs = sqlite3_vfs_find(0);
|
||||||
devsym_vfs.szOsFile += g.pVfs->szOsFile;
|
devsym_vfs.szOsFile += g.pVfs->szOsFile;
|
||||||
|
devsym_vfs.xShmOpen = (g.pVfs->xShmOpen ? devsymShmOpen : 0);
|
||||||
|
devsym_vfs.xShmSize = (g.pVfs->xShmSize ? devsymShmSize : 0);
|
||||||
|
devsym_vfs.xShmGet = (g.pVfs->xShmGet ? devsymShmGet : 0);
|
||||||
|
devsym_vfs.xShmRelease = (g.pVfs->xShmRelease ? devsymShmRelease : 0);
|
||||||
|
devsym_vfs.xShmLock = (g.pVfs->xShmLock ? devsymShmLock : 0);
|
||||||
|
devsym_vfs.xShmClose = (g.pVfs->xShmClose ? devsymShmClose : 0);
|
||||||
|
devsym_vfs.xShmDelete = (g.pVfs->xShmDelete ? devsymShmDelete : 0);
|
||||||
sqlite3_vfs_register(&devsym_vfs, 0);
|
sqlite3_vfs_register(&devsym_vfs, 0);
|
||||||
}
|
}
|
||||||
if( iDeviceChar>=0 ){
|
if( iDeviceChar>=0 ){
|
||||||
|
|||||||
Reference in New Issue
Block a user