OpenCoverage

backup.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/sqlite/src/src/backup.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5struct sqlite3_backup {-
6 sqlite3* pDestDb;-
7 Btree *pDest;-
8 u32 iDestSchema;-
9 int bDestLocked;-
10-
11 Pgno iNext;-
12 sqlite3* pSrcDb;-
13 Btree *pSrc;-
14-
15 int rc;-
16-
17-
18-
19-
20 Pgno nRemaining;-
21 Pgno nPagecount;-
22-
23 int isAttached;-
24 sqlite3_backup *pNext;-
25};-
26static Btree *findBtree(sqlite3 *pErrorDb, sqlite3 *pDb, const char *zDb){-
27 int i = sqlite3FindDbName(pDb, zDb);-
28-
29 if( i==1
i==1Description
TRUEevaluated 5 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 79 times by 1 test
Evaluated by:
  • Self test (438)
){
5-79
30 Parse sParse;-
31 int rc = 0;-
32 memset(&sParse, 0, sizeof(sParse));-
33 sParse.db = pDb;-
34 if( sqlite3OpenTempDatabase(&sParse)
sqlite3OpenTem...abase(&sParse)Description
TRUEnever evaluated
FALSEevaluated 5 times by 1 test
Evaluated by:
  • Self test (438)
){
0-5
35 sqlite3ErrorWithMsg(pErrorDb, sParse.rc, "%s", sParse.zErrMsg);-
36 rc = 1;-
37 }
never executed: end of block
0
38 sqlite3DbFree(pErrorDb, sParse.zErrMsg);-
39 sqlite3ParserReset(&sParse);-
40 if( rc
rcDescription
TRUEnever evaluated
FALSEevaluated 5 times by 1 test
Evaluated by:
  • Self test (438)
){
0-5
41 return
never executed: return 0;
0;
never executed: return 0;
0
42 }-
43 }
executed 5 times by 1 test: end of block
Executed by:
  • Self test (438)
5
44-
45 if( i<0
i<0Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 82 times by 1 test
Evaluated by:
  • Self test (438)
){
2-82
46 sqlite3ErrorWithMsg(pErrorDb, 1, "unknown database %s", zDb);-
47 return
executed 2 times by 1 test: return 0;
Executed by:
  • Self test (438)
0;
executed 2 times by 1 test: return 0;
Executed by:
  • Self test (438)
2
48 }-
49-
50 return
executed 82 times by 1 test: return pDb->aDb[i].pBt;
Executed by:
  • Self test (438)
pDb->aDb[i].pBt;
executed 82 times by 1 test: return pDb->aDb[i].pBt;
Executed by:
  • Self test (438)
82
51}-
52-
53-
54-
55-
56-
57static int setDestPgsz(sqlite3_backup *p){-
58 int rc;-
59 rc = sqlite3BtreeSetPageSize(p->pDest,sqlite3BtreeGetPageSize(p->pSrc),-1,0);-
60 return
executed 535 times by 2 tests: return rc;
Executed by:
  • Self test (34)
  • Self test (438)
rc;
executed 535 times by 2 tests: return rc;
Executed by:
  • Self test (34)
  • Self test (438)
535
61}-
62-
63-
64-
65-
66-
67-
68-
69static int checkReadTransaction(sqlite3 *db, Btree *p){-
70 if( sqlite3BtreeIsInReadTrans(p)
sqlite3BtreeIsInReadTrans(p)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 39 times by 1 test
Evaluated by:
  • Self test (438)
){
1-39
71 sqlite3ErrorWithMsg(db, 1, "destination database is in use");-
72 return
executed 1 time by 1 test: return 1;
Executed by:
  • Self test (438)
1;
executed 1 time by 1 test: return 1;
Executed by:
  • Self test (438)
1
73 }-
74 return
executed 39 times by 1 test: return 0;
Executed by:
  • Self test (438)
0;
executed 39 times by 1 test: return 0;
Executed by:
  • Self test (438)
39
75}-
76sqlite3_backup *sqlite3_backup_init(-
77 sqlite3* pDestDb,-
78 const char *zDestDb,-
79 sqlite3* pSrcDb,-
80 const char *zSrcDb-
81){-
82 sqlite3_backup *p;-
83 sqlite3_mutex_enter(pSrcDb->mutex);-
84 sqlite3_mutex_enter(pDestDb->mutex);-
85-
86 if( pSrcDb==pDestDb
pSrcDb==pDestDbDescription
TRUEnever evaluated
FALSEevaluated 42 times by 1 test
Evaluated by:
  • Self test (438)
){
0-42
87 sqlite3ErrorWithMsg(-
88 pDestDb, 1, "source and destination must be distinct"-
89 );-
90 p = 0;-
91 }
never executed: end of block
else {
0
92-
93-
94-
95-
96 p = (sqlite3_backup *)sqlite3MallocZero(sizeof(sqlite3_backup));-
97 if( !p
!pDescription
TRUEnever evaluated
FALSEevaluated 42 times by 1 test
Evaluated by:
  • Self test (438)
){
0-42
98 sqlite3Error(pDestDb, 7);-
99 }
never executed: end of block
0
100 }
executed 42 times by 1 test: end of block
Executed by:
  • Self test (438)
42
101-
102-
103 if( p
pDescription
TRUEevaluated 42 times by 1 test
Evaluated by:
  • Self test (438)
FALSEnever evaluated
){
0-42
104 p->pSrc = findBtree(pDestDb, pSrcDb, zSrcDb);-
105 p->pDest = findBtree(pDestDb, pDestDb, zDestDb);-
106 p->pDestDb = pDestDb;-
107 p->pSrcDb = pSrcDb;-
108 p->iNext = 1;-
109 p->isAttached = 0;-
110-
111 if( 0==p->pSrc
0==p->pSrcDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 41 times by 1 test
Evaluated by:
  • Self test (438)
|| 0==p->pDest
0==p->pDestDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 40 times by 1 test
Evaluated by:
  • Self test (438)
1-41
112 || checkReadTransaction(pDestDb, p->pDest)!=0
checkReadTrans..., p->pDest)!=0Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 39 times by 1 test
Evaluated by:
  • Self test (438)
1-39
113 ){-
114-
115-
116-
117-
118-
119 sqlite3_free(p);-
120 p = 0;-
121 }
executed 3 times by 1 test: end of block
Executed by:
  • Self test (438)
3
122 }
executed 42 times by 1 test: end of block
Executed by:
  • Self test (438)
42
123 if( p
pDescription
TRUEevaluated 39 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 3 times by 1 test
Evaluated by:
  • Self test (438)
){
3-39
124 p->pSrc->nBackup++;-
125 }
executed 39 times by 1 test: end of block
Executed by:
  • Self test (438)
39
126-
127 sqlite3_mutex_leave(pDestDb->mutex);-
128 sqlite3_mutex_leave(pSrcDb->mutex);-
129 return
executed 42 times by 1 test: return p;
Executed by:
  • Self test (438)
p;
executed 42 times by 1 test: return p;
Executed by:
  • Self test (438)
42
130}-
131-
132-
133-
134-
135-
136-
137static int isFatalError(int rc){-
138 return
executed 3091 times by 2 tests: return (rc!=0 && rc!=5 && (rc!=6));
Executed by:
  • Self test (34)
  • Self test (438)
(rc!=0
rc!=0Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 3079 times by 2 tests
Evaluated by:
  • Self test (34)
  • Self test (438)
&& rc!=5
rc!=5Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 11 times by 1 test
Evaluated by:
  • Self test (438)
&& (
(rc!=6)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • Self test (438)
FALSEnever evaluated
rc!=6)
(rc!=6)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • Self test (438)
FALSEnever evaluated
);
executed 3091 times by 2 tests: return (rc!=0 && rc!=5 && (rc!=6));
Executed by:
  • Self test (34)
  • Self test (438)
0-3091
139}-
140-
141-
142-
143-
144-
145-
146static int backupOnePage(-
147 sqlite3_backup *p,-
148 Pgno iSrcPg,-
149 const u8 *zSrcData,-
150 int bUpdate-
151){-
152 Pager * const pDestPager = sqlite3BtreePager(p->pDest);-
153 const int nSrcPgsz = sqlite3BtreeGetPageSize(p->pSrc);-
154 int nDestPgsz = sqlite3BtreeGetPageSize(p->pDest);-
155 const int nCopy = ((
(nSrcPgsz)<(nDestPgsz)Description
TRUEevaluated 17 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 98732 times by 2 tests
Evaluated by:
  • Self test (34)
  • Self test (438)
nSrcPgsz)<(nDestPgsz)
(nSrcPgsz)<(nDestPgsz)Description
TRUEevaluated 17 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 98732 times by 2 tests
Evaluated by:
  • Self test (34)
  • Self test (438)
?(nSrcPgsz):(nDestPgsz));
17-98732
156 const i64 iEnd = (i64)iSrcPg*(i64)nSrcPgsz;-
157-
158-
159-
160-
161-
162-
163-
164 int rc = 0;-
165 i64 iOff;-
166-
167 -
168 ((void) (0))-
169 ;-
170 -
171 ((void) (0))-
172 ;-
173 -
174 ((void) (0))-
175 ;-
176 -
177 ((void) (0))-
178 ;-
179 -
180 ((void) (0))-
181 ;-
182-
183-
184-
185-
186 if( nSrcPgsz!=nDestPgsz
nSrcPgsz!=nDestPgszDescription
TRUEevaluated 165 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 98584 times by 2 tests
Evaluated by:
  • Self test (34)
  • Self test (438)
&& sqlite3PagerIsMemdb(pDestPager)
sqlite3PagerIs...db(pDestPager)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 163 times by 1 test
Evaluated by:
  • Self test (438)
){
2-98584
187 rc = 8;-
188 }
executed 2 times by 1 test: end of block
Executed by:
  • Self test (438)
2
189 for(iOff=iEnd-(i64)nSrcPgsz; rc==0
rc==0Description
TRUEevaluated 197387 times by 2 tests
Evaluated by:
  • Self test (34)
  • Self test (438)
FALSEevaluated 275 times by 1 test
Evaluated by:
  • Self test (438)
&& iOff<iEnd
iOff<iEndDescription
TRUEevaluated 98913 times by 2 tests
Evaluated by:
  • Self test (34)
  • Self test (438)
FALSEevaluated 98474 times by 2 tests
Evaluated by:
  • Self test (34)
  • Self test (438)
; iOff+=nDestPgsz){
275-197387
190 DbPage *pDestPg = 0;-
191 Pgno iDest = (Pgno)(iOff/nDestPgsz)+1;-
192 if( iDest==((Pgno)((sqlite3PendingByte/((p->pDest->pBt)->pageSize))+1))
iDest==((Pgno)...pageSize))+1))Description
TRUEnever evaluated
FALSEevaluated 98913 times by 2 tests
Evaluated by:
  • Self test (34)
  • Self test (438)
) continue;
never executed: continue;
0-98913
193 if( 0==(rc = sqlite3PagerGet(pDestPager, iDest, &pDestPg, 0))
0==(rc = sqlit... &pDestPg, 0))Description
TRUEevaluated 98913 times by 2 tests
Evaluated by:
  • Self test (34)
  • Self test (438)
FALSEnever evaluated
0-98913
194 && 0==(rc = sqlite3PagerWrite(pDestPg))
0==(rc = sqlit...rite(pDestPg))Description
TRUEevaluated 98640 times by 2 tests
Evaluated by:
  • Self test (34)
  • Self test (438)
FALSEevaluated 273 times by 1 test
Evaluated by:
  • Self test (438)
273-98640
195 ){-
196 const u8 *zIn = &zSrcData[iOff%nSrcPgsz];-
197 u8 *zDestData = sqlite3PagerGetData(pDestPg);-
198 u8 *zOut = &zDestData[iOff%nDestPgsz];-
199 memcpy(zOut, zIn, nCopy);-
200 ((u8 *)sqlite3PagerGetExtra(pDestPg))[0] = 0;-
201 if( iOff==0
iOff==0Description
TRUEevaluated 529 times by 2 tests
Evaluated by:
  • Self test (34)
  • Self test (438)
FALSEevaluated 98111 times by 2 tests
Evaluated by:
  • Self test (34)
  • Self test (438)
&& bUpdate==0
bUpdate==0Description
TRUEevaluated 525 times by 2 tests
Evaluated by:
  • Self test (34)
  • Self test (438)
FALSEevaluated 4 times by 1 test
Evaluated by:
  • Self test (438)
){
4-98111
202 sqlite3Put4byte(&zOut[28], sqlite3BtreeLastPage(p->pSrc));-
203 }
executed 525 times by 2 tests: end of block
Executed by:
  • Self test (34)
  • Self test (438)
525
204 }
executed 98640 times by 2 tests: end of block
Executed by:
  • Self test (34)
  • Self test (438)
98640
205 sqlite3PagerUnref(pDestPg);-
206 }
executed 98913 times by 2 tests: end of block
Executed by:
  • Self test (34)
  • Self test (438)
98913
207-
208 return
executed 98749 times by 2 tests: return rc;
Executed by:
  • Self test (34)
  • Self test (438)
rc;
executed 98749 times by 2 tests: return rc;
Executed by:
  • Self test (34)
  • Self test (438)
98749
209}-
210static int backupTruncateFile(sqlite3_file *pFile, i64 iSize){-
211 i64 iCurrent;-
212 int rc = sqlite3OsFileSize(pFile, &iCurrent);-
213 if( rc==0
rc==0Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • Self test (438)
FALSEnever evaluated
&& iCurrent>iSize
iCurrent>iSizeDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • Self test (438)
FALSEnever evaluated
){
0-8
214 rc = sqlite3OsTruncate(pFile, iSize);-
215 }
executed 8 times by 1 test: end of block
Executed by:
  • Self test (438)
8
216 return
executed 8 times by 1 test: return rc;
Executed by:
  • Self test (438)
rc;
executed 8 times by 1 test: return rc;
Executed by:
  • Self test (438)
8
217}-
218-
219-
220-
221-
222-
223static void attachBackupObject(sqlite3_backup *p){-
224 sqlite3_backup **pp;-
225 -
226 ((void) (0))-
227 ;-
228 pp = sqlite3PagerBackupPtr(sqlite3BtreePager(p->pSrc));-
229 p->pNext = *pp;-
230 *pp = p;-
231 p->isAttached = 1;-
232}
executed 7 times by 1 test: end of block
Executed by:
  • Self test (438)
7
233-
234-
235-
236-
237int sqlite3_backup_step(sqlite3_backup *p, int nPage){-
238 int rc;-
239 int destMode;-
240 int pgszSrc = 0;-
241 int pgszDest = 0;-
242-
243-
244-
245-
246 sqlite3_mutex_enter(p->pSrcDb->mutex);-
247 sqlite3BtreeEnter(p->pSrc);-
248 if( p->pDestDb
p->pDestDbDescription
TRUEevaluated 52 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 498 times by 2 tests
Evaluated by:
  • Self test (34)
  • Self test (438)
){
52-498
249 sqlite3_mutex_enter(p->pDestDb->mutex);-
250 }
executed 52 times by 1 test: end of block
Executed by:
  • Self test (438)
52
251-
252 rc = p->rc;-
253 if( !isFatalError(rc)
!isFatalError(rc)Description
TRUEevaluated 549 times by 2 tests
Evaluated by:
  • Self test (34)
  • Self test (438)
FALSEevaluated 1 time by 1 test
Evaluated by:
  • Self test (438)
){
1-549
254 Pager * const pSrcPager = sqlite3BtreePager(p->pSrc);-
255 Pager * const pDestPager = sqlite3BtreePager(p->pDest);-
256 int ii;-
257 int nSrcPage = -1;-
258 int bCloseTrans = 0;-
259-
260-
261-
262-
263 if( p->pDestDb
p->pDestDbDescription
TRUEevaluated 51 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 498 times by 2 tests
Evaluated by:
  • Self test (34)
  • Self test (438)
&& p->pSrc->pBt->inTransaction==2
p->pSrc->pBt->inTransaction==2Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 49 times by 1 test
Evaluated by:
  • Self test (438)
){
2-498
264 rc = 5;-
265 }
executed 2 times by 1 test: end of block
Executed by:
  • Self test (438)
else{
2
266 rc = 0;-
267 }
executed 547 times by 2 tests: end of block
Executed by:
  • Self test (34)
  • Self test (438)
547
268-
269-
270-
271-
272-
273 if( rc==0
rc==0Description
TRUEevaluated 547 times by 2 tests
Evaluated by:
  • Self test (34)
  • Self test (438)
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test (438)
&& 0==sqlite3BtreeIsInReadTrans(p->pSrc)
0==sqlite3Btre...Trans(p->pSrc)Description
TRUEevaluated 49 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 498 times by 2 tests
Evaluated by:
  • Self test (34)
  • Self test (438)
){
2-547
274 rc = sqlite3BtreeBeginTrans(p->pSrc, 0, 0);-
275 bCloseTrans = 1;-
276 }
executed 49 times by 1 test: end of block
Executed by:
  • Self test (438)
49
277-
278-
279-
280-
281-
282-
283-
284 if( p->bDestLocked==0
p->bDestLocked==0Description
TRUEevaluated 540 times by 2 tests
Evaluated by:
  • Self test (34)
  • Self test (438)
FALSEevaluated 9 times by 1 test
Evaluated by:
  • Self test (438)
&& rc==0
rc==0Description
TRUEevaluated 535 times by 2 tests
Evaluated by:
  • Self test (34)
  • Self test (438)
FALSEevaluated 5 times by 1 test
Evaluated by:
  • Self test (438)
&& setDestPgsz(p)==7
setDestPgsz(p)==7Description
TRUEnever evaluated
FALSEevaluated 535 times by 2 tests
Evaluated by:
  • Self test (34)
  • Self test (438)
){
0-540
285 rc = 7;-
286 }
never executed: end of block
0
287-
288-
289 if( 0==rc
0==rcDescription
TRUEevaluated 542 times by 2 tests
Evaluated by:
  • Self test (34)
  • Self test (438)
FALSEevaluated 7 times by 1 test
Evaluated by:
  • Self test (438)
&& p->bDestLocked==0
p->bDestLocked==0Description
TRUEevaluated 535 times by 2 tests
Evaluated by:
  • Self test (34)
  • Self test (438)
FALSEevaluated 7 times by 1 test
Evaluated by:
  • Self test (438)
7-542
290 && 0==(rc = sqlite3BtreeBeginTrans(p->pDest, 2,
0==(rc = sqlit...>iDestSchema))Description
TRUEevaluated 533 times by 2 tests
Evaluated by:
  • Self test (34)
  • Self test (438)
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test (438)
2-533
291 (int*)&p->iDestSchema))
0==(rc = sqlit...>iDestSchema))Description
TRUEevaluated 533 times by 2 tests
Evaluated by:
  • Self test (34)
  • Self test (438)
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test (438)
2-533
292 ){-
293 p->bDestLocked = 1;-
294 }
executed 533 times by 2 tests: end of block
Executed by:
  • Self test (34)
  • Self test (438)
533
295-
296-
297-
298 pgszSrc = sqlite3BtreeGetPageSize(p->pSrc);-
299 pgszDest = sqlite3BtreeGetPageSize(p->pDest);-
300 destMode = sqlite3PagerGetJournalMode(sqlite3BtreePager(p->pDest));-
301 if( 0==rc
0==rcDescription
TRUEevaluated 540 times by 2 tests
Evaluated by:
  • Self test (34)
  • Self test (438)
FALSEevaluated 9 times by 1 test
Evaluated by:
  • Self test (438)
&& destMode==5
destMode==5Description
TRUEevaluated 26 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 514 times by 2 tests
Evaluated by:
  • Self test (34)
  • Self test (438)
&& pgszSrc!=pgszDest
pgszSrc!=pgszDestDescription
TRUEnever evaluated
FALSEevaluated 26 times by 1 test
Evaluated by:
  • Self test (438)
){
0-540
302 rc = 8;-
303 }
never executed: end of block
0
304-
305-
306-
307-
308 nSrcPage = (int)sqlite3BtreeLastPage(p->pSrc);-
309 -
310 ((void) (0))-
311 ;-
312 for(ii=0; (nPage<0
nPage<0Description
TRUEnever evaluated
FALSEevaluated 98035 times by 2 tests
Evaluated by:
  • Self test (34)
  • Self test (438)
|| ii<nPage
ii<nPageDescription
TRUEevaluated 98028 times by 2 tests
Evaluated by:
  • Self test (34)
  • Self test (438)
FALSEevaluated 7 times by 1 test
Evaluated by:
  • Self test (438)
) && p->iNext<=(Pgno)nSrcPage
p->iNext<=(Pgno)nSrcPageDescription
TRUEevaluated 97762 times by 2 tests
Evaluated by:
  • Self test (34)
  • Self test (438)
FALSEevaluated 266 times by 2 tests
Evaluated by:
  • Self test (34)
  • Self test (438)
&& !rc
!rcDescription
TRUEevaluated 97486 times by 2 tests
Evaluated by:
  • Self test (34)
  • Self test (438)
FALSEevaluated 276 times by 1 test
Evaluated by:
  • Self test (438)
; ii++){
0-98035
313 const Pgno iSrcPg = p->iNext;-
314 if( iSrcPg!=((Pgno)((sqlite3PendingByte/((p->pSrc->pBt)->pageSize))+1))
iSrcPg!=((Pgno...pageSize))+1))Description
TRUEevaluated 97284 times by 2 tests
Evaluated by:
  • Self test (34)
  • Self test (438)
FALSEevaluated 202 times by 1 test
Evaluated by:
  • Self test (438)
){
202-97284
315 DbPage *pSrcPg;-
316 rc = sqlite3PagerGet(pSrcPager, iSrcPg, &pSrcPg,0x02);-
317 if( rc==0
rc==0Description
TRUEevaluated 97284 times by 2 tests
Evaluated by:
  • Self test (34)
  • Self test (438)
FALSEnever evaluated
){
0-97284
318 rc = backupOnePage(p, iSrcPg, sqlite3PagerGetData(pSrcPg), 0);-
319 sqlite3PagerUnref(pSrcPg);-
320 }
executed 97284 times by 2 tests: end of block
Executed by:
  • Self test (34)
  • Self test (438)
97284
321 }
executed 97284 times by 2 tests: end of block
Executed by:
  • Self test (34)
  • Self test (438)
97284
322 p->iNext++;-
323 }
executed 97486 times by 2 tests: end of block
Executed by:
  • Self test (34)
  • Self test (438)
97486
324 if( rc==0
rc==0Description
TRUEevaluated 265 times by 2 tests
Evaluated by:
  • Self test (34)
  • Self test (438)
FALSEevaluated 284 times by 1 test
Evaluated by:
  • Self test (438)
){
265-284
325 p->nPagecount = nSrcPage;-
326 p->nRemaining = nSrcPage+1-p->iNext;-
327 if( p->iNext>(Pgno)nSrcPage
p->iNext>(Pgno)nSrcPageDescription
TRUEevaluated 258 times by 2 tests
Evaluated by:
  • Self test (34)
  • Self test (438)
FALSEevaluated 7 times by 1 test
Evaluated by:
  • Self test (438)
){
7-258
328 rc = 101;-
329 }
executed 258 times by 2 tests: end of block
Executed by:
  • Self test (34)
  • Self test (438)
else if( !p->isAttached
!p->isAttachedDescription
TRUEevaluated 7 times by 1 test
Evaluated by:
  • Self test (438)
FALSEnever evaluated
){
0-258
330 attachBackupObject(p);-
331 }
executed 7 times by 1 test: end of block
Executed by:
  • Self test (438)
7
332 }
executed 265 times by 2 tests: end of block
Executed by:
  • Self test (34)
  • Self test (438)
265
333-
334-
335-
336-
337-
338-
339 if( rc==101
rc==101Description
TRUEevaluated 258 times by 2 tests
Evaluated by:
  • Self test (34)
  • Self test (438)
FALSEevaluated 291 times by 1 test
Evaluated by:
  • Self test (438)
){
258-291
340 if( nSrcPage==0
nSrcPage==0Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 254 times by 2 tests
Evaluated by:
  • Self test (34)
  • Self test (438)
){
4-254
341 rc = sqlite3BtreeNewDb(p->pDest);-
342 nSrcPage = 1;-
343 }
executed 4 times by 1 test: end of block
Executed by:
  • Self test (438)
4
344 if( rc==0
rc==0Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 254 times by 2 tests
Evaluated by:
  • Self test (34)
  • Self test (438)
|| rc==101
rc==101Description
TRUEevaluated 254 times by 2 tests
Evaluated by:
  • Self test (34)
  • Self test (438)
FALSEnever evaluated
){
0-254
345 rc = sqlite3BtreeUpdateMeta(p->pDest,1,p->iDestSchema+1);-
346 }
executed 258 times by 2 tests: end of block
Executed by:
  • Self test (34)
  • Self test (438)
258
347 if( rc==0
rc==0Description
TRUEevaluated 258 times by 2 tests
Evaluated by:
  • Self test (34)
  • Self test (438)
FALSEnever evaluated
){
0-258
348 if( p->pDestDb
p->pDestDbDescription
TRUEevaluated 33 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 225 times by 2 tests
Evaluated by:
  • Self test (34)
  • Self test (438)
){
33-225
349 sqlite3ResetAllSchemasOfConnection(p->pDestDb);-
350 }
executed 33 times by 1 test: end of block
Executed by:
  • Self test (438)
33
351 if( destMode==5
destMode==5Description
TRUEevaluated 23 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 235 times by 2 tests
Evaluated by:
  • Self test (34)
  • Self test (438)
){
23-235
352 rc = sqlite3BtreeSetVersion(p->pDest, 2);-
353 }
executed 23 times by 1 test: end of block
Executed by:
  • Self test (438)
23
354 }
executed 258 times by 2 tests: end of block
Executed by:
  • Self test (34)
  • Self test (438)
258
355 if( rc==0
rc==0Description
TRUEevaluated 258 times by 2 tests
Evaluated by:
  • Self test (34)
  • Self test (438)
FALSEnever evaluated
){
0-258
356 int nDestTruncate;-
357 -
358 ((void) (0))-
359 ;-
360 -
361 ((void) (0))-
362 ;-
363 if( pgszSrc<pgszDest
pgszSrc<pgszDestDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 250 times by 2 tests
Evaluated by:
  • Self test (34)
  • Self test (438)
){
8-250
364 int ratio = pgszDest/pgszSrc;-
365 nDestTruncate = (nSrcPage+ratio-1)/ratio;-
366 if( nDestTruncate==(int)((Pgno)((sqlite3PendingByte/((p->pDest->pBt)->pageSize))+1))
nDestTruncate=...pageSize))+1))Description
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • Self test (438)
){
0-8
367 nDestTruncate--;-
368 }
never executed: end of block
0
369 }
executed 8 times by 1 test: end of block
Executed by:
  • Self test (438)
else{
8
370 nDestTruncate = nSrcPage * (pgszSrc/pgszDest);-
371 }
executed 250 times by 2 tests: end of block
Executed by:
  • Self test (34)
  • Self test (438)
250
372 -
373 ((void) (0))-
374 ;-
375-
376 if( pgszSrc<pgszDest
pgszSrc<pgszDestDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 250 times by 2 tests
Evaluated by:
  • Self test (34)
  • Self test (438)
){
8-250
377 const i64 iSize = (i64)pgszSrc * (i64)nSrcPage;-
378 sqlite3_file * const pFile = sqlite3PagerFile(pDestPager);-
379 Pgno iPg;-
380 int nDstPage;-
381 i64 iOff;-
382 i64 iEnd;-
383-
384 -
385 ((void) (0))-
386 ;-
387 -
388 ((void) (0))-
389-
390-
391-
392 -
393 ;-
394-
395-
396-
397-
398-
399-
400-
401 sqlite3PagerPagecount(pDestPager, &nDstPage);-
402 for(iPg=nDestTruncate; rc==0
rc==0Description
TRUEevaluated 26 times by 1 test
Evaluated by:
  • Self test (438)
FALSEnever evaluated
&& iPg<=(Pgno)nDstPage
iPg<=(Pgno)nDstPageDescription
TRUEevaluated 18 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 8 times by 1 test
Evaluated by:
  • Self test (438)
; iPg++){
0-26
403 if( iPg!=((Pgno)((sqlite3PendingByte/((p->pDest->pBt)->pageSize))+1))
iPg!=((Pgno)((...pageSize))+1))Description
TRUEevaluated 18 times by 1 test
Evaluated by:
  • Self test (438)
FALSEnever evaluated
){
0-18
404 DbPage *pPg;-
405 rc = sqlite3PagerGet(pDestPager, iPg, &pPg, 0);-
406 if( rc==0
rc==0Description
TRUEevaluated 18 times by 1 test
Evaluated by:
  • Self test (438)
FALSEnever evaluated
){
0-18
407 rc = sqlite3PagerWrite(pPg);-
408 sqlite3PagerUnref(pPg);-
409 }
executed 18 times by 1 test: end of block
Executed by:
  • Self test (438)
18
410 }
executed 18 times by 1 test: end of block
Executed by:
  • Self test (438)
18
411 }
executed 18 times by 1 test: end of block
Executed by:
  • Self test (438)
18
412 if( rc==0
rc==0Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • Self test (438)
FALSEnever evaluated
){
0-8
413 rc = sqlite3PagerCommitPhaseOne(pDestPager, 0, 1);-
414 }
executed 8 times by 1 test: end of block
Executed by:
  • Self test (438)
8
415-
416-
417 iEnd = ((
(sqlite3Pendin...zDest)<(iSize)Description
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • Self test (438)
sqlite3PendingByte + pgszDest)<(iSize)
(sqlite3Pendin...zDest)<(iSize)Description
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • Self test (438)
?(sqlite3PendingByte + pgszDest):(iSize));
0-8
418 for(-
419 iOff=sqlite3PendingByte+pgszSrc;-
420 rc==0
rc==0Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • Self test (438)
FALSEnever evaluated
&& iOff<iEnd
iOff<iEndDescription
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • Self test (438)
;
0-8
421 iOff+=pgszSrc-
422 ){-
423 PgHdr *pSrcPg = 0;-
424 const Pgno iSrcPg = (Pgno)((iOff/pgszSrc)+1);-
425 rc = sqlite3PagerGet(pSrcPager, iSrcPg, &pSrcPg, 0);-
426 if( rc==0
rc==0Description
TRUEnever evaluated
FALSEnever evaluated
){
0
427 u8 *zData = sqlite3PagerGetData(pSrcPg);-
428 rc = sqlite3OsWrite(pFile, zData, pgszSrc, iOff);-
429 }
never executed: end of block
0
430 sqlite3PagerUnref(pSrcPg);-
431 }
never executed: end of block
0
432 if( rc==0
rc==0Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • Self test (438)
FALSEnever evaluated
){
0-8
433 rc = backupTruncateFile(pFile, iSize);-
434 }
executed 8 times by 1 test: end of block
Executed by:
  • Self test (438)
8
435-
436-
437 if( rc==0
rc==0Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • Self test (438)
FALSEnever evaluated
){
0-8
438 rc = sqlite3PagerSync(pDestPager, 0);-
439 }
executed 8 times by 1 test: end of block
Executed by:
  • Self test (438)
8
440 }
executed 8 times by 1 test: end of block
Executed by:
  • Self test (438)
else{
8
441 sqlite3PagerTruncateImage(pDestPager, nDestTruncate);-
442 rc = sqlite3PagerCommitPhaseOne(pDestPager, 0, 0);-
443 }
executed 250 times by 2 tests: end of block
Executed by:
  • Self test (34)
  • Self test (438)
250
444-
445-
446 if( 0==rc
0==rcDescription
TRUEevaluated 163 times by 2 tests
Evaluated by:
  • Self test (34)
  • Self test (438)
FALSEevaluated 95 times by 1 test
Evaluated by:
  • Self test (438)
95-163
447 && 0==(rc = sqlite3BtreeCommitPhaseTwo(p->pDest, 0))
0==(rc = sqlit...(p->pDest, 0))Description
TRUEevaluated 163 times by 2 tests
Evaluated by:
  • Self test (34)
  • Self test (438)
FALSEnever evaluated
0-163
448 ){-
449 rc = 101;-
450 }
executed 163 times by 2 tests: end of block
Executed by:
  • Self test (34)
  • Self test (438)
163
451 }
executed 258 times by 2 tests: end of block
Executed by:
  • Self test (34)
  • Self test (438)
258
452 }
executed 258 times by 2 tests: end of block
Executed by:
  • Self test (34)
  • Self test (438)
258
453-
454-
455-
456-
457-
458-
459 if( bCloseTrans
bCloseTransDescription
TRUEevaluated 49 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 500 times by 2 tests
Evaluated by:
  • Self test (34)
  • Self test (438)
){
49-500
460 ;-
461 sqlite3BtreeCommitPhaseOne(p->pSrc, 0);-
462 sqlite3BtreeCommitPhaseTwo(p->pSrc, 0);-
463 -
464 ((void) (0))-
465 ;-
466 }
executed 49 times by 1 test: end of block
Executed by:
  • Self test (438)
49
467-
468 if( rc==(10 | (12<<8))
rc==(10 | (12<<8))Description
TRUEnever evaluated
FALSEevaluated 549 times by 2 tests
Evaluated by:
  • Self test (34)
  • Self test (438)
){
0-549
469 rc = 7;-
470 }
never executed: end of block
0
471 p->rc = rc;-
472 }
executed 549 times by 2 tests: end of block
Executed by:
  • Self test (34)
  • Self test (438)
549
473 if( p->pDestDb
p->pDestDbDescription
TRUEevaluated 52 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 498 times by 2 tests
Evaluated by:
  • Self test (34)
  • Self test (438)
){
52-498
474 sqlite3_mutex_leave(p->pDestDb->mutex);-
475 }
executed 52 times by 1 test: end of block
Executed by:
  • Self test (438)
52
476 sqlite3BtreeLeave(p->pSrc);-
477 sqlite3_mutex_leave(p->pSrcDb->mutex);-
478 return
executed 550 times by 2 tests: return rc;
Executed by:
  • Self test (34)
  • Self test (438)
rc;
executed 550 times by 2 tests: return rc;
Executed by:
  • Self test (34)
  • Self test (438)
550
479}-
480-
481-
482-
483-
484int sqlite3_backup_finish(sqlite3_backup *p){-
485 sqlite3_backup **pp;-
486 sqlite3 *pSrcDb;-
487 int rc;-
488-
489-
490 if( p==0
p==0Description
TRUEnever evaluated
FALSEevaluated 537 times by 2 tests
Evaluated by:
  • Self test (34)
  • Self test (438)
) return
never executed: return 0;
0;
never executed: return 0;
0-537
491 pSrcDb = p->pSrcDb;-
492 sqlite3_mutex_enter(pSrcDb->mutex);-
493 sqlite3BtreeEnter(p->pSrc);-
494 if( p->pDestDb
p->pDestDbDescription
TRUEevaluated 39 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 498 times by 2 tests
Evaluated by:
  • Self test (34)
  • Self test (438)
){
39-498
495 sqlite3_mutex_enter(p->pDestDb->mutex);-
496 }
executed 39 times by 1 test: end of block
Executed by:
  • Self test (438)
39
497-
498-
499 if( p->pDestDb
p->pDestDbDescription
TRUEevaluated 39 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 498 times by 2 tests
Evaluated by:
  • Self test (34)
  • Self test (438)
){
39-498
500 p->pSrc->nBackup--;-
501 }
executed 39 times by 1 test: end of block
Executed by:
  • Self test (438)
39
502 if( p->isAttached
p->isAttachedDescription
TRUEevaluated 7 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 530 times by 2 tests
Evaluated by:
  • Self test (34)
  • Self test (438)
){
7-530
503 pp = sqlite3PagerBackupPtr(sqlite3BtreePager(p->pSrc));-
504 while( *
*pp!=pDescription
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • Self test (438)
pp!=p
*pp!=pDescription
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • Self test (438)
){
0-7
505 pp = &(*pp)->pNext;-
506 }
never executed: end of block
0
507 *pp = p->pNext;-
508 }
executed 7 times by 1 test: end of block
Executed by:
  • Self test (438)
7
509-
510-
511 sqlite3BtreeRollback(p->pDest, 0, 0);-
512-
513-
514 rc = (
(p->rc==101)Description
TRUEevaluated 163 times by 2 tests
Evaluated by:
  • Self test (34)
  • Self test (438)
FALSEevaluated 374 times by 1 test
Evaluated by:
  • Self test (438)
p->rc==101)
(p->rc==101)Description
TRUEevaluated 163 times by 2 tests
Evaluated by:
  • Self test (34)
  • Self test (438)
FALSEevaluated 374 times by 1 test
Evaluated by:
  • Self test (438)
? 0 : p->rc;
163-374
515 if( p->pDestDb
p->pDestDbDescription
TRUEevaluated 39 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 498 times by 2 tests
Evaluated by:
  • Self test (34)
  • Self test (438)
){
39-498
516 sqlite3Error(p->pDestDb, rc);-
517-
518-
519 sqlite3LeaveMutexAndCloseZombie(p->pDestDb);-
520 }
executed 39 times by 1 test: end of block
Executed by:
  • Self test (438)
39
521 sqlite3BtreeLeave(p->pSrc);-
522 if( p->pDestDb
p->pDestDbDescription
TRUEevaluated 39 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 498 times by 2 tests
Evaluated by:
  • Self test (34)
  • Self test (438)
){
39-498
523-
524-
525-
526 sqlite3_free(p);-
527 }
executed 39 times by 1 test: end of block
Executed by:
  • Self test (438)
39
528 sqlite3LeaveMutexAndCloseZombie(pSrcDb);-
529 return
executed 537 times by 2 tests: return rc;
Executed by:
  • Self test (34)
  • Self test (438)
rc;
executed 537 times by 2 tests: return rc;
Executed by:
  • Self test (34)
  • Self test (438)
537
530}-
531-
532-
533-
534-
535-
536int sqlite3_backup_remaining(sqlite3_backup *p){-
537-
538-
539-
540-
541-
542-
543 return
never executed: return p->nRemaining;
p->nRemaining;
never executed: return p->nRemaining;
0
544}-
545-
546-
547-
548-
549-
550int sqlite3_backup_pagecount(sqlite3_backup *p){-
551-
552-
553-
554-
555-
556-
557 return
never executed: return p->nPagecount;
p->nPagecount;
never executed: return p->nPagecount;
0
558}-
559static __attribute__((noinline)) void backupUpdate(-
560 sqlite3_backup *p,-
561 Pgno iPage,-
562 const u8 *aData-
563){-
564 -
565 ((void) (0))-
566 ;-
567 do{-
568 -
569 ((void) (0))-
570 ;-
571 if( !isFatalError(p->rc)
!isFatalError(p->rc)Description
TRUEevaluated 2541 times by 1 test
Evaluated by:
  • Self test (438)
FALSEnever evaluated
&& iPage<p->iNext
iPage<p->iNextDescription
TRUEevaluated 1465 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 1076 times by 1 test
Evaluated by:
  • Self test (438)
){
0-2541
572-
573-
574-
575-
576 int rc;-
577 -
578 ((void) (0))-
579 ;-
580 sqlite3_mutex_enter(p->pDestDb->mutex);-
581 rc = backupOnePage(p, iPage, aData, 1);-
582 sqlite3_mutex_leave(p->pDestDb->mutex);-
583 -
584 ((void) (0))-
585 ;-
586 if( rc!=0
rc!=0Description
TRUEnever evaluated
FALSEevaluated 1465 times by 1 test
Evaluated by:
  • Self test (438)
){
0-1465
587 p->rc = rc;-
588 }
never executed: end of block
0
589 }
executed 1465 times by 1 test: end of block
Executed by:
  • Self test (438)
1465
590 }
executed 2541 times by 1 test: end of block
Executed by:
  • Self test (438)
while( (
(p = p->pNext)!=0Description
TRUEnever evaluated
FALSEevaluated 2541 times by 1 test
Evaluated by:
  • Self test (438)
p = p->pNext)!=0
(p = p->pNext)!=0Description
TRUEnever evaluated
FALSEevaluated 2541 times by 1 test
Evaluated by:
  • Self test (438)
);
0-2541
591}
executed 2541 times by 1 test: end of block
Executed by:
  • Self test (438)
2541
592void sqlite3BackupUpdate(sqlite3_backup *pBackup, Pgno iPage, const u8 *aData){-
593 if( pBackup
pBackupDescription
TRUEevaluated 2541 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 1492489 times by 131 tests
Evaluated by:
  • Self test
  • Self test (10)
  • Self test (101)
  • Self test (104)
  • Self test (11)
  • Self test (12)
  • Self test (13)
  • Self test (14)
  • Self test (15)
  • Self test (16)
  • Self test (17)
  • Self test (18)
  • Self test (19)
  • Self test (2)
  • Self test (20)
  • Self test (21)
  • Self test (22)
  • Self test (23)
  • Self test (24)
  • Self test (26)
  • Self test (27)
  • Self test (28)
  • Self test (3)
  • Self test (31)
  • Self test (32)
  • ...
) backupUpdate(pBackup, iPage, aData);
executed 2541 times by 1 test: backupUpdate(pBackup, iPage, aData);
Executed by:
  • Self test (438)
2541-1492489
594}
executed 1495030 times by 131 tests: end of block
Executed by:
  • Self test
  • Self test (10)
  • Self test (101)
  • Self test (104)
  • Self test (11)
  • Self test (12)
  • Self test (13)
  • Self test (14)
  • Self test (15)
  • Self test (16)
  • Self test (17)
  • Self test (18)
  • Self test (19)
  • Self test (2)
  • Self test (20)
  • Self test (21)
  • Self test (22)
  • Self test (23)
  • Self test (24)
  • Self test (26)
  • Self test (27)
  • Self test (28)
  • Self test (3)
  • Self test (31)
  • Self test (32)
  • ...
1495030
595void sqlite3BackupRestart(sqlite3_backup *pBackup){-
596 sqlite3_backup *p;-
597 for(p=pBackup; p
pDescription
TRUEevaluated 64 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 205694 times by 438 tests
Evaluated by:
  • Self test
  • Self test (10)
  • Self test (100)
  • Self test (101)
  • Self test (102)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (11)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (12)
  • Self test (120)
  • ...
; p=p->pNext){
64-205694
598 -
599 ((void) (0))-
600 ;-
601 p->iNext = 1;-
602 }
executed 64 times by 1 test: end of block
Executed by:
  • Self test (438)
64
603}
executed 205694 times by 438 tests: end of block
Executed by:
  • Self test
  • Self test (10)
  • Self test (100)
  • Self test (101)
  • Self test (102)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (11)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (12)
  • Self test (120)
  • ...
205694
604int sqlite3BtreeCopyFile(Btree *pTo, Btree *pFrom){-
605 int rc;-
606 sqlite3_file *pFd;-
607 sqlite3_backup b;-
608 sqlite3BtreeEnter(pTo);-
609 sqlite3BtreeEnter(pFrom);-
610-
611 -
612 ((void) (0))-
613 ;-
614 pFd = sqlite3PagerFile(sqlite3BtreePager(pTo));-
615 if( pFd->pMethods
pFd->pMethodsDescription
TRUEevaluated 492 times by 2 tests
Evaluated by:
  • Self test (34)
  • Self test (438)
FALSEevaluated 6 times by 1 test
Evaluated by:
  • Self test (438)
){
6-492
616 i64 nByte = sqlite3BtreeGetPageSize(pFrom)*(i64)sqlite3BtreeLastPage(pFrom);-
617 rc = sqlite3OsFileControl(pFd, 11, &nByte);-
618 if( rc==12
rc==12Description
TRUEevaluated 492 times by 2 tests
Evaluated by:
  • Self test (34)
  • Self test (438)
FALSEnever evaluated
) rc = 0;
executed 492 times by 2 tests: rc = 0;
Executed by:
  • Self test (34)
  • Self test (438)
0-492
619 if( rc
rcDescription
TRUEnever evaluated
FALSEevaluated 492 times by 2 tests
Evaluated by:
  • Self test (34)
  • Self test (438)
) goto
never executed: goto copy_finished;
copy_finished;
never executed: goto copy_finished;
0-492
620 }
executed 492 times by 2 tests: end of block
Executed by:
  • Self test (34)
  • Self test (438)
492
621-
622-
623-
624-
625-
626-
627 memset(&b, 0, sizeof(b));-
628 b.pSrcDb = pFrom->db;-
629 b.pSrc = pFrom;-
630 b.pDest = pTo;-
631 b.iNext = 1;-
632 sqlite3_backup_step(&b, 0x7FFFFFFF);-
633 -
634 ((void) (0))-
635 ;-
636-
637 rc = sqlite3_backup_finish(&b);-
638 if( rc==0
rc==0Description
TRUEevaluated 130 times by 2 tests
Evaluated by:
  • Self test (34)
  • Self test (438)
FALSEevaluated 368 times by 1 test
Evaluated by:
  • Self test (438)
){
130-368
639 pTo->pBt->btsFlags &= ~0x0002;-
640 }
executed 130 times by 2 tests: end of block
Executed by:
  • Self test (34)
  • Self test (438)
else{
130
641 sqlite3PagerClearCache(sqlite3BtreePager(b.pDest));-
642 }
executed 368 times by 1 test: end of block
Executed by:
  • Self test (438)
368
643-
644 -
645 ((void) (0))-
646 ;-
647copy_finished:
code before this statement executed 498 times by 2 tests: copy_finished:
Executed by:
  • Self test (34)
  • Self test (438)
498
648 sqlite3BtreeLeave(pFrom);-
649 sqlite3BtreeLeave(pTo);-
650 return
executed 498 times by 2 tests: return rc;
Executed by:
  • Self test (34)
  • Self test (438)
rc;
executed 498 times by 2 tests: return rc;
Executed by:
  • Self test (34)
  • Self test (438)
498
651}-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.2