OpenCoverage

wal.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/sqlite/src/src/wal.c
Switch to Source codePreprocessed file
LineSourceCount
1typedef struct WalIndexHdr WalIndexHdr;-
2typedef struct WalIterator WalIterator;-
3typedef struct WalCkptInfo WalCkptInfo;-
4struct WalIndexHdr {-
5 u32 iVersion;-
6 u32 unused;-
7 u32 iChange;-
8 u8 isInit;-
9 u8 bigEndCksum;-
10 u16 szPage;-
11 u32 mxFrame;-
12 u32 nPage;-
13 u32 aFrameCksum[2];-
14 u32 aSalt[2];-
15 u32 aCksum[2];-
16};-
17struct WalCkptInfo {-
18 u32 nBackfill;-
19 u32 aReadMark[(8 -3)];-
20 u8 aLock[8];-
21 u32 nBackfillAttempted;-
22 u32 notUsed0;-
23};-
24struct Wal {-
25 sqlite3_vfs *pVfs;-
26 sqlite3_file *pDbFd;-
27 sqlite3_file *pWalFd;-
28 u32 iCallback;-
29 i64 mxWalSize;-
30 int nWiData;-
31 int szFirstBlock;-
32 volatile u32 **apWiData;-
33 u32 szPage;-
34 i16 readLock;-
35 u8 syncFlags;-
36 u8 exclusiveMode;-
37 u8 writeLock;-
38 u8 ckptLock;-
39 u8 readOnly;-
40 u8 truncateOnCommit;-
41 u8 syncHeader;-
42 u8 padToSectorBoundary;-
43 u8 bShmUnreliable;-
44 WalIndexHdr hdr;-
45 u32 minFrame;-
46 u32 iReCksum;-
47 const char *zWalName;-
48 u32 nCkpt;-
49-
50-
51-
52-
53-
54-
55};-
56typedef u16 ht_slot;-
57struct WalIterator {-
58 int iPrior;-
59 int nSegment;-
60 struct WalSegment {-
61 int iNext;-
62 ht_slot *aIndex;-
63 u32 *aPgno;-
64 int nEntry;-
65 int iZero;-
66 } aSegment[1];-
67};-
68static __attribute__((noinline)) int walIndexPageRealloc(-
69 Wal *pWal,-
70 int iPage,-
71 volatile u32 **ppPage-
72){-
73 int rc = 0;-
74-
75-
76 if( pWal->nWiData<=iPage
pWal->nWiData<=iPageDescription
TRUEevaluated 1514 times by 49 tests
Evaluated by:
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • ...
FALSEevaluated 920 times by 21 tests
Evaluated by:
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (438)
  • Self test (74)
  • Self test (79)
  • Self test (81)
  • Self test (83)
  • Self test (85)
  • Self test (90)
  • Self test (91)
  • Self test (92)
  • Self test (93)
  • Self test (94)
  • Self test (95)
  • Self test (96)
  • Self test (97)
  • Self test (98)
  • Self test (99)
){
920-1514
77 int nByte = sizeof(u32*)*(iPage+1);-
78 volatile u32 **apNew;-
79 apNew = (volatile u32 **)sqlite3_realloc64((void *)pWal->apWiData, nByte);-
80 if( !apNew
!apNewDescription
TRUEnever evaluated
FALSEevaluated 1514 times by 49 tests
Evaluated by:
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • ...
){
0-1514
81 *ppPage = 0;-
82 return
never executed: return 7;
7;
never executed: return 7;
0
83 }-
84 memset((void*)&apNew[pWal->nWiData], 0,-
85 sizeof(u32*)*(iPage+1-pWal->nWiData));-
86 pWal->apWiData = apNew;-
87 pWal->nWiData = iPage+1;-
88 }
executed 1514 times by 49 tests: end of block
Executed by:
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • ...
1514
89-
90-
91 -
92 ((void) (0))-
93 ;-
94 if( pWal->exclusiveMode==2
pWal->exclusiveMode==2Description
TRUEevaluated 34 times by 2 tests
Evaluated by:
  • Self test (104)
  • Self test (438)
FALSEevaluated 2400 times by 49 tests
Evaluated by:
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • ...
){
34-2400
95 pWal->apWiData[iPage] = (u32 volatile *)sqlite3MallocZero(( sizeof(ht_slot)*(4096*2) + 4096*sizeof(u32) ));-
96 if( !pWal->apWiData[iPage]
!pWal->apWiData[iPage]Description
TRUEnever evaluated
FALSEevaluated 34 times by 2 tests
Evaluated by:
  • Self test (104)
  • Self test (438)
) rc = 7;
never executed: rc = 7;
0-34
97 }
executed 34 times by 2 tests: end of block
Executed by:
  • Self test (104)
  • Self test (438)
else{
34
98 rc = sqlite3OsShmMap(pWal->pDbFd, iPage, ( sizeof(ht_slot)*(4096*2) + 4096*sizeof(u32) ),-
99 pWal->writeLock, (void volatile **)&pWal->apWiData[iPage]-
100 );-
101 -
102 ((void) (0))-
103 ;-
104 ;-
105 if( (
(rc&0xff)==8Description
TRUEevaluated 32 times by 3 tests
Evaluated by:
  • Self test (103)
  • Self test (104)
  • Self test (438)
FALSEevaluated 2368 times by 48 tests
Evaluated by:
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • Self test (75)
  • ...
rc&0xff)==8
(rc&0xff)==8Description
TRUEevaluated 32 times by 3 tests
Evaluated by:
  • Self test (103)
  • Self test (104)
  • Self test (438)
FALSEevaluated 2368 times by 48 tests
Evaluated by:
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • Self test (75)
  • ...
){
32-2368
106 pWal->readOnly |= 2;-
107 if( rc==8
rc==8Description
TRUEevaluated 10 times by 3 tests
Evaluated by:
  • Self test (103)
  • Self test (104)
  • Self test (438)
FALSEevaluated 22 times by 2 tests
Evaluated by:
  • Self test (104)
  • Self test (438)
){
10-22
108 rc = 0;-
109 }
executed 10 times by 3 tests: end of block
Executed by:
  • Self test (103)
  • Self test (104)
  • Self test (438)
10
110 }
executed 32 times by 3 tests: end of block
Executed by:
  • Self test (103)
  • Self test (104)
  • Self test (438)
32
111 }
executed 2400 times by 49 tests: end of block
Executed by:
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • ...
2400
112-
113 *ppPage = pWal->apWiData[iPage];-
114 -
115 ((void) (0))-
116 ;-
117 return
executed 2434 times by 49 tests: return rc;
Executed by:
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • ...
rc;
executed 2434 times by 49 tests: return rc;
Executed by:
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • ...
2434
118}-
119static int walIndexPage(-
120 Wal *pWal,-
121 int iPage,-
122 volatile u32 **ppPage-
123){-
124 if( pWal->nWiData<=iPage
pWal->nWiData<=iPageDescription
TRUEevaluated 1514 times by 49 tests
Evaluated by:
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • ...
FALSEevaluated 3607105 times by 49 tests
Evaluated by:
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • ...
|| (*
(*ppPage = pWa...ata[iPage])==0Description
TRUEevaluated 920 times by 21 tests
Evaluated by:
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (438)
  • Self test (74)
  • Self test (79)
  • Self test (81)
  • Self test (83)
  • Self test (85)
  • Self test (90)
  • Self test (91)
  • Self test (92)
  • Self test (93)
  • Self test (94)
  • Self test (95)
  • Self test (96)
  • Self test (97)
  • Self test (98)
  • Self test (99)
FALSEevaluated 3606185 times by 49 tests
Evaluated by:
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • ...
ppPage = pWal->apWiData[iPage])==0
(*ppPage = pWa...ata[iPage])==0Description
TRUEevaluated 920 times by 21 tests
Evaluated by:
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (438)
  • Self test (74)
  • Self test (79)
  • Self test (81)
  • Self test (83)
  • Self test (85)
  • Self test (90)
  • Self test (91)
  • Self test (92)
  • Self test (93)
  • Self test (94)
  • Self test (95)
  • Self test (96)
  • Self test (97)
  • Self test (98)
  • Self test (99)
FALSEevaluated 3606185 times by 49 tests
Evaluated by:
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • ...
){
920-3607105
125 return
executed 2434 times by 49 tests: return walIndexPageRealloc(pWal, iPage, ppPage);
Executed by:
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • ...
walIndexPageRealloc(pWal, iPage, ppPage);
executed 2434 times by 49 tests: return walIndexPageRealloc(pWal, iPage, ppPage);
Executed by:
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • ...
2434
126 }-
127 return
executed 3606185 times by 49 tests: return 0;
Executed by:
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • ...
0;
executed 3606185 times by 49 tests: return 0;
Executed by:
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • ...
3606185
128}-
129-
130-
131-
132-
133static volatile WalCkptInfo *walCkptInfo(Wal *pWal){-
134 -
135 ((void) (0))-
136 ;-
137 return
executed 85059 times by 49 tests: return (volatile WalCkptInfo*)&(pWal->apWiData[0][sizeof(WalIndexHdr)/2]);
Executed by:
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • ...
(volatile WalCkptInfo*)&(pWal->apWiData[0][sizeof(WalIndexHdr)/2]);
executed 85059 times by 49 tests: return (volatile WalCkptInfo*)&(pWal->apWiData[0][sizeof(WalIndexHdr)/2]);
Executed by:
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • ...
85059
138}-
139-
140-
141-
142-
143static volatile WalIndexHdr *walIndexHdr(Wal *pWal){-
144 -
145 ((void) (0))-
146 ;-
147 return
executed 403297 times by 49 tests: return (volatile WalIndexHdr*)pWal->apWiData[0];
Executed by:
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • ...
(volatile WalIndexHdr*)pWal->apWiData[0];
executed 403297 times by 49 tests: return (volatile WalIndexHdr*)pWal->apWiData[0];
Executed by:
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • ...
403297
148}-
149static void walChecksumBytes(-
150 int nativeCksum,-
151 u8 *a,-
152 int nByte,-
153 const u32 *aIn,-
154 u32 *aOut-
155){-
156 u32 s1, s2;-
157 u32 *aData = (u32 *)a;-
158 u32 *aEnd = (u32 *)&a[nByte];-
159-
160 if( aIn
aInDescription
TRUEevaluated 876618 times by 26 tests
Evaluated by:
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (72)
  • Self test (73)
  • Self test (81)
  • Self test (83)
  • Self test (86)
  • Self test (91)
  • Self test (92)
  • Self test (93)
  • Self test (94)
  • Self test (95)
  • Self test (96)
  • Self test (97)
  • Self test (98)
  • ...
FALSEevaluated 130607 times by 49 tests
Evaluated by:
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • ...
){
130607-876618
161 s1 = aIn[0];-
162 s2 = aIn[1];-
163 }
executed 876618 times by 26 tests: end of block
Executed by:
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (72)
  • Self test (73)
  • Self test (81)
  • Self test (83)
  • Self test (86)
  • Self test (91)
  • Self test (92)
  • Self test (93)
  • Self test (94)
  • Self test (95)
  • Self test (96)
  • Self test (97)
  • Self test (98)
  • ...
else{
876618
164 s1 = s2 = 0;-
165 }
executed 130607 times by 49 tests: end of block
Executed by:
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • ...
130607
166-
167 -
168 ((void) (0))-
169 ;-
170 -
171 ((void) (0))-
172 ;-
173-
174 if( nativeCksum
nativeCksumDescription
TRUEevaluated 1007183 times by 49 tests
Evaluated by:
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • ...
FALSEevaluated 42 times by 1 test
Evaluated by:
  • Self test (438)
){
42-1007183
175 do {-
176 s1 += *aData++ + s2;-
177 s2 += *aData++ + s1;-
178 }
executed 57119004 times by 49 tests: end of block
Executed by:
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • ...
while( aData<aEnd
aData<aEndDescription
TRUEevaluated 56111821 times by 49 tests
Evaluated by:
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • ...
FALSEevaluated 1007183 times by 49 tests
Evaluated by:
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • ...
);
1007183-57119004
179 }
executed 1007183 times by 49 tests: end of block
Executed by:
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • ...
else{
1007183
180 do {-
181 s1 += ( (((aData[0])&0x000000FF)<<24) + (((aData[0])&0x0000FF00)<<8) + (((aData[0])&0x00FF0000)>>8) + (((aData[0])&0xFF000000)>>24) ) + s2;-
182 s2 += ( (((aData[1])&0x000000FF)<<24) + (((aData[1])&0x0000FF00)<<8) + (((aData[1])&0x00FF0000)>>8) + (((aData[1])&0xFF000000)>>24) ) + s1;-
183 aData += 2;-
184 }
executed 2586 times by 1 test: end of block
Executed by:
  • Self test (438)
while( aData<aEnd
aData<aEndDescription
TRUEevaluated 2544 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 42 times by 1 test
Evaluated by:
  • Self test (438)
);
42-2586
185 }
executed 42 times by 1 test: end of block
Executed by:
  • Self test (438)
42
186-
187 aOut[0] = s1;-
188 aOut[1] = s2;-
189}
executed 1007225 times by 49 tests: end of block
Executed by:
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • ...
1007225
190-
191static void walShmBarrier(Wal *pWal){-
192 if( pWal->exclusiveMode!=2
pWal->exclusiveMode!=2Description
TRUEevaluated 189453 times by 49 tests
Evaluated by:
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • ...
FALSEevaluated 146 times by 2 tests
Evaluated by:
  • Self test (104)
  • Self test (438)
){
146-189453
193 sqlite3OsShmBarrier(pWal->pDbFd);-
194 }
executed 189453 times by 49 tests: end of block
Executed by:
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • ...
189453
195}
executed 189599 times by 49 tests: end of block
Executed by:
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • ...
189599
196-
197-
198-
199-
200-
201-
202static void walIndexWriteHdr(Wal *pWal){-
203 volatile WalIndexHdr *aHdr = walIndexHdr(pWal);-
204 const int nCksum = -
205 __builtin_offsetof (-
206 WalIndexHdr-
207 , -
208 aCksum-
209 )-
210 ;-
211-
212 -
213 ((void) (0))-
214 ;-
215 pWal->hdr.isInit = 1;-
216 pWal->hdr.iVersion = 3007000;-
217 walChecksumBytes(1, (u8*)&pWal->hdr, nCksum, 0, pWal->hdr.aCksum);-
218 memcpy((void*)&aHdr[1], (const void*)&pWal->hdr, sizeof(WalIndexHdr));-
219 walShmBarrier(pWal);-
220 memcpy((void*)&aHdr[0], (const void*)&pWal->hdr, sizeof(WalIndexHdr));-
221}
executed 60765 times by 29 tests: end of block
Executed by:
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (72)
  • Self test (73)
  • Self test (79)
  • Self test (81)
  • Self test (83)
  • Self test (85)
  • Self test (86)
  • Self test (90)
  • Self test (91)
  • Self test (92)
  • Self test (93)
  • Self test (94)
  • Self test (95)
  • ...
60765
222static void walEncodeFrame(-
223 Wal *pWal,-
224 u32 iPage,-
225 u32 nTruncate,-
226 u8 *aData,-
227 u8 *aFrame-
228){-
229 int nativeCksum;-
230 u32 *aCksum = pWal->hdr.aFrameCksum;-
231 -
232 ((void) (0))-
233 ;-
234 sqlite3Put4byte(&aFrame[0], iPage);-
235 sqlite3Put4byte(&aFrame[4], nTruncate);-
236 if( pWal->iReCksum==0
pWal->iReCksum==0Description
TRUEevaluated 194920 times by 26 tests
Evaluated by:
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (72)
  • Self test (73)
  • Self test (81)
  • Self test (83)
  • Self test (86)
  • Self test (91)
  • Self test (92)
  • Self test (93)
  • Self test (94)
  • Self test (95)
  • Self test (96)
  • Self test (97)
  • Self test (98)
  • ...
FALSEevaluated 11917 times by 1 test
Evaluated by:
  • Self test (438)
){
11917-194920
237 memcpy(&aFrame[8], pWal->hdr.aSalt, 8);-
238-
239 nativeCksum = (pWal->hdr.bigEndCksum==0);-
240 walChecksumBytes(nativeCksum, aFrame, 8, aCksum, aCksum);-
241 walChecksumBytes(nativeCksum, aData, pWal->szPage, aCksum, aCksum);-
242-
243 sqlite3Put4byte(&aFrame[16], aCksum[0]);-
244 sqlite3Put4byte(&aFrame[20], aCksum[1]);-
245 }
executed 194920 times by 26 tests: end of block
Executed by:
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (72)
  • Self test (73)
  • Self test (81)
  • Self test (83)
  • Self test (86)
  • Self test (91)
  • Self test (92)
  • Self test (93)
  • Self test (94)
  • Self test (95)
  • Self test (96)
  • Self test (97)
  • Self test (98)
  • ...
else{
194920
246 memset(&aFrame[8], 0, 16);-
247 }
executed 11917 times by 1 test: end of block
Executed by:
  • Self test (438)
11917
248}-
249-
250-
251-
252-
253-
254-
255static int walDecodeFrame(-
256 Wal *pWal,-
257 u32 *piPage,-
258 u32 *pnTruncate,-
259 u8 *aData,-
260 u8 *aFrame-
261){-
262 int nativeCksum;-
263 u32 *aCksum = pWal->hdr.aFrameCksum;-
264 u32 pgno;-
265 -
266 ((void) (0))-
267 ;-
268-
269-
270-
271-
272 if( memcmp(&pWal->hdr.aSalt, &aFrame[8], 8)!=0
memcmp(&pWal->...rame[8], 8)!=0Description
TRUEevaluated 29 times by 2 tests
Evaluated by:
  • Self test (101)
  • Self test (438)
FALSEevaluated 243389 times by 5 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (50)
){
29-243389
273 return
executed 29 times by 2 tests: return 0;
Executed by:
  • Self test (101)
  • Self test (438)
0;
executed 29 times by 2 tests: return 0;
Executed by:
  • Self test (101)
  • Self test (438)
29
274 }-
275-
276-
277-
278 pgno = sqlite3Get4byte(&aFrame[0]);-
279 if( pgno==0
pgno==0Description
TRUEnever evaluated
FALSEevaluated 243389 times by 5 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (50)
){
0-243389
280 return
never executed: return 0;
0;
never executed: return 0;
0
281 }-
282-
283-
284-
285-
286-
287-
288 nativeCksum = (pWal->hdr.bigEndCksum==0);-
289 walChecksumBytes(nativeCksum, aFrame, 8, aCksum, aCksum);-
290 walChecksumBytes(nativeCksum, aData, pWal->szPage, aCksum, aCksum);-
291 if( aCksum[0]!=sqlite3Get4byte(&aFrame[16])
aCksum[0]!=sql...e(&aFrame[16])Description
TRUEevaluated 59 times by 2 tests
Evaluated by:
  • Self test (104)
  • Self test (438)
FALSEevaluated 243330 times by 5 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (50)
59-243330
292 || aCksum[1]!=sqlite3Get4byte(&aFrame[20])
aCksum[1]!=sql...e(&aFrame[20])Description
TRUEnever evaluated
FALSEevaluated 243330 times by 5 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (50)
0-243330
293 ){-
294-
295 return
executed 59 times by 2 tests: return 0;
Executed by:
  • Self test (104)
  • Self test (438)
0;
executed 59 times by 2 tests: return 0;
Executed by:
  • Self test (104)
  • Self test (438)
59
296 }-
297-
298-
299-
300-
301 *piPage = pgno;-
302 *pnTruncate = sqlite3Get4byte(&aFrame[4]);-
303 return
executed 243330 times by 5 tests: return 1;
Executed by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (50)
1;
executed 243330 times by 5 tests: return 1;
Executed by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (50)
243330
304}-
305static int walLockShared(Wal *pWal, int lockIdx){-
306 int rc;-
307 if( pWal->exclusiveMode
pWal->exclusiveModeDescription
TRUEevaluated 52 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 63102 times by 49 tests
Evaluated by:
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • ...
) return
executed 52 times by 1 test: return 0;
Executed by:
  • Self test (438)
0;
executed 52 times by 1 test: return 0;
Executed by:
  • Self test (438)
52-63102
308 rc = sqlite3OsShmLock(pWal->pDbFd, lockIdx, 1,-
309 2 | 4);-
310 -
311 ;-
312 -
313 return
executed 63102 times by 49 tests: return rc;
Executed by:
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • ...
rc;
executed 63102 times by 49 tests: return rc;
Executed by:
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • ...
63102
314}-
315static void walUnlockShared(Wal *pWal, int lockIdx){-
316 if( pWal->exclusiveMode
pWal->exclusiveModeDescription
TRUEevaluated 54 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 63082 times by 49 tests
Evaluated by:
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • ...
) return;
executed 54 times by 1 test: return;
Executed by:
  • Self test (438)
54-63082
317 (void)sqlite3OsShmLock(pWal->pDbFd, lockIdx, 1,-
318 1 | 4);-
319 ;-
320}
executed 63082 times by 49 tests: end of block
Executed by:
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • ...
63082
321static int walLockExclusive(Wal *pWal, int lockIdx, int n){-
322 int rc;-
323 if( pWal->exclusiveMode
pWal->exclusiveModeDescription
TRUEevaluated 1724 times by 10 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (73)
  • Self test (75)
  • Self test (80)
  • Self test (82)
  • Self test (85)
  • Self test (90)
FALSEevaluated 134790 times by 46 tests
Evaluated by:
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • Self test (75)
  • ...
) return
executed 1724 times by 10 tests: return 0;
Executed by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (73)
  • Self test (75)
  • Self test (80)
  • Self test (82)
  • Self test (85)
  • Self test (90)
0;
executed 1724 times by 10 tests: return 0;
Executed by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (73)
  • Self test (75)
  • Self test (80)
  • Self test (82)
  • Self test (85)
  • Self test (90)
1724-134790
324 rc = sqlite3OsShmLock(pWal->pDbFd, lockIdx, n,-
325 2 | 8);-
326 -
327 ;-
328 -
329 return
executed 134790 times by 46 tests: return rc;
Executed by:
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • Self test (75)
  • ...
rc;
executed 134790 times by 46 tests: return rc;
Executed by:
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • Self test (75)
  • ...
134790
330}-
331static void walUnlockExclusive(Wal *pWal, int lockIdx, int n){-
332 if( pWal->exclusiveMode
pWal->exclusiveModeDescription
TRUEevaluated 1724 times by 10 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (73)
  • Self test (75)
  • Self test (80)
  • Self test (82)
  • Self test (85)
  • Self test (90)
FALSEevaluated 129675 times by 46 tests
Evaluated by:
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • Self test (75)
  • ...
) return;
executed 1724 times by 10 tests: return;
Executed by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (73)
  • Self test (75)
  • Self test (80)
  • Self test (82)
  • Self test (85)
  • Self test (90)
1724-129675
333 (void)sqlite3OsShmLock(pWal->pDbFd, lockIdx, n,-
334 1 | 8);-
335 -
336 ;-
337}
executed 129675 times by 46 tests: end of block
Executed by:
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • Self test (75)
  • ...
129675
338-
339-
340-
341-
342-
343-
344static int walHash(u32 iPage){-
345 -
346 ((void) (0))-
347 ;-
348 -
349 ((void) (0))-
350 ;-
351 return
executed 3536740 times by 48 tests: return (iPage*383) & ((4096*2)-1);
Executed by:
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • ...
(iPage*383) & ((4096*2)-1);
executed 3536740 times by 48 tests: return (iPage*383) & ((4096*2)-1);
Executed by:
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • ...
3536740
352}-
353static int walNextHash(int iPriorHash){-
354 return
executed 15557106 times by 45 tests: return (iPriorHash+1)&((4096*2)-1);
Executed by:
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • Self test (75)
  • ...
(iPriorHash+1)&((4096*2)-1);
executed 15557106 times by 45 tests: return (iPriorHash+1)&((4096*2)-1);
Executed by:
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • Self test (75)
  • ...
15557106
355}-
356-
357-
358-
359-
360-
361-
362typedef struct WalHashLoc WalHashLoc;-
363struct WalHashLoc {-
364 volatile ht_slot *aHash;-
365 volatile u32 *aPgno;-
366 u32 iZero;-
367};-
368static int walHashGet(-
369 Wal *pWal,-
370 int iHash,-
371 WalHashLoc *pLoc-
372){-
373 int rc;-
374-
375 rc = walIndexPage(pWal, iHash, &pLoc->aPgno);-
376 -
377 ((void) (0))-
378 ;-
379-
380 if( rc==0
rc==0Description
TRUEevaluated 3541959 times by 48 tests
Evaluated by:
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • ...
FALSEnever evaluated
){
0-3541959
381 pLoc->aHash = (volatile ht_slot *)&pLoc->aPgno[4096];-
382 if( iHash==0
iHash==0Description
TRUEevaluated 1840038 times by 48 tests
Evaluated by:
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • ...
FALSEevaluated 1701921 times by 3 tests
Evaluated by:
  • Self test (438)
  • Self test (64)
  • Self test (74)
){
1701921-1840038
383 pLoc->aPgno = &pLoc->aPgno[(sizeof(WalIndexHdr)*2+sizeof(WalCkptInfo))/sizeof(u32)];-
384 pLoc->iZero = 0;-
385 }
executed 1840038 times by 48 tests: end of block
Executed by:
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • ...
else{
1840038
386 pLoc->iZero = (4096 - ((sizeof(WalIndexHdr)*2+sizeof(WalCkptInfo))/sizeof(u32))) + (iHash-1)*4096;-
387 }
executed 1701921 times by 3 tests: end of block
Executed by:
  • Self test (438)
  • Self test (64)
  • Self test (74)
1701921
388 pLoc->aPgno = &pLoc->aPgno[-1];-
389 }
executed 3541959 times by 48 tests: end of block
Executed by:
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • ...
3541959
390 return
executed 3541959 times by 48 tests: return rc;
Executed by:
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • ...
rc;
executed 3541959 times by 48 tests: return rc;
Executed by:
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • ...
3541959
391}-
392-
393-
394-
395-
396-
397-
398-
399static int walFramePage(u32 iFrame){-
400 int iHash = (iFrame+4096 -(4096 - ((sizeof(WalIndexHdr)*2+sizeof(WalCkptInfo))/sizeof(u32)))-1) / 4096;-
401 -
402 ((void) (0))-
403-
404-
405-
406-
407 -
408 ;-
409 return
executed 3715446 times by 48 tests: return iHash;
Executed by:
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • ...
iHash;
executed 3715446 times by 48 tests: return iHash;
Executed by:
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • ...
3715446
410}-
411-
412-
413-
414-
415static u32 walFramePgno(Wal *pWal, u32 iFrame){-
416 int iHash = walFramePage(iFrame);-
417 if( iHash==0
iHash==0Description
TRUEevaluated 1971 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 4738 times by 1 test
Evaluated by:
  • Self test (438)
){
1971-4738
418 return
executed 1971 times by 1 test: return pWal->apWiData[0][(sizeof(WalIndexHdr)*2+sizeof(WalCkptInfo))/sizeof(u32) + iFrame - 1];
Executed by:
  • Self test (438)
pWal->apWiData[0][(sizeof(WalIndexHdr)*2+sizeof(WalCkptInfo))/sizeof(u32) + iFrame - 1];
executed 1971 times by 1 test: return pWal->apWiData[0][(sizeof(WalIndexHdr)*2+sizeof(WalCkptInfo))/sizeof(u32) + iFrame - 1];
Executed by:
  • Self test (438)
1971
419 }-
420 return
executed 4738 times by 1 test: return pWal->apWiData[iHash][(iFrame-1-(4096 - ((sizeof(WalIndexHdr)*2+sizeof(WalCkptInfo))/sizeof(u32))))%4096];
Executed by:
  • Self test (438)
pWal->apWiData[iHash][(iFrame-1-(4096 - ((sizeof(WalIndexHdr)*2+sizeof(WalCkptInfo))/sizeof(u32))))%4096];
executed 4738 times by 1 test: return pWal->apWiData[iHash][(iFrame-1-(4096 - ((sizeof(WalIndexHdr)*2+sizeof(WalCkptInfo))/sizeof(u32))))%4096];
Executed by:
  • Self test (438)
4738
421}-
422static void walCleanupHash(Wal *pWal){-
423 WalHashLoc sLoc;-
424 int iLimit = 0;-
425 int nByte;-
426 int i;-
427-
428 -
429 ((void) (0))-
430 ;-
431 ;-
432 ;-
433 ;-
434-
435 if( pWal->hdr.mxFrame==0
pWal->hdr.mxFrame==0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 80 times by 1 test
Evaluated by:
  • Self test (438)
) return;
executed 3 times by 1 test: return;
Executed by:
  • Self test (438)
3-80
436-
437-
438-
439-
440-
441 -
442 ((void) (0))-
443 ;-
444 -
445 ((void) (0))-
446 ;-
447 walHashGet(pWal, walFramePage(pWal->hdr.mxFrame), &sLoc);-
448-
449-
450-
451-
452 iLimit = pWal->hdr.mxFrame - sLoc.iZero;-
453 -
454 ((void) (0))-
455 ;-
456 for(i=0; i<(4096*2)
i<(4096*2)Description
TRUEevaluated 655360 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 80 times by 1 test
Evaluated by:
  • Self test (438)
; i++){
80-655360
457 if( sLoc.aHash[i]>iLimit
sLoc.aHash[i]>iLimitDescription
TRUEevaluated 7218 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 648142 times by 1 test
Evaluated by:
  • Self test (438)
){
7218-648142
458 sLoc.aHash[i] = 0;-
459 }
executed 7218 times by 1 test: end of block
Executed by:
  • Self test (438)
7218
460 }
executed 655360 times by 1 test: end of block
Executed by:
  • Self test (438)
655360
461-
462-
463-
464-
465 nByte = (int)((char *)sLoc.aHash - (char *)&sLoc.aPgno[iLimit+1]);-
466 memset((void *)&sLoc.aPgno[iLimit+1], 0, nByte);-
467}
executed 80 times by 1 test: end of block
Executed by:
  • Self test (438)
80
468-
469-
470-
471-
472-
473-
474static int walIndexAppend(Wal *pWal, u32 iFrame, u32 iPage){-
475 int rc;-
476 WalHashLoc sLoc;-
477-
478 rc = walHashGet(pWal, walFramePage(iFrame), &sLoc);-
479-
480-
481-
482-
483 if( rc==0
rc==0Description
TRUEevaluated 439729 times by 26 tests
Evaluated by:
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (72)
  • Self test (73)
  • Self test (81)
  • Self test (83)
  • Self test (86)
  • Self test (91)
  • Self test (92)
  • Self test (93)
  • Self test (94)
  • Self test (95)
  • Self test (96)
  • Self test (97)
  • Self test (98)
  • ...
FALSEnever evaluated
){
0-439729
484 int iKey;-
485 int idx;-
486 int nCollide;-
487-
488 idx = iFrame - sLoc.iZero;-
489 -
490 ((void) (0))-
491 ;-
492-
493-
494-
495-
496 if( idx==1
idx==1Description
TRUEevaluated 5184 times by 20 tests
Evaluated by:
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (64)
  • Self test (86)
  • Self test (91)
  • Self test (92)
  • Self test (93)
  • Self test (94)
  • Self test (95)
  • Self test (96)
  • Self test (97)
  • Self test (98)
  • Self test (99)
FALSEevaluated 434545 times by 25 tests
Evaluated by:
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (438)
  • Self test (50)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (72)
  • Self test (73)
  • Self test (81)
  • Self test (83)
  • Self test (86)
  • Self test (91)
  • Self test (92)
  • Self test (93)
  • Self test (94)
  • Self test (95)
  • Self test (96)
  • Self test (97)
  • Self test (98)
  • Self test (99)
){
5184-434545
497 int nByte = (int)((u8 *)&sLoc.aHash[(4096*2)]-
498 - (u8 *)&sLoc.aPgno[1]);-
499 memset((void*)&sLoc.aPgno[1], 0, nByte);-
500 }
executed 5184 times by 20 tests: end of block
Executed by:
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (64)
  • Self test (86)
  • Self test (91)
  • Self test (92)
  • Self test (93)
  • Self test (94)
  • Self test (95)
  • Self test (96)
  • Self test (97)
  • Self test (98)
  • Self test (99)
5184
501-
502-
503-
504-
505-
506-
507-
508 if( sLoc.aPgno[idx]
sLoc.aPgno[idx]Description
TRUEnever evaluated
FALSEevaluated 439729 times by 26 tests
Evaluated by:
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (72)
  • Self test (73)
  • Self test (81)
  • Self test (83)
  • Self test (86)
  • Self test (91)
  • Self test (92)
  • Self test (93)
  • Self test (94)
  • Self test (95)
  • Self test (96)
  • Self test (97)
  • Self test (98)
  • ...
){
0-439729
509 walCleanupHash(pWal);-
510 -
511 ((void) (0))-
512 ;-
513 }
never executed: end of block
0
514-
515-
516 nCollide = idx;-
517 for(iKey=walHash(iPage); sLoc.aHash[iKey]
sLoc.aHash[iKey]Description
TRUEevaluated 6814097 times by 22 tests
Evaluated by:
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (438)
  • Self test (50)
  • Self test (62)
  • Self test (63)
  • Self test (72)
  • Self test (73)
  • Self test (81)
  • Self test (83)
  • Self test (91)
  • Self test (92)
  • Self test (93)
  • Self test (94)
  • Self test (96)
  • Self test (97)
  • Self test (98)
  • Self test (99)
FALSEevaluated 439728 times by 26 tests
Evaluated by:
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (72)
  • Self test (73)
  • Self test (81)
  • Self test (83)
  • Self test (86)
  • Self test (91)
  • Self test (92)
  • Self test (93)
  • Self test (94)
  • Self test (95)
  • Self test (96)
  • Self test (97)
  • Self test (98)
  • ...
; iKey=walNextHash(iKey)){
439728-6814097
518 if( (
(nCollide--)==0Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 6814096 times by 22 tests
Evaluated by:
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (438)
  • Self test (50)
  • Self test (62)
  • Self test (63)
  • Self test (72)
  • Self test (73)
  • Self test (81)
  • Self test (83)
  • Self test (91)
  • Self test (92)
  • Self test (93)
  • Self test (94)
  • Self test (96)
  • Self test (97)
  • Self test (98)
  • Self test (99)
nCollide--)==0
(nCollide--)==0Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 6814096 times by 22 tests
Evaluated by:
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (438)
  • Self test (50)
  • Self test (62)
  • Self test (63)
  • Self test (72)
  • Self test (73)
  • Self test (81)
  • Self test (83)
  • Self test (91)
  • Self test (92)
  • Self test (93)
  • Self test (94)
  • Self test (96)
  • Self test (97)
  • Self test (98)
  • Self test (99)
) return
executed 1 time by 1 test: return sqlite3CorruptError(1084);
Executed by:
  • Self test (438)
sqlite3CorruptError(1084);
executed 1 time by 1 test: return sqlite3CorruptError(1084);
Executed by:
  • Self test (438)
1-6814096
519 }
executed 6814096 times by 22 tests: end of block
Executed by:
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (438)
  • Self test (50)
  • Self test (62)
  • Self test (63)
  • Self test (72)
  • Self test (73)
  • Self test (81)
  • Self test (83)
  • Self test (91)
  • Self test (92)
  • Self test (93)
  • Self test (94)
  • Self test (96)
  • Self test (97)
  • Self test (98)
  • Self test (99)
6814096
520 sLoc.aPgno[idx] = iPage;-
521 sLoc.aHash[iKey] = (ht_slot)idx;-
522 }
executed 439728 times by 26 tests: end of block
Executed by:
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (72)
  • Self test (73)
  • Self test (81)
  • Self test (83)
  • Self test (86)
  • Self test (91)
  • Self test (92)
  • Self test (93)
  • Self test (94)
  • Self test (95)
  • Self test (96)
  • Self test (97)
  • Self test (98)
  • ...
439728
523-
524-
525 return
executed 439728 times by 26 tests: return rc;
Executed by:
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (72)
  • Self test (73)
  • Self test (81)
  • Self test (83)
  • Self test (86)
  • Self test (91)
  • Self test (92)
  • Self test (93)
  • Self test (94)
  • Self test (95)
  • Self test (96)
  • Self test (97)
  • Self test (98)
  • ...
rc;
executed 439728 times by 26 tests: return rc;
Executed by:
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (72)
  • Self test (73)
  • Self test (81)
  • Self test (83)
  • Self test (86)
  • Self test (91)
  • Self test (92)
  • Self test (93)
  • Self test (94)
  • Self test (95)
  • Self test (96)
  • Self test (97)
  • Self test (98)
  • ...
439728
526}-
527static int walIndexRecover(Wal *pWal){-
528 int rc;-
529 i64 nSize;-
530 u32 aFrameCksum[2] = {0, 0};-
531 int iLock;-
532-
533-
534-
535-
536-
537-
538-
539 -
540 ((void) (0))-
541 ;-
542 -
543 ((void) (0))-
544 ;-
545 -
546 ((void) (0))-
547 ;-
548 -
549 ((void) (0))-
550 ;-
551 iLock = 1 + pWal->ckptLock;-
552 rc = walLockExclusive(pWal, iLock, (3+(0))-iLock);-
553 if( rc==0
rc==0Description
TRUEevaluated 960 times by 21 tests
Evaluated by:
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (438)
  • Self test (50)
  • Self test (79)
  • Self test (81)
  • Self test (83)
  • Self test (85)
  • Self test (90)
  • Self test (91)
  • Self test (92)
  • Self test (93)
  • Self test (94)
  • Self test (95)
  • Self test (96)
  • Self test (97)
  • Self test (98)
  • Self test (99)
FALSEevaluated 15 times by 3 tests
Evaluated by:
  • Self test (438)
  • Self test (50)
  • Self test (51)
){
15-960
554 rc = walLockExclusive(pWal, (3+(1)), (8 -3)-1);-
555 if( rc!=0
rc!=0Description
TRUEnever evaluated
FALSEevaluated 960 times by 21 tests
Evaluated by:
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (438)
  • Self test (50)
  • Self test (79)
  • Self test (81)
  • Self test (83)
  • Self test (85)
  • Self test (90)
  • Self test (91)
  • Self test (92)
  • Self test (93)
  • Self test (94)
  • Self test (95)
  • Self test (96)
  • Self test (97)
  • Self test (98)
  • Self test (99)
){
0-960
556 walUnlockExclusive(pWal, iLock, (3+(0))-iLock);-
557 }
never executed: end of block
0
558 }
executed 960 times by 21 tests: end of block
Executed by:
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (438)
  • Self test (50)
  • Self test (79)
  • Self test (81)
  • Self test (83)
  • Self test (85)
  • Self test (90)
  • Self test (91)
  • Self test (92)
  • Self test (93)
  • Self test (94)
  • Self test (95)
  • Self test (96)
  • Self test (97)
  • Self test (98)
  • Self test (99)
960
559 if( rc
rcDescription
TRUEevaluated 15 times by 3 tests
Evaluated by:
  • Self test (438)
  • Self test (50)
  • Self test (51)
FALSEevaluated 960 times by 21 tests
Evaluated by:
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (438)
  • Self test (50)
  • Self test (79)
  • Self test (81)
  • Self test (83)
  • Self test (85)
  • Self test (90)
  • Self test (91)
  • Self test (92)
  • Self test (93)
  • Self test (94)
  • Self test (95)
  • Self test (96)
  • Self test (97)
  • Self test (98)
  • Self test (99)
){
15-960
560 return
executed 15 times by 3 tests: return rc;
Executed by:
  • Self test (438)
  • Self test (50)
  • Self test (51)
rc;
executed 15 times by 3 tests: return rc;
Executed by:
  • Self test (438)
  • Self test (50)
  • Self test (51)
15
561 }-
562-
563 ;-
564-
565 memset(&pWal->hdr, 0, sizeof(WalIndexHdr));-
566-
567 rc = sqlite3OsFileSize(pWal->pWalFd, &nSize);-
568 if( rc!=0
rc!=0Description
TRUEnever evaluated
FALSEevaluated 960 times by 21 tests
Evaluated by:
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (438)
  • Self test (50)
  • Self test (79)
  • Self test (81)
  • Self test (83)
  • Self test (85)
  • Self test (90)
  • Self test (91)
  • Self test (92)
  • Self test (93)
  • Self test (94)
  • Self test (95)
  • Self test (96)
  • Self test (97)
  • Self test (98)
  • Self test (99)
){
0-960
569 goto
never executed: goto recovery_error;
recovery_error;
never executed: goto recovery_error;
0
570 }-
571-
572 if( nSize>32
nSize>32Description
TRUEevaluated 305 times by 5 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (50)
FALSEevaluated 655 times by 19 tests
Evaluated by:
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (28)
  • Self test (438)
  • Self test (79)
  • Self test (81)
  • Self test (83)
  • Self test (85)
  • Self test (90)
  • Self test (91)
  • Self test (92)
  • Self test (93)
  • Self test (94)
  • Self test (95)
  • Self test (96)
  • Self test (97)
  • Self test (98)
  • Self test (99)
){
305-655
573 u8 aBuf[32];-
574 u8 *aFrame = 0;-
575 int szFrame;-
576 u8 *aData;-
577 int iFrame;-
578 i64 iOffset;-
579 int szPage;-
580 u32 magic;-
581 u32 version;-
582 int isValid;-
583-
584-
585 rc = sqlite3OsRead(pWal->pWalFd, aBuf, 32, 0);-
586 if( rc!=0
rc!=0Description
TRUEnever evaluated
FALSEevaluated 305 times by 5 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (50)
){
0-305
587 goto
never executed: goto recovery_error;
recovery_error;
never executed: goto recovery_error;
0
588 }-
589-
590-
591-
592-
593-
594-
595 magic = sqlite3Get4byte(&aBuf[0]);-
596 szPage = sqlite3Get4byte(&aBuf[8]);-
597 if( (
(magic&0xFFFFFFFE)!=0x377f0682Description
TRUEnever evaluated
FALSEevaluated 305 times by 5 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (50)
magic&0xFFFFFFFE)!=0x377f0682
(magic&0xFFFFFFFE)!=0x377f0682Description
TRUEnever evaluated
FALSEevaluated 305 times by 5 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (50)
0-305
598 || szPage&(szPage-1)
szPage&(szPage-1)Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 302 times by 5 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (50)
3-302
599 || szPage>65536
szPage>65536Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 299 times by 5 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (50)
3-299
600 || szPage<512
szPage<512Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 293 times by 5 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (50)
6-293
601 ){-
602 goto
executed 12 times by 1 test: goto finished;
Executed by:
  • Self test (438)
finished;
executed 12 times by 1 test: goto finished;
Executed by:
  • Self test (438)
12
603 }-
604 pWal->hdr.bigEndCksum = (u8)(magic&0x00000001);-
605 pWal->szPage = szPage;-
606 pWal->nCkpt = sqlite3Get4byte(&aBuf[12]);-
607 memcpy(&pWal->hdr.aSalt, &aBuf[16], 8);-
608-
609-
610 walChecksumBytes(pWal->hdr.bigEndCksum==0,-
611 aBuf, 32 -2*4, 0, pWal->hdr.aFrameCksum-
612 );-
613 if( pWal->hdr.aFrameCksum[0]!=sqlite3Get4byte(&aBuf[24])
pWal->hdr.aFra...yte(&aBuf[24])Description
TRUEnever evaluated
FALSEevaluated 293 times by 5 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (50)
0-293
614 || pWal->hdr.aFrameCksum[1]!=sqlite3Get4byte(&aBuf[28])
pWal->hdr.aFra...yte(&aBuf[28])Description
TRUEnever evaluated
FALSEevaluated 293 times by 5 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (50)
0-293
615 ){-
616 goto
never executed: goto finished;
finished;
never executed: goto finished;
0
617 }-
618-
619-
620-
621 version = sqlite3Get4byte(&aBuf[4]);-
622 if( version!=3007000
version!=3007000Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 291 times by 5 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (50)
){
2-291
623 rc = sqlite3CantopenError(1222);-
624 goto
executed 2 times by 1 test: goto finished;
Executed by:
  • Self test (438)
finished;
executed 2 times by 1 test: goto finished;
Executed by:
  • Self test (438)
2
625 }-
626-
627-
628 szFrame = szPage + 24;-
629 aFrame = (u8 *)sqlite3_malloc64(szFrame);-
630 if( !aFrame
!aFrameDescription
TRUEnever evaluated
FALSEevaluated 291 times by 5 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (50)
){
0-291
631 rc = 7;-
632 goto
never executed: goto recovery_error;
recovery_error;
never executed: goto recovery_error;
0
633 }-
634 aData = &aFrame[24];-
635-
636-
637 iFrame = 0;-
638 for(iOffset=32; (
(iOffset+szFrame)<=nSizeDescription
TRUEevaluated 243001 times by 5 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (50)
FALSEevaluated 213 times by 4 tests
Evaluated by:
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (50)
iOffset+szFrame)<=nSize
(iOffset+szFrame)<=nSizeDescription
TRUEevaluated 243001 times by 5 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (50)
FALSEevaluated 213 times by 4 tests
Evaluated by:
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (50)
; iOffset+=szFrame){
213-243001
639 u32 pgno;-
640 u32 nTruncate;-
641-
642-
643 iFrame++;-
644 rc = sqlite3OsRead(pWal->pWalFd, aFrame, szFrame, iOffset);-
645 if( rc!=0
rc!=0Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 242999 times by 5 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (50)
) break;
executed 2 times by 1 test: break;
Executed by:
  • Self test (438)
2-242999
646 isValid = walDecodeFrame(pWal, &pgno, &nTruncate, aData, aFrame);-
647 if( !isValid
!isValidDescription
TRUEevaluated 76 times by 3 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (438)
FALSEevaluated 242923 times by 5 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (50)
) break;
executed 76 times by 3 tests: break;
Executed by:
  • Self test (101)
  • Self test (104)
  • Self test (438)
76-242923
648 rc = walIndexAppend(pWal, iFrame, pgno);-
649 if( rc!=0
rc!=0Description
TRUEnever evaluated
FALSEevaluated 242923 times by 5 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (50)
) break;
never executed: break;
0-242923
650-
651-
652 if( nTruncate
nTruncateDescription
TRUEevaluated 2073 times by 5 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (50)
FALSEevaluated 240850 times by 3 tests
Evaluated by:
  • Self test (104)
  • Self test (105)
  • Self test (438)
){
2073-240850
653 pWal->hdr.mxFrame = iFrame;-
654 pWal->hdr.nPage = nTruncate;-
655 pWal->hdr.szPage = (u16)((szPage&0xff00) | (szPage>>16));-
656 ;-
657 ;-
658 aFrameCksum[0] = pWal->hdr.aFrameCksum[0];-
659 aFrameCksum[1] = pWal->hdr.aFrameCksum[1];-
660 }
executed 2073 times by 5 tests: end of block
Executed by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (50)
2073
661 }
executed 242923 times by 5 tests: end of block
Executed by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (50)
242923
662-
663 sqlite3_free(aFrame);-
664 }
executed 291 times by 5 tests: end of block
Executed by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (50)
291
665-
666finished:
code before this statement executed 946 times by 21 tests: finished:
Executed by:
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (438)
  • Self test (50)
  • Self test (79)
  • Self test (81)
  • Self test (83)
  • Self test (85)
  • Self test (90)
  • Self test (91)
  • Self test (92)
  • Self test (93)
  • Self test (94)
  • Self test (95)
  • Self test (96)
  • Self test (97)
  • Self test (98)
  • Self test (99)
946
667 if( rc==0
rc==0Description
TRUEevaluated 956 times by 21 tests
Evaluated by:
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (438)
  • Self test (50)
  • Self test (79)
  • Self test (81)
  • Self test (83)
  • Self test (85)
  • Self test (90)
  • Self test (91)
  • Self test (92)
  • Self test (93)
  • Self test (94)
  • Self test (95)
  • Self test (96)
  • Self test (97)
  • Self test (98)
  • Self test (99)
FALSEevaluated 4 times by 1 test
Evaluated by:
  • Self test (438)
){
4-956
668 volatile WalCkptInfo *pInfo;-
669 int i;-
670 pWal->hdr.aFrameCksum[0] = aFrameCksum[0];-
671 pWal->hdr.aFrameCksum[1] = aFrameCksum[1];-
672 walIndexWriteHdr(pWal);-
673-
674-
675-
676-
677-
678 pInfo = walCkptInfo(pWal);-
679 pInfo->nBackfill = 0;-
680 pInfo->nBackfillAttempted = pWal->hdr.mxFrame;-
681 pInfo->aReadMark[0] = 0;-
682 for(i=1; i<(8 -3)
i<(8 -3)Description
TRUEevaluated 3824 times by 21 tests
Evaluated by:
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (438)
  • Self test (50)
  • Self test (79)
  • Self test (81)
  • Self test (83)
  • Self test (85)
  • Self test (90)
  • Self test (91)
  • Self test (92)
  • Self test (93)
  • Self test (94)
  • Self test (95)
  • Self test (96)
  • Self test (97)
  • Self test (98)
  • Self test (99)
FALSEevaluated 956 times by 21 tests
Evaluated by:
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (438)
  • Self test (50)
  • Self test (79)
  • Self test (81)
  • Self test (83)
  • Self test (85)
  • Self test (90)
  • Self test (91)
  • Self test (92)
  • Self test (93)
  • Self test (94)
  • Self test (95)
  • Self test (96)
  • Self test (97)
  • Self test (98)
  • Self test (99)
; i++) pInfo->aReadMark[i] = 0xffffffff;
executed 3824 times by 21 tests: pInfo->aReadMark[i] = 0xffffffff;
Executed by:
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (438)
  • Self test (50)
  • Self test (79)
  • Self test (81)
  • Self test (83)
  • Self test (85)
  • Self test (90)
  • Self test (91)
  • Self test (92)
  • Self test (93)
  • Self test (94)
  • Self test (95)
  • Self test (96)
  • Self test (97)
  • Self test (98)
  • Self test (99)
956-3824
683 if( pWal->hdr.mxFrame
pWal->hdr.mxFrameDescription
TRUEevaluated 286 times by 5 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (50)
FALSEevaluated 670 times by 19 tests
Evaluated by:
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (28)
  • Self test (438)
  • Self test (79)
  • Self test (81)
  • Self test (83)
  • Self test (85)
  • Self test (90)
  • Self test (91)
  • Self test (92)
  • Self test (93)
  • Self test (94)
  • Self test (95)
  • Self test (96)
  • Self test (97)
  • Self test (98)
  • Self test (99)
) pInfo->aReadMark[1] = pWal->hdr.mxFrame;
executed 286 times by 5 tests: pInfo->aReadMark[1] = pWal->hdr.mxFrame;
Executed by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (50)
286-670
684-
685-
686-
687-
688-
689-
690 if( pWal->hdr.nPage
pWal->hdr.nPageDescription
TRUEevaluated 286 times by 5 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (50)
FALSEevaluated 670 times by 19 tests
Evaluated by:
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (28)
  • Self test (438)
  • Self test (79)
  • Self test (81)
  • Self test (83)
  • Self test (85)
  • Self test (90)
  • Self test (91)
  • Self test (92)
  • Self test (93)
  • Self test (94)
  • Self test (95)
  • Self test (96)
  • Self test (97)
  • Self test (98)
  • Self test (99)
){
286-670
691 sqlite3_log((27 | (1<<8)),-
692 "recovered %d frames from WAL file %s",-
693 pWal->hdr.mxFrame, pWal->zWalName-
694 );-
695 }
executed 286 times by 5 tests: end of block
Executed by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (50)
286
696 }
executed 956 times by 21 tests: end of block
Executed by:
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (438)
  • Self test (50)
  • Self test (79)
  • Self test (81)
  • Self test (83)
  • Self test (85)
  • Self test (90)
  • Self test (91)
  • Self test (92)
  • Self test (93)
  • Self test (94)
  • Self test (95)
  • Self test (96)
  • Self test (97)
  • Self test (98)
  • Self test (99)
956
697-
698recovery_error:
code before this statement executed 960 times by 21 tests: recovery_error:
Executed by:
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (438)
  • Self test (50)
  • Self test (79)
  • Self test (81)
  • Self test (83)
  • Self test (85)
  • Self test (90)
  • Self test (91)
  • Self test (92)
  • Self test (93)
  • Self test (94)
  • Self test (95)
  • Self test (96)
  • Self test (97)
  • Self test (98)
  • Self test (99)
960
699 ;-
700 walUnlockExclusive(pWal, iLock, (3+(0))-iLock);-
701 walUnlockExclusive(pWal, (3+(1)), (8 -3)-1);-
702 return
executed 960 times by 21 tests: return rc;
Executed by:
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (438)
  • Self test (50)
  • Self test (79)
  • Self test (81)
  • Self test (83)
  • Self test (85)
  • Self test (90)
  • Self test (91)
  • Self test (92)
  • Self test (93)
  • Self test (94)
  • Self test (95)
  • Self test (96)
  • Self test (97)
  • Self test (98)
  • Self test (99)
rc;
executed 960 times by 21 tests: return rc;
Executed by:
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (438)
  • Self test (50)
  • Self test (79)
  • Self test (81)
  • Self test (83)
  • Self test (85)
  • Self test (90)
  • Self test (91)
  • Self test (92)
  • Self test (93)
  • Self test (94)
  • Self test (95)
  • Self test (96)
  • Self test (97)
  • Self test (98)
  • Self test (99)
960
703}-
704-
705-
706-
707-
708static void walIndexClose(Wal *pWal, int isDelete){-
709 if( pWal->exclusiveMode==2
pWal->exclusiveMode==2Description
TRUEevaluated 14 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 1369 times by 38 tests
Evaluated by:
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • Self test (75)
  • Self test (76)
  • ...
|| pWal->bShmUnreliable
pWal->bShmUnreliableDescription
TRUEevaluated 11 times by 2 tests
Evaluated by:
  • Self test (104)
  • Self test (438)
FALSEevaluated 1358 times by 38 tests
Evaluated by:
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • Self test (75)
  • Self test (76)
  • ...
){
11-1369
710 int i;-
711 for(i=0; i<pWal->nWiData
i<pWal->nWiDataDescription
TRUEevaluated 25 times by 2 tests
Evaluated by:
  • Self test (104)
  • Self test (438)
FALSEevaluated 25 times by 2 tests
Evaluated by:
  • Self test (104)
  • Self test (438)
; i++){
25
712 sqlite3_free((void *)pWal->apWiData[i]);-
713 pWal->apWiData[i] = 0;-
714 }
executed 25 times by 2 tests: end of block
Executed by:
  • Self test (104)
  • Self test (438)
25
715 }
executed 25 times by 2 tests: end of block
Executed by:
  • Self test (104)
  • Self test (438)
25
716 if( pWal->exclusiveMode!=2
pWal->exclusiveMode!=2Description
TRUEevaluated 1369 times by 38 tests
Evaluated by:
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • Self test (75)
  • Self test (76)
  • ...
FALSEevaluated 14 times by 1 test
Evaluated by:
  • Self test (438)
){
14-1369
717 sqlite3OsShmUnmap(pWal->pDbFd, isDelete);-
718 }
executed 1369 times by 38 tests: end of block
Executed by:
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • Self test (75)
  • Self test (76)
  • ...
1369
719}
executed 1383 times by 38 tests: end of block
Executed by:
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • Self test (75)
  • Self test (76)
  • ...
1383
720int sqlite3WalOpen(-
721 sqlite3_vfs *pVfs,-
722 sqlite3_file *pDbFd,-
723 const char *zWalName,-
724 int bNoShm,-
725 i64 mxWalSize,-
726 Wal **ppWal-
727){-
728 int rc;-
729 Wal *pRet;-
730 int flags;-
731-
732 -
733 ((void) (0))-
734 ;-
735 -
736 ((void) (0))-
737 ;-
738-
739-
740-
741-
742-
743-
744-
745 -
746 ((void) (0))-
747 ;-
748 -
749 ((void) (0))-
750 ;-
751 *ppWal = 0;-
752 pRet = (Wal*)sqlite3MallocZero(sizeof(Wal) + pVfs->szOsFile);-
753 if( !pRet
!pRetDescription
TRUEnever evaluated
FALSEevaluated 1392 times by 49 tests
Evaluated by:
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • ...
){
0-1392
754 return
never executed: return 7;
7;
never executed: return 7;
0
755 }-
756-
757 pRet->pVfs = pVfs;-
758 pRet->pWalFd = (sqlite3_file *)&pRet[1];-
759 pRet->pDbFd = pDbFd;-
760 pRet->readLock = -1;-
761 pRet->mxWalSize = mxWalSize;-
762 pRet->zWalName = zWalName;-
763 pRet->syncHeader = 1;-
764 pRet->padToSectorBoundary = 1;-
765 pRet->exclusiveMode = (bNoShm
bNoShmDescription
TRUEevaluated 12 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 1380 times by 49 tests
Evaluated by:
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • ...
? 2: 0);
12-1380
766-
767-
768 flags = (0x00000002|0x00000004|0x00080000);-
769 rc = sqlite3OsOpen(pVfs, zWalName, pRet->pWalFd, flags, &flags);-
770 if( rc==0
rc==0Description
TRUEevaluated 1390 times by 49 tests
Evaluated by:
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • ...
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test (438)
&& flags&0x00000001
flags&0x00000001Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 1389 times by 49 tests
Evaluated by:
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • ...
){
1-1390
771 pRet->readOnly = 1;-
772 }
executed 1 time by 1 test: end of block
Executed by:
  • Self test (438)
1
773-
774 if( rc!=0
rc!=0Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 1390 times by 49 tests
Evaluated by:
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • ...
){
2-1390
775 walIndexClose(pRet, 0);-
776 sqlite3OsClose(pRet->pWalFd);-
777 sqlite3_free(pRet);-
778 }
executed 2 times by 1 test: end of block
Executed by:
  • Self test (438)
else{
2
779 int iDC = sqlite3OsDeviceCharacteristics(pDbFd);-
780 if( iDC & 0x00000400
iDC & 0x00000400Description
TRUEnever evaluated
FALSEevaluated 1390 times by 49 tests
Evaluated by:
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • ...
){ pRet->syncHeader = 0; }
never executed: end of block
0-1390
781 if( iDC & 0x00001000
iDC & 0x00001000Description
TRUEevaluated 1360 times by 39 tests
Evaluated by:
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • Self test (75)
  • ...
FALSEevaluated 30 times by 11 tests
Evaluated by:
  • Self test (100)
  • Self test (438)
  • Self test (91)
  • Self test (92)
  • Self test (93)
  • Self test (94)
  • Self test (95)
  • Self test (96)
  • Self test (97)
  • Self test (98)
  • Self test (99)
){
30-1360
782 pRet->padToSectorBoundary = 0;-
783 }
executed 1360 times by 39 tests: end of block
Executed by:
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • Self test (75)
  • ...
1360
784 *ppWal = pRet;-
785 ;-
786 }
executed 1390 times by 49 tests: end of block
Executed by:
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • ...
1390
787 return
executed 1392 times by 49 tests: return rc;
Executed by:
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • ...
rc;
executed 1392 times by 49 tests: return rc;
Executed by:
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • ...
1392
788}-
789-
790-
791-
792-
793void sqlite3WalLimit(Wal *pWal, i64 iLimit){-
794 if( pWal
pWalDescription
TRUEnever evaluated
FALSEevaluated 10 times by 1 test
Evaluated by:
  • Self test (438)
) pWal->mxWalSize = iLimit;
never executed: pWal->mxWalSize = iLimit;
0-10
795}
executed 10 times by 1 test: end of block
Executed by:
  • Self test (438)
10
796static int walIteratorNext(-
797 WalIterator *p,-
798 u32 *piPage,-
799 u32 *piFrame-
800){-
801 u32 iMin;-
802 u32 iRet = 0xFFFFFFFF;-
803 int i;-
804-
805 iMin = p->iPrior;-
806 -
807 ((void) (0))-
808 ;-
809 for(i=p->nSegment-1; i>=0
i>=0Description
TRUEevaluated 855010 times by 8 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
FALSEevaluated 361376 times by 8 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
; i--){
361376-855010
810 struct WalSegment *pSegment = &p->aSegment[i];-
811 while( pSegment->iNext<pSegment->nEntry
pSegment->iNex...egment->nEntryDescription
TRUEevaluated 903509 times by 8 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
FALSEevaluated 308881 times by 8 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
){
308881-903509
812 u32 iPg = pSegment->aPgno[pSegment->aIndex[pSegment->iNext]];-
813 if( iPg>iMin
iPg>iMinDescription
TRUEevaluated 546129 times by 8 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
FALSEevaluated 357380 times by 8 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
){
357380-546129
814 if( iPg<iRet
iPg<iRetDescription
TRUEevaluated 543553 times by 8 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
FALSEevaluated 2576 times by 1 test
Evaluated by:
  • Self test (438)
){
2576-543553
815 iRet = iPg;-
816 *piFrame = pSegment->iZero + pSegment->aIndex[pSegment->iNext];-
817 }
executed 543553 times by 8 tests: end of block
Executed by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
543553
818 break;
executed 546129 times by 8 tests: break;
Executed by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
546129
819 }-
820 pSegment->iNext++;-
821 }
executed 357380 times by 8 tests: end of block
Executed by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
357380
822 }
executed 855010 times by 8 tests: end of block
Executed by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
855010
823-
824 *piPage = p->iPrior = iRet;-
825 return
executed 361376 times by 8 tests: return (iRet==0xFFFFFFFF);
Executed by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
(iRet==0xFFFFFFFF);
executed 361376 times by 8 tests: return (iRet==0xFFFFFFFF);
Executed by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
361376
826}-
827static void walMerge(-
828 const u32 *aContent,-
829 ht_slot *aLeft,-
830 int nLeft,-
831 ht_slot **paRight,-
832 int *pnRight,-
833 ht_slot *aTmp-
834){-
835 int iLeft = 0;-
836 int iRight = 0;-
837 int iOut = 0;-
838 int nRight = *pnRight;-
839 ht_slot *aRight = *paRight;-
840-
841 -
842 ((void) (0))-
843 ;-
844 while( iRight<nRight
iRight<nRightDescription
TRUEevaluated 4143709 times by 8 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
FALSEevaluated 454379 times by 8 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
|| iLeft<nLeft
iLeft<nLeftDescription
TRUEevaluated 32122 times by 2 tests
Evaluated by:
  • Self test (438)
  • Self test (72)
FALSEevaluated 422257 times by 8 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
){
32122-4143709
845 ht_slot logpage;-
846 Pgno dbpage;-
847-
848 if( (
(iLeft<nLeft)Description
TRUEevaluated 2307771 times by 8 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
FALSEevaluated 1868060 times by 8 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
iLeft<nLeft)
(iLeft<nLeft)Description
TRUEevaluated 2307771 times by 8 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
FALSEevaluated 1868060 times by 8 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
1868060-2307771
849 && (iRight>=nRight
iRight>=nRightDescription
TRUEevaluated 32122 times by 2 tests
Evaluated by:
  • Self test (438)
  • Self test (72)
FALSEevaluated 2275649 times by 8 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
|| aContent[aLeft[iLeft]]<aContent[aRight[iRight]]
aContent[aLeft...Right[iRight]]Description
TRUEevaluated 2046639 times by 8 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
FALSEevaluated 229010 times by 5 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
)
32122-2275649
850 ){-
851 logpage = aLeft[iLeft++];-
852 }
executed 2078761 times by 8 tests: end of block
Executed by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
else{
2078761
853 logpage = aRight[iRight++];-
854 }
executed 2097070 times by 8 tests: end of block
Executed by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
2097070
855 dbpage = aContent[logpage];-
856-
857 aTmp[iOut++] = logpage;-
858 if( iLeft<nLeft
iLeft<nLeftDescription
TRUEevaluated 1924009 times by 6 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
FALSEevaluated 2251822 times by 8 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
&& aContent[aLeft[iLeft]]==dbpage
aContent[aLeft[iLeft]]==dbpageDescription
TRUEevaluated 69721 times by 5 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
FALSEevaluated 1854288 times by 6 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
) iLeft++;
executed 69721 times by 5 tests: iLeft++;
Executed by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
69721-2251822
859-
860 -
861 ((void) (0))-
862 ;-
863 -
864 ((void) (0))-
865 ;-
866 }
executed 4175831 times by 8 tests: end of block
Executed by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
4175831
867-
868 *paRight = aLeft;-
869 *pnRight = iOut;-
870 memcpy(aLeft, aTmp, sizeof(aTmp[0])*iOut);-
871}
executed 422257 times by 8 tests: end of block
Executed by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
422257
872static void walMergesort(-
873 const u32 *aContent,-
874 ht_slot *aBuffer,-
875 ht_slot *aList,-
876 int *pnList-
877){-
878 struct Sublist {-
879 int nList;-
880 ht_slot *aList;-
881 };-
882-
883 const int nList = *pnList;-
884 int nMerge = 0;-
885 ht_slot *aMerge = 0;-
886 int iList;-
887 u32 iSub = 0;-
888 struct Sublist aSub[13];-
889-
890 memset(aSub, 0, sizeof(aSub));-
891 -
892 ((void) (0))-
893 ;-
894 -
895 ((void) (0))-
896 ;-
897-
898 for(iList=0; iList<nList
iList<nListDescription
TRUEevaluated 427396 times by 8 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
FALSEevaluated 5139 times by 8 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
; iList++){
5139-427396
899 nMerge = 1;-
900 aMerge = &aList[iList];-
901 for(iSub=0; iList & (1<<iSub)
iList & (1<<iSub)Description
TRUEevaluated 420456 times by 8 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
FALSEevaluated 427396 times by 8 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
; iSub++){
420456-427396
902 struct Sublist *p;-
903 -
904 ((void) (0))-
905 ;-
906 p = &aSub[iSub];-
907 -
908 ((void) (0))-
909 ;-
910 -
911 ((void) (0))-
912 ;-
913 walMerge(aContent, p->aList, p->nList, &aMerge, &nMerge, aBuffer);-
914 }
executed 420456 times by 8 tests: end of block
Executed by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
420456
915 aSub[iSub].aList = aMerge;-
916 aSub[iSub].nList = nMerge;-
917 }
executed 427396 times by 8 tests: end of block
Executed by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
427396
918-
919 for(iSub++; iSub<((int)(sizeof(aSub)/sizeof(aSub[0])))
iSub<((int)(si...eof(aSub[0])))Description
TRUEevaluated 56487 times by 8 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
FALSEevaluated 5139 times by 8 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
; iSub++){
5139-56487
920 if( nList & (1<<iSub)
nList & (1<<iSub)Description
TRUEevaluated 1801 times by 6 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
FALSEevaluated 54686 times by 8 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
){
1801-54686
921 struct Sublist *p;-
922 -
923 ((void) (0))-
924 ;-
925 p = &aSub[iSub];-
926 -
927 ((void) (0))-
928 ;-
929 -
930 ((void) (0))-
931 ;-
932 walMerge(aContent, p->aList, p->nList, &aMerge, &nMerge, aBuffer);-
933 }
executed 1801 times by 6 tests: end of block
Executed by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
1801
934 }
executed 56487 times by 8 tests: end of block
Executed by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
56487
935 -
936 ((void) (0))-
937 ;-
938 *pnList = nMerge;-
939}
executed 5139 times by 8 tests: end of block
Executed by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
5139
940-
941-
942-
943-
944static void walIteratorFree(WalIterator *p){-
945 sqlite3_free(p);-
946}
executed 7346 times by 13 tests: end of block
Executed by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (73)
  • Self test (75)
  • Self test (80)
  • Self test (82)
  • Self test (84)
  • Self test (85)
  • Self test (89)
  • Self test (90)
7346
947static int walIteratorInit(Wal *pWal, u32 nBackfill, WalIterator **pp){-
948 WalIterator *p;-
949 int nSegment;-
950 u32 iLast;-
951 int nByte;-
952 int i;-
953 ht_slot *aTmp;-
954 int rc = 0;-
955-
956-
957-
958-
959 -
960 ((void) (0))-
961 ;-
962 iLast = pWal->hdr.mxFrame;-
963-
964-
965 nSegment = walFramePage(iLast) + 1;-
966 nByte = sizeof(WalIterator)-
967 + (nSegment-1)*sizeof(struct WalSegment)-
968 + iLast*sizeof(ht_slot);-
969 p = (WalIterator *)sqlite3_malloc64(nByte);-
970 if( !p
!pDescription
TRUEnever evaluated
FALSEevaluated 5064 times by 8 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
){
0-5064
971 return
never executed: return 7;
7;
never executed: return 7;
0
972 }-
973 memset(p, 0, nByte);-
974 p->nSegment = nSegment;-
975-
976-
977-
978-
979 aTmp = (ht_slot *)sqlite3_malloc64(-
980 sizeof(ht_slot) * (iLast>4096?4096:iLast)-
981 );-
982 if( !aTmp
!aTmpDescription
TRUEnever evaluated
FALSEevaluated 5064 times by 8 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
){
0-5064
983 rc = 7;-
984 }
never executed: end of block
0
985-
986 for(i=walFramePage(nBackfill+1); rc==0
rc==0Description
TRUEevaluated 10203 times by 8 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
FALSEnever evaluated
&& i<nSegment
i<nSegmentDescription
TRUEevaluated 5139 times by 8 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
FALSEevaluated 5064 times by 8 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
; i++){
0-10203
987 WalHashLoc sLoc;-
988-
989 rc = walHashGet(pWal, i, &sLoc);-
990 if( rc==0
rc==0Description
TRUEevaluated 5139 times by 8 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
FALSEnever evaluated
){
0-5139
991 int j;-
992 int nEntry;-
993 ht_slot *aIndex;-
994-
995 sLoc.aPgno++;-
996 if( (
(i+1)==nSegmentDescription
TRUEevaluated 5064 times by 8 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
FALSEevaluated 75 times by 1 test
Evaluated by:
  • Self test (438)
i+1)==nSegment
(i+1)==nSegmentDescription
TRUEevaluated 5064 times by 8 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
FALSEevaluated 75 times by 1 test
Evaluated by:
  • Self test (438)
){
75-5064
997 nEntry = (int)(iLast - sLoc.iZero);-
998 }
executed 5064 times by 8 tests: end of block
Executed by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
else{
5064
999 nEntry = (int)((u32*)sLoc.aHash - (u32*)sLoc.aPgno);-
1000 }
executed 75 times by 1 test: end of block
Executed by:
  • Self test (438)
75
1001 aIndex = &((ht_slot *)&p->aSegment[p->nSegment])[sLoc.iZero];-
1002 sLoc.iZero++;-
1003-
1004 for(j=0; j<nEntry
j<nEntryDescription
TRUEevaluated 427396 times by 8 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
FALSEevaluated 5139 times by 8 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
; j++){
5139-427396
1005 aIndex[j] = (ht_slot)j;-
1006 }
executed 427396 times by 8 tests: end of block
Executed by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
427396
1007 walMergesort((u32 *)sLoc.aPgno, aTmp, aIndex, &nEntry);-
1008 p->aSegment[i].iZero = sLoc.iZero;-
1009 p->aSegment[i].nEntry = nEntry;-
1010 p->aSegment[i].aIndex = aIndex;-
1011 p->aSegment[i].aPgno = (u32 *)sLoc.aPgno;-
1012 }
executed 5139 times by 8 tests: end of block
Executed by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
5139
1013 }
executed 5139 times by 8 tests: end of block
Executed by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
5139
1014 sqlite3_free(aTmp);-
1015-
1016 if( rc!=0
rc!=0Description
TRUEnever evaluated
FALSEevaluated 5064 times by 8 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
){
0-5064
1017 walIteratorFree(p);-
1018 p = 0;-
1019 }
never executed: end of block
0
1020 *pp = p;-
1021 return
executed 5064 times by 8 tests: return rc;
Executed by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
rc;
executed 5064 times by 8 tests: return rc;
Executed by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
5064
1022}-
1023-
1024-
1025-
1026-
1027-
1028-
1029-
1030static int walBusyLock(-
1031 Wal *pWal,-
1032 int (*xBusy)(void*),-
1033 void *pBusyArg,-
1034 int lockIdx,-
1035 int n-
1036){-
1037 int rc;-
1038 do {-
1039 rc = walLockExclusive(pWal, lockIdx, n);-
1040 }
executed 12304 times by 8 tests: end of block
Executed by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
while( xBusy
xBusyDescription
TRUEevaluated 890 times by 3 tests
Evaluated by:
  • Self test (104)
  • Self test (105)
  • Self test (438)
FALSEevaluated 11414 times by 8 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
&& rc==5
rc==5Description
TRUEevaluated 504 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 386 times by 3 tests
Evaluated by:
  • Self test (104)
  • Self test (105)
  • Self test (438)
&& xBusy(pBusyArg)
xBusy(pBusyArg)Description
TRUEevaluated 432 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 72 times by 1 test
Evaluated by:
  • Self test (438)
);
72-12304
1041 return
executed 11872 times by 8 tests: return rc;
Executed by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
rc;
executed 11872 times by 8 tests: return rc;
Executed by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
11872
1042}-
1043-
1044-
1045-
1046-
1047-
1048static int walPagesize(Wal *pWal){-
1049 return
executed 14521 times by 13 tests: return (pWal->hdr.szPage&0xfe00) + ((pWal->hdr.szPage&0x0001)<<16);
Executed by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (73)
  • Self test (75)
  • Self test (80)
  • Self test (82)
  • Self test (84)
  • Self test (85)
  • Self test (89)
  • Self test (90)
(pWal->hdr.szPage&0xfe00) + ((pWal->hdr.szPage&0x0001)<<16);
executed 14521 times by 13 tests: return (pWal->hdr.szPage&0xfe00) + ((pWal->hdr.szPage&0x0001)<<16);
Executed by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (73)
  • Self test (75)
  • Self test (80)
  • Self test (82)
  • Self test (84)
  • Self test (85)
  • Self test (89)
  • Self test (90)
14521
1050}-
1051static void walRestartHdr(Wal *pWal, u32 salt1){-
1052 volatile WalCkptInfo *pInfo = walCkptInfo(pWal);-
1053 int i;-
1054 u32 *aSalt = pWal->hdr.aSalt;-
1055 pWal->nCkpt++;-
1056 pWal->hdr.mxFrame = 0;-
1057 sqlite3Put4byte((u8*)&aSalt[0], 1 + sqlite3Get4byte((u8*)&aSalt[0]));-
1058 memcpy(&pWal->hdr.aSalt[1], &salt1, 4);-
1059 walIndexWriteHdr(pWal);-
1060 pInfo->nBackfill = 0;-
1061 pInfo->nBackfillAttempted = 0;-
1062 pInfo->aReadMark[1] = 0;-
1063 for(i=2; i<(8 -3)
i<(8 -3)Description
TRUEevaluated 13023 times by 4 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
FALSEevaluated 4341 times by 4 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
; i++) pInfo->aReadMark[i] = 0xffffffff;
executed 13023 times by 4 tests: pInfo->aReadMark[i] = 0xffffffff;
Executed by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
4341-13023
1064 -
1065 ((void) (0))-
1066 ;-
1067}
executed 4341 times by 4 tests: end of block
Executed by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
4341
1068static int walCheckpoint(-
1069 Wal *pWal,-
1070 sqlite3 *db,-
1071 int eMode,-
1072 int (*xBusy)(void*),-
1073 void *pBusyArg,-
1074 int sync_flags,-
1075 u8 *zBuf-
1076){-
1077 int rc = 0;-
1078 int szPage;-
1079 WalIterator *pIter = 0;-
1080 u32 iDbpage = 0;-
1081 u32 iFrame = 0;-
1082 u32 mxSafeFrame;-
1083 u32 mxPage;-
1084 int i;-
1085 volatile WalCkptInfo *pInfo;-
1086-
1087 szPage = walPagesize(pWal);-
1088 ;-
1089 ;-
1090 pInfo = walCkptInfo(pWal);-
1091 if( pInfo->nBackfill<pWal->hdr.mxFrame
pInfo->nBackfi...l->hdr.mxFrameDescription
TRUEevaluated 6936 times by 8 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
FALSEevaluated 410 times by 9 tests
Evaluated by:
  • Self test (104)
  • Self test (438)
  • Self test (73)
  • Self test (80)
  • Self test (82)
  • Self test (84)
  • Self test (85)
  • Self test (89)
  • Self test (90)
){
410-6936
1092-
1093-
1094-
1095 -
1096 ((void) (0))-
1097 ;-
1098-
1099-
1100-
1101-
1102-
1103-
1104 mxSafeFrame = pWal->hdr.mxFrame;-
1105 mxPage = pWal->hdr.nPage;-
1106 for(i=1; i<(8 -3)
i<(8 -3)Description
TRUEevaluated 27744 times by 8 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
FALSEevaluated 6936 times by 8 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
; i++){
6936-27744
1107 u32 y = pInfo->aReadMark[i];-
1108 if( mxSafeFrame>y
mxSafeFrame>yDescription
TRUEevaluated 6553 times by 6 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
FALSEevaluated 21191 times by 8 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
){
6553-21191
1109 -
1110 ((void) (0))-
1111 ;-
1112 rc = walBusyLock(pWal, xBusy, pBusyArg, (3+(i)), 1);-
1113 if( rc==0
rc==0Description
TRUEevaluated 4642 times by 6 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
FALSEevaluated 1911 times by 1 test
Evaluated by:
  • Self test (438)
){
1911-4642
1114 pInfo->aReadMark[i] = (i==1
i==1Description
TRUEevaluated 4607 times by 5 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (75)
FALSEevaluated 35 times by 2 tests
Evaluated by:
  • Self test (438)
  • Self test (72)
? mxSafeFrame : 0xffffffff);
35-4607
1115 walUnlockExclusive(pWal, (3+(i)), 1);-
1116 }
executed 4642 times by 6 tests: end of block
Executed by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
else if( rc==5
rc==5Description
TRUEevaluated 1911 times by 1 test
Evaluated by:
  • Self test (438)
FALSEnever evaluated
){
0-4642
1117 mxSafeFrame = y;-
1118 xBusy = 0;-
1119 }
executed 1911 times by 1 test: end of block
Executed by:
  • Self test (438)
else{
1911
1120 goto
never executed: goto walcheckpoint_out;
walcheckpoint_out;
never executed: goto walcheckpoint_out;
0
1121 }-
1122 }-
1123 }
executed 27744 times by 8 tests: end of block
Executed by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
27744
1124-
1125-
1126 if( pInfo->nBackfill<mxSafeFrame
pInfo->nBackfill<mxSafeFrameDescription
TRUEevaluated 5064 times by 8 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
FALSEevaluated 1872 times by 1 test
Evaluated by:
  • Self test (438)
){
1872-5064
1127 rc = walIteratorInit(pWal, pInfo->nBackfill, &pIter);-
1128 -
1129 ((void) (0))-
1130 ;-
1131 }
executed 5064 times by 8 tests: end of block
Executed by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
5064
1132-
1133 if( pIter
pIterDescription
TRUEevaluated 5064 times by 8 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
FALSEevaluated 1872 times by 1 test
Evaluated by:
  • Self test (438)
1872-5064
1134 && (
(rc = walBusyL...(3+(0)),1))==0Description
TRUEevaluated 5060 times by 8 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
FALSEevaluated 4 times by 1 test
Evaluated by:
  • Self test (438)
rc = walBusyLock(pWal, xBusy, pBusyArg, (3+(0)),1))==0
(rc = walBusyL...(3+(0)),1))==0Description
TRUEevaluated 5060 times by 8 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
FALSEevaluated 4 times by 1 test
Evaluated by:
  • Self test (438)
4-5060
1135 ){-
1136 u32 nBackfill = pInfo->nBackfill;-
1137-
1138 pInfo->nBackfillAttempted = mxSafeFrame;-
1139-
1140-
1141 rc = sqlite3OsSync(pWal->pWalFd, (((sync_flags)>>2)&0x03));-
1142-
1143-
1144-
1145-
1146 if( rc==0
rc==0Description
TRUEevaluated 5060 times by 8 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
FALSEnever evaluated
){
0-5060
1147 i64 nReq = ((i64)mxPage * szPage);-
1148 i64 nSize;-
1149 rc = sqlite3OsFileSize(pWal->pDbFd, &nSize);-
1150 if( rc==0
rc==0Description
TRUEevaluated 5060 times by 8 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
FALSEnever evaluated
&& nSize<nReq
nSize<nReqDescription
TRUEevaluated 603 times by 8 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
FALSEevaluated 4457 times by 4 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
){
0-5060
1151 sqlite3OsFileControlHint(pWal->pDbFd, 5, &nReq);-
1152 }
executed 603 times by 8 tests: end of block
Executed by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
603
1153 }
executed 5060 times by 8 tests: end of block
Executed by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
5060
1154-
1155-
1156-
1157 while( rc==0
rc==0Description
TRUEevaluated 361376 times by 8 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
FALSEnever evaluated
&& 0==walIteratorNext(pIter, &iDbpage, &iFrame)
0==walIterator...page, &iFrame)Description
TRUEevaluated 356328 times by 8 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
FALSEevaluated 5048 times by 8 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
){
0-361376
1158 i64 iOffset;-
1159 -
1160 ((void) (0))-
1161 ;-
1162 if( db->u1.isInterrupted
db->u1.isInterruptedDescription
TRUEevaluated 11 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 356317 times by 8 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
){
11-356317
1163 rc = db->mallocFailed
db->mallocFailedDescription
TRUEnever evaluated
FALSEevaluated 11 times by 1 test
Evaluated by:
  • Self test (438)
? 7 : 9;
0-11
1164 break;
executed 11 times by 1 test: break;
Executed by:
  • Self test (438)
11
1165 }-
1166 if( iFrame<=nBackfill
iFrame<=nBackfillDescription
TRUEevaluated 63 times by 2 tests
Evaluated by:
  • Self test (438)
  • Self test (72)
FALSEevaluated 356254 times by 8 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
|| iFrame>mxSafeFrame
iFrame>mxSafeFrameDescription
TRUEevaluated 75 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 356179 times by 8 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
|| iDbpage>mxPage
iDbpage>mxPageDescription
TRUEevaluated 403 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 355776 times by 8 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
){
63-356254
1167 continue;
executed 541 times by 2 tests: continue;
Executed by:
  • Self test (438)
  • Self test (72)
541
1168 }-
1169 iOffset = ( 32 + ((iFrame)-1)*(i64)((szPage)+24) ) + 24;-
1170-
1171 rc = sqlite3OsRead(pWal->pWalFd, zBuf, szPage, iOffset);-
1172 if( rc!=0
rc!=0Description
TRUEnever evaluated
FALSEevaluated 355776 times by 8 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
) break;
never executed: break;
0-355776
1173 iOffset = (iDbpage-1)*(i64)szPage;-
1174 ;-
1175 rc = sqlite3OsWrite(pWal->pDbFd, zBuf, szPage, iOffset);-
1176 if( rc!=0
rc!=0Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 355775 times by 8 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
) break;
executed 1 time by 1 test: break;
Executed by:
  • Self test (438)
1-355775
1177 }
executed 355775 times by 8 tests: end of block
Executed by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
355775
1178-
1179-
1180 if( rc==0
rc==0Description
TRUEevaluated 5048 times by 8 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
FALSEevaluated 12 times by 1 test
Evaluated by:
  • Self test (438)
){
12-5048
1181 if( mxSafeFrame==walIndexHdr(pWal)->mxFrame
mxSafeFrame==w...pWal)->mxFrameDescription
TRUEevaluated 5011 times by 8 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
FALSEevaluated 37 times by 1 test
Evaluated by:
  • Self test (438)
){
37-5011
1182 i64 szDb = pWal->hdr.nPage*(i64)szPage;-
1183 ;-
1184 rc = sqlite3OsTruncate(pWal->pDbFd, szDb);-
1185 if( rc==0
rc==0Description
TRUEevaluated 5011 times by 8 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
FALSEnever evaluated
){
0-5011
1186 rc = sqlite3OsSync(pWal->pDbFd, (((sync_flags)>>2)&0x03));-
1187 }
executed 5011 times by 8 tests: end of block
Executed by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
5011
1188 }
executed 5011 times by 8 tests: end of block
Executed by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
5011
1189 if( rc==0
rc==0Description
TRUEevaluated 5048 times by 8 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
FALSEnever evaluated
){
0-5048
1190 pInfo->nBackfill = mxSafeFrame;-
1191 }
executed 5048 times by 8 tests: end of block
Executed by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
5048
1192 }
executed 5048 times by 8 tests: end of block
Executed by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
5048
1193-
1194-
1195 walUnlockExclusive(pWal, (3+(0)), 1);-
1196 }
executed 5060 times by 8 tests: end of block
Executed by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
5060
1197-
1198 if( rc==5
rc==5Description
TRUEevaluated 1876 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 5060 times by 8 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
){
1876-5060
1199-
1200-
1201 rc = 0;-
1202 }
executed 1876 times by 1 test: end of block
Executed by:
  • Self test (438)
1876
1203 }
executed 6936 times by 8 tests: end of block
Executed by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (75)
  • Self test (84)
  • Self test (89)
6936
1204-
1205-
1206-
1207-
1208-
1209-
1210 if( rc==0
rc==0Description
TRUEevaluated 7334 times by 13 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (73)
  • Self test (75)
  • Self test (80)
  • Self test (82)
  • Self test (84)
  • Self test (85)
  • Self test (89)
  • Self test (90)
FALSEevaluated 12 times by 1 test
Evaluated by:
  • Self test (438)
&& eMode!=0
eMode!=0Description
TRUEevaluated 132 times by 3 tests
Evaluated by:
  • Self test (104)
  • Self test (105)
  • Self test (438)
FALSEevaluated 7202 times by 13 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (73)
  • Self test (75)
  • Self test (80)
  • Self test (82)
  • Self test (84)
  • Self test (85)
  • Self test (89)
  • Self test (90)
){
12-7334
1211 -
1212 ((void) (0))-
1213 ;-
1214 if( pInfo->nBackfill<pWal->hdr.mxFrame
pInfo->nBackfi...l->hdr.mxFrameDescription
TRUEevaluated 16 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 116 times by 3 tests
Evaluated by:
  • Self test (104)
  • Self test (105)
  • Self test (438)
){
16-116
1215 rc = 5;-
1216 }
executed 16 times by 1 test: end of block
Executed by:
  • Self test (438)
else if( eMode>=2
eMode>=2Description
TRUEevaluated 91 times by 3 tests
Evaluated by:
  • Self test (104)
  • Self test (105)
  • Self test (438)
FALSEevaluated 25 times by 1 test
Evaluated by:
  • Self test (438)
){
16-91
1217 u32 salt1;-
1218 sqlite3_randomness(4, &salt1);-
1219 -
1220 ((void) (0))-
1221 ;-
1222 rc = walBusyLock(pWal, xBusy, pBusyArg, (3+(1)), (8 -3)-1);-
1223 if( rc==0
rc==0Description
TRUEevaluated 61 times by 3 tests
Evaluated by:
  • Self test (104)
  • Self test (105)
  • Self test (438)
FALSEevaluated 30 times by 1 test
Evaluated by:
  • Self test (438)
){
30-61
1224 if( eMode==3
eMode==3Description
TRUEevaluated 38 times by 3 tests
Evaluated by:
  • Self test (104)
  • Self test (105)
  • Self test (438)
FALSEevaluated 23 times by 1 test
Evaluated by:
  • Self test (438)
){
23-38
1225 walRestartHdr(pWal, salt1);-
1226 rc = sqlite3OsTruncate(pWal->pWalFd, 0);-
1227 }
executed 38 times by 3 tests: end of block
Executed by:
  • Self test (104)
  • Self test (105)
  • Self test (438)
38
1228 walUnlockExclusive(pWal, (3+(1)), (8 -3)-1);-
1229 }
executed 61 times by 3 tests: end of block
Executed by:
  • Self test (104)
  • Self test (105)
  • Self test (438)
61
1230 }
executed 91 times by 3 tests: end of block
Executed by:
  • Self test (104)
  • Self test (105)
  • Self test (438)
91
1231 }
executed 132 times by 3 tests: end of block
Executed by:
  • Self test (104)
  • Self test (105)
  • Self test (438)
132
1232-
1233 walcheckpoint_out:
code before this statement executed 7346 times by 13 tests: walcheckpoint_out:
Executed by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (73)
  • Self test (75)
  • Self test (80)
  • Self test (82)
  • Self test (84)
  • Self test (85)
  • Self test (89)
  • Self test (90)
7346
1234 walIteratorFree(pIter);-
1235 return
executed 7346 times by 13 tests: return rc;
Executed by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (73)
  • Self test (75)
  • Self test (80)
  • Self test (82)
  • Self test (84)
  • Self test (85)
  • Self test (89)
  • Self test (90)
rc;
executed 7346 times by 13 tests: return rc;
Executed by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (72)
  • Self test (73)
  • Self test (75)
  • Self test (80)
  • Self test (82)
  • Self test (84)
  • Self test (85)
  • Self test (89)
  • Self test (90)
7346
1236}-
1237-
1238-
1239-
1240-
1241-
1242static void walLimitSize(Wal *pWal, i64 nMax){-
1243 i64 sz;-
1244 int rx;-
1245 sqlite3BeginBenignMalloc();-
1246 rx = sqlite3OsFileSize(pWal->pWalFd, &sz);-
1247 if( rx==0
rx==0Description
TRUEevaluated 19 times by 1 test
Evaluated by:
  • Self test (438)
FALSEnever evaluated
&& (
(sz > nMax )Description
TRUEevaluated 14 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 5 times by 1 test
Evaluated by:
  • Self test (438)
sz > nMax )
(sz > nMax )Description
TRUEevaluated 14 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 5 times by 1 test
Evaluated by:
  • Self test (438)
){
0-19
1248 rx = sqlite3OsTruncate(pWal->pWalFd, nMax);-
1249 }
executed 14 times by 1 test: end of block
Executed by:
  • Self test (438)
14
1250 sqlite3EndBenignMalloc();-
1251 if( rx
rxDescription
TRUEnever evaluated
FALSEevaluated 19 times by 1 test
Evaluated by:
  • Self test (438)
){
0-19
1252 sqlite3_log(rx, "cannot limit WAL size: %s", pWal->zWalName);-
1253 }
never executed: end of block
0
1254}
executed 19 times by 1 test: end of block
Executed by:
  • Self test (438)
19
1255-
1256-
1257-
1258-
1259int sqlite3WalClose(-
1260 Wal *pWal,-
1261 sqlite3 *db,-
1262 int sync_flags,-
1263 int nBuf,-
1264 u8 *zBuf-
1265){-
1266 int rc = 0;-
1267 if( pWal
pWalDescription
TRUEevaluated 1379 times by 38 tests
Evaluated by:
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • Self test (75)
  • Self test (76)
  • ...
FALSEevaluated 93926 times by 48 tests
Evaluated by:
  • Self test (101)
  • Self test (102)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (24)
  • Self test (25)
  • Self test (26)
  • Self test (27)
  • Self test (30)
  • Self test (31)
  • Self test (32)
  • Self test (33)
  • Self test (34)
  • Self test (35)
  • Self test (36)
  • Self test (37)
  • Self test (38)
  • Self test (39)
  • Self test (40)
  • Self test (41)
  • Self test (42)
  • Self test (43)
  • Self test (438)
  • Self test (44)
  • ...
){
1379-93926
1268 int isDelete = 0;-
1269 if( zBuf!=0
zBuf!=0Description
TRUEevaluated 1377 times by 38 tests
Evaluated by:
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • Self test (75)
  • Self test (76)
  • ...
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test (438)
2-1377
1270 && 0==(rc = sqlite3OsLock(pWal->pDbFd, 4))
0==(rc = sqlit...al->pDbFd, 4))Description
TRUEevaluated 882 times by 10 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (73)
  • Self test (75)
  • Self test (80)
  • Self test (82)
  • Self test (85)
  • Self test (90)
FALSEevaluated 495 times by 35 tests
Evaluated by:
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (74)
  • Self test (75)
  • Self test (76)
  • Self test (78)
  • ...
495-882
1271 ){-
1272 if( pWal->exclusiveMode==0
pWal->exclusiveMode==0Description
TRUEevaluated 868 times by 10 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (73)
  • Self test (75)
  • Self test (80)
  • Self test (82)
  • Self test (85)
  • Self test (90)
FALSEevaluated 14 times by 1 test
Evaluated by:
  • Self test (438)
){
14-868
1273 pWal->exclusiveMode = 1;-
1274 }
executed 868 times by 10 tests: end of block
Executed by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (73)
  • Self test (75)
  • Self test (80)
  • Self test (82)
  • Self test (85)
  • Self test (90)
868
1275 rc = sqlite3WalCheckpoint(pWal, db,-
1276 0, 0, 0, sync_flags, nBuf, zBuf, 0, 0-
1277 );-
1278 if( rc==0
rc==0Description
TRUEevaluated 840 times by 10 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (73)
  • Self test (75)
  • Self test (80)
  • Self test (82)
  • Self test (85)
  • Self test (90)
FALSEevaluated 42 times by 2 tests
Evaluated by:
  • Self test (104)
  • Self test (438)
){
42-840
1279 int bPersist = -1;-
1280 sqlite3OsFileControlHint(-
1281 pWal->pDbFd, 10, &bPersist-
1282 );-
1283 if( bPersist!=1
bPersist!=1Description
TRUEevaluated 835 times by 10 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (73)
  • Self test (75)
  • Self test (80)
  • Self test (82)
  • Self test (85)
  • Self test (90)
FALSEevaluated 5 times by 1 test
Evaluated by:
  • Self test (438)
){
5-835
1284-
1285-
1286-
1287 isDelete = 1;-
1288 }
executed 835 times by 10 tests: end of block
Executed by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (73)
  • Self test (75)
  • Self test (80)
  • Self test (82)
  • Self test (85)
  • Self test (90)
else if( pWal->mxWalSize>=0
pWal->mxWalSize>=0Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 3 times by 1 test
Evaluated by:
  • Self test (438)
){
2-835
1289-
1290-
1291-
1292-
1293-
1294-
1295 walLimitSize(pWal, 0);-
1296 }
executed 2 times by 1 test: end of block
Executed by:
  • Self test (438)
2
1297 }
executed 840 times by 10 tests: end of block
Executed by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (73)
  • Self test (75)
  • Self test (80)
  • Self test (82)
  • Self test (85)
  • Self test (90)
840
1298 }
executed 882 times by 10 tests: end of block
Executed by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (73)
  • Self test (75)
  • Self test (80)
  • Self test (82)
  • Self test (85)
  • Self test (90)
882
1299-
1300 walIndexClose(pWal, isDelete);-
1301 sqlite3OsClose(pWal->pWalFd);-
1302 if( isDelete
isDeleteDescription
TRUEevaluated 835 times by 10 tests
Evaluated by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (73)
  • Self test (75)
  • Self test (80)
  • Self test (82)
  • Self test (85)
  • Self test (90)
FALSEevaluated 544 times by 35 tests
Evaluated by:
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (74)
  • Self test (75)
  • Self test (76)
  • Self test (78)
  • ...
){
544-835
1303 sqlite3BeginBenignMalloc();-
1304 sqlite3OsDelete(pWal->pVfs, pWal->zWalName, 0);-
1305 sqlite3EndBenignMalloc();-
1306 }
executed 835 times by 10 tests: end of block
Executed by:
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (438)
  • Self test (73)
  • Self test (75)
  • Self test (80)
  • Self test (82)
  • Self test (85)
  • Self test (90)
835
1307 ;-
1308 sqlite3_free((void *)pWal->apWiData);-
1309 sqlite3_free(pWal);-
1310 }
executed 1379 times by 38 tests: end of block
Executed by:
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • Self test (75)
  • Self test (76)
  • ...
1379
1311 return
executed 95305 times by 67 tests: return rc;
Executed by:
  • Self test (101)
  • Self test (102)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (24)
  • Self test (25)
  • Self test (26)
  • Self test (27)
  • Self test (28)
  • Self test (29)
  • Self test (30)
  • Self test (31)
  • Self test (32)
  • Self test (33)
  • Self test (34)
  • Self test (35)
  • Self test (36)
  • Self test (37)
  • Self test (38)
  • Self test (39)
  • Self test (40)
  • Self test (41)
  • Self test (42)
  • Self test (43)
  • ...
rc;
executed 95305 times by 67 tests: return rc;
Executed by:
  • Self test (101)
  • Self test (102)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (24)
  • Self test (25)
  • Self test (26)
  • Self test (27)
  • Self test (28)
  • Self test (29)
  • Self test (30)
  • Self test (31)
  • Self test (32)
  • Self test (33)
  • Self test (34)
  • Self test (35)
  • Self test (36)
  • Self test (37)
  • Self test (38)
  • Self test (39)
  • Self test (40)
  • Self test (41)
  • Self test (42)
  • Self test (43)
  • ...
95305
1312}-
1313static int walIndexTryHdr(Wal *pWal, int *pChanged){-
1314 u32 aCksum[2];-
1315 WalIndexHdr h1, h2;-
1316 WalIndexHdr volatile *aHdr;-
1317-
1318-
1319 -
1320 ((void) (0))-
1321 ;-
1322 aHdr = walIndexHdr(pWal);-
1323 memcpy(&h1, (void *)&aHdr[0], sizeof(h1));-
1324 walShmBarrier(pWal);-
1325 memcpy(&h2, (void *)&aHdr[1], sizeof(h2));-
1326-
1327 if( memcmp(&h1, &h2, sizeof(h1))!=0
memcmp(&h1, &h...sizeof(h1))!=0Description
TRUEevaluated 82 times by 3 tests
Evaluated by:
  • Self test (438)
  • Self test (50)
  • Self test (51)
FALSEevaluated 65673 times by 49 tests
Evaluated by:
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • ...
){
82-65673
1328 return
executed 82 times by 3 tests: return 1;
Executed by:
  • Self test (438)
  • Self test (50)
  • Self test (51)
1;
executed 82 times by 3 tests: return 1;
Executed by:
  • Self test (438)
  • Self test (50)
  • Self test (51)
82
1329 }-
1330 if( h1.isInit==0
h1.isInit==0Description
TRUEevaluated 932 times by 20 tests
Evaluated by:
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (438)
  • Self test (79)
  • Self test (81)
  • Self test (83)
  • Self test (85)
  • Self test (90)
  • Self test (91)
  • Self test (92)
  • Self test (93)
  • Self test (94)
  • Self test (95)
  • Self test (96)
  • Self test (97)
  • Self test (98)
  • Self test (99)
FALSEevaluated 64741 times by 49 tests
Evaluated by:
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • ...
){
932-64741
1331 return
executed 932 times by 20 tests: return 1;
Executed by:
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (438)
  • Self test (79)
  • Self test (81)
  • Self test (83)
  • Self test (85)
  • Self test (90)
  • Self test (91)
  • Self test (92)
  • Self test (93)
  • Self test (94)
  • Self test (95)
  • Self test (96)
  • Self test (97)
  • Self test (98)
  • Self test (99)
1;
executed 932 times by 20 tests: return 1;
Executed by:
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (438)
  • Self test (79)
  • Self test (81)
  • Self test (83)
  • Self test (85)
  • Self test (90)
  • Self test (91)
  • Self test (92)
  • Self test (93)
  • Self test (94)
  • Self test (95)
  • Self test (96)
  • Self test (97)
  • Self test (98)
  • Self test (99)
932
1332 }-
1333 walChecksumBytes(1, (u8*)&h1, sizeof(h1)-sizeof(h1.aCksum), 0, aCksum);-
1334 if( aCksum[0]!=h1.aCksum[0]
aCksum[0]!=h1.aCksum[0]Description
TRUEevaluated 44 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 64697 times by 49 tests
Evaluated by:
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • ...
|| aCksum[1]!=h1.aCksum[1]
aCksum[1]!=h1.aCksum[1]Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 64695 times by 49 tests
Evaluated by:
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • ...
){
2-64697
1335 return
executed 46 times by 1 test: return 1;
Executed by:
  • Self test (438)
1;
executed 46 times by 1 test: return 1;
Executed by:
  • Self test (438)
46
1336 }-
1337-
1338 if( memcmp(&pWal->hdr, &h1, sizeof(WalIndexHdr))
memcmp(&pWal->...(WalIndexHdr))Description
TRUEevaluated 798 times by 36 tests
Evaluated by:
  • Self test (103)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • Self test (75)
  • Self test (76)
  • Self test (78)
  • Self test (79)
  • ...
FALSEevaluated 63897 times by 49 tests
Evaluated by:
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • ...
){
798-63897
1339 *pChanged = 1;-
1340 memcpy(&pWal->hdr, &h1, sizeof(WalIndexHdr));-
1341 pWal->szPage = (pWal->hdr.szPage&0xfe00) + ((pWal->hdr.szPage&0x0001)<<16);-
1342 ;-
1343 ;-
1344 }
executed 798 times by 36 tests: end of block
Executed by:
  • Self test (103)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • Self test (75)
  • Self test (76)
  • Self test (78)
  • Self test (79)
  • ...
798
1345-
1346-
1347 return
executed 64695 times by 49 tests: return 0;
Executed by:
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • ...
0;
executed 64695 times by 49 tests: return 0;
Executed by:
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • ...
64695
1348}-
1349static int walIndexReadHdr(Wal *pWal, int *pChanged){-
1350 int rc;-
1351 int badHdr;-
1352 volatile u32 *page0;-
1353-
1354-
1355-
1356-
1357 -
1358 ((void) (0))-
1359 ;-
1360 rc = walIndexPage(pWal, 0, &page0);-
1361 if( rc!=0
rc!=0Description
TRUEevaluated 27 times by 2 tests
Evaluated by:
  • Self test (104)
  • Self test (438)
FALSEevaluated 65650 times by 49 tests
Evaluated by:
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • ...
){
27-65650
1362 -
1363 ((void) (0))-
1364 ;-
1365 if( rc==(8 | (5<<8))
rc==(8 | (5<<8))Description
TRUEevaluated 22 times by 2 tests
Evaluated by:
  • Self test (104)
  • Self test (438)
FALSEevaluated 5 times by 1 test
Evaluated by:
  • Self test (438)
){
5-22
1366-
1367-
1368-
1369-
1370-
1371-
1372 -
1373 ((void) (0))-
1374 ;-
1375 -
1376 ((void) (0))-
1377 ;-
1378 -
1379 ((void) (0))-
1380 ;-
1381 pWal->bShmUnreliable = 1;-
1382 pWal->exclusiveMode = 2;-
1383 *pChanged = 1;-
1384 }
executed 22 times by 2 tests: end of block
Executed by:
  • Self test (104)
  • Self test (438)
else{
22
1385 return
executed 5 times by 1 test: return rc;
Executed by:
  • Self test (438)
rc;
executed 5 times by 1 test: return rc;
Executed by:
  • Self test (438)
5
1386 }-
1387 }else{-
1388-
1389-
1390 ;-
1391 }
executed 65650 times by 49 tests: end of block
Executed by:
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • ...
65650
1392 -
1393 ((void) (0))-
1394 ;-
1395-
1396-
1397-
1398-
1399-
1400-
1401 badHdr = (page0
page0Description
TRUEevaluated 64772 times by 49 tests
Evaluated by:
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • ...
FALSEevaluated 900 times by 20 tests
Evaluated by:
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (438)
  • Self test (79)
  • Self test (81)
  • Self test (83)
  • Self test (85)
  • Self test (90)
  • Self test (91)
  • Self test (92)
  • Self test (93)
  • Self test (94)
  • Self test (95)
  • Self test (96)
  • Self test (97)
  • Self test (98)
  • Self test (99)
? walIndexTryHdr(pWal, pChanged) : 1);
900-64772
1402-
1403-
1404-
1405-
1406 -
1407 ((void) (0))-
1408 ;-
1409 if( badHdr
badHdrDescription
TRUEevaluated 985 times by 22 tests
Evaluated by:
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (79)
  • Self test (81)
  • Self test (83)
  • Self test (85)
  • Self test (90)
  • Self test (91)
  • Self test (92)
  • Self test (93)
  • Self test (94)
  • Self test (95)
  • Self test (96)
  • Self test (97)
  • Self test (98)
  • Self test (99)
FALSEevaluated 64687 times by 49 tests
Evaluated by:
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • ...
){
985-64687
1410 if( pWal->bShmUnreliable==0
pWal->bShmUnreliable==0Description
TRUEevaluated 963 times by 22 tests
Evaluated by:
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (79)
  • Self test (81)
  • Self test (83)
  • Self test (85)
  • Self test (90)
  • Self test (91)
  • Self test (92)
  • Self test (93)
  • Self test (94)
  • Self test (95)
  • Self test (96)
  • Self test (97)
  • Self test (98)
  • Self test (99)
FALSEevaluated 22 times by 2 tests
Evaluated by:
  • Self test (104)
  • Self test (438)
&& (
(pWal->readOnly & 2)Description
TRUEnever evaluated
FALSEevaluated 963 times by 22 tests
Evaluated by:
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (79)
  • Self test (81)
  • Self test (83)
  • Self test (85)
  • Self test (90)
  • Self test (91)
  • Self test (92)
  • Self test (93)
  • Self test (94)
  • Self test (95)
  • Self test (96)
  • Self test (97)
  • Self test (98)
  • Self test (99)
pWal->readOnly & 2)
(pWal->readOnly & 2)Description
TRUEnever evaluated
FALSEevaluated 963 times by 22 tests
Evaluated by:
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (79)
  • Self test (81)
  • Self test (83)
  • Self test (85)
  • Self test (90)
  • Self test (91)
  • Self test (92)
  • Self test (93)
  • Self test (94)
  • Self test (95)
  • Self test (96)
  • Self test (97)
  • Self test (98)
  • Self test (99)
){
0-963
1411 if( 0==(rc = walLockShared(pWal, 0))
0==(rc = walLo...ared(pWal, 0))Description
TRUEnever evaluated
FALSEnever evaluated
){
0
1412 walUnlockShared(pWal, 0);-
1413 rc = (8 | (1<<8));-
1414 }
never executed: end of block
0
1415 }
never executed: end of block
else if( 0==(rc = walLockExclusive(pWal, 0, 1))
0==(rc = walLo...e(pWal, 0, 1))Description
TRUEevaluated 983 times by 22 tests
Evaluated by:
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (79)
  • Self test (81)
  • Self test (83)
  • Self test (85)
  • Self test (90)
  • Self test (91)
  • Self test (92)
  • Self test (93)
  • Self test (94)
  • Self test (95)
  • Self test (96)
  • Self test (97)
  • Self test (98)
  • Self test (99)
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test (438)
){
0-983
1416 pWal->writeLock = 1;-
1417 if( 0==(rc = walIndexPage(pWal, 0, &page0))
0==(rc = walIn...l, 0, &page0))Description
TRUEevaluated 983 times by 22 tests
Evaluated by:
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (79)
  • Self test (81)
  • Self test (83)
  • Self test (85)
  • Self test (90)
  • Self test (91)
  • Self test (92)
  • Self test (93)
  • Self test (94)
  • Self test (95)
  • Self test (96)
  • Self test (97)
  • Self test (98)
  • Self test (99)
FALSEnever evaluated
){
0-983
1418 badHdr = walIndexTryHdr(pWal, pChanged);-
1419 if( badHdr
badHdrDescription
TRUEevaluated 975 times by 22 tests
Evaluated by:
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (79)
  • Self test (81)
  • Self test (83)
  • Self test (85)
  • Self test (90)
  • Self test (91)
  • Self test (92)
  • Self test (93)
  • Self test (94)
  • Self test (95)
  • Self test (96)
  • Self test (97)
  • Self test (98)
  • Self test (99)
FALSEevaluated 8 times by 1 test
Evaluated by:
  • Self test (438)
){
8-975
1420-
1421-
1422-
1423-
1424 rc = walIndexRecover(pWal);-
1425 *pChanged = 1;-
1426 }
executed 975 times by 22 tests: end of block
Executed by:
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (79)
  • Self test (81)
  • Self test (83)
  • Self test (85)
  • Self test (90)
  • Self test (91)
  • Self test (92)
  • Self test (93)
  • Self test (94)
  • Self test (95)
  • Self test (96)
  • Self test (97)
  • Self test (98)
  • Self test (99)
975
1427 }
executed 983 times by 22 tests: end of block
Executed by:
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (79)
  • Self test (81)
  • Self test (83)
  • Self test (85)
  • Self test (90)
  • Self test (91)
  • Self test (92)
  • Self test (93)
  • Self test (94)
  • Self test (95)
  • Self test (96)
  • Self test (97)
  • Self test (98)
  • Self test (99)
983
1428 pWal->writeLock = 0;-
1429 walUnlockExclusive(pWal, 0, 1);-
1430 }
executed 983 times by 22 tests: end of block
Executed by:
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (79)
  • Self test (81)
  • Self test (83)
  • Self test (85)
  • Self test (90)
  • Self test (91)
  • Self test (92)
  • Self test (93)
  • Self test (94)
  • Self test (95)
  • Self test (96)
  • Self test (97)
  • Self test (98)
  • Self test (99)
983
1431 }
executed 985 times by 22 tests: end of block
Executed by:
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (79)
  • Self test (81)
  • Self test (83)
  • Self test (85)
  • Self test (90)
  • Self test (91)
  • Self test (92)
  • Self test (93)
  • Self test (94)
  • Self test (95)
  • Self test (96)
  • Self test (97)
  • Self test (98)
  • Self test (99)
985
1432-
1433-
1434-
1435-
1436-
1437 if( badHdr==0
badHdr==0Description
TRUEevaluated 64695 times by 49 tests
Evaluated by:
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • ...
FALSEevaluated 977 times by 22 tests
Evaluated by:
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (79)
  • Self test (81)
  • Self test (83)
  • Self test (85)
  • Self test (90)
  • Self test (91)
  • Self test (92)
  • Self test (93)
  • Self test (94)
  • Self test (95)
  • Self test (96)
  • Self test (97)
  • Self test (98)
  • Self test (99)
&& pWal->hdr.iVersion!=3007000
pWal->hdr.iVersion!=3007000Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 64693 times by 49 tests
Evaluated by:
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • ...
){
2-64695
1438 rc = sqlite3CantopenError(2200);-
1439 }
executed 2 times by 1 test: end of block
Executed by:
  • Self test (438)
2
1440 if( pWal->bShmUnreliable
pWal->bShmUnreliableDescription
TRUEevaluated 22 times by 2 tests
Evaluated by:
  • Self test (104)
  • Self test (438)
FALSEevaluated 65650 times by 49 tests
Evaluated by:
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • ...
){
22-65650
1441 if( rc!=0
rc!=0Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 20 times by 2 tests
Evaluated by:
  • Self test (104)
  • Self test (438)
){
2-20
1442 walIndexClose(pWal, 0);-
1443 pWal->bShmUnreliable = 0;-
1444 -
1445 ((void) (0))-
1446 ;-
1447-
1448-
1449-
1450 if( rc==(10 | (2<<8))
rc==(10 | (2<<8))Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • Self test (438)
FALSEnever evaluated
) rc = (-1);
executed 2 times by 1 test: rc = (-1);
Executed by:
  • Self test (438)
0-2
1451 }
executed 2 times by 1 test: end of block
Executed by:
  • Self test (438)
2
1452 pWal->exclusiveMode = 0;-
1453 }
executed 22 times by 2 tests: end of block
Executed by:
  • Self test (104)
  • Self test (438)
22
1454-
1455 return
executed 65672 times by 49 tests: return rc;
Executed by:
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • ...
rc;
executed 65672 times by 49 tests: return rc;
Executed by:
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (28)
  • Self test (29)
  • Self test (37)
  • Self test (41)
  • Self test (438)
  • Self test (50)
  • Self test (51)
  • Self test (62)
  • Self test (63)
  • Self test (64)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (72)
  • Self test (73)
  • Self test (74)
  • ...
65672
1456}-
1457static int walBeginShmUnreliable(Wal *pWal, int *pChanged){-
1458 i64 szWal;-
1459 i64 iOffset;-
1460 u8 aBuf[32];-
1461 u8 *aFrame = 0;-
1462 int szFrame;-
1463 u8 *aData;-
1464 volatile void *pDummy;-
1465 int rc;-
1466 u32 aSaveCksum[2];-
1467-
1468 -
1469 ((void) (0))-
1470 ;-
1471 -
1472 ((void) (0))-
1473 ;-
1474 -
1475 ((void) (0))-
1476 ;-
1477-
1478-
1479-
1480-
1481 rc = walLockShared(pWal, (3+(0)));-
1482 if( rc!=0
rc!=0Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • Self test (104)
FALSEevaluated 49 times by 2 tests
Evaluated by:
  • Self test (104)
  • Self test (438)
){
1-49
1483 if( rc==5
rc==5Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • Self test (104)
FALSEnever evaluated
) rc = (-1);
executed 1 time by 1 test: rc = (-1);
Executed by:
  • Self test (104)
0-1
1484 goto
executed 1 time by 1 test: goto begin_unreliable_shm_out;
Executed by:
  • Self test (104)
begin_unreliable_shm_out;
executed 1 time by 1 test: goto begin_unreliable_shm_out;
Executed by:
  • Self test (104)
1
1485 }-
1486 pWal->readLock = 0;-
1487 rc = sqlite3OsShmMap(pWal->pDbFd, 0, ( sizeof(ht_slot)*(4096*2) + 4096*sizeof(u32) ), 0, &pDummy);-
1488 -
1489 ((void) (0))-
1490 ;-
1491 if( rc!=(8 | (5<<8))
rc!=(8 | (5<<8))Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 46 times by 2 tests
Evaluated by:
  • Self test (104)
  • Self test (438)
){
3-46
1492 rc = (rc==8
rc==8Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test (438)
FALSEnever evaluated
? (-1) : rc);
0-3
1493 goto
executed 3 times by 1 test: goto begin_unreliable_shm_out;
Executed by:
  • Self test (438)
begin_unreliable_shm_out;
executed 3 times by 1 test: goto begin_unreliable_shm_out;
Executed by:
  • Self test (438)
3
1494 }-
1495-
1496-
1497-
1498-
1499-
1500 memcpy(&pWal->hdr, (void*)walIndexHdr(pWal), sizeof(WalIndexHdr));-
1501-
1502-
1503-
1504-
1505 rc = sqlite3OsFileSize(pWal->pWalFd, &szWal);-
1506 if( rc!=0
rc!=0Description
TRUEnever evaluated
FALSEevaluated 46 times by 2 tests
Evaluated by:
  • Self test (104)
  • Self test (438)
){
0-46
1507 goto
never executed: goto begin_unreliable_shm_out;
begin_unreliable_shm_out;
never executed: goto begin_unreliable_shm_out;
0
1508 }-
1509 if( szWal<32
szWal<32Description
TRUEevaluated 10 times by 2 tests
Evaluated by:
  • Self test (104)
  • Self test (438)
FALSEevaluated 36 times by 2 tests
Evaluated by:
  • Self test (104)
  • Self test (438)
){
10-36
1510-
1511-
1512-
1513-
1514-
1515-
1516 *pChanged = 1;-
1517 rc = (pWal->hdr.mxFrame==0
pWal->hdr.mxFrame==0Description
TRUEevaluated 9 times by 2 tests
Evaluated by:
  • Self test (104)
  • Self test (438)
FALSEevaluated 1 time by 1 test
Evaluated by:
  • Self test (104)
? 0 : (-1));
1-9
1518 goto
executed 10 times by 2 tests: goto begin_unreliable_shm_out;
Executed by:
  • Self test (104)
  • Self test (438)
begin_unreliable_shm_out;
executed 10 times by 2 tests: goto begin_unreliable_shm_out;
Executed by:
  • Self test (104)
  • Self test (438)
10
1519 }-
1520-
1521-
1522 rc = sqlite3OsRead(pWal->pWalFd, aBuf, 32, 0);-
1523 if( rc!=0
rc!=0Description
TRUEnever evaluated
FALSEevaluated 36 times by 2 tests
Evaluated by:
  • Self test (104)
  • Self test (438)
){
0-36
1524 goto
never executed: goto begin_unreliable_shm_out;
begin_unreliable_shm_out;
never executed: goto begin_unreliable_shm_out;
0
1525 }-
1526 if( memcmp(&pWal->hdr.aSalt, &aBuf[16], 8)
memcmp(&pWal->... &aBuf[16], 8)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 34 times by 2 tests
Evaluated by:
  • Self test (104)
  • Self test (438)
){
2-34
1527-
1528-
1529-
1530 rc = (-1);-
1531 goto
executed 2 times by 1 test: goto begin_unreliable_shm_out;
Executed by:
  • Self test (438)
begin_unreliable_shm_out;
executed 2 times by 1 test: goto begin_unreliable_shm_out;
Executed by:
  • Self test (438)
2
1532 }-
1533-
1534-
1535 szFrame = pWal->hdr.szPage + 24;-
1536 aFrame = (u8 *)sqlite3_malloc64(szFrame);-
1537 if( aFrame==0
aFrame==0Description
TRUEnever evaluated
FALSEevaluated 34 times by 2 tests
Evaluated by:
  • Self test (104)
  • Self test (438)
){
0-34
1538 rc = 7;-
1539 goto
never executed: goto begin_unreliable_shm_out;
begin_unreliable_shm_out;
never executed: goto begin_unreliable_shm_out;
0
1540 }-
1541 aData = &aFrame[24];-
1542-
1543-
1544-
1545-
1546-
1547 aSaveCksum[0] = pWal->hdr.aFrameCksum[0];-
1548 aSaveCksum[1] = pWal->hdr.aFrameCksum[1];-
1549 for(iOffset=( 32 + ((pWal->hdr.mxFrame+1)-1)*(i64)((pWal->hdr.szPage)+24) );-
1550 iOffset+szFrame<=szWal
iOffset+szFrame<=szWalDescription
TRUEevaluated 419 times by 2 tests
Evaluated by:
  • Self test (104)
  • Self test (438)
FALSEevaluated 20 times by 2 tests
Evaluated by:
  • Self test (104)
  • Self test (438)
;
20-419
1551 iOffset+=szFrame-
1552 ){-
1553 u32 pgno;-
1554 u32 nTruncate;-
1555-
1556-
1557 rc = sqlite3OsRead(pWal->pWalFd, aFrame, szFrame, iOffset);-
1558 if( rc!=0
rc!=0Description
TRUEnever evaluated
FALSEevaluated 419 times by 2 tests
Evaluated by:
  • Self test (104)
  • Self test (438)
) break;
never executed: break;
0-419
1559 if(