Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Fix many minor issues in the unlocked transaction code. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | begin-concurrent |
Files: | files | file ages | folders |
SHA1: |
53aaeea6c98f82f3b55d4b3ab139ee41 |
User & Date: | dan 2015-08-21 20:11:23.106 |
Context
2015-08-22
| ||
07:55 | Merge trunk changes into this branch. (check-in: 9021f7369f user: dan tags: begin-concurrent) | |
2015-08-21
| ||
20:11 | Fix many minor issues in the unlocked transaction code. (check-in: 53aaeea6c9 user: dan tags: begin-concurrent) | |
18:55 | When committing an UNLOCKED transaction, try to move pages allocated at the end of the file to free slots within the file (like an incremental-vacuum operation does). (check-in: 069679162d user: dan tags: begin-concurrent) | |
Changes
Changes to src/btree.c.
︙ | |||
3902 3903 3904 3905 3906 3907 3908 | 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 | - + | ** nPage (inclusive) at the end of the database file. Meanwhile, ** other transactions have allocated (iFirst..nHPage). So move ** pages (iFirst..MIN(nPage,nHPage)) to (MAX(nPage,nHPage)+1). */ Pgno iLast = MIN(nPage, nHPage); /* Last page to move */ Pgno iPg; Pgno nCurrent; /* Current size of db */ |
︙ |
Changes to src/main.c.
︙ | |||
2740 2741 2742 2743 2744 2745 2746 | 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 | - | db->magic = SQLITE_MAGIC_BUSY; db->aDb = db->aDbStatic; assert( sizeof(db->aLimit)==sizeof(aHardLimit) ); memcpy(db->aLimit, aHardLimit, sizeof(db->aLimit)); db->aLimit[SQLITE_LIMIT_WORKER_THREADS] = SQLITE_DEFAULT_WORKER_THREADS; db->autoCommit = 1; |
︙ |
Changes to src/pager.c.
︙ | |||
5627 5628 5629 5630 5631 5632 5633 | 5627 5628 5629 5630 5631 5632 5633 5634 5635 5636 5637 5638 5639 5640 | - - | */ if( exFlag>=0 ){ rc = sqlite3WalBeginWriteTransaction(pPager->pWal); }else{ pPager->pAllRead = sqlite3BitvecCreate(pPager->dbSize); if( pPager->pAllRead==0 ){ rc = SQLITE_NOMEM; |
︙ | |||
6151 6152 6153 6154 6155 6156 6157 | 6149 6150 6151 6152 6153 6154 6155 6156 6157 6158 6159 6160 6161 6162 6163 | - + - | void sqlite3PagerDropExclusiveLock(Pager *pPager){ if( pagerUseWal(pPager) ){ sqlite3WalEndWriteTransaction(pPager->pWal); } } /* |
︙ |
Changes to src/pager.h.
︙ | |||
141 142 143 144 145 146 147 | 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 | - - - | /* Operations on page references. */ int sqlite3PagerWrite(DbPage*); void sqlite3PagerDontWrite(DbPage*); int sqlite3PagerMovepage(Pager*,DbPage*,Pgno,int); int sqlite3PagerPageRefcount(DbPage*); void *sqlite3PagerGetData(DbPage *); void *sqlite3PagerGetExtra(DbPage *); |
︙ | |||
193 194 195 196 197 198 199 200 201 202 203 204 205 206 | 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 | + + | int sqlite3SectorSize(sqlite3_file *); /* Functions used to truncate the database file. */ void sqlite3PagerTruncateImage(Pager*,Pgno); void sqlite3PagerRekey(DbPage*, Pgno, u16); void sqlite3PagerDropExclusiveLock(Pager*); int sqlite3PagerIsUnlocked(Pager*); int sqlite3PagerIswriteable(DbPage*); int sqlite3PagerUpgradeSnapshot(Pager *pPager, DbPage*); void sqlite3PagerSetDbsize(Pager *pPager, Pgno); #if defined(SQLITE_HAS_CODEC) && !defined(SQLITE_OMIT_WAL) void *sqlite3PagerCodec(DbPage *); #endif |
︙ |
Changes to src/vacuum.c.
︙ | |||
352 353 354 355 356 357 358 | 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 | - + | ** database. No locks are held on any other files (since the main file ** was committed at the btree level). So it safe to end the transaction ** by manually setting the autoCommit flag to true and detaching the ** vacuum database. The vacuum_db journal file is deleted when the pager ** is closed by the DETACH. */ db->autoCommit = 1; |
︙ |
Changes to src/vdbeaux.c.
︙ | |||
2567 2568 2569 2570 2571 2572 2573 | 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 | - + | ** to invoke any required unlock-notify callbacks. */ if( db->autoCommit ){ sqlite3ConnectionUnlocked(db); } assert( db->nVdbeActive>0 || db->autoCommit==0 || db->nStatement==0 ); |
︙ |
Changes to src/wal.c.
︙ | |||
2667 2668 2669 2670 2671 2672 2673 | 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 | - - - - - - - - - - - - - - - - - - - | } void sqlite3WalUpgradeSnapshot(Wal *pWal){ assert( pWal->writeLock ); memcpy(&pWal->hdr, (void*)walIndexHdr(pWal), sizeof(WalIndexHdr)); } |
︙ |
Changes to src/wal.h.
︙ | |||
122 123 124 125 126 127 128 | 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 | - - | /* Return true if the argument is non-NULL and the WAL module is using ** heap-memory for the wal-index. Otherwise, if the argument is NULL or the ** WAL module is using shared-memory, return false. */ int sqlite3WalHeapMemory(Wal *pWal); |
︙ |