]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Fixes for compiling with SQLITE_OMIT_AUTOVACUUM and/or SQLITE_OMIT_TRIGGER defined. omit-fixes
authordan <dan@noemail.net>
Mon, 11 Mar 2013 11:49:03 +0000 (11:49 +0000)
committerdan <dan@noemail.net>
Mon, 11 Mar 2013 11:49:03 +0000 (11:49 +0000)
FossilOrigin-Name: 938b91e8552516772060d4e55e2f79cca4c13e27

manifest
manifest.uuid
src/btree.c
src/pragma.c

index 035401514a18fc1a11cb721e0421f818498f6089..e8d43bfe67e56c66c21734f862c0d17fe17a61f4 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Add\sa\stest\scase\sfor\sthe\sproblem\sfixed\sby\sthe\sprevious\scommit.
-D 2013-03-09T14:49:07.597
+C Fixes\sfor\scompiling\swith\sSQLITE_OMIT_AUTOVACUUM\sand/or\sSQLITE_OMIT_TRIGGER\sdefined.
+D 2013-03-11T11:49:03.189
 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
 F Makefile.in 9a804abbd3cae82d196e4d33aba13239e32522a5
 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@@ -121,7 +121,7 @@ F src/auth.c 523da7fb4979469955d822ff9298352d6b31de34
 F src/backup.c b2cac9f7993f3f9588827b824b1501d0c820fa68
 F src/bitvec.c 26675fe8e431dc555e6f2d0e11e651d172234aa1
 F src/btmutex.c 976f45a12e37293e32cae0281b15a21d48a8aaa7
-F src/btree.c c7ce6045f023ba6426d5cca63fab5e1e3d282309
+F src/btree.c 746c4dafae8565b3be6fb9ce3bb1fa9f1e67cc59
 F src/btree.h 3ad7964d6c5b1c7bff569aab6adfa075f8bf06cd
 F src/btreeInt.h eecc84f02375b2bb7a44abbcbbe3747dde73edb2
 F src/build.c 375e5df716e03b9343c5e1211be3b24e6d6dff05
@@ -168,7 +168,7 @@ F src/parse.y 5d5e12772845805fdfeb889163516b84fbb9ae95
 F src/pcache.c f8043b433a57aba85384a531e3937a804432a346
 F src/pcache.h 1b5dcc3dc8103d03e625b177023ee67764fa6b7c
 F src/pcache1.c 9fd22671c270b35131ef480bbc00392b8b5f8ab9
-F src/pragma.c bdb484d0283965c431d4153f28c30f836a1f16b1
+F src/pragma.c 9f0ee3d74a7f33eeeff40a4b014fc3abf8182ce2
 F src/prepare.c 78cd7ae8cd0d8de8ef8a8b5352fc5f38693a0852
 F src/printf.c 4a9f882f1c1787a8b494a2987765acf9d97ac21f
 F src/random.c cd4a67b3953b88019f8cd4ccd81394a8ddfaba50
@@ -1037,7 +1037,10 @@ F tool/vdbe-compress.tcl f12c884766bd14277f4fcedcae07078011717381
 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
 F tool/warnings.sh fbc018d67fd7395f440c28f33ef0f94420226381
 F tool/win/sqlite.vsix 97894c2790eda7b5bce3cc79cb2a8ec2fde9b3ac
-P ddee56c9b2b591b9386b1072c3b3a699f7c1f853
-R 0685395d6c72f7d3eee9637a399e2144
+P e899b058a703158012c054974bd9a909d75144d8
+R 769137243190ff2093b112f59a144071
+T *branch * omit-fixes
+T *sym-omit-fixes *
+T -sym-trunk *
 U dan
-Z 77cf7ba50ad60c04d236fa95e2bf9a03
+Z 6114da9985cb574374ef28f435a1a3f9
index 947aa65ad853e67eebe72f6243e833f25512017d..ccadf4f32770b7359811e1f826d42f1826fd4ab7 100644 (file)
@@ -1 +1 @@
-e899b058a703158012c054974bd9a909d75144d8
\ No newline at end of file
+938b91e8552516772060d4e55e2f79cca4c13e27
\ No newline at end of file
index 16b56f5bf0acb576c75c64f542340974c1447088..07ec3fe52a8f97196de9e9370e4abccb8b188723 100644 (file)
@@ -43,6 +43,25 @@ int sqlite3BtreeTrace=1;  /* True to enable tracing */
 */
 #define get2byteNotZero(X)  (((((int)get2byte(X))-1)&0xffff)+1)
 
+/*
+** Values passed as the 5th argument to allocateBtreePage()
+*/
+#define BTALLOC_ANY   0           /* Allocate any page */
+#define BTALLOC_EXACT 1           /* Allocate exact page if possible */
+#define BTALLOC_LE    2           /* Allocate any page <= the parameter */
+
+/*
+** Macro IfNotOmitAV(x) returns (x) if SQLITE_OMIT_AUTOVACUUM is not 
+** defined, or 0 if it is. For example:
+**
+**   bIncrVacuum = IfNotOmitAV(pBtShared->incrVacuum);
+*/
+#ifndef SQLITE_OMIT_AUTOVACUUM
+#define IfNotOmitAV(expr) (expr)
+#else
+#define IfNotOmitAV(expr) 0
+#endif
+
 #ifndef SQLITE_OMIT_SHARED_CACHE
 /*
 ** A list of BtShared objects that are eligible for participation
@@ -2595,7 +2614,7 @@ int sqlite3BtreeBeginTrans(Btree *p, int wrflag){
   if( p->inTrans==TRANS_WRITE || (p->inTrans==TRANS_READ && !wrflag) ){
     goto trans_begun;
   }
-  assert( pBt->bDoTruncate==0 );
+  assert( IfNotOmitAV(pBt->bDoTruncate)==0 );
 
   /* Write transactions are not possible on a read-only database */
   if( (pBt->btsFlags & BTS_READ_ONLY)!=0 && wrflag ){
@@ -2910,9 +2929,6 @@ static int relocatePage(
 
 /* Forward declaration required by incrVacuumStep(). */
 static int allocateBtreePage(BtShared *, MemPage **, Pgno *, Pgno, u8);
-#define BTALLOC_ANY   0           /* Allocate any page */
-#define BTALLOC_EXACT 1           /* Allocate exact page if possible */
-#define BTALLOC_LE    2           /* Allocate any page <= the parameter */
 
 /*
 ** Perform a single step of an incremental-vacuum. If successful, return
@@ -4902,7 +4918,7 @@ static int allocateBtreePage(
   Pgno mxPage;     /* Total size of the database file */
 
   assert( sqlite3_mutex_held(pBt->mutex) );
-  assert( eMode==BTALLOC_ANY || (nearby>0 && pBt->autoVacuum) );
+  assert( eMode==BTALLOC_ANY || (nearby>0 && IfNotOmitAV(pBt->autoVacuum)) );
   pPage1 = pBt->pPage1;
   mxPage = btreePagecount(pBt);
   n = get4byte(&pPage1->aData[36]);
@@ -5135,7 +5151,7 @@ static int allocateBtreePage(
     ** here are confined to those pages that lie between the end of the
     ** database image and the end of the database file.
     */
-    int bNoContent = (0==pBt->bDoTruncate);
+    int bNoContent = (0==IfNotOmitAV(pBt->bDoTruncate));
 
     rc = sqlite3PagerWrite(pBt->pPage1->pDbPage);
     if( rc ) return rc;
index 9927c50f2ae882f720f02d204b0f15d6fe27e2ac..f6dadbd4a8976254091e23c1c390c4c6289d6a21 100644 (file)
@@ -1130,6 +1130,7 @@ void sqlite3Pragma(
 #endif /* !defined(SQLITE_OMIT_FOREIGN_KEY) */
 
 #ifndef SQLITE_OMIT_FOREIGN_KEY
+#ifndef SQLITE_OMIT_TRIGGER
   if( sqlite3StrICmp(zLeft, "foreign_key_check")==0 ){
     FKey *pFK;             /* A foreign key constraint */
     Table *pTab;           /* Child table contain "REFERENCES" keyword */
@@ -1241,6 +1242,7 @@ void sqlite3Pragma(
       sqlite3VdbeJumpHere(v, addrTop);
     }
   }else
+#endif /* !defined(SQLITE_OMIT_TRIGGER) */
 #endif /* !defined(SQLITE_OMIT_FOREIGN_KEY) */
 
 #ifndef NDEBUG