| | @@ -1150,11 +1150,11 @@ |
| 1150 | 1150 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 1151 | 1151 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 1152 | 1152 | */ |
| 1153 | 1153 | #define SQLITE_VERSION "3.24.0" |
| 1154 | 1154 | #define SQLITE_VERSION_NUMBER 3024000 |
| 1155 | | -#define SQLITE_SOURCE_ID "2018-05-30 01:14:20 86ee267ee86f5264774a9f215b1158aeaa2d605e77c205731b5ee3945d7de4c2" |
| 1155 | +#define SQLITE_SOURCE_ID "2018-06-04 19:24:41 c7ee0833225bfd8c5ec2f9bf62b97c4e04d03bd9566366d5221ac8fb199a87ca" |
| 1156 | 1156 | |
| 1157 | 1157 | /* |
| 1158 | 1158 | ** CAPI3REF: Run-Time Library Version Numbers |
| 1159 | 1159 | ** KEYWORDS: sqlite3_version sqlite3_sourceid |
| 1160 | 1160 | ** |
| | @@ -10063,11 +10063,11 @@ |
| 10063 | 10063 | ** memory representation of the database exists. A contiguous memory |
| 10064 | 10064 | ** representation of the database will usually only exist if there has |
| 10065 | 10065 | ** been a prior call to [sqlite3_deserialize(D,S,...)] with the same |
| 10066 | 10066 | ** values of D and S. |
| 10067 | 10067 | ** The size of the database is written into *P even if the |
| 10068 | | -** SQLITE_SERIALIZE_NOCOPY bit is set but no contigious copy |
| 10068 | +** SQLITE_SERIALIZE_NOCOPY bit is set but no contiguous copy |
| 10069 | 10069 | ** of the database exists. |
| 10070 | 10070 | ** |
| 10071 | 10071 | ** A call to sqlite3_serialize(D,S,P,F) might return NULL even if the |
| 10072 | 10072 | ** SQLITE_SERIALIZE_NOCOPY bit is omitted from argument F if a memory |
| 10073 | 10073 | ** allocation error occurs. |
| | @@ -35437,11 +35437,11 @@ |
| 35437 | 35437 | ** or an error number on failure". See the manpage for details. */ |
| 35438 | 35438 | int err; |
| 35439 | 35439 | do{ |
| 35440 | 35440 | err = osFallocate(pFile->h, buf.st_size, nSize-buf.st_size); |
| 35441 | 35441 | }while( err==EINTR ); |
| 35442 | | - if( err ) return SQLITE_IOERR_WRITE; |
| 35442 | + if( err && err!=EINVAL ) return SQLITE_IOERR_WRITE; |
| 35443 | 35443 | #else |
| 35444 | 35444 | /* If the OS does not have posix_fallocate(), fake it. Write a |
| 35445 | 35445 | ** single byte to the last byte in each block that falls entirely |
| 35446 | 35446 | ** within the extended region. Then, if required, a single byte |
| 35447 | 35447 | ** at offset (nSize-1), to set the size of the file correctly. |
| | @@ -62893,11 +62893,15 @@ |
| 62893 | 62893 | ** |
| 62894 | 62894 | ** Use the separate sqlite3BtreeCursorRestore() routine to restore a cursor |
| 62895 | 62895 | ** back to where it ought to be if this routine returns true. |
| 62896 | 62896 | */ |
| 62897 | 62897 | SQLITE_PRIVATE int sqlite3BtreeCursorHasMoved(BtCursor *pCur){ |
| 62898 | | - return pCur->eState!=CURSOR_VALID; |
| 62898 | + assert( EIGHT_BYTE_ALIGNMENT(pCur) |
| 62899 | + || pCur==sqlite3BtreeFakeValidCursor() ); |
| 62900 | + assert( offsetof(BtCursor, eState)==0 ); |
| 62901 | + assert( sizeof(pCur->eState)==1 ); |
| 62902 | + return CURSOR_VALID != *(u8*)pCur; |
| 62899 | 62903 | } |
| 62900 | 62904 | |
| 62901 | 62905 | /* |
| 62902 | 62906 | ** Return a pointer to a fake BtCursor object that will always answer |
| 62903 | 62907 | ** false to the sqlite3BtreeCursorHasMoved() routine above. The fake |
| | @@ -86664,14 +86668,14 @@ |
| 86664 | 86668 | ** If cursor P2 is a table, then the content extracted is the data. |
| 86665 | 86669 | ** |
| 86666 | 86670 | ** If the P1 cursor must be pointing to a valid row (not a NULL row) |
| 86667 | 86671 | ** of a real table, not a pseudo-table. |
| 86668 | 86672 | ** |
| 86669 | | -** If P3!=0 then this opcode is allowed to make an ephermeral pointer |
| 86673 | +** If P3!=0 then this opcode is allowed to make an ephemeral pointer |
| 86670 | 86674 | ** into the database page. That means that the content of the output |
| 86671 | 86675 | ** register will be invalidated as soon as the cursor moves - including |
| 86672 | | -** moves caused by other cursors that "save" the the current cursors |
| 86676 | +** moves caused by other cursors that "save" the current cursors |
| 86673 | 86677 | ** position in order that they can write to the same table. If P3==0 |
| 86674 | 86678 | ** then a copy of the data is made into memory. P3!=0 is faster, but |
| 86675 | 86679 | ** P3==0 is safer. |
| 86676 | 86680 | ** |
| 86677 | 86681 | ** If P3!=0 then the content of the P2 register is unsuitable for use |
| | @@ -87484,11 +87488,11 @@ |
| 87484 | 87488 | ** Synopsis: r[P2]=root iDb=P1 flags=P3 |
| 87485 | 87489 | ** |
| 87486 | 87490 | ** Allocate a new b-tree in the main database file if P1==0 or in the |
| 87487 | 87491 | ** TEMP database file if P1==1 or in an attached database if |
| 87488 | 87492 | ** P1>1. The P3 argument must be 1 (BTREE_INTKEY) for a rowid table |
| 87489 | | -** it must be 2 (BTREE_BLOBKEY) for a index or WITHOUT ROWID table. |
| 87493 | +** it must be 2 (BTREE_BLOBKEY) for an index or WITHOUT ROWID table. |
| 87490 | 87494 | ** The root page number of the new b-tree is stored in register P2. |
| 87491 | 87495 | */ |
| 87492 | 87496 | case OP_CreateBtree: { /* out2 */ |
| 87493 | 87497 | int pgno; |
| 87494 | 87498 | Db *pDb; |
| | @@ -93231,33 +93235,35 @@ |
| 93231 | 93235 | assert( iCol>=0 && iCol<pEList->nExpr ); |
| 93232 | 93236 | pOrig = pEList->a[iCol].pExpr; |
| 93233 | 93237 | assert( pOrig!=0 ); |
| 93234 | 93238 | db = pParse->db; |
| 93235 | 93239 | pDup = sqlite3ExprDup(db, pOrig, 0); |
| 93236 | | - if( pDup==0 ) return; |
| 93237 | | - if( zType[0]!='G' ) incrAggFunctionDepth(pDup, nSubquery); |
| 93238 | | - if( pExpr->op==TK_COLLATE ){ |
| 93239 | | - pDup = sqlite3ExprAddCollateString(pParse, pDup, pExpr->u.zToken); |
| 93240 | | - } |
| 93241 | | - ExprSetProperty(pDup, EP_Alias); |
| 93242 | | - |
| 93243 | | - /* Before calling sqlite3ExprDelete(), set the EP_Static flag. This |
| 93244 | | - ** prevents ExprDelete() from deleting the Expr structure itself, |
| 93245 | | - ** allowing it to be repopulated by the memcpy() on the following line. |
| 93246 | | - ** The pExpr->u.zToken might point into memory that will be freed by the |
| 93247 | | - ** sqlite3DbFree(db, pDup) on the last line of this block, so be sure to |
| 93248 | | - ** make a copy of the token before doing the sqlite3DbFree(). |
| 93249 | | - */ |
| 93250 | | - ExprSetProperty(pExpr, EP_Static); |
| 93251 | | - sqlite3ExprDelete(db, pExpr); |
| 93252 | | - memcpy(pExpr, pDup, sizeof(*pExpr)); |
| 93253 | | - if( !ExprHasProperty(pExpr, EP_IntValue) && pExpr->u.zToken!=0 ){ |
| 93254 | | - assert( (pExpr->flags & (EP_Reduced|EP_TokenOnly))==0 ); |
| 93255 | | - pExpr->u.zToken = sqlite3DbStrDup(db, pExpr->u.zToken); |
| 93256 | | - pExpr->flags |= EP_MemToken; |
| 93257 | | - } |
| 93258 | | - sqlite3DbFree(db, pDup); |
| 93240 | + if( pDup!=0 ){ |
| 93241 | + if( zType[0]!='G' ) incrAggFunctionDepth(pDup, nSubquery); |
| 93242 | + if( pExpr->op==TK_COLLATE ){ |
| 93243 | + pDup = sqlite3ExprAddCollateString(pParse, pDup, pExpr->u.zToken); |
| 93244 | + } |
| 93245 | + ExprSetProperty(pDup, EP_Alias); |
| 93246 | + |
| 93247 | + /* Before calling sqlite3ExprDelete(), set the EP_Static flag. This |
| 93248 | + ** prevents ExprDelete() from deleting the Expr structure itself, |
| 93249 | + ** allowing it to be repopulated by the memcpy() on the following line. |
| 93250 | + ** The pExpr->u.zToken might point into memory that will be freed by the |
| 93251 | + ** sqlite3DbFree(db, pDup) on the last line of this block, so be sure to |
| 93252 | + ** make a copy of the token before doing the sqlite3DbFree(). |
| 93253 | + */ |
| 93254 | + ExprSetProperty(pExpr, EP_Static); |
| 93255 | + sqlite3ExprDelete(db, pExpr); |
| 93256 | + memcpy(pExpr, pDup, sizeof(*pExpr)); |
| 93257 | + if( !ExprHasProperty(pExpr, EP_IntValue) && pExpr->u.zToken!=0 ){ |
| 93258 | + assert( (pExpr->flags & (EP_Reduced|EP_TokenOnly))==0 ); |
| 93259 | + pExpr->u.zToken = sqlite3DbStrDup(db, pExpr->u.zToken); |
| 93260 | + pExpr->flags |= EP_MemToken; |
| 93261 | + } |
| 93262 | + sqlite3DbFree(db, pDup); |
| 93263 | + } |
| 93264 | + ExprSetProperty(pExpr, EP_Alias); |
| 93259 | 93265 | } |
| 93260 | 93266 | |
| 93261 | 93267 | |
| 93262 | 93268 | /* |
| 93263 | 93269 | ** Return TRUE if the name zCol occurs anywhere in the USING clause. |
| | @@ -93505,10 +93511,11 @@ |
| 93505 | 93511 | #ifndef SQLITE_OMIT_UPSERT |
| 93506 | 93512 | if( pExpr->iTable==2 ){ |
| 93507 | 93513 | testcase( iCol==(-1) ); |
| 93508 | 93514 | pExpr->iTable = pNC->uNC.pUpsert->regData + iCol; |
| 93509 | 93515 | eNewExprOp = TK_REGISTER; |
| 93516 | + ExprSetProperty(pExpr, EP_Alias); |
| 93510 | 93517 | }else |
| 93511 | 93518 | #endif /* SQLITE_OMIT_UPSERT */ |
| 93512 | 93519 | { |
| 93513 | 93520 | #ifndef SQLITE_OMIT_TRIGGER |
| 93514 | 93521 | if( iCol<0 ){ |
| | @@ -103788,19 +103795,19 @@ |
| 103788 | 103795 | const char *zCol; /* Name of the column of the table */ |
| 103789 | 103796 | int iSrc; /* Index in pTabList->a[] of table being read */ |
| 103790 | 103797 | int iDb; /* The index of the database the expression refers to */ |
| 103791 | 103798 | int iCol; /* Index of column in table */ |
| 103792 | 103799 | |
| 103800 | + assert( pExpr->op==TK_COLUMN || pExpr->op==TK_TRIGGER ); |
| 103793 | 103801 | if( db->xAuth==0 ) return; |
| 103794 | 103802 | iDb = sqlite3SchemaToIndex(pParse->db, pSchema); |
| 103795 | 103803 | if( iDb<0 ){ |
| 103796 | 103804 | /* An attempt to read a column out of a subquery or other |
| 103797 | 103805 | ** temporary table. */ |
| 103798 | 103806 | return; |
| 103799 | 103807 | } |
| 103800 | 103808 | |
| 103801 | | - assert( pExpr->op==TK_COLUMN || pExpr->op==TK_TRIGGER ); |
| 103802 | 103809 | if( pExpr->op==TK_TRIGGER ){ |
| 103803 | 103810 | pTab = pParse->pTriggerTab; |
| 103804 | 103811 | }else{ |
| 103805 | 103812 | assert( pTabList ); |
| 103806 | 103813 | for(iSrc=0; ALWAYS(iSrc<pTabList->nSrc); iSrc++){ |
| | @@ -122104,11 +122111,11 @@ |
| 122104 | 122111 | for(i=0; i<pEList->nExpr; i++){ |
| 122105 | 122112 | struct ExprList_item *pItem = &pEList->a[i]; |
| 122106 | 122113 | if( pItem->u.x.iOrderByCol==0 ){ |
| 122107 | 122114 | Expr *pExpr = pItem->pExpr; |
| 122108 | 122115 | Table *pTab = pExpr->pTab; |
| 122109 | | - if( pExpr->op==TK_COLUMN && pTab && !IsVirtual(pTab) |
| 122116 | + if( pExpr->op==TK_COLUMN && pExpr->iColumn>=0 && pTab && !IsVirtual(pTab) |
| 122110 | 122117 | && (pTab->aCol[pExpr->iColumn].colFlags & COLFLAG_SORTERREF) |
| 122111 | 122118 | ){ |
| 122112 | 122119 | int j; |
| 122113 | 122120 | for(j=0; j<nDefer; j++){ |
| 122114 | 122121 | if( pSort->aDefer[j].iCsr==pExpr->iTable ) break; |
| | @@ -207576,11 +207583,11 @@ |
| 207576 | 207583 | int nArg, /* Number of args */ |
| 207577 | 207584 | sqlite3_value **apUnused /* Function arguments */ |
| 207578 | 207585 | ){ |
| 207579 | 207586 | assert( nArg==0 ); |
| 207580 | 207587 | UNUSED_PARAM2(nArg, apUnused); |
| 207581 | | - sqlite3_result_text(pCtx, "fts5: 2018-05-30 01:14:20 86ee267ee86f5264774a9f215b1158aeaa2d605e77c205731b5ee3945d7de4c2", -1, SQLITE_TRANSIENT); |
| 207588 | + sqlite3_result_text(pCtx, "fts5: 2018-06-04 19:24:41 c7ee0833225bfd8c5ec2f9bf62b97c4e04d03bd9566366d5221ac8fb199a87ca", -1, SQLITE_TRANSIENT); |
| 207582 | 207589 | } |
| 207583 | 207590 | |
| 207584 | 207591 | static int fts5Init(sqlite3 *db){ |
| 207585 | 207592 | static const sqlite3_module fts5Mod = { |
| 207586 | 207593 | /* iVersion */ 2, |
| | @@ -211846,12 +211853,12 @@ |
| 211846 | 211853 | } |
| 211847 | 211854 | #endif /* SQLITE_CORE */ |
| 211848 | 211855 | #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_STMTVTAB) */ |
| 211849 | 211856 | |
| 211850 | 211857 | /************** End of stmt.c ************************************************/ |
| 211851 | | -#if __LINE__!=211851 |
| 211858 | +#if __LINE__!=211858 |
| 211852 | 211859 | #undef SQLITE_SOURCE_ID |
| 211853 | | -#define SQLITE_SOURCE_ID "2018-05-30 01:14:20 86ee267ee86f5264774a9f215b1158aeaa2d605e77c205731b5ee3945d7dalt2" |
| 211860 | +#define SQLITE_SOURCE_ID "2018-06-04 19:24:41 c7ee0833225bfd8c5ec2f9bf62b97c4e04d03bd9566366d5221ac8fb199aalt2" |
| 211854 | 211861 | #endif |
| 211855 | 211862 | /* Return the source-id for this library */ |
| 211856 | 211863 | SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; } |
| 211857 | 211864 | /************************** End of sqlite3.c ******************************/ |
| 211858 | 211865 | |