Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Avoid reading the file-size before page 1 is read-locked. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | server-edition |
Files: | files | file ages | folders |
SHA3-256: |
f6b025bf632501f51e691a05d3092256 |
User & Date: | dan 2017-04-29 15:48:32.290 |
Context
2017-05-01
| ||
20:07 | Update this branch with latest trunk changes. (check-in: 83b1e163ef user: dan tags: server-edition) | |
2017-04-29
| ||
15:48 | Avoid reading the file-size before page 1 is read-locked. (check-in: f6b025bf63 user: dan tags: server-edition) | |
2017-04-28
| ||
17:32 | Fix various bugs revealed by running performance tests. (check-in: a40b42c422 user: dan tags: server-edition) | |
Changes
Changes to src/btree.c.
︙ | ︙ | |||
2912 2913 2914 2915 2916 2917 2918 | if( rc!=SQLITE_OK ) return rc; /* Do some checking to help insure the file we opened really is ** a valid database file. */ nPage = nPageHeader = get4byte(28+(u8*)pPage1->aData); sqlite3PagerPagecount(pBt->pPager, &nPageFile); | < < < < < < | 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 | if( rc!=SQLITE_OK ) return rc; /* Do some checking to help insure the file we opened really is ** a valid database file. */ nPage = nPageHeader = get4byte(28+(u8*)pPage1->aData); sqlite3PagerPagecount(pBt->pPager, &nPageFile); if( nPage==0 || memcmp(24+(u8*)pPage1->aData, 92+(u8*)pPage1->aData,4)!=0 ){ nPage = nPageFile; } if( nPage>0 ){ u32 pageSize; u32 usableSize; u8 *page1 = pPage1->aData; |
︙ | ︙ | |||
5701 5702 5703 5704 5705 5706 5707 | int i; /* Try to lock a free-list trunk. If bAlloc is true, it has to be a ** free-list trunk with at least one entry in the free-list. */ nList = (int)get4byte(&pNode->aData[4]); for(i=0; i<nList; i++){ Pgno iTrunk = get4byte(&pNode->aData[8+i*4]); | | | 5695 5696 5697 5698 5699 5700 5701 5702 5703 5704 5705 5706 5707 5708 5709 | int i; /* Try to lock a free-list trunk. If bAlloc is true, it has to be a ** free-list trunk with at least one entry in the free-list. */ nList = (int)get4byte(&pNode->aData[4]); for(i=0; i<nList; i++){ Pgno iTrunk = get4byte(&pNode->aData[8+i*4]); if( SQLITE_OK==sqlite3PagerPagelock(pBt->pPager, iTrunk, 1) ){ rc = btreeGetUnusedPage(pBt, iTrunk, &pTrunk, 0); if( rc==SQLITE_OK && bAlloc ){ if( !get4byte(&pTrunk->aData[0]) && !get4byte(&pTrunk->aData[4]) ){ releasePage(pTrunk); pTrunk = 0; } } |
︙ | ︙ |
Changes to src/pager.c.
︙ | ︙ | |||
7663 7664 7665 7666 7667 7668 7669 | } #endif #ifdef SQLITE_SERVER_EDITION int sqlite3PagerIsServer(Pager *pPager){ return pagerIsServer(pPager); } | | | < < < < | 7663 7664 7665 7666 7667 7668 7669 7670 7671 7672 7673 7674 7675 | } #endif #ifdef SQLITE_SERVER_EDITION int sqlite3PagerIsServer(Pager *pPager){ return pagerIsServer(pPager); } int sqlite3PagerPagelock(Pager *pPager, Pgno pgno, int bWrite){ return sqlite3ServerLock(pPager->pServer, pgno, bWrite); } #endif #endif /* SQLITE_OMIT_DISKIO */ |
Changes to src/pager.h.
︙ | ︙ | |||
235 236 237 238 239 240 241 | # define disable_simulated_io_errors() # define enable_simulated_io_errors() #endif #ifdef SQLITE_SERVER_EDITION int sqlite3PagerRollbackJournal(Pager*, int); int sqlite3PagerIsServer(Pager *pPager); | | < | 235 236 237 238 239 240 241 242 243 244 245 | # define disable_simulated_io_errors() # define enable_simulated_io_errors() #endif #ifdef SQLITE_SERVER_EDITION int sqlite3PagerRollbackJournal(Pager*, int); int sqlite3PagerIsServer(Pager *pPager); int sqlite3PagerPagelock(Pager *pPager, Pgno, int); #endif #endif /* SQLITE_PAGER_H */ |
Changes to src/server.c.
︙ | ︙ | |||
395 396 397 398 399 400 401 | /* ** Begin a transaction. */ int sqlite3ServerBegin(Server *p){ #if 0 return posixLock(p->pHma->fd, p->iClient+1, SERVER_WRITE_LOCK, 0); #endif | | | 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 | /* ** Begin a transaction. */ int sqlite3ServerBegin(Server *p){ #if 0 return posixLock(p->pHma->fd, p->iClient+1, SERVER_WRITE_LOCK, 0); #endif return sqlite3ServerLock(p, 1, 0); } /* ** End a transaction (and release all locks). */ int sqlite3ServerEnd(Server *p){ int i; |
︙ | ︙ |