| | @@ -1,8 +1,8 @@ |
| 1 | 1 | /****************************************************************************** |
| 2 | 2 | ** This file is an amalgamation of many separate C source files from SQLite |
| 3 | | -** version 3.8.7. By combining all the individual C code files into this |
| 3 | +** version 3.8.7.1. By combining all the individual C code files into this |
| 4 | 4 | ** single large file, the entire code can be compiled as a single translation |
| 5 | 5 | ** unit. This allows many compilers to do optimizations that would not be |
| 6 | 6 | ** possible if the files were compiled separately. Performance improvements |
| 7 | 7 | ** of 5% or more are commonly seen when SQLite is compiled as a single |
| 8 | 8 | ** translation unit. |
| | @@ -229,13 +229,13 @@ |
| 229 | 229 | ** |
| 230 | 230 | ** See also: [sqlite3_libversion()], |
| 231 | 231 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 232 | 232 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 233 | 233 | */ |
| 234 | | -#define SQLITE_VERSION "3.8.7" |
| 234 | +#define SQLITE_VERSION "3.8.7.1" |
| 235 | 235 | #define SQLITE_VERSION_NUMBER 3008007 |
| 236 | | -#define SQLITE_SOURCE_ID "2014-10-17 11:24:17 e4ab094f8afce0817f4074e823fabe59fc29ebb4" |
| 236 | +#define SQLITE_SOURCE_ID "2014-10-29 01:27:43 83afe23e553e802c0947c80d0ffdd120423e7c52" |
| 237 | 237 | |
| 238 | 238 | /* |
| 239 | 239 | ** CAPI3REF: Run-Time Library Version Numbers |
| 240 | 240 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 241 | 241 | ** |
| | @@ -20754,15 +20754,11 @@ |
| 20754 | 20754 | ** HAVE_STRCHRNUL. If that routine is not available, this module |
| 20755 | 20755 | ** will supply its own. The built-in version is slower than |
| 20756 | 20756 | ** the glibc version so the glibc version is definitely preferred. |
| 20757 | 20757 | */ |
| 20758 | 20758 | #if !defined(HAVE_STRCHRNUL) |
| 20759 | | -# if defined(linux) |
| 20760 | | -# define HAVE_STRCHRNUL 1 |
| 20761 | | -# else |
| 20762 | | -# define HAVE_STRCHRNUL 0 |
| 20763 | | -# endif |
| 20759 | +# define HAVE_STRCHRNUL 0 |
| 20764 | 20760 | #endif |
| 20765 | 20761 | |
| 20766 | 20762 | |
| 20767 | 20763 | /* |
| 20768 | 20764 | ** Conversion types fall into various categories as defined by the |
| | @@ -42804,10 +42800,18 @@ |
| 42804 | 42800 | }else if( pPager->journalMode==PAGER_JOURNALMODE_TRUNCATE ){ |
| 42805 | 42801 | if( pPager->journalOff==0 ){ |
| 42806 | 42802 | rc = SQLITE_OK; |
| 42807 | 42803 | }else{ |
| 42808 | 42804 | rc = sqlite3OsTruncate(pPager->jfd, 0); |
| 42805 | + if( rc==SQLITE_OK && pPager->fullSync ){ |
| 42806 | + /* Make sure the new file size is written into the inode right away. |
| 42807 | + ** Otherwise the journal might resurrect following a power loss and |
| 42808 | + ** cause the last transaction to roll back. See |
| 42809 | + ** https://bugzilla.mozilla.org/show_bug.cgi?id=1072773 |
| 42810 | + */ |
| 42811 | + rc = sqlite3OsSync(pPager->jfd, pPager->syncFlags); |
| 42812 | + } |
| 42809 | 42813 | } |
| 42810 | 42814 | pPager->journalOff = 0; |
| 42811 | 42815 | }else if( pPager->journalMode==PAGER_JOURNALMODE_PERSIST |
| 42812 | 42816 | || (pPager->exclusiveMode && pPager->journalMode!=PAGER_JOURNALMODE_WAL) |
| 42813 | 42817 | ){ |
| | @@ -71441,11 +71445,11 @@ |
| 71441 | 71445 | */ |
| 71442 | 71446 | if( pC->nHdrParsed<=p2 ){ |
| 71443 | 71447 | if( pOp->p4type==P4_MEM ){ |
| 71444 | 71448 | sqlite3VdbeMemShallowCopy(pDest, pOp->p4.pMem, MEM_Static); |
| 71445 | 71449 | }else{ |
| 71446 | | - MemSetTypeFlag(pDest, MEM_Null); |
| 71450 | + sqlite3VdbeMemSetNull(pDest); |
| 71447 | 71451 | } |
| 71448 | 71452 | goto op_column_out; |
| 71449 | 71453 | } |
| 71450 | 71454 | } |
| 71451 | 71455 | |
| | @@ -93755,11 +93759,11 @@ |
| 93755 | 93759 | if( okOnePass ){ |
| 93756 | 93760 | /* Just one row. Hence the top-of-loop is a no-op */ |
| 93757 | 93761 | assert( nKey==nPk ); /* OP_Found will use an unpacked key */ |
| 93758 | 93762 | assert( !IsVirtual(pTab) ); |
| 93759 | 93763 | if( aToOpen[iDataCur-iTabCur] ){ |
| 93760 | | - assert( pPk!=0 ); |
| 93764 | + assert( pPk!=0 || pTab->pSelect!=0 ); |
| 93761 | 93765 | sqlite3VdbeAddOp4Int(v, OP_NotFound, iDataCur, addrBypass, iKey, nKey); |
| 93762 | 93766 | VdbeCoverage(v); |
| 93763 | 93767 | } |
| 93764 | 93768 | }else if( pPk ){ |
| 93765 | 93769 | addrLoop = sqlite3VdbeAddOp1(v, OP_Rewind, iEphCur); VdbeCoverage(v); |
| | @@ -111279,12 +111283,12 @@ |
| 111279 | 111283 | 0, 0); |
| 111280 | 111284 | } |
| 111281 | 111285 | |
| 111282 | 111286 | /* Top of the update loop */ |
| 111283 | 111287 | if( okOnePass ){ |
| 111284 | | - if( aToOpen[iDataCur-iBaseCur] ){ |
| 111285 | | - assert( pPk!=0 ); |
| 111288 | + if( aToOpen[iDataCur-iBaseCur] && !isView ){ |
| 111289 | + assert( pPk ); |
| 111286 | 111290 | sqlite3VdbeAddOp4Int(v, OP_NotFound, iDataCur, labelBreak, regKey, nKey); |
| 111287 | 111291 | VdbeCoverageNeverTaken(v); |
| 111288 | 111292 | } |
| 111289 | 111293 | labelContinue = labelBreak; |
| 111290 | 111294 | sqlite3VdbeAddOp2(v, OP_IsNull, pPk ? regKey : regOldRowid, labelBreak); |
| 111291 | 111295 | |