| | @@ -381,11 +381,11 @@ |
| 381 | 381 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 382 | 382 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 383 | 383 | */ |
| 384 | 384 | #define SQLITE_VERSION "3.16.0" |
| 385 | 385 | #define SQLITE_VERSION_NUMBER 3016000 |
| 386 | | -#define SQLITE_SOURCE_ID "2016-12-26 12:25:19 edc9db41f3ee200ba44579a46ed8331bbbbf539e" |
| 386 | +#define SQLITE_SOURCE_ID "2016-12-30 00:09:14 f57952bac652901e1bd48b68301941efbcf29dc4" |
| 387 | 387 | |
| 388 | 388 | /* |
| 389 | 389 | ** CAPI3REF: Run-Time Library Version Numbers |
| 390 | 390 | ** KEYWORDS: sqlite3_version sqlite3_sourceid |
| 391 | 391 | ** |
| | @@ -19064,17 +19064,26 @@ |
| 19064 | 19064 | return 0; |
| 19065 | 19065 | } |
| 19066 | 19066 | return 1; |
| 19067 | 19067 | } |
| 19068 | 19068 | |
| 19069 | +/* The julian day number for 9999-12-31 23:59:59.999 is 5373484.4999999. |
| 19070 | +** Multiplying this by 86400000 gives 464269060799999 as the maximum value |
| 19071 | +** for DateTime.iJD. |
| 19072 | +** |
| 19073 | +** But some older compilers (ex: gcc 4.2.1 on older Macs) cannot deal with |
| 19074 | +** such a large integer literal, so we have to encode it. |
| 19075 | +*/ |
| 19076 | +#define INT_464269060799999 ((((i64)0x1a640)<<32)|0x1072fdff) |
| 19077 | + |
| 19069 | 19078 | /* |
| 19070 | 19079 | ** Return TRUE if the given julian day number is within range. |
| 19071 | 19080 | ** |
| 19072 | 19081 | ** The input is the JulianDay times 86400000. |
| 19073 | 19082 | */ |
| 19074 | 19083 | static int validJulianDay(sqlite3_int64 iJD){ |
| 19075 | | - return iJD>=0 && iJD<=464269060799999; |
| 19084 | + return iJD>=0 && iJD<=INT_464269060799999; |
| 19076 | 19085 | } |
| 19077 | 19086 | |
| 19078 | 19087 | /* |
| 19079 | 19088 | ** Compute the Year, Month, and Day from the julian day number. |
| 19080 | 19089 | */ |
| | @@ -24570,11 +24579,11 @@ |
| 24570 | 24579 | pNew = pOld; |
| 24571 | 24580 | }else if( sqlite3GlobalConfig.bMemstat ){ |
| 24572 | 24581 | sqlite3_mutex_enter(mem0.mutex); |
| 24573 | 24582 | sqlite3StatusHighwater(SQLITE_STATUS_MALLOC_SIZE, (int)nBytes); |
| 24574 | 24583 | nDiff = nNew - nOld; |
| 24575 | | - if( sqlite3StatusValue(SQLITE_STATUS_MEMORY_USED) >= |
| 24584 | + if( nDiff>0 && sqlite3StatusValue(SQLITE_STATUS_MEMORY_USED) >= |
| 24576 | 24585 | mem0.alarmThreshold-nDiff ){ |
| 24577 | 24586 | sqlite3MallocAlarm(nDiff); |
| 24578 | 24587 | } |
| 24579 | 24588 | pNew = sqlite3GlobalConfig.m.xRealloc(pOld, nNew); |
| 24580 | 24589 | if( pNew==0 && mem0.alarmThreshold>0 ){ |
| | @@ -78764,11 +78773,11 @@ |
| 78764 | 78773 | break; |
| 78765 | 78774 | } |
| 78766 | 78775 | p->rc = pOp->p1; |
| 78767 | 78776 | p->errorAction = (u8)pOp->p2; |
| 78768 | 78777 | p->pc = pcx; |
| 78769 | | - assert( pOp->p5>=0 && pOp->p5<=4 ); |
| 78778 | + assert( pOp->p5<=4 ); |
| 78770 | 78779 | if( p->rc ){ |
| 78771 | 78780 | if( pOp->p5 ){ |
| 78772 | 78781 | static const char * const azType[] = { "NOT NULL", "UNIQUE", "CHECK", |
| 78773 | 78782 | "FOREIGN KEY" }; |
| 78774 | 78783 | testcase( pOp->p5==1 ); |
| | @@ -81570,11 +81579,12 @@ |
| 81570 | 81579 | pC->seekOp = pOp->opcode; |
| 81571 | 81580 | #endif |
| 81572 | 81581 | |
| 81573 | 81582 | if( pC->isTable ){ |
| 81574 | 81583 | /* The BTREE_SEEK_EQ flag is only set on index cursors */ |
| 81575 | | - assert( sqlite3BtreeCursorHasHint(pC->uc.pCursor, BTREE_SEEK_EQ)==0 ); |
| 81584 | + assert( sqlite3BtreeCursorHasHint(pC->uc.pCursor, BTREE_SEEK_EQ)==0 |
| 81585 | + || CORRUPT_DB ); |
| 81576 | 81586 | |
| 81577 | 81587 | /* The input value in P3 might be of any type: integer, real, string, |
| 81578 | 81588 | ** blob, or NULL. But it needs to be an integer before we can do |
| 81579 | 81589 | ** the seek, so convert it. */ |
| 81580 | 81590 | pIn3 = &aMem[pOp->p3]; |
| | @@ -140448,11 +140458,11 @@ |
| 140448 | 140458 | /* |
| 140449 | 140459 | ** Cause any pending operation to stop at its earliest opportunity. |
| 140450 | 140460 | */ |
| 140451 | 140461 | SQLITE_API void sqlite3_interrupt(sqlite3 *db){ |
| 140452 | 140462 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 140453 | | - if( !sqlite3SafetyCheckOk(db) ){ |
| 140463 | + if( !sqlite3SafetyCheckOk(db) && (db==0 || db->magic!=SQLITE_MAGIC_ZOMBIE) ){ |
| 140454 | 140464 | (void)SQLITE_MISUSE_BKPT; |
| 140455 | 140465 | return; |
| 140456 | 140466 | } |
| 140457 | 140467 | #endif |
| 140458 | 140468 | db->u1.isInterrupted = 1; |
| | @@ -196750,11 +196760,11 @@ |
| 196750 | 196760 | int nArg, /* Number of args */ |
| 196751 | 196761 | sqlite3_value **apUnused /* Function arguments */ |
| 196752 | 196762 | ){ |
| 196753 | 196763 | assert( nArg==0 ); |
| 196754 | 196764 | UNUSED_PARAM2(nArg, apUnused); |
| 196755 | | - sqlite3_result_text(pCtx, "fts5: 2016-12-23 16:05:22 2940661b8c014b94973e05c44f1b1f4f443dbdd3", -1, SQLITE_TRANSIENT); |
| 196765 | + sqlite3_result_text(pCtx, "fts5: 2016-12-29 19:48:46 afcdc4a60e357d171156e0de705bf7ad1b37daab", -1, SQLITE_TRANSIENT); |
| 196756 | 196766 | } |
| 196757 | 196767 | |
| 196758 | 196768 | static int fts5Init(sqlite3 *db){ |
| 196759 | 196769 | static const sqlite3_module fts5Mod = { |
| 196760 | 196770 | /* iVersion */ 2, |
| 196761 | 196771 | |