/ Check-in [28284ccc]
Login

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

Overview
Comment:First small steps toward brining trunk and apple-osx closer together.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 28284ccc0d7301503f6d2d7bee9093738d52e331
User & Date: drh 2015-02-19 00:29:11
Context
2015-02-19
02:43
Move the os_unix.c file closer to apple-osx. check-in: 81f242e3 user: drh tags: trunk
00:29
First small steps toward brining trunk and apple-osx closer together. check-in: 28284ccc user: drh tags: trunk
2015-02-13
16:36
Improvements to SQLITE_ENABLE_API_ARMOR. check-in: 823ad40c user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/func.c.

   287    287       len = 0;
   288    288       if( p1<0 ){
   289    289         for(z2=z; *z2; len++){
   290    290           SQLITE_SKIP_UTF8(z2);
   291    291         }
   292    292       }
   293    293     }
          294  +#ifdef SQLITE_SUBSTR_COMPATIBILITY
          295  +  /* If SUBSTR_COMPATIBILITY is defined then substr(X,0,N) work the same as
          296  +  ** as substr(X,1,N) - it returns the first N characters of X.  This
          297  +  ** is essentially a back-out of the bug-fix in check-in [5fc125d362df4b8]
          298  +  ** from 2009-02-02 for compatibility of applications that exploited the
          299  +  ** old buggy behavior. */
          300  +  if( p1==0 ) p1 = 1; /* <rdar://problem/6778339> */
          301  +#endif
   294    302     if( argc==3 ){
   295    303       p2 = sqlite3_value_int(argv[2]);
   296    304       if( p2<0 ){
   297    305         p2 = -p2;
   298    306         negP2 = 1;
   299    307       }
   300    308     }else{

Changes to src/main.c.

  2703   2703     db->szMmap = sqlite3GlobalConfig.szMmap;
  2704   2704     db->nextPagesize = 0;
  2705   2705     db->nMaxSorterMmap = 0x7FFFFFFF;
  2706   2706     db->flags |= SQLITE_ShortColNames | SQLITE_EnableTrigger | SQLITE_CacheSpill
  2707   2707   #if !defined(SQLITE_DEFAULT_AUTOMATIC_INDEX) || SQLITE_DEFAULT_AUTOMATIC_INDEX
  2708   2708                    | SQLITE_AutoIndex
  2709   2709   #endif
         2710  +#if SQLITE_DEFAULT_CKPTFULLFSYNC
         2711  +                 | SQLITE_CkptFullFSync
         2712  +#endif
  2710   2713   #if SQLITE_DEFAULT_FILE_FORMAT<4
  2711   2714                    | SQLITE_LegacyFileFmt
  2712   2715   #endif
  2713   2716   #ifdef SQLITE_ENABLE_LOAD_EXTENSION
  2714   2717                    | SQLITE_LoadExtension
  2715   2718   #endif
  2716   2719   #if SQLITE_DEFAULT_RECURSIVE_TRIGGERS
................................................................................
  3297   3300         rc = sqlite3OsFileControl(fd, op, pArg);
  3298   3301       }else{
  3299   3302         rc = SQLITE_NOTFOUND;
  3300   3303       }
  3301   3304       sqlite3BtreeLeave(pBtree);
  3302   3305     }
  3303   3306     sqlite3_mutex_leave(db->mutex);
  3304         -  return rc;   
         3307  +  return rc;
  3305   3308   }
  3306   3309   
  3307   3310   /*
  3308   3311   ** Interface to the testing logic.
  3309   3312   */
  3310   3313   int sqlite3_test_control(int op, ...){
  3311   3314     int rc = 0;

Changes to src/sqlite.h.in.

   940    940   ** opcode causes the xFileControl method to swap the file handle with the one
   941    941   ** pointed to by the pArg argument.  This capability is used during testing
   942    942   ** and only needs to be supported when SQLITE_TEST is defined.
   943    943   **
   944    944   ** </ul>
   945    945   */
   946    946   #define SQLITE_FCNTL_LOCKSTATE               1
   947         -#define SQLITE_GET_LOCKPROXYFILE             2
   948         -#define SQLITE_SET_LOCKPROXYFILE             3
   949         -#define SQLITE_LAST_ERRNO                    4
          947  +#define SQLITE_FCNTL_GET_LOCKPROXYFILE       2
          948  +#define SQLITE_FCNTL_SET_LOCKPROXYFILE       3
          949  +#define SQLITE_FCNTL_LAST_ERRNO              4
   950    950   #define SQLITE_FCNTL_SIZE_HINT               5
   951    951   #define SQLITE_FCNTL_CHUNK_SIZE              6
   952    952   #define SQLITE_FCNTL_FILE_POINTER            7
   953    953   #define SQLITE_FCNTL_SYNC_OMITTED            8
   954    954   #define SQLITE_FCNTL_WIN32_AV_RETRY          9
   955    955   #define SQLITE_FCNTL_PERSIST_WAL            10
   956    956   #define SQLITE_FCNTL_OVERWRITE              11
................................................................................
   961    961   #define SQLITE_FCNTL_TEMPFILENAME           16
   962    962   #define SQLITE_FCNTL_MMAP_SIZE              18
   963    963   #define SQLITE_FCNTL_TRACE                  19
   964    964   #define SQLITE_FCNTL_HAS_MOVED              20
   965    965   #define SQLITE_FCNTL_SYNC                   21
   966    966   #define SQLITE_FCNTL_COMMIT_PHASETWO        22
   967    967   #define SQLITE_FCNTL_WIN32_SET_HANDLE       23
          968  +
          969  +/* deprecated names */
          970  +#define SQLITE_GET_LOCKPROXYFILE      SQLITE_FCNTL_GET_LOCKPROXYFILE
          971  +#define SQLITE_SET_LOCKPROXYFILE      SQLITE_FCNTL_SET_LOCKPROXYFILE
          972  +#define SQLITE_LAST_ERRNO             SQLITE_FCNTL_LAST_ERRNO
          973  +
   968    974   
   969    975   /*
   970    976   ** CAPI3REF: Mutex Handle
   971    977   **
   972    978   ** The mutex module within SQLite defines [sqlite3_mutex] to be an
   973    979   ** abstract type for a mutex object.  The SQLite core never looks
   974    980   ** at the internal representation of an [sqlite3_mutex].  It only
................................................................................
  5056   5062   **
  5057   5063   ** ^(This routine returns [SQLITE_OK] if shared cache was enabled or disabled
  5058   5064   ** successfully.  An [error code] is returned otherwise.)^
  5059   5065   **
  5060   5066   ** ^Shared cache is disabled by default. But this might change in
  5061   5067   ** future releases of SQLite.  Applications that care about shared
  5062   5068   ** cache setting should set it explicitly.
         5069  +**
         5070  +** Note: This method is disabled on MacOS X 10.7 and iOS version 5.0
         5071  +** and will always return SQLITE_MISUSE. On those systems, 
         5072  +** shared cache mode should be enabled per-database connection via 
         5073  +** [sqlite3_open_v2()] with [SQLITE_OPEN_SHAREDCACHE].
  5063   5074   **
  5064   5075   ** This interface is threadsafe on processors where writing a
  5065   5076   ** 32-bit integer is atomic.
  5066   5077   **
  5067   5078   ** See Also:  [SQLite Shared-Cache Mode]
  5068   5079   */
  5069   5080   int sqlite3_enable_shared_cache(int);

Changes to src/test_backup.c.

    10     10   **
    11     11   *************************************************************************
    12     12   ** This file contains test logic for the sqlite3_backup() interface.
    13     13   **
    14     14   */
    15     15   
    16     16   #include "tcl.h"
    17         -#include <sqlite3.h>
           17  +#include "sqlite3.h"
    18     18   #include <assert.h>
    19     19   
    20     20   /* These functions are implemented in main.c. */
    21     21   extern const char *sqlite3ErrName(int);
    22     22   
    23     23   /* These functions are implemented in test1.c. */
    24     24   extern int getDbPointer(Tcl_Interp *, const char *, sqlite3 **);

Changes to src/test_demovfs.c.

   111    111   **
   112    112   **   Much more efficient if the underlying OS is not caching write 
   113    113   **   operations.
   114    114   */
   115    115   
   116    116   #if !defined(SQLITE_TEST) || SQLITE_OS_UNIX
   117    117   
   118         -#include <sqlite3.h>
          118  +#include "sqlite3.h"
   119    119   
   120    120   #include <assert.h>
   121    121   #include <string.h>
   122    122   #include <sys/types.h>
   123    123   #include <sys/stat.h>
   124    124   #include <sys/file.h>
   125    125   #include <sys/param.h>

Changes to src/test_rtree.c.

     9      9   **    May you share freely, never taking more than you give.
    10     10   **
    11     11   *************************************************************************
    12     12   ** Code for testing all sorts of SQLite interfaces. This code
    13     13   ** is not included in the SQLite library. 
    14     14   */
    15     15   
    16         -#include <sqlite3.h>
           16  +#include "sqlite3.h"
    17     17   #include <tcl.h>
    18     18   
    19     19   /* Solely for the UNUSED_PARAMETER() macro. */
    20     20   #include "sqliteInt.h"
    21     21   
    22     22   #ifdef SQLITE_ENABLE_RTREE
    23     23   /* 

Changes to src/test_superlock.c.

    14     14   ** mode database files. The interface to the example code in this file 
    15     15   ** consists of the following two functions:
    16     16   **
    17     17   **   sqlite3demo_superlock()
    18     18   **   sqlite3demo_superunlock()
    19     19   */
    20     20   
    21         -#include <sqlite3.h>
           21  +#include "sqlite3.h"
    22     22   #include <string.h>               /* memset(), strlen() */
    23     23   #include <assert.h>               /* assert() */
    24     24   
    25     25   /*
    26     26   ** A structure to collect a busy-handler callback and argument and a count
    27     27   ** of the number of times it has been invoked.
    28     28   */

Changes to test/incrvacuum2.test.

   184    184       DELETE FROM t1;
   185    185     }
   186    186   
   187    187     do_test 4.2 {
   188    188       execsql { 
   189    189         PRAGMA journal_mode = WAL;
   190    190         PRAGMA incremental_vacuum(1);
   191         -      PRAGMA wal_checkpoint;
   192    191       }
          192  +  } {wal}
          193  +  do_test 4.2.1 {
          194  +    execsql { PRAGMA wal_checkpoint }
   193    195       file size test.db-wal
   194    196     } [expr {32+2*(512+24)}]
   195    197   
   196    198     do_test 4.3 {
   197    199       db close
   198    200       sqlite3 db test.db
   199    201       set maxsz 0