/ Check-in [711c5917]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Changes to give a warning-free build with SQLITE_OMIT_INCRBLOB and SQLITE_OMIT_SHARED_CACHE.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:711c59171b22df04224183a713e6c36e0bb3bba8
User & Date: drh 2016-09-10 19:51:40
Context
2016-09-12
09:28
Have releasetest.tcl delete all test files except for "testfixture", "testfixture.exe", "sqlite3", "sqlite3.exe", "test.log" and "test-out.txt" after each test run is finished. Passing the "--keep" option restores the old behaviour. check-in: e0e042dc user: dan tags: trunk
2016-09-10
19:51
Changes to give a warning-free build with SQLITE_OMIT_INCRBLOB and SQLITE_OMIT_SHARED_CACHE. check-in: 711c5917 user: drh tags: trunk
14:43
Add test code to delete an SQLite database and its auxiliary files. check-in: 8a9d1281 user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/btree.h.

    86     86   int sqlite3BtreeBeginStmt(Btree*,int);
    87     87   int sqlite3BtreeCreateTable(Btree*, int*, int flags);
    88     88   int sqlite3BtreeIsInTrans(Btree*);
    89     89   int sqlite3BtreeIsInReadTrans(Btree*);
    90     90   int sqlite3BtreeIsInBackup(Btree*);
    91     91   void *sqlite3BtreeSchema(Btree *, int, void(*)(void *));
    92     92   int sqlite3BtreeSchemaLocked(Btree *pBtree);
           93  +#ifndef SQLITE_OMIT_SHARED_CACHE
    93     94   int sqlite3BtreeLockTable(Btree *pBtree, int iTab, u8 isWriteLock);
           95  +#endif
    94     96   int sqlite3BtreeSavepoint(Btree *, int, int);
    95     97   
    96     98   const char *sqlite3BtreeGetFilename(Btree *);
    97     99   const char *sqlite3BtreeGetJournalname(Btree *);
    98    100   int sqlite3BtreeCopyFile(Btree *, Btree *);
    99    101   
   100    102   int sqlite3BtreeIncrVacuum(Btree *);
................................................................................
   289    291   const void *sqlite3BtreePayloadFetch(BtCursor*, u32 *pAmt);
   290    292   u32 sqlite3BtreePayloadSize(BtCursor*);
   291    293   int sqlite3BtreeData(BtCursor*, u32 offset, u32 amt, void*);
   292    294   
   293    295   char *sqlite3BtreeIntegrityCheck(Btree*, int *aRoot, int nRoot, int, int*);
   294    296   struct Pager *sqlite3BtreePager(Btree*);
   295    297   
          298  +#ifndef SQLITE_OMIT_INCRBLOB
   296    299   int sqlite3BtreePutData(BtCursor*, u32 offset, u32 amt, void*);
   297    300   void sqlite3BtreeIncrblobCursor(BtCursor *);
          301  +#endif
   298    302   void sqlite3BtreeClearCursor(BtCursor *);
   299    303   int sqlite3BtreeSetVersion(Btree *pBt, int iVersion);
   300    304   int sqlite3BtreeCursorHasHint(BtCursor*, unsigned int mask);
   301    305   int sqlite3BtreeIsReadonly(Btree *pBt);
   302    306   int sqlite3HeaderSizeBtree(void);
   303    307   
   304    308   #ifndef NDEBUG

Changes to src/tclsqlite.c.

   586    586     if( rc!=TCL_OK || atoi(Tcl_GetStringResult(pDb->interp)) ){
   587    587       return 1;
   588    588     }
   589    589     return 0;
   590    590   }
   591    591   #endif
   592    592   
   593         -#ifndef SQLITE_OMIT_TRACE
          593  +#if !defined(SQLITE_OMIT_TRACE) && !defined(SQLITE_OMIT_FLOATING_POINT) && \
          594  +    !defined(SQLITE_OMIT_DEPRECATED)
   594    595   /*
   595    596   ** This routine is called by the SQLite trace handler whenever a new
   596    597   ** block of SQL is executed.  The TCL script in pDb->zTrace is executed.
   597    598   */
   598    599   static void DbTraceHandler(void *cd, const char *zSql){
   599    600     SqliteDb *pDb = (SqliteDb*)cd;
   600    601     Tcl_DString str;
................................................................................
   680    681         break;
   681    682       }
   682    683     }
   683    684     return SQLITE_OK;
   684    685   }
   685    686   #endif
   686    687   
   687         -#ifndef SQLITE_OMIT_TRACE
          688  +#if !defined(SQLITE_OMIT_TRACE) && !defined(SQLITE_OMIT_FLOATING_POINT) && \
          689  +    !defined(SQLITE_OMIT_DEPRECATED)
   688    690   /*
   689    691   ** This routine is called by the SQLite profile handler after a statement
   690    692   ** SQL has executed.  The TCL script in pDb->zProfile is evaluated.
   691    693   */
   692    694   static void DbProfileHandler(void *cd, const char *zSql, sqlite_uint64 tm){
   693    695     SqliteDb *pDb = (SqliteDb*)cd;
   694    696     Tcl_DString str;
................................................................................
  2743   2745         zProfile = Tcl_GetStringFromObj(objv[2], &len);
  2744   2746         if( zProfile && len>0 ){
  2745   2747           pDb->zProfile = Tcl_Alloc( len + 1 );
  2746   2748           memcpy(pDb->zProfile, zProfile, len+1);
  2747   2749         }else{
  2748   2750           pDb->zProfile = 0;
  2749   2751         }
  2750         -#if !defined(SQLITE_OMIT_TRACE) && !defined(SQLITE_OMIT_FLOATING_POINT)
         2752  +#if !defined(SQLITE_OMIT_TRACE) && !defined(SQLITE_OMIT_FLOATING_POINT) && \
         2753  +    !defined(SQLITE_OMIT_DEPRECATED)
  2751   2754         if( pDb->zProfile ){
  2752   2755           pDb->interp = interp;
  2753   2756           sqlite3_profile(pDb->db, DbProfileHandler, pDb);
  2754   2757         }else{
  2755   2758           sqlite3_profile(pDb->db, 0, 0);
  2756   2759         }
  2757   2760   #endif
................................................................................
  2930   2933         zTrace = Tcl_GetStringFromObj(objv[2], &len);
  2931   2934         if( zTrace && len>0 ){
  2932   2935           pDb->zTrace = Tcl_Alloc( len + 1 );
  2933   2936           memcpy(pDb->zTrace, zTrace, len+1);
  2934   2937         }else{
  2935   2938           pDb->zTrace = 0;
  2936   2939         }
  2937         -#if !defined(SQLITE_OMIT_TRACE) && !defined(SQLITE_OMIT_FLOATING_POINT) \
  2938         -    && !defined(SQLITE_OMIT_DEPRECATED)
         2940  +#if !defined(SQLITE_OMIT_TRACE) && !defined(SQLITE_OMIT_FLOATING_POINT) && \
         2941  +    !defined(SQLITE_OMIT_DEPRECATED)
  2939   2942         if( pDb->zTrace ){
  2940   2943           pDb->interp = interp;
  2941   2944           sqlite3_trace(pDb->db, DbTraceHandler, pDb);
  2942   2945         }else{
  2943   2946           sqlite3_trace(pDb->db, 0, 0);
  2944   2947         }
  2945   2948   #endif

Changes to src/test3.c.

   249    249   static int SQLITE_TCLAPI btree_close_cursor(
   250    250     void *NotUsed,
   251    251     Tcl_Interp *interp,    /* The TCL interpreter that invoked this command */
   252    252     int argc,              /* Number of arguments */
   253    253     const char **argv      /* Text of each argument */
   254    254   ){
   255    255     BtCursor *pCur;
   256         -  Btree *pBt;
   257    256     int rc;
   258    257   
   259    258     if( argc!=2 ){
   260    259       Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
   261    260          " ID\"", 0);
   262    261       return TCL_ERROR;
   263    262     }
   264    263     pCur = sqlite3TestTextToPtr(argv[1]);
   265         -  pBt = pCur->pBtree;
   266         -  sqlite3_mutex_enter(pBt->db->mutex);
   267         -  sqlite3BtreeEnter(pBt);
          264  +#if SQLITE_THREADSAFE>0
          265  +  {
          266  +    Btree *pBt = pCur->pBtree;
          267  +    sqlite3_mutex_enter(pBt->db->mutex);
          268  +    sqlite3BtreeEnter(pBt);
          269  +    rc = sqlite3BtreeCloseCursor(pCur);
          270  +    sqlite3BtreeLeave(pBt);
          271  +    sqlite3_mutex_leave(pBt->db->mutex);
          272  +  }
          273  +#else
   268    274     rc = sqlite3BtreeCloseCursor(pCur);
   269         -  sqlite3BtreeLeave(pBt);
   270         -  sqlite3_mutex_leave(pBt->db->mutex);
          275  +#endif
   271    276     ckfree((char *)pCur);
   272    277     if( rc ){
   273    278       Tcl_AppendResult(interp, sqlite3ErrName(rc), 0);
   274    279       return TCL_ERROR;
   275    280     }
   276    281     return SQLITE_OK;
   277    282   }

Changes to src/vdbe.c.

  3873   3873       assert( oc!=OP_SeekGE || r.default_rc==+1 );
  3874   3874       assert( oc!=OP_SeekLT || r.default_rc==+1 );
  3875   3875   
  3876   3876       r.aMem = &aMem[pOp->p3];
  3877   3877   #ifdef SQLITE_DEBUG
  3878   3878       { int i; for(i=0; i<r.nField; i++) assert( memIsValid(&r.aMem[i]) ); }
  3879   3879   #endif
  3880         -    ExpandBlob(r.aMem);
         3880  +    (void)ExpandBlob(r.aMem);
  3881   3881       r.eqSeen = 0;
  3882   3882       rc = sqlite3BtreeMovetoUnpacked(pC->uc.pCursor, &r, 0, 0, &res);
  3883   3883       if( rc!=SQLITE_OK ){
  3884   3884         goto abort_due_to_error;
  3885   3885       }
  3886   3886       if( eqOnly && r.eqSeen==0 ){
  3887   3887         assert( res!=0 );
................................................................................
  4016   4016     pFree = 0;
  4017   4017     if( pOp->p4.i>0 ){
  4018   4018       r.pKeyInfo = pC->pKeyInfo;
  4019   4019       r.nField = (u16)pOp->p4.i;
  4020   4020       r.aMem = pIn3;
  4021   4021       for(ii=0; ii<r.nField; ii++){
  4022   4022         assert( memIsValid(&r.aMem[ii]) );
  4023         -      ExpandBlob(&r.aMem[ii]);
         4023  +      (void)ExpandBlob(&r.aMem[ii]);
  4024   4024   #ifdef SQLITE_DEBUG
  4025   4025         if( ii ) REGISTER_TRACE(pOp->p3+ii, &r.aMem[ii]);
  4026   4026   #endif
  4027   4027       }
  4028   4028       pIdxKey = &r;
  4029   4029     }else{
  4030   4030       pIdxKey = sqlite3VdbeAllocUnpackedRecord(
  4031   4031           pC->pKeyInfo, aTempRec, sizeof(aTempRec), &pFree
  4032   4032       );
  4033   4033       if( pIdxKey==0 ) goto no_mem;
  4034   4034       assert( pIn3->flags & MEM_Blob );
  4035         -    ExpandBlob(pIn3);
         4035  +    (void)ExpandBlob(pIn3);
  4036   4036       sqlite3VdbeRecordUnpack(pC->pKeyInfo, pIn3->n, pIn3->z, pIdxKey);
  4037   4037     }
  4038   4038     pIdxKey->default_rc = 0;
  4039   4039     takeJump = 0;
  4040   4040     if( pOp->opcode==OP_NoConflict ){
  4041   4041       /* For the OP_NoConflict opcode, take the jump if any of the
  4042   4042       ** input fields are NULL, since any key with a NULL will not

Changes to src/vdbemem.c.

   188    188   **
   189    189   ** Return SQLITE_OK on success or SQLITE_NOMEM if malloc fails.
   190    190   */
   191    191   int sqlite3VdbeMemMakeWriteable(Mem *pMem){
   192    192     int f;
   193    193     assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) );
   194    194     assert( (pMem->flags&MEM_RowSet)==0 );
   195         -  ExpandBlob(pMem);
          195  +  (void)ExpandBlob(pMem);
   196    196     f = pMem->flags;
   197    197     if( (f&(MEM_Str|MEM_Blob)) && (pMem->szMalloc==0 || pMem->z!=pMem->zMalloc) ){
   198    198       if( sqlite3VdbeMemGrow(pMem, pMem->n + 2, 1) ){
   199    199         return SQLITE_NOMEM_BKPT;
   200    200       }
   201    201       pMem->z[pMem->n] = 0;
   202    202       pMem->z[pMem->n+1] = 0;