Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(95)

Side by Side Diff: third_party/sqlite/src/src/pragma.c

Issue 2732553002: [sql] SQLite patch to implement "smart" auto-vacuum. (Closed)
Patch Set: sigh, keep clang happy on windows Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/sqlite/src/src/pragma.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 ** 2003 April 6 2 ** 2003 April 6
3 ** 3 **
4 ** The author disclaims copyright to this source code. In place of 4 ** The author disclaims copyright to this source code. In place of
5 ** a legal notice, here is a blessing: 5 ** a legal notice, here is a blessing:
6 ** 6 **
7 ** May you do good and not evil. 7 ** May you do good and not evil.
8 ** May you find forgiveness for yourself and forgive others. 8 ** May you find forgiveness for yourself and forgive others.
9 ** May you share freely, never taking more than you give. 9 ** May you share freely, never taking more than you give.
10 ** 10 **
(...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after
729 sqlite3VdbeAddOp2(v, OP_Integer, iLimit, 1); 729 sqlite3VdbeAddOp2(v, OP_Integer, iLimit, 1);
730 addr = sqlite3VdbeAddOp1(v, OP_IncrVacuum, iDb); VdbeCoverage(v); 730 addr = sqlite3VdbeAddOp1(v, OP_IncrVacuum, iDb); VdbeCoverage(v);
731 sqlite3VdbeAddOp1(v, OP_ResultRow, 1); 731 sqlite3VdbeAddOp1(v, OP_ResultRow, 1);
732 sqlite3VdbeAddOp2(v, OP_AddImm, 1, -1); 732 sqlite3VdbeAddOp2(v, OP_AddImm, 1, -1);
733 sqlite3VdbeAddOp2(v, OP_IfPos, 1, addr); VdbeCoverage(v); 733 sqlite3VdbeAddOp2(v, OP_IfPos, 1, addr); VdbeCoverage(v);
734 sqlite3VdbeJumpHere(v, addr); 734 sqlite3VdbeJumpHere(v, addr);
735 break; 735 break;
736 } 736 }
737 #endif 737 #endif
738 738
739 /*
740 ** PRAGMA [schema.]auto_vacuum_slack_pages(N)
741 **
742 ** Control chunk size of auto-vacuum.
743 */
744 #ifndef SQLITE_OMIT_AUTOVACUUM
745 case PragTyp_AUTO_VACUUM_SLACK_PAGES: {
746 Btree *pBt = pDb->pBt;
747 assert( pBt!=0 );
748 if( !zRight ){
749 returnSingleInt(v, sqlite3BtreeGetAutoVacuumSlackPages(pBt));
750 }else{
751 int nPages = 8;
752 if( sqlite3GetInt32(zRight, &nPages) ){
753 sqlite3BtreeSetAutoVacuumSlackPages(pBt, nPages);
754 }
755 }
756 break;
757 }
758 #endif
759
739 #ifndef SQLITE_OMIT_PAGER_PRAGMAS 760 #ifndef SQLITE_OMIT_PAGER_PRAGMAS
740 /* 761 /*
741 ** PRAGMA [schema.]cache_size 762 ** PRAGMA [schema.]cache_size
742 ** PRAGMA [schema.]cache_size=N 763 ** PRAGMA [schema.]cache_size=N
743 ** 764 **
744 ** The first form reports the current local setting for the 765 ** The first form reports the current local setting for the
745 ** page cache size. The second form sets the local 766 ** page cache size. The second form sets the local
746 ** page cache size value. If N is positive then that is the 767 ** page cache size value. If N is positive then that is the
747 ** number of pages in the cache. If N is negative, then the 768 ** number of pages in the cache. If N is negative, then the
748 ** number of pages is adjusted so that the cache uses -N kibibytes 769 ** number of pages is adjusted so that the cache uses -N kibibytes
(...skipping 1520 matching lines...) Expand 10 before | Expand all | Expand 10 after
2269 pName = pragmaLocate(zName+7); 2290 pName = pragmaLocate(zName+7);
2270 if( pName==0 ) return 0; 2291 if( pName==0 ) return 0;
2271 if( (pName->mPragFlg & (PragFlg_Result0|PragFlg_Result1))==0 ) return 0; 2292 if( (pName->mPragFlg & (PragFlg_Result0|PragFlg_Result1))==0 ) return 0;
2272 assert( sqlite3HashFind(&db->aModule, zName)==0 ); 2293 assert( sqlite3HashFind(&db->aModule, zName)==0 );
2273 return sqlite3VtabCreateModule(db, zName, &pragmaVtabModule, (void*)pName, 0); 2294 return sqlite3VtabCreateModule(db, zName, &pragmaVtabModule, (void*)pName, 0);
2274 } 2295 }
2275 2296
2276 #endif /* SQLITE_OMIT_VIRTUALTABLE */ 2297 #endif /* SQLITE_OMIT_VIRTUALTABLE */
2277 2298
2278 #endif /* SQLITE_OMIT_PRAGMA */ 2299 #endif /* SQLITE_OMIT_PRAGMA */
OLDNEW
« no previous file with comments | « third_party/sqlite/src/src/pragma.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698