Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Working on the pager (CVS 212) |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
1f07abe46e2de8c5d9659bd5a78efe4c |
User & Date: | drh 2001-04-15 02:27:25.000 |
Context
2001-04-15
| ||
02:30 | Version 1.0.31 (CVS 472) (check-in: a7bfcbb413 user: drh tags: trunk) | |
02:27 | Working on the pager (CVS 212) (check-in: 1f07abe46e user: drh tags: trunk) | |
00:37 | Pager is working, mostly. (CVS 211) (check-in: f82fa7070a user: drh tags: trunk) | |
Changes
Changes to src/pager.c.
︙ | |||
23 24 25 26 27 28 29 | 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | - + | ************************************************************************* ** This is the implementation of the page cache subsystem. ** ** The page cache is used to access a database file. The pager journals ** all writes in order to support rollback. Locking is used to limit ** access to one or more reader or on writer. ** |
︙ | |||
452 453 454 455 456 457 458 | 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 | - + | strcpy(pPager->zJournal, zFilename); strcpy(&pPager->zJournal[nameLen], "-journal"); pPager->fd = fd; pPager->jfd = -1; pPager->nRef = 0; pPager->dbSize = -1; pPager->nPage = 0; |
︙ | |||
616 617 618 619 620 621 622 623 624 625 626 627 628 629 | 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 | + | } pPg->pPager = pPager; pPg->pNextAll = pPager->pAll; if( pPager->pAll ){ pPager->pAll->pPrevAll = pPg; } pPg->pPrevAll = 0; pPager->pAll = pPg; pPager->nPage++; }else{ /* Recycle an older page. First locate the page to be recycled. ** Try to find one that is not dirty and is near the head of ** of the free list */ int cnt = 4; pPg = pPager->pFirst; |
︙ | |||
772 773 774 775 776 777 778 | 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 | - + | ** All subsequent write attempts also return SQLITE_FULL until there ** is a call to sqlitepager_commit() or sqlitepager_rollback() to ** reset. */ int sqlitepager_write(void *pData){ PgHdr *pPg = DATA_TO_PGHDR(pData); Pager *pPager = pPg->pPager; |
︙ |
Changes to test/pager.test.
︙ | |||
19 20 21 22 23 24 25 | 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | - + | # drh@hwaci.com # http://www.hwaci.com/drh/ # #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this script is page cache subsystem. # |
︙ | |||
161 162 163 164 165 166 167 168 | 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + | pager_rollback $::p1 } msg] lappend v $msg } {0 {}} do_test pager-2.29 { page_read $::g1 } {Page-One} do_test pager-2.99 { pager_close $::p1 } {} do_test pager-3.1 { set v [catch { set ::p1 [pager_open ptf1.db 5] } msg] if {$v} {lappend v $msg} set v } {0} do_test pager-3.2 { pager_pagecount $::p1 } {1} do_test pager-3.3 { set v [catch { set ::g(1) [page_get $::p1 1] } msg] if {$v} {lappend v $msg} set v } {0} do_test pager-3.4 { page_read $::g(1) } {Page-One} do_test pager-3.5 { for {set i 2} {$i<=20} {incr i} { set gx [page_get $::p1 $i] page_write $gx "Page-$i" page_unref $gx } pager_commit $::p1 } {} for {set i 2} {$i<=20} {incr i} { do_test pager-3.6.[expr {$i-1}] [subst { set gx \[page_get $::p1 $i\] set v \[page_read \$gx\] page_unref \$gx set v }] "Page-$i" } |