/ Check-in [f8699a1a]
Login

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

Overview
Comment:Merge trunk changes with this branch.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | fts5
Files: files | file ages | folders
SHA1: f8699a1a3b0f3bb612aff87a2729f912d709c534
User & Date: dan 2015-01-21 17:20:21
Context
2015-01-21
18:23
Fix an fts5 issue with loading doclist-indexes for a term that is the last thing on its leaf page. check-in: e0d61442 user: dan tags: fts5
17:20
Merge trunk changes with this branch. check-in: f8699a1a user: dan tags: fts5
17:00
Fix an assert() that may fail following an OOM error. check-in: 5f592359 user: dan tags: trunk
16:10
Add further tests for fts5 backend. check-in: 09dabb3b user: dan tags: fts5
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to Makefile.msc.

    54     54   !ENDIF
    55     55   
    56     56   # Set this non-0 to dynamically link to the MSVC runtime library.
    57     57   #
    58     58   !IFNDEF USE_CRT_DLL
    59     59   USE_CRT_DLL = 0
    60     60   !ENDIF
           61  +
           62  +# Set this non-0 to link to the RPCRT4 library.
           63  +#
           64  +!IFNDEF USE_RPCRT4_LIB
           65  +USE_RPCRT4_LIB = 0
           66  +!ENDIF
    61     67   
    62     68   # Set this non-0 to generate assembly code listings for the source code
    63     69   # files.
    64     70   #
    65     71   !IFNDEF USE_LISTINGS
    66     72   USE_LISTINGS = 0
    67     73   !ENDIF
................................................................................
   496    502   # The same set of OMIT and ENABLE flags should be passed to the
   497    503   # LEMON parser generator and the mkkeywordhash tool as well.
   498    504   
   499    505   # These are the required SQLite compilation options used when compiling for
   500    506   # the Windows platform.
   501    507   #
   502    508   REQ_FEATURE_FLAGS = $(REQ_FEATURE_FLAGS) -DSQLITE_MAX_TRIGGER_DEPTH=100
          509  +
          510  +# If we are linking to the RPCRT4 library, enable features that need it.
          511  +#
          512  +!IF $(USE_RPCRT4_LIB)!=0
          513  +REQ_FEATURE_FLAGS = $(REQ_FEATURE_FLAGS) -DSQLITE_WIN32_USE_UUID=1
          514  +!ENDIF
   503    515   
   504    516   # Add the required and optional SQLite compilation options into the command
   505    517   # lines used to invoke the MSVC code and resource compilers.
   506    518   #
   507    519   TCC = $(TCC) $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS)
   508    520   RCC = $(RCC) $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS)
   509    521   
................................................................................
   559    571   # Command line prefixes for compiling code, compiling resources,
   560    572   # linking, etc.
   561    573   #
   562    574   LTCOMPILE = $(TCC) -Fo$@
   563    575   LTRCOMPILE = $(RCC) -r
   564    576   LTLIB = lib.exe
   565    577   LTLINK = $(TCC) -Fe$@
          578  +
          579  +# If requested, link to the RPCRT4 library.
          580  +#
          581  +!IF $(USE_RPCRT4_LIB)!=0
          582  +LTLINK = $(LTLINK) rpcrt4.lib
          583  +!ENDIF
   566    584   
   567    585   # If a platform was set, force the linker to target that.
   568    586   # Note that the vcvars*.bat family of batch files typically
   569    587   # set this for you.  Otherwise, the linker will attempt
   570    588   # to deduce the binary type based on the object files.
   571    589   !IFDEF PLATFORM
   572    590   LTLINKOPTS = /MACHINE:$(PLATFORM)

Changes to src/expr.c.

  2252   2252   */
  2253   2253   void sqlite3ExprCacheStore(Parse *pParse, int iTab, int iCol, int iReg){
  2254   2254     int i;
  2255   2255     int minLru;
  2256   2256     int idxLru;
  2257   2257     struct yColCache *p;
  2258   2258   
  2259         -  assert( iReg>0 );  /* Register numbers are always positive */
         2259  +  /* Unless an error has occurred, register numbers are always positive. */
         2260  +  assert( iReg>0 || pParse->nErr || pParse->db->mallocFailed );
  2260   2261     assert( iCol>=-1 && iCol<32768 );  /* Finite column numbers */
  2261   2262   
  2262   2263     /* The SQLITE_ColumnCache flag disables the column cache.  This is used
  2263   2264     ** for testing only - to verify that SQLite always gets the same answer
  2264   2265     ** with and without the column cache.
  2265   2266     */
  2266   2267     if( OptimizationDisabled(pParse->db, SQLITE_ColumnCache) ) return;

Changes to src/os_win.c.

  1062   1062   #else
  1063   1063     { "InterlockedCompareExchange", (SYSCALL)InterlockedCompareExchange, 0 },
  1064   1064   
  1065   1065   #define osInterlockedCompareExchange ((LONG(WINAPI*)(LONG \
  1066   1066           SQLITE_WIN32_VOLATILE*, LONG,LONG))aSyscall[76].pCurrent)
  1067   1067   #endif /* defined(InterlockedCompareExchange) */
  1068   1068   
         1069  +#if !SQLITE_OS_WINCE && !SQLITE_OS_WINRT && SQLITE_WIN32_USE_UUID
         1070  +  { "UuidCreate",               (SYSCALL)UuidCreate,             0 },
         1071  +#else
         1072  +  { "UuidCreate",               (SYSCALL)0,                      0 },
         1073  +#endif
         1074  +
         1075  +#define osUuidCreate ((RPC_STATUS(RPC_ENTRY*)(UUID*))aSyscall[77].pCurrent)
         1076  +
         1077  +#if !SQLITE_OS_WINCE && !SQLITE_OS_WINRT && SQLITE_WIN32_USE_UUID
         1078  +  { "UuidCreateSequential",     (SYSCALL)UuidCreateSequential,   0 },
         1079  +#else
         1080  +  { "UuidCreateSequential",     (SYSCALL)0,                      0 },
         1081  +#endif
         1082  +
         1083  +#define osUuidCreateSequential \
         1084  +        ((RPC_STATUS(RPC_ENTRY*)(UUID*))aSyscall[78].pCurrent)
         1085  +
  1069   1086   }; /* End of the overrideable system calls */
  1070   1087   
  1071   1088   /*
  1072   1089   ** This is the xSetSystemCall() method of sqlite3_vfs for all of the
  1073   1090   ** "win32" VFSes.  Return SQLITE_OK opon successfully updating the
  1074   1091   ** system call pointer, or SQLITE_NOTFOUND if there is no configurable
  1075   1092   ** system call named zName.
................................................................................
  5340   5357   #endif
  5341   5358     if( sizeof(LARGE_INTEGER)<=nBuf-n ){
  5342   5359       LARGE_INTEGER i;
  5343   5360       osQueryPerformanceCounter(&i);
  5344   5361       memcpy(&zBuf[n], &i, sizeof(i));
  5345   5362       n += sizeof(i);
  5346   5363     }
         5364  +#endif
         5365  +#if !SQLITE_OS_WINCE && !SQLITE_OS_WINRT && SQLITE_WIN32_USE_UUID
         5366  +  if( sizeof(UUID)<=nBuf-n ){
         5367  +    UUID id;
         5368  +    memset(&id, 0, sizeof(UUID));
         5369  +    osUuidCreate(&id);
         5370  +    memcpy(zBuf, &id, sizeof(UUID));
         5371  +    n += sizeof(UUID);
         5372  +  }
         5373  +  if( sizeof(UUID)<=nBuf-n ){
         5374  +    UUID id;
         5375  +    memset(&id, 0, sizeof(UUID));
         5376  +    osUuidCreateSequential(&id);
         5377  +    memcpy(zBuf, &id, sizeof(UUID));
         5378  +    n += sizeof(UUID);
         5379  +  }
  5347   5380   #endif
  5348   5381     return n;
  5349   5382   }
  5350   5383   
  5351   5384   
  5352   5385   /*
  5353   5386   ** Sleep for a little while.  Return the amount of time slept.
................................................................................
  5518   5551       winGetSystemCall,    /* xGetSystemCall */
  5519   5552       winNextSystemCall,   /* xNextSystemCall */
  5520   5553     };
  5521   5554   #endif
  5522   5555   
  5523   5556     /* Double-check that the aSyscall[] array has been constructed
  5524   5557     ** correctly.  See ticket [bb3a86e890c8e96ab] */
  5525         -  assert( ArraySize(aSyscall)==77 );
         5558  +  assert( ArraySize(aSyscall)==79 );
  5526   5559   
  5527   5560     /* get memory map allocation granularity */
  5528   5561     memset(&winSysInfo, 0, sizeof(SYSTEM_INFO));
  5529   5562   #if SQLITE_OS_WINRT
  5530   5563     osGetNativeSystemInfo(&winSysInfo);
  5531   5564   #else
  5532   5565     osGetSystemInfo(&winSysInfo);

Changes to src/vdbeaux.c.

  3369   3369     u32 szHdr;
  3370   3370     u32 idx;
  3371   3371     u32 notUsed;
  3372   3372     const unsigned char *aKey = (const unsigned char*)pKey;
  3373   3373   
  3374   3374     if( CORRUPT_DB ) return;
  3375   3375     idx = getVarint32(aKey, szHdr);
  3376         -  assert( szHdr<=nKey );
         3376  +  assert( nKey>=0 );
         3377  +  assert( szHdr<=(u32)nKey );
  3377   3378     while( idx<szHdr ){
  3378   3379       idx += getVarint32(aKey+idx, notUsed);
  3379   3380       nField++;
  3380   3381     }
  3381   3382     assert( nField <= pKeyInfo->nField+pKeyInfo->nXField );
  3382   3383   }
  3383   3384   #else

Changes to test/mallocK.test.

   129    129   
   130    130   do_faultsim_test 6 -faults oom* -body {
   131    131     db cache flush
   132    132     db eval { SELECT DISTINCT c FROM t3 WHERE b BETWEEN '.xx..' AND '.xxxx' }
   133    133   } -test {
   134    134     faultsim_test_result {0 {12 13 14 15}} 
   135    135   }
          136  +
          137  +do_execsql_test 7.1 {
          138  +  CREATE TABLE x1(a INTEGER PRIMARY KEY, b);
          139  +}
          140  +do_faultsim_test 7.2 -faults oom* -body {
          141  +  execsql { SELECT * FROM x1 WHERE a = (SELECT 1) }
          142  +} -test {
          143  +  faultsim_test_result [list 0 {}]
          144  +}
          145  +
   136    146   
   137    147   finish_test
   138    148