Fossil SCM
Update the built-in SQLite to the 3.25.0 release.
Commit
048a6f80d33fd5a4aa9a218be233bf3f252cbaac4b351c30633dbda01d283d73
Parent
4b562158f6e8fe0…
2 files changed
+67
-40
+11
-10
+67
-40
| --- src/sqlite3.c | ||
| +++ src/sqlite3.c | ||
| @@ -1156,11 +1156,11 @@ | ||
| 1156 | 1156 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 1157 | 1157 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 1158 | 1158 | */ |
| 1159 | 1159 | #define SQLITE_VERSION "3.25.0" |
| 1160 | 1160 | #define SQLITE_VERSION_NUMBER 3025000 |
| 1161 | -#define SQLITE_SOURCE_ID "2018-09-10 19:34:06 74c381b573817d0212153278b5ee5d2238a27a727dcf7ee769365c47bb9fc40d" | |
| 1161 | +#define SQLITE_SOURCE_ID "2018-09-15 04:01:47 b63af6c3bd33152742648d5d2e8dc5d5fcbcdd27df409272b6aea00a6f761760" | |
| 1162 | 1162 | |
| 1163 | 1163 | /* |
| 1164 | 1164 | ** CAPI3REF: Run-Time Library Version Numbers |
| 1165 | 1165 | ** KEYWORDS: sqlite3_version sqlite3_sourceid |
| 1166 | 1166 | ** |
| @@ -2113,22 +2113,23 @@ | ||
| 2113 | 2113 | ** The [SQLITE_FCNTL_DATA_VERSION] opcode is used to detect changes to |
| 2114 | 2114 | ** a database file. The argument is a pointer to a 32-bit unsigned integer. |
| 2115 | 2115 | ** The "data version" for the pager is written into the pointer. The |
| 2116 | 2116 | ** "data version" changes whenever any change occurs to the corresponding |
| 2117 | 2117 | ** database file, either through SQL statements on the same database |
| 2118 | -** connection, or through transactions committed by separate database | |
| 2118 | +** connection or through transactions committed by separate database | |
| 2119 | 2119 | ** connections possibly in other processes. The [sqlite3_total_changes()] |
| 2120 | 2120 | ** interface can be used to find if any database on the connection has changed, |
| 2121 | -** but that interface response to changes on TEMP as well as MAIN and does | |
| 2121 | +** but that interface responds to changes on TEMP as well as MAIN and does | |
| 2122 | 2122 | ** not provide a mechanism to detect changes to MAIN only. Also, the |
| 2123 | -** [sqlite3_total_changes()] interface response to internal changes only and | |
| 2123 | +** [sqlite3_total_changes()] interface responds to internal changes only and | |
| 2124 | 2124 | ** omits changes made by other database connections. The |
| 2125 | 2125 | ** [PRAGMA data_version] command provide a mechanism to detect changes to |
| 2126 | 2126 | ** a single attached database that occur due to other database connections, |
| 2127 | -** but omits changes implemented by the database connection for which it is | |
| 2127 | +** but omits changes implemented by the database connection on which it is | |
| 2128 | 2128 | ** called. This file control is the only mechanism to detect changes that |
| 2129 | -** happen either internally or externally on a single database. | |
| 2129 | +** happen either internally or externally and that are associated with | |
| 2130 | +** a particular attached database. | |
| 2130 | 2131 | ** </ul> |
| 2131 | 2132 | */ |
| 2132 | 2133 | #define SQLITE_FCNTL_LOCKSTATE 1 |
| 2133 | 2134 | #define SQLITE_FCNTL_GET_LOCKPROXYFILE 2 |
| 2134 | 2135 | #define SQLITE_FCNTL_SET_LOCKPROXYFILE 3 |
| @@ -5762,11 +5763,11 @@ | ||
| 5762 | 5763 | ** SQL function or aggregate, pass NULL pointers for all three function |
| 5763 | 5764 | ** callbacks. |
| 5764 | 5765 | ** |
| 5765 | 5766 | ** ^The sixth, seventh, eighth and ninth parameters (xStep, xFinal, xValue |
| 5766 | 5767 | ** and xInverse) passed to sqlite3_create_window_function are pointers to |
| 5767 | -** C-lanugage callbacks that implement the new function. xStep and xFinal | |
| 5768 | +** C-language callbacks that implement the new function. xStep and xFinal | |
| 5768 | 5769 | ** must both be non-NULL. xValue and xInverse may either both be NULL, in |
| 5769 | 5770 | ** which case a regular aggregate function is created, or must both be |
| 5770 | 5771 | ** non-NULL, in which case the new function may be used as either an aggregate |
| 5771 | 5772 | ** or aggregate window function. More details regarding the implementation |
| 5772 | 5773 | ** of aggregate window functions are |
| @@ -10288,11 +10289,11 @@ | ||
| 10288 | 10289 | ** |
| 10289 | 10290 | ** The SQLITE_DESERIALIZE_FREEONCLOSE means that the database serialization |
| 10290 | 10291 | ** in the P argument is held in memory obtained from [sqlite3_malloc64()] |
| 10291 | 10292 | ** and that SQLite should take ownership of this memory and automatically |
| 10292 | 10293 | ** free it when it has finished using it. Without this flag, the caller |
| 10293 | -** is resposible for freeing any dynamically allocated memory. | |
| 10294 | +** is responsible for freeing any dynamically allocated memory. | |
| 10294 | 10295 | ** |
| 10295 | 10296 | ** The SQLITE_DESERIALIZE_RESIZEABLE flag means that SQLite is allowed to |
| 10296 | 10297 | ** grow the size of the database using calls to [sqlite3_realloc64()]. This |
| 10297 | 10298 | ** flag should only be used if SQLITE_DESERIALIZE_FREEONCLOSE is also used. |
| 10298 | 10299 | ** Without this flag, the deserialized database cannot increase in size beyond |
| @@ -12466,11 +12467,11 @@ | ||
| 12466 | 12467 | ** "place". |
| 12467 | 12468 | ** |
| 12468 | 12469 | ** This way, even if the tokenizer does not provide synonyms |
| 12469 | 12470 | ** when tokenizing query text (it should not - to do would be |
| 12470 | 12471 | ** inefficient), it doesn't matter if the user queries for |
| 12471 | -** 'first + place' or '1st + place', as there are entires in the | |
| 12472 | +** 'first + place' or '1st + place', as there are entries in the | |
| 12472 | 12473 | ** FTS index corresponding to both forms of the first token. |
| 12473 | 12474 | ** </ol> |
| 12474 | 12475 | ** |
| 12475 | 12476 | ** Whether it is parsing document or query text, any call to xToken that |
| 12476 | 12477 | ** specifies a <i>tflags</i> argument with the FTS5_TOKEN_COLOCATED bit |
| @@ -12494,11 +12495,11 @@ | ||
| 12494 | 12495 | ** |
| 12495 | 12496 | ** In many cases, method (1) above is the best approach. It does not add |
| 12496 | 12497 | ** extra data to the FTS index or require FTS5 to query for multiple terms, |
| 12497 | 12498 | ** so it is efficient in terms of disk space and query speed. However, it |
| 12498 | 12499 | ** does not support prefix queries very well. If, as suggested above, the |
| 12499 | -** token "first" is subsituted for "1st" by the tokenizer, then the query: | |
| 12500 | +** token "first" is substituted for "1st" by the tokenizer, then the query: | |
| 12500 | 12501 | ** |
| 12501 | 12502 | ** <codeblock> |
| 12502 | 12503 | ** ... MATCH '1s*'</codeblock> |
| 12503 | 12504 | ** |
| 12504 | 12505 | ** will not match documents that contain the token "1st" (as the tokenizer |
| @@ -18972,10 +18973,11 @@ | ||
| 18972 | 18973 | SQLITE_PRIVATE void sqlite3AlterFinishAddColumn(Parse *, Token *); |
| 18973 | 18974 | SQLITE_PRIVATE void sqlite3AlterBeginAddColumn(Parse *, SrcList *); |
| 18974 | 18975 | SQLITE_PRIVATE void *sqlite3RenameTokenMap(Parse*, void*, Token*); |
| 18975 | 18976 | SQLITE_PRIVATE void sqlite3RenameTokenRemap(Parse*, void *pTo, void *pFrom); |
| 18976 | 18977 | SQLITE_PRIVATE void sqlite3RenameExprUnmap(Parse*, Expr*); |
| 18978 | +SQLITE_PRIVATE void sqlite3RenameExprlistUnmap(Parse*, ExprList*); | |
| 18977 | 18979 | SQLITE_PRIVATE CollSeq *sqlite3GetCollSeq(Parse*, u8, CollSeq *, const char*); |
| 18978 | 18980 | SQLITE_PRIVATE char sqlite3AffinityType(const char*, Column*); |
| 18979 | 18981 | SQLITE_PRIVATE void sqlite3Analyze(Parse*, Token*, Token*); |
| 18980 | 18982 | SQLITE_PRIVATE int sqlite3InvokeBusyHandler(BusyHandler*, sqlite3_file*); |
| 18981 | 18983 | SQLITE_PRIVATE int sqlite3FindDb(sqlite3*, Token*); |
| @@ -27606,11 +27608,16 @@ | ||
| 27606 | 27608 | bufpt = va_arg(ap,char*); |
| 27607 | 27609 | } |
| 27608 | 27610 | if( bufpt==0 ){ |
| 27609 | 27611 | bufpt = ""; |
| 27610 | 27612 | }else if( xtype==etDYNSTRING ){ |
| 27611 | - if( pAccum->nChar==0 && pAccum->mxAlloc && width==0 && precision<0 ){ | |
| 27613 | + if( pAccum->nChar==0 | |
| 27614 | + && pAccum->mxAlloc | |
| 27615 | + && width==0 | |
| 27616 | + && precision<0 | |
| 27617 | + && pAccum->accError==0 | |
| 27618 | + ){ | |
| 27612 | 27619 | /* Special optimization for sqlite3_mprintf("%z..."): |
| 27613 | 27620 | ** Extend an existing memory allocation rather than creating |
| 27614 | 27621 | ** a new one. */ |
| 27615 | 27622 | assert( (pAccum->printfFlags&SQLITE_PRINTF_MALLOCED)==0 ); |
| 27616 | 27623 | pAccum->zText = bufpt; |
| @@ -36968,11 +36975,13 @@ | ||
| 36968 | 36975 | static void unixShmBarrier( |
| 36969 | 36976 | sqlite3_file *fd /* Database file holding the shared memory */ |
| 36970 | 36977 | ){ |
| 36971 | 36978 | UNUSED_PARAMETER(fd); |
| 36972 | 36979 | sqlite3MemoryBarrier(); /* compiler-defined memory barrier */ |
| 36973 | - assert( unixFileMutexNotheld((unixFile*)fd) ); | |
| 36980 | + assert( fd->pMethods->xLock==nolockLock | |
| 36981 | + || unixFileMutexNotheld((unixFile*)fd) | |
| 36982 | + ); | |
| 36974 | 36983 | unixEnterMutex(); /* Also mutex, for redundancy */ |
| 36975 | 36984 | unixLeaveMutex(); |
| 36976 | 36985 | } |
| 36977 | 36986 | |
| 36978 | 36987 | /* |
| @@ -46285,12 +46294,12 @@ | ||
| 46285 | 46294 | ** block of memory. |
| 46286 | 46295 | ** |
| 46287 | 46296 | ** This file also implements interface sqlite3_serialize() and |
| 46288 | 46297 | ** sqlite3_deserialize(). |
| 46289 | 46298 | */ |
| 46290 | -#ifdef SQLITE_ENABLE_DESERIALIZE | |
| 46291 | 46299 | /* #include "sqliteInt.h" */ |
| 46300 | +#ifdef SQLITE_ENABLE_DESERIALIZE | |
| 46292 | 46301 | |
| 46293 | 46302 | /* |
| 46294 | 46303 | ** Forward declaration of objects used by this utility |
| 46295 | 46304 | */ |
| 46296 | 46305 | typedef struct sqlite3_vfs MemVfs; |
| @@ -60507,11 +60516,11 @@ | ||
| 60507 | 60516 | ** Other threads might append new content to the WAL and wal-index but |
| 60508 | 60517 | ** that extra content is ignored by the current thread. |
| 60509 | 60518 | ** |
| 60510 | 60519 | ** If the database contents have changes since the previous read |
| 60511 | 60520 | ** transaction, then *pChanged is set to 1 before returning. The |
| 60512 | -** Pager layer will use this to know that is cache is stale and | |
| 60521 | +** Pager layer will use this to know that its cache is stale and | |
| 60513 | 60522 | ** needs to be flushed. |
| 60514 | 60523 | */ |
| 60515 | 60524 | SQLITE_PRIVATE int sqlite3WalBeginReadTransaction(Wal *pWal, int *pChanged){ |
| 60516 | 60525 | int rc; /* Return code */ |
| 60517 | 60526 | int cnt = 0; /* Number of TryBeginRead attempts */ |
| @@ -78538,11 +78547,11 @@ | ||
| 78538 | 78547 | ** error, then it might not have been halted properly. So halt |
| 78539 | 78548 | ** it now. |
| 78540 | 78549 | */ |
| 78541 | 78550 | sqlite3VdbeHalt(p); |
| 78542 | 78551 | |
| 78543 | - /* If the VDBE has be run even partially, then transfer the error code | |
| 78552 | + /* If the VDBE has been run even partially, then transfer the error code | |
| 78544 | 78553 | ** and error message from the VDBE into the main database structure. But |
| 78545 | 78554 | ** if the VDBE has just been set to run but has not actually executed any |
| 78546 | 78555 | ** instructions yet, leave the main database error information unchanged. |
| 78547 | 78556 | */ |
| 78548 | 78557 | if( p->pc>=0 ){ |
| @@ -101161,11 +101170,11 @@ | ||
| 101161 | 101170 | ** bTemp is not true, database "temp", can still be parsed. This is |
| 101162 | 101171 | ** called at the end of the generation of an ALTER TABLE ... RENAME ... |
| 101163 | 101172 | ** statement to ensure that the operation has not rendered any schema |
| 101164 | 101173 | ** objects unusable. |
| 101165 | 101174 | */ |
| 101166 | -void renameTestSchema(Parse *pParse, const char *zDb, int bTemp){ | |
| 101175 | +static void renameTestSchema(Parse *pParse, const char *zDb, int bTemp){ | |
| 101167 | 101176 | sqlite3NestedParse(pParse, |
| 101168 | 101177 | "SELECT 1 " |
| 101169 | 101178 | "FROM \"%w\".%s " |
| 101170 | 101179 | "WHERE name NOT LIKE 'sqlite_%%'" |
| 101171 | 101180 | " AND sql NOT LIKE 'create virtual%%'" |
| @@ -101188,11 +101197,11 @@ | ||
| 101188 | 101197 | |
| 101189 | 101198 | /* |
| 101190 | 101199 | ** Generate code to reload the schema for database iDb. And, if iDb!=1, for |
| 101191 | 101200 | ** the temp database as well. |
| 101192 | 101201 | */ |
| 101193 | -void renameReloadSchema(Parse *pParse, int iDb){ | |
| 101202 | +static void renameReloadSchema(Parse *pParse, int iDb){ | |
| 101194 | 101203 | Vdbe *v = pParse->pVdbe; |
| 101195 | 101204 | if( v ){ |
| 101196 | 101205 | sqlite3ChangeCookie(pParse, iDb); |
| 101197 | 101206 | sqlite3VdbeAddParseSchemaOp(pParse->pVdbe, iDb, 0); |
| 101198 | 101207 | if( iDb!=1 ) sqlite3VdbeAddParseSchemaOp(pParse->pVdbe, 1, 0); |
| @@ -101768,11 +101777,11 @@ | ||
| 101768 | 101777 | ** if( x==y ) ... |
| 101769 | 101778 | ** |
| 101770 | 101779 | ** Technically, as x no longer points into a valid object or to the byte |
| 101771 | 101780 | ** following a valid object, it may not be used in comparison operations. |
| 101772 | 101781 | */ |
| 101773 | -void renameTokenCheckAll(Parse *pParse, void *pPtr){ | |
| 101782 | +static void renameTokenCheckAll(Parse *pParse, void *pPtr){ | |
| 101774 | 101783 | if( pParse->nErr==0 && pParse->db->mallocFailed==0 ){ |
| 101775 | 101784 | RenameToken *p; |
| 101776 | 101785 | u8 i = 0; |
| 101777 | 101786 | for(p=pParse->pRename; p; p=p->pNext){ |
| 101778 | 101787 | if( p->p ){ |
| @@ -101840,10 +101849,28 @@ | ||
| 101840 | 101849 | memset(&sWalker, 0, sizeof(Walker)); |
| 101841 | 101850 | sWalker.pParse = pParse; |
| 101842 | 101851 | sWalker.xExprCallback = renameUnmapExprCb; |
| 101843 | 101852 | sqlite3WalkExpr(&sWalker, pExpr); |
| 101844 | 101853 | } |
| 101854 | + | |
| 101855 | +/* | |
| 101856 | +** Remove all nodes that are part of expression-list pEList from the | |
| 101857 | +** rename list. | |
| 101858 | +*/ | |
| 101859 | +SQLITE_PRIVATE void sqlite3RenameExprlistUnmap(Parse *pParse, ExprList *pEList){ | |
| 101860 | + if( pEList ){ | |
| 101861 | + int i; | |
| 101862 | + Walker sWalker; | |
| 101863 | + memset(&sWalker, 0, sizeof(Walker)); | |
| 101864 | + sWalker.pParse = pParse; | |
| 101865 | + sWalker.xExprCallback = renameUnmapExprCb; | |
| 101866 | + sqlite3WalkExprList(&sWalker, pEList); | |
| 101867 | + for(i=0; i<pEList->nExpr; i++){ | |
| 101868 | + sqlite3RenameTokenRemap(pParse, 0, (void*)pEList->a[i].zName); | |
| 101869 | + } | |
| 101870 | + } | |
| 101871 | +} | |
| 101845 | 101872 | |
| 101846 | 101873 | /* |
| 101847 | 101874 | ** Free the list of RenameToken objects given in the second argument |
| 101848 | 101875 | */ |
| 101849 | 101876 | static void renameTokenFree(sqlite3 *db, RenameToken *pToken){ |
| @@ -107746,10 +107773,13 @@ | ||
| 107746 | 107773 | /* Use sqlite3EndTable() to add the view to the SQLITE_MASTER table */ |
| 107747 | 107774 | sqlite3EndTable(pParse, 0, &sEnd, 0, 0); |
| 107748 | 107775 | |
| 107749 | 107776 | create_view_fail: |
| 107750 | 107777 | sqlite3SelectDelete(db, pSelect); |
| 107778 | + if( IN_RENAME_OBJECT ){ | |
| 107779 | + sqlite3RenameExprlistUnmap(pParse, pCNames); | |
| 107780 | + } | |
| 107751 | 107781 | sqlite3ExprListDelete(db, pCNames); |
| 107752 | 107782 | return; |
| 107753 | 107783 | } |
| 107754 | 107784 | #endif /* SQLITE_OMIT_VIEW */ |
| 107755 | 107785 | |
| @@ -135329,15 +135359,12 @@ | ||
| 135329 | 135359 | static int codeCursorHintFixExpr(Walker *pWalker, Expr *pExpr){ |
| 135330 | 135360 | int rc = WRC_Continue; |
| 135331 | 135361 | struct CCurHint *pHint = pWalker->u.pCCurHint; |
| 135332 | 135362 | if( pExpr->op==TK_COLUMN ){ |
| 135333 | 135363 | if( pExpr->iTable!=pHint->iTabCur ){ |
| 135334 | - Vdbe *v = pWalker->pParse->pVdbe; | |
| 135335 | 135364 | int reg = ++pWalker->pParse->nMem; /* Register for column value */ |
| 135336 | - sqlite3ExprCodeGetColumnOfTable( | |
| 135337 | - v, pExpr->pTab, pExpr->iTable, pExpr->iColumn, reg | |
| 135338 | - ); | |
| 135365 | + sqlite3ExprCode(pWalker->pParse, pExpr, reg); | |
| 135339 | 135366 | pExpr->op = TK_REGISTER; |
| 135340 | 135367 | pExpr->iTable = reg; |
| 135341 | 135368 | }else if( pHint->pIdx!=0 ){ |
| 135342 | 135369 | pExpr->iTable = pHint->iIdxCur; |
| 135343 | 135370 | pExpr->iColumn = sqlite3ColumnOfIndex(pHint->pIdx, pExpr->iColumn); |
| @@ -177353,15 +177380,15 @@ | ||
| 177353 | 177380 | jsonAppendChar(pStr, ']'); |
| 177354 | 177381 | if( pStr->bErr ){ |
| 177355 | 177382 | if( pStr->bErr==1 ) sqlite3_result_error_nomem(ctx); |
| 177356 | 177383 | assert( pStr->bStatic ); |
| 177357 | 177384 | }else if( isFinal ){ |
| 177358 | - sqlite3_result_text(ctx, pStr->zBuf, pStr->nUsed, | |
| 177385 | + sqlite3_result_text(ctx, pStr->zBuf, (int)pStr->nUsed, | |
| 177359 | 177386 | pStr->bStatic ? SQLITE_TRANSIENT : sqlite3_free); |
| 177360 | 177387 | pStr->bStatic = 1; |
| 177361 | 177388 | }else{ |
| 177362 | - sqlite3_result_text(ctx, pStr->zBuf, pStr->nUsed, SQLITE_TRANSIENT); | |
| 177389 | + sqlite3_result_text(ctx, pStr->zBuf, (int)pStr->nUsed, SQLITE_TRANSIENT); | |
| 177363 | 177390 | pStr->nUsed--; |
| 177364 | 177391 | } |
| 177365 | 177392 | }else{ |
| 177366 | 177393 | sqlite3_result_text(ctx, "[]", 2, SQLITE_STATIC); |
| 177367 | 177394 | } |
| @@ -177406,11 +177433,11 @@ | ||
| 177406 | 177433 | }else if( z[i]=='\\' ){ |
| 177407 | 177434 | i++; |
| 177408 | 177435 | } |
| 177409 | 177436 | } |
| 177410 | 177437 | pStr->nUsed -= i; |
| 177411 | - memmove(&z[1], &z[i+1], pStr->nUsed-1); | |
| 177438 | + memmove(&z[1], &z[i+1], (size_t)pStr->nUsed-1); | |
| 177412 | 177439 | } |
| 177413 | 177440 | #else |
| 177414 | 177441 | # define jsonGroupInverse 0 |
| 177415 | 177442 | #endif |
| 177416 | 177443 | |
| @@ -177452,15 +177479,15 @@ | ||
| 177452 | 177479 | jsonAppendChar(pStr, '}'); |
| 177453 | 177480 | if( pStr->bErr ){ |
| 177454 | 177481 | if( pStr->bErr==1 ) sqlite3_result_error_nomem(ctx); |
| 177455 | 177482 | assert( pStr->bStatic ); |
| 177456 | 177483 | }else if( isFinal ){ |
| 177457 | - sqlite3_result_text(ctx, pStr->zBuf, pStr->nUsed, | |
| 177484 | + sqlite3_result_text(ctx, pStr->zBuf, (int)pStr->nUsed, | |
| 177458 | 177485 | pStr->bStatic ? SQLITE_TRANSIENT : sqlite3_free); |
| 177459 | 177486 | pStr->bStatic = 1; |
| 177460 | 177487 | }else{ |
| 177461 | - sqlite3_result_text(ctx, pStr->zBuf, pStr->nUsed, SQLITE_TRANSIENT); | |
| 177488 | + sqlite3_result_text(ctx, pStr->zBuf, (int)pStr->nUsed, SQLITE_TRANSIENT); | |
| 177462 | 177489 | pStr->nUsed--; |
| 177463 | 177490 | } |
| 177464 | 177491 | }else{ |
| 177465 | 177492 | sqlite3_result_text(ctx, "{}", 2, SQLITE_STATIC); |
| 177466 | 177493 | } |
| @@ -181310,11 +181337,11 @@ | ||
| 181310 | 181337 | ** DROP TABLE <tablename>; -- Would fail with SQLITE_LOCKED |
| 181311 | 181338 | ** COMMIT; |
| 181312 | 181339 | */ |
| 181313 | 181340 | static int rtreeSavepoint(sqlite3_vtab *pVtab, int iSavepoint){ |
| 181314 | 181341 | Rtree *pRtree = (Rtree *)pVtab; |
| 181315 | - int iwt = pRtree->inWrTrans; | |
| 181342 | + u8 iwt = pRtree->inWrTrans; | |
| 181316 | 181343 | UNUSED_PARAMETER(iSavepoint); |
| 181317 | 181344 | pRtree->inWrTrans = 0; |
| 181318 | 181345 | nodeBlobReset(pRtree); |
| 181319 | 181346 | pRtree->inWrTrans = iwt; |
| 181320 | 181347 | return SQLITE_OK; |
| @@ -182450,11 +182477,11 @@ | ||
| 182450 | 182477 | continue; |
| 182451 | 182478 | } |
| 182452 | 182479 | break; |
| 182453 | 182480 | } |
| 182454 | 182481 | if( z[j-1]<'0' ) return 0; |
| 182455 | - if( pVal ) *pVal = atof((const char*)p->z); | |
| 182482 | + if( pVal ) *pVal = (GeoCoord)atof((const char*)p->z); | |
| 182456 | 182483 | p->z += j; |
| 182457 | 182484 | return 1; |
| 182458 | 182485 | } |
| 182459 | 182486 | |
| 182460 | 182487 | /* |
| @@ -182705,12 +182732,12 @@ | ||
| 182705 | 182732 | int ii; |
| 182706 | 182733 | if( p ){ |
| 182707 | 182734 | for(ii=0; ii<p->nVertex; ii++){ |
| 182708 | 182735 | x0 = p->a[ii*2]; |
| 182709 | 182736 | y0 = p->a[ii*2+1]; |
| 182710 | - x1 = A*x0 + B*y0 + E; | |
| 182711 | - y1 = C*x0 + D*y0 + F; | |
| 182737 | + x1 = (GeoCoord)(A*x0 + B*y0 + E); | |
| 182738 | + y1 = (GeoCoord)(C*x0 + D*y0 + F); | |
| 182712 | 182739 | p->a[ii*2] = x1; |
| 182713 | 182740 | p->a[ii*2+1] = y1; |
| 182714 | 182741 | } |
| 182715 | 182742 | sqlite3_result_blob(context, p->hdr, |
| 182716 | 182743 | 4+8*p->nVertex, SQLITE_TRANSIENT); |
| @@ -182781,15 +182808,15 @@ | ||
| 182781 | 182808 | int ii; |
| 182782 | 182809 | mnX = mxX = p->a[0]; |
| 182783 | 182810 | mnY = mxY = p->a[1]; |
| 182784 | 182811 | for(ii=1; ii<p->nVertex; ii++){ |
| 182785 | 182812 | double r = p->a[ii*2]; |
| 182786 | - if( r<mnX ) mnX = r; | |
| 182787 | - else if( r>mxX ) mxX = r; | |
| 182813 | + if( r<mnX ) mnX = (float)r; | |
| 182814 | + else if( r>mxX ) mxX = (float)r; | |
| 182788 | 182815 | r = p->a[ii*2+1]; |
| 182789 | - if( r<mnY ) mnY = r; | |
| 182790 | - else if( r>mxY ) mxY = r; | |
| 182816 | + if( r<mnY ) mnY = (float)r; | |
| 182817 | + else if( r>mxY ) mxY = (float)r; | |
| 182791 | 182818 | } |
| 182792 | 182819 | if( pRc ) *pRc = SQLITE_OK; |
| 182793 | 182820 | if( aCoord==0 ){ |
| 182794 | 182821 | geopolyBboxFill: |
| 182795 | 182822 | pOut = sqlite3_realloc(p, sizeof(GeoPoly)+sizeof(GeoCoord)*6); |
| @@ -197385,11 +197412,11 @@ | ||
| 197385 | 197412 | ** "place". |
| 197386 | 197413 | ** |
| 197387 | 197414 | ** This way, even if the tokenizer does not provide synonyms |
| 197388 | 197415 | ** when tokenizing query text (it should not - to do would be |
| 197389 | 197416 | ** inefficient), it doesn't matter if the user queries for |
| 197390 | -** 'first + place' or '1st + place', as there are entires in the | |
| 197417 | +** 'first + place' or '1st + place', as there are entries in the | |
| 197391 | 197418 | ** FTS index corresponding to both forms of the first token. |
| 197392 | 197419 | ** </ol> |
| 197393 | 197420 | ** |
| 197394 | 197421 | ** Whether it is parsing document or query text, any call to xToken that |
| 197395 | 197422 | ** specifies a <i>tflags</i> argument with the FTS5_TOKEN_COLOCATED bit |
| @@ -197413,11 +197440,11 @@ | ||
| 197413 | 197440 | ** |
| 197414 | 197441 | ** In many cases, method (1) above is the best approach. It does not add |
| 197415 | 197442 | ** extra data to the FTS index or require FTS5 to query for multiple terms, |
| 197416 | 197443 | ** so it is efficient in terms of disk space and query speed. However, it |
| 197417 | 197444 | ** does not support prefix queries very well. If, as suggested above, the |
| 197418 | -** token "first" is subsituted for "1st" by the tokenizer, then the query: | |
| 197445 | +** token "first" is substituted for "1st" by the tokenizer, then the query: | |
| 197419 | 197446 | ** |
| 197420 | 197447 | ** <codeblock> |
| 197421 | 197448 | ** ... MATCH '1s*'</codeblock> |
| 197422 | 197449 | ** |
| 197423 | 197450 | ** will not match documents that contain the token "1st" (as the tokenizer |
| @@ -214387,11 +214414,11 @@ | ||
| 214387 | 214414 | int nArg, /* Number of args */ |
| 214388 | 214415 | sqlite3_value **apUnused /* Function arguments */ |
| 214389 | 214416 | ){ |
| 214390 | 214417 | assert( nArg==0 ); |
| 214391 | 214418 | UNUSED_PARAM2(nArg, apUnused); |
| 214392 | - sqlite3_result_text(pCtx, "fts5: 2018-09-10 16:38:25 564fa75195c5179d0bc86431aaff06136fc65ec63aa9839cd1114b1fbfac928b", -1, SQLITE_TRANSIENT); | |
| 214419 | + sqlite3_result_text(pCtx, "fts5: 2018-09-15 04:01:47 b63af6c3bd33152742648d5d2e8dc5d5fcbcdd27df409272b6aea00a6f761760", -1, SQLITE_TRANSIENT); | |
| 214393 | 214420 | } |
| 214394 | 214421 | |
| 214395 | 214422 | static int fts5Init(sqlite3 *db){ |
| 214396 | 214423 | static const sqlite3_module fts5Mod = { |
| 214397 | 214424 | /* iVersion */ 2, |
| @@ -219097,12 +219124,12 @@ | ||
| 219097 | 219124 | } |
| 219098 | 219125 | #endif /* SQLITE_CORE */ |
| 219099 | 219126 | #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_STMTVTAB) */ |
| 219100 | 219127 | |
| 219101 | 219128 | /************** End of stmt.c ************************************************/ |
| 219102 | -#if __LINE__!=219102 | |
| 219129 | +#if __LINE__!=219129 | |
| 219103 | 219130 | #undef SQLITE_SOURCE_ID |
| 219104 | -#define SQLITE_SOURCE_ID "2018-09-10 19:34:06 74c381b573817d0212153278b5ee5d2238a27a727dcf7ee769365c47bb9falt2" | |
| 219131 | +#define SQLITE_SOURCE_ID "2018-09-15 04:01:47 b63af6c3bd33152742648d5d2e8dc5d5fcbcdd27df409272b6aea00a6f76alt2" | |
| 219105 | 219132 | #endif |
| 219106 | 219133 | /* Return the source-id for this library */ |
| 219107 | 219134 | SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; } |
| 219108 | 219135 | /************************** End of sqlite3.c ******************************/ |
| 219109 | 219136 |
| --- src/sqlite3.c | |
| +++ src/sqlite3.c | |
| @@ -1156,11 +1156,11 @@ | |
| 1156 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 1157 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 1158 | */ |
| 1159 | #define SQLITE_VERSION "3.25.0" |
| 1160 | #define SQLITE_VERSION_NUMBER 3025000 |
| 1161 | #define SQLITE_SOURCE_ID "2018-09-10 19:34:06 74c381b573817d0212153278b5ee5d2238a27a727dcf7ee769365c47bb9fc40d" |
| 1162 | |
| 1163 | /* |
| 1164 | ** CAPI3REF: Run-Time Library Version Numbers |
| 1165 | ** KEYWORDS: sqlite3_version sqlite3_sourceid |
| 1166 | ** |
| @@ -2113,22 +2113,23 @@ | |
| 2113 | ** The [SQLITE_FCNTL_DATA_VERSION] opcode is used to detect changes to |
| 2114 | ** a database file. The argument is a pointer to a 32-bit unsigned integer. |
| 2115 | ** The "data version" for the pager is written into the pointer. The |
| 2116 | ** "data version" changes whenever any change occurs to the corresponding |
| 2117 | ** database file, either through SQL statements on the same database |
| 2118 | ** connection, or through transactions committed by separate database |
| 2119 | ** connections possibly in other processes. The [sqlite3_total_changes()] |
| 2120 | ** interface can be used to find if any database on the connection has changed, |
| 2121 | ** but that interface response to changes on TEMP as well as MAIN and does |
| 2122 | ** not provide a mechanism to detect changes to MAIN only. Also, the |
| 2123 | ** [sqlite3_total_changes()] interface response to internal changes only and |
| 2124 | ** omits changes made by other database connections. The |
| 2125 | ** [PRAGMA data_version] command provide a mechanism to detect changes to |
| 2126 | ** a single attached database that occur due to other database connections, |
| 2127 | ** but omits changes implemented by the database connection for which it is |
| 2128 | ** called. This file control is the only mechanism to detect changes that |
| 2129 | ** happen either internally or externally on a single database. |
| 2130 | ** </ul> |
| 2131 | */ |
| 2132 | #define SQLITE_FCNTL_LOCKSTATE 1 |
| 2133 | #define SQLITE_FCNTL_GET_LOCKPROXYFILE 2 |
| 2134 | #define SQLITE_FCNTL_SET_LOCKPROXYFILE 3 |
| @@ -5762,11 +5763,11 @@ | |
| 5762 | ** SQL function or aggregate, pass NULL pointers for all three function |
| 5763 | ** callbacks. |
| 5764 | ** |
| 5765 | ** ^The sixth, seventh, eighth and ninth parameters (xStep, xFinal, xValue |
| 5766 | ** and xInverse) passed to sqlite3_create_window_function are pointers to |
| 5767 | ** C-lanugage callbacks that implement the new function. xStep and xFinal |
| 5768 | ** must both be non-NULL. xValue and xInverse may either both be NULL, in |
| 5769 | ** which case a regular aggregate function is created, or must both be |
| 5770 | ** non-NULL, in which case the new function may be used as either an aggregate |
| 5771 | ** or aggregate window function. More details regarding the implementation |
| 5772 | ** of aggregate window functions are |
| @@ -10288,11 +10289,11 @@ | |
| 10288 | ** |
| 10289 | ** The SQLITE_DESERIALIZE_FREEONCLOSE means that the database serialization |
| 10290 | ** in the P argument is held in memory obtained from [sqlite3_malloc64()] |
| 10291 | ** and that SQLite should take ownership of this memory and automatically |
| 10292 | ** free it when it has finished using it. Without this flag, the caller |
| 10293 | ** is resposible for freeing any dynamically allocated memory. |
| 10294 | ** |
| 10295 | ** The SQLITE_DESERIALIZE_RESIZEABLE flag means that SQLite is allowed to |
| 10296 | ** grow the size of the database using calls to [sqlite3_realloc64()]. This |
| 10297 | ** flag should only be used if SQLITE_DESERIALIZE_FREEONCLOSE is also used. |
| 10298 | ** Without this flag, the deserialized database cannot increase in size beyond |
| @@ -12466,11 +12467,11 @@ | |
| 12466 | ** "place". |
| 12467 | ** |
| 12468 | ** This way, even if the tokenizer does not provide synonyms |
| 12469 | ** when tokenizing query text (it should not - to do would be |
| 12470 | ** inefficient), it doesn't matter if the user queries for |
| 12471 | ** 'first + place' or '1st + place', as there are entires in the |
| 12472 | ** FTS index corresponding to both forms of the first token. |
| 12473 | ** </ol> |
| 12474 | ** |
| 12475 | ** Whether it is parsing document or query text, any call to xToken that |
| 12476 | ** specifies a <i>tflags</i> argument with the FTS5_TOKEN_COLOCATED bit |
| @@ -12494,11 +12495,11 @@ | |
| 12494 | ** |
| 12495 | ** In many cases, method (1) above is the best approach. It does not add |
| 12496 | ** extra data to the FTS index or require FTS5 to query for multiple terms, |
| 12497 | ** so it is efficient in terms of disk space and query speed. However, it |
| 12498 | ** does not support prefix queries very well. If, as suggested above, the |
| 12499 | ** token "first" is subsituted for "1st" by the tokenizer, then the query: |
| 12500 | ** |
| 12501 | ** <codeblock> |
| 12502 | ** ... MATCH '1s*'</codeblock> |
| 12503 | ** |
| 12504 | ** will not match documents that contain the token "1st" (as the tokenizer |
| @@ -18972,10 +18973,11 @@ | |
| 18972 | SQLITE_PRIVATE void sqlite3AlterFinishAddColumn(Parse *, Token *); |
| 18973 | SQLITE_PRIVATE void sqlite3AlterBeginAddColumn(Parse *, SrcList *); |
| 18974 | SQLITE_PRIVATE void *sqlite3RenameTokenMap(Parse*, void*, Token*); |
| 18975 | SQLITE_PRIVATE void sqlite3RenameTokenRemap(Parse*, void *pTo, void *pFrom); |
| 18976 | SQLITE_PRIVATE void sqlite3RenameExprUnmap(Parse*, Expr*); |
| 18977 | SQLITE_PRIVATE CollSeq *sqlite3GetCollSeq(Parse*, u8, CollSeq *, const char*); |
| 18978 | SQLITE_PRIVATE char sqlite3AffinityType(const char*, Column*); |
| 18979 | SQLITE_PRIVATE void sqlite3Analyze(Parse*, Token*, Token*); |
| 18980 | SQLITE_PRIVATE int sqlite3InvokeBusyHandler(BusyHandler*, sqlite3_file*); |
| 18981 | SQLITE_PRIVATE int sqlite3FindDb(sqlite3*, Token*); |
| @@ -27606,11 +27608,16 @@ | |
| 27606 | bufpt = va_arg(ap,char*); |
| 27607 | } |
| 27608 | if( bufpt==0 ){ |
| 27609 | bufpt = ""; |
| 27610 | }else if( xtype==etDYNSTRING ){ |
| 27611 | if( pAccum->nChar==0 && pAccum->mxAlloc && width==0 && precision<0 ){ |
| 27612 | /* Special optimization for sqlite3_mprintf("%z..."): |
| 27613 | ** Extend an existing memory allocation rather than creating |
| 27614 | ** a new one. */ |
| 27615 | assert( (pAccum->printfFlags&SQLITE_PRINTF_MALLOCED)==0 ); |
| 27616 | pAccum->zText = bufpt; |
| @@ -36968,11 +36975,13 @@ | |
| 36968 | static void unixShmBarrier( |
| 36969 | sqlite3_file *fd /* Database file holding the shared memory */ |
| 36970 | ){ |
| 36971 | UNUSED_PARAMETER(fd); |
| 36972 | sqlite3MemoryBarrier(); /* compiler-defined memory barrier */ |
| 36973 | assert( unixFileMutexNotheld((unixFile*)fd) ); |
| 36974 | unixEnterMutex(); /* Also mutex, for redundancy */ |
| 36975 | unixLeaveMutex(); |
| 36976 | } |
| 36977 | |
| 36978 | /* |
| @@ -46285,12 +46294,12 @@ | |
| 46285 | ** block of memory. |
| 46286 | ** |
| 46287 | ** This file also implements interface sqlite3_serialize() and |
| 46288 | ** sqlite3_deserialize(). |
| 46289 | */ |
| 46290 | #ifdef SQLITE_ENABLE_DESERIALIZE |
| 46291 | /* #include "sqliteInt.h" */ |
| 46292 | |
| 46293 | /* |
| 46294 | ** Forward declaration of objects used by this utility |
| 46295 | */ |
| 46296 | typedef struct sqlite3_vfs MemVfs; |
| @@ -60507,11 +60516,11 @@ | |
| 60507 | ** Other threads might append new content to the WAL and wal-index but |
| 60508 | ** that extra content is ignored by the current thread. |
| 60509 | ** |
| 60510 | ** If the database contents have changes since the previous read |
| 60511 | ** transaction, then *pChanged is set to 1 before returning. The |
| 60512 | ** Pager layer will use this to know that is cache is stale and |
| 60513 | ** needs to be flushed. |
| 60514 | */ |
| 60515 | SQLITE_PRIVATE int sqlite3WalBeginReadTransaction(Wal *pWal, int *pChanged){ |
| 60516 | int rc; /* Return code */ |
| 60517 | int cnt = 0; /* Number of TryBeginRead attempts */ |
| @@ -78538,11 +78547,11 @@ | |
| 78538 | ** error, then it might not have been halted properly. So halt |
| 78539 | ** it now. |
| 78540 | */ |
| 78541 | sqlite3VdbeHalt(p); |
| 78542 | |
| 78543 | /* If the VDBE has be run even partially, then transfer the error code |
| 78544 | ** and error message from the VDBE into the main database structure. But |
| 78545 | ** if the VDBE has just been set to run but has not actually executed any |
| 78546 | ** instructions yet, leave the main database error information unchanged. |
| 78547 | */ |
| 78548 | if( p->pc>=0 ){ |
| @@ -101161,11 +101170,11 @@ | |
| 101161 | ** bTemp is not true, database "temp", can still be parsed. This is |
| 101162 | ** called at the end of the generation of an ALTER TABLE ... RENAME ... |
| 101163 | ** statement to ensure that the operation has not rendered any schema |
| 101164 | ** objects unusable. |
| 101165 | */ |
| 101166 | void renameTestSchema(Parse *pParse, const char *zDb, int bTemp){ |
| 101167 | sqlite3NestedParse(pParse, |
| 101168 | "SELECT 1 " |
| 101169 | "FROM \"%w\".%s " |
| 101170 | "WHERE name NOT LIKE 'sqlite_%%'" |
| 101171 | " AND sql NOT LIKE 'create virtual%%'" |
| @@ -101188,11 +101197,11 @@ | |
| 101188 | |
| 101189 | /* |
| 101190 | ** Generate code to reload the schema for database iDb. And, if iDb!=1, for |
| 101191 | ** the temp database as well. |
| 101192 | */ |
| 101193 | void renameReloadSchema(Parse *pParse, int iDb){ |
| 101194 | Vdbe *v = pParse->pVdbe; |
| 101195 | if( v ){ |
| 101196 | sqlite3ChangeCookie(pParse, iDb); |
| 101197 | sqlite3VdbeAddParseSchemaOp(pParse->pVdbe, iDb, 0); |
| 101198 | if( iDb!=1 ) sqlite3VdbeAddParseSchemaOp(pParse->pVdbe, 1, 0); |
| @@ -101768,11 +101777,11 @@ | |
| 101768 | ** if( x==y ) ... |
| 101769 | ** |
| 101770 | ** Technically, as x no longer points into a valid object or to the byte |
| 101771 | ** following a valid object, it may not be used in comparison operations. |
| 101772 | */ |
| 101773 | void renameTokenCheckAll(Parse *pParse, void *pPtr){ |
| 101774 | if( pParse->nErr==0 && pParse->db->mallocFailed==0 ){ |
| 101775 | RenameToken *p; |
| 101776 | u8 i = 0; |
| 101777 | for(p=pParse->pRename; p; p=p->pNext){ |
| 101778 | if( p->p ){ |
| @@ -101840,10 +101849,28 @@ | |
| 101840 | memset(&sWalker, 0, sizeof(Walker)); |
| 101841 | sWalker.pParse = pParse; |
| 101842 | sWalker.xExprCallback = renameUnmapExprCb; |
| 101843 | sqlite3WalkExpr(&sWalker, pExpr); |
| 101844 | } |
| 101845 | |
| 101846 | /* |
| 101847 | ** Free the list of RenameToken objects given in the second argument |
| 101848 | */ |
| 101849 | static void renameTokenFree(sqlite3 *db, RenameToken *pToken){ |
| @@ -107746,10 +107773,13 @@ | |
| 107746 | /* Use sqlite3EndTable() to add the view to the SQLITE_MASTER table */ |
| 107747 | sqlite3EndTable(pParse, 0, &sEnd, 0, 0); |
| 107748 | |
| 107749 | create_view_fail: |
| 107750 | sqlite3SelectDelete(db, pSelect); |
| 107751 | sqlite3ExprListDelete(db, pCNames); |
| 107752 | return; |
| 107753 | } |
| 107754 | #endif /* SQLITE_OMIT_VIEW */ |
| 107755 | |
| @@ -135329,15 +135359,12 @@ | |
| 135329 | static int codeCursorHintFixExpr(Walker *pWalker, Expr *pExpr){ |
| 135330 | int rc = WRC_Continue; |
| 135331 | struct CCurHint *pHint = pWalker->u.pCCurHint; |
| 135332 | if( pExpr->op==TK_COLUMN ){ |
| 135333 | if( pExpr->iTable!=pHint->iTabCur ){ |
| 135334 | Vdbe *v = pWalker->pParse->pVdbe; |
| 135335 | int reg = ++pWalker->pParse->nMem; /* Register for column value */ |
| 135336 | sqlite3ExprCodeGetColumnOfTable( |
| 135337 | v, pExpr->pTab, pExpr->iTable, pExpr->iColumn, reg |
| 135338 | ); |
| 135339 | pExpr->op = TK_REGISTER; |
| 135340 | pExpr->iTable = reg; |
| 135341 | }else if( pHint->pIdx!=0 ){ |
| 135342 | pExpr->iTable = pHint->iIdxCur; |
| 135343 | pExpr->iColumn = sqlite3ColumnOfIndex(pHint->pIdx, pExpr->iColumn); |
| @@ -177353,15 +177380,15 @@ | |
| 177353 | jsonAppendChar(pStr, ']'); |
| 177354 | if( pStr->bErr ){ |
| 177355 | if( pStr->bErr==1 ) sqlite3_result_error_nomem(ctx); |
| 177356 | assert( pStr->bStatic ); |
| 177357 | }else if( isFinal ){ |
| 177358 | sqlite3_result_text(ctx, pStr->zBuf, pStr->nUsed, |
| 177359 | pStr->bStatic ? SQLITE_TRANSIENT : sqlite3_free); |
| 177360 | pStr->bStatic = 1; |
| 177361 | }else{ |
| 177362 | sqlite3_result_text(ctx, pStr->zBuf, pStr->nUsed, SQLITE_TRANSIENT); |
| 177363 | pStr->nUsed--; |
| 177364 | } |
| 177365 | }else{ |
| 177366 | sqlite3_result_text(ctx, "[]", 2, SQLITE_STATIC); |
| 177367 | } |
| @@ -177406,11 +177433,11 @@ | |
| 177406 | }else if( z[i]=='\\' ){ |
| 177407 | i++; |
| 177408 | } |
| 177409 | } |
| 177410 | pStr->nUsed -= i; |
| 177411 | memmove(&z[1], &z[i+1], pStr->nUsed-1); |
| 177412 | } |
| 177413 | #else |
| 177414 | # define jsonGroupInverse 0 |
| 177415 | #endif |
| 177416 | |
| @@ -177452,15 +177479,15 @@ | |
| 177452 | jsonAppendChar(pStr, '}'); |
| 177453 | if( pStr->bErr ){ |
| 177454 | if( pStr->bErr==1 ) sqlite3_result_error_nomem(ctx); |
| 177455 | assert( pStr->bStatic ); |
| 177456 | }else if( isFinal ){ |
| 177457 | sqlite3_result_text(ctx, pStr->zBuf, pStr->nUsed, |
| 177458 | pStr->bStatic ? SQLITE_TRANSIENT : sqlite3_free); |
| 177459 | pStr->bStatic = 1; |
| 177460 | }else{ |
| 177461 | sqlite3_result_text(ctx, pStr->zBuf, pStr->nUsed, SQLITE_TRANSIENT); |
| 177462 | pStr->nUsed--; |
| 177463 | } |
| 177464 | }else{ |
| 177465 | sqlite3_result_text(ctx, "{}", 2, SQLITE_STATIC); |
| 177466 | } |
| @@ -181310,11 +181337,11 @@ | |
| 181310 | ** DROP TABLE <tablename>; -- Would fail with SQLITE_LOCKED |
| 181311 | ** COMMIT; |
| 181312 | */ |
| 181313 | static int rtreeSavepoint(sqlite3_vtab *pVtab, int iSavepoint){ |
| 181314 | Rtree *pRtree = (Rtree *)pVtab; |
| 181315 | int iwt = pRtree->inWrTrans; |
| 181316 | UNUSED_PARAMETER(iSavepoint); |
| 181317 | pRtree->inWrTrans = 0; |
| 181318 | nodeBlobReset(pRtree); |
| 181319 | pRtree->inWrTrans = iwt; |
| 181320 | return SQLITE_OK; |
| @@ -182450,11 +182477,11 @@ | |
| 182450 | continue; |
| 182451 | } |
| 182452 | break; |
| 182453 | } |
| 182454 | if( z[j-1]<'0' ) return 0; |
| 182455 | if( pVal ) *pVal = atof((const char*)p->z); |
| 182456 | p->z += j; |
| 182457 | return 1; |
| 182458 | } |
| 182459 | |
| 182460 | /* |
| @@ -182705,12 +182732,12 @@ | |
| 182705 | int ii; |
| 182706 | if( p ){ |
| 182707 | for(ii=0; ii<p->nVertex; ii++){ |
| 182708 | x0 = p->a[ii*2]; |
| 182709 | y0 = p->a[ii*2+1]; |
| 182710 | x1 = A*x0 + B*y0 + E; |
| 182711 | y1 = C*x0 + D*y0 + F; |
| 182712 | p->a[ii*2] = x1; |
| 182713 | p->a[ii*2+1] = y1; |
| 182714 | } |
| 182715 | sqlite3_result_blob(context, p->hdr, |
| 182716 | 4+8*p->nVertex, SQLITE_TRANSIENT); |
| @@ -182781,15 +182808,15 @@ | |
| 182781 | int ii; |
| 182782 | mnX = mxX = p->a[0]; |
| 182783 | mnY = mxY = p->a[1]; |
| 182784 | for(ii=1; ii<p->nVertex; ii++){ |
| 182785 | double r = p->a[ii*2]; |
| 182786 | if( r<mnX ) mnX = r; |
| 182787 | else if( r>mxX ) mxX = r; |
| 182788 | r = p->a[ii*2+1]; |
| 182789 | if( r<mnY ) mnY = r; |
| 182790 | else if( r>mxY ) mxY = r; |
| 182791 | } |
| 182792 | if( pRc ) *pRc = SQLITE_OK; |
| 182793 | if( aCoord==0 ){ |
| 182794 | geopolyBboxFill: |
| 182795 | pOut = sqlite3_realloc(p, sizeof(GeoPoly)+sizeof(GeoCoord)*6); |
| @@ -197385,11 +197412,11 @@ | |
| 197385 | ** "place". |
| 197386 | ** |
| 197387 | ** This way, even if the tokenizer does not provide synonyms |
| 197388 | ** when tokenizing query text (it should not - to do would be |
| 197389 | ** inefficient), it doesn't matter if the user queries for |
| 197390 | ** 'first + place' or '1st + place', as there are entires in the |
| 197391 | ** FTS index corresponding to both forms of the first token. |
| 197392 | ** </ol> |
| 197393 | ** |
| 197394 | ** Whether it is parsing document or query text, any call to xToken that |
| 197395 | ** specifies a <i>tflags</i> argument with the FTS5_TOKEN_COLOCATED bit |
| @@ -197413,11 +197440,11 @@ | |
| 197413 | ** |
| 197414 | ** In many cases, method (1) above is the best approach. It does not add |
| 197415 | ** extra data to the FTS index or require FTS5 to query for multiple terms, |
| 197416 | ** so it is efficient in terms of disk space and query speed. However, it |
| 197417 | ** does not support prefix queries very well. If, as suggested above, the |
| 197418 | ** token "first" is subsituted for "1st" by the tokenizer, then the query: |
| 197419 | ** |
| 197420 | ** <codeblock> |
| 197421 | ** ... MATCH '1s*'</codeblock> |
| 197422 | ** |
| 197423 | ** will not match documents that contain the token "1st" (as the tokenizer |
| @@ -214387,11 +214414,11 @@ | |
| 214387 | int nArg, /* Number of args */ |
| 214388 | sqlite3_value **apUnused /* Function arguments */ |
| 214389 | ){ |
| 214390 | assert( nArg==0 ); |
| 214391 | UNUSED_PARAM2(nArg, apUnused); |
| 214392 | sqlite3_result_text(pCtx, "fts5: 2018-09-10 16:38:25 564fa75195c5179d0bc86431aaff06136fc65ec63aa9839cd1114b1fbfac928b", -1, SQLITE_TRANSIENT); |
| 214393 | } |
| 214394 | |
| 214395 | static int fts5Init(sqlite3 *db){ |
| 214396 | static const sqlite3_module fts5Mod = { |
| 214397 | /* iVersion */ 2, |
| @@ -219097,12 +219124,12 @@ | |
| 219097 | } |
| 219098 | #endif /* SQLITE_CORE */ |
| 219099 | #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_STMTVTAB) */ |
| 219100 | |
| 219101 | /************** End of stmt.c ************************************************/ |
| 219102 | #if __LINE__!=219102 |
| 219103 | #undef SQLITE_SOURCE_ID |
| 219104 | #define SQLITE_SOURCE_ID "2018-09-10 19:34:06 74c381b573817d0212153278b5ee5d2238a27a727dcf7ee769365c47bb9falt2" |
| 219105 | #endif |
| 219106 | /* Return the source-id for this library */ |
| 219107 | SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; } |
| 219108 | /************************** End of sqlite3.c ******************************/ |
| 219109 |
| --- src/sqlite3.c | |
| +++ src/sqlite3.c | |
| @@ -1156,11 +1156,11 @@ | |
| 1156 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 1157 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 1158 | */ |
| 1159 | #define SQLITE_VERSION "3.25.0" |
| 1160 | #define SQLITE_VERSION_NUMBER 3025000 |
| 1161 | #define SQLITE_SOURCE_ID "2018-09-15 04:01:47 b63af6c3bd33152742648d5d2e8dc5d5fcbcdd27df409272b6aea00a6f761760" |
| 1162 | |
| 1163 | /* |
| 1164 | ** CAPI3REF: Run-Time Library Version Numbers |
| 1165 | ** KEYWORDS: sqlite3_version sqlite3_sourceid |
| 1166 | ** |
| @@ -2113,22 +2113,23 @@ | |
| 2113 | ** The [SQLITE_FCNTL_DATA_VERSION] opcode is used to detect changes to |
| 2114 | ** a database file. The argument is a pointer to a 32-bit unsigned integer. |
| 2115 | ** The "data version" for the pager is written into the pointer. The |
| 2116 | ** "data version" changes whenever any change occurs to the corresponding |
| 2117 | ** database file, either through SQL statements on the same database |
| 2118 | ** connection or through transactions committed by separate database |
| 2119 | ** connections possibly in other processes. The [sqlite3_total_changes()] |
| 2120 | ** interface can be used to find if any database on the connection has changed, |
| 2121 | ** but that interface responds to changes on TEMP as well as MAIN and does |
| 2122 | ** not provide a mechanism to detect changes to MAIN only. Also, the |
| 2123 | ** [sqlite3_total_changes()] interface responds to internal changes only and |
| 2124 | ** omits changes made by other database connections. The |
| 2125 | ** [PRAGMA data_version] command provide a mechanism to detect changes to |
| 2126 | ** a single attached database that occur due to other database connections, |
| 2127 | ** but omits changes implemented by the database connection on which it is |
| 2128 | ** called. This file control is the only mechanism to detect changes that |
| 2129 | ** happen either internally or externally and that are associated with |
| 2130 | ** a particular attached database. |
| 2131 | ** </ul> |
| 2132 | */ |
| 2133 | #define SQLITE_FCNTL_LOCKSTATE 1 |
| 2134 | #define SQLITE_FCNTL_GET_LOCKPROXYFILE 2 |
| 2135 | #define SQLITE_FCNTL_SET_LOCKPROXYFILE 3 |
| @@ -5762,11 +5763,11 @@ | |
| 5763 | ** SQL function or aggregate, pass NULL pointers for all three function |
| 5764 | ** callbacks. |
| 5765 | ** |
| 5766 | ** ^The sixth, seventh, eighth and ninth parameters (xStep, xFinal, xValue |
| 5767 | ** and xInverse) passed to sqlite3_create_window_function are pointers to |
| 5768 | ** C-language callbacks that implement the new function. xStep and xFinal |
| 5769 | ** must both be non-NULL. xValue and xInverse may either both be NULL, in |
| 5770 | ** which case a regular aggregate function is created, or must both be |
| 5771 | ** non-NULL, in which case the new function may be used as either an aggregate |
| 5772 | ** or aggregate window function. More details regarding the implementation |
| 5773 | ** of aggregate window functions are |
| @@ -10288,11 +10289,11 @@ | |
| 10289 | ** |
| 10290 | ** The SQLITE_DESERIALIZE_FREEONCLOSE means that the database serialization |
| 10291 | ** in the P argument is held in memory obtained from [sqlite3_malloc64()] |
| 10292 | ** and that SQLite should take ownership of this memory and automatically |
| 10293 | ** free it when it has finished using it. Without this flag, the caller |
| 10294 | ** is responsible for freeing any dynamically allocated memory. |
| 10295 | ** |
| 10296 | ** The SQLITE_DESERIALIZE_RESIZEABLE flag means that SQLite is allowed to |
| 10297 | ** grow the size of the database using calls to [sqlite3_realloc64()]. This |
| 10298 | ** flag should only be used if SQLITE_DESERIALIZE_FREEONCLOSE is also used. |
| 10299 | ** Without this flag, the deserialized database cannot increase in size beyond |
| @@ -12466,11 +12467,11 @@ | |
| 12467 | ** "place". |
| 12468 | ** |
| 12469 | ** This way, even if the tokenizer does not provide synonyms |
| 12470 | ** when tokenizing query text (it should not - to do would be |
| 12471 | ** inefficient), it doesn't matter if the user queries for |
| 12472 | ** 'first + place' or '1st + place', as there are entries in the |
| 12473 | ** FTS index corresponding to both forms of the first token. |
| 12474 | ** </ol> |
| 12475 | ** |
| 12476 | ** Whether it is parsing document or query text, any call to xToken that |
| 12477 | ** specifies a <i>tflags</i> argument with the FTS5_TOKEN_COLOCATED bit |
| @@ -12494,11 +12495,11 @@ | |
| 12495 | ** |
| 12496 | ** In many cases, method (1) above is the best approach. It does not add |
| 12497 | ** extra data to the FTS index or require FTS5 to query for multiple terms, |
| 12498 | ** so it is efficient in terms of disk space and query speed. However, it |
| 12499 | ** does not support prefix queries very well. If, as suggested above, the |
| 12500 | ** token "first" is substituted for "1st" by the tokenizer, then the query: |
| 12501 | ** |
| 12502 | ** <codeblock> |
| 12503 | ** ... MATCH '1s*'</codeblock> |
| 12504 | ** |
| 12505 | ** will not match documents that contain the token "1st" (as the tokenizer |
| @@ -18972,10 +18973,11 @@ | |
| 18973 | SQLITE_PRIVATE void sqlite3AlterFinishAddColumn(Parse *, Token *); |
| 18974 | SQLITE_PRIVATE void sqlite3AlterBeginAddColumn(Parse *, SrcList *); |
| 18975 | SQLITE_PRIVATE void *sqlite3RenameTokenMap(Parse*, void*, Token*); |
| 18976 | SQLITE_PRIVATE void sqlite3RenameTokenRemap(Parse*, void *pTo, void *pFrom); |
| 18977 | SQLITE_PRIVATE void sqlite3RenameExprUnmap(Parse*, Expr*); |
| 18978 | SQLITE_PRIVATE void sqlite3RenameExprlistUnmap(Parse*, ExprList*); |
| 18979 | SQLITE_PRIVATE CollSeq *sqlite3GetCollSeq(Parse*, u8, CollSeq *, const char*); |
| 18980 | SQLITE_PRIVATE char sqlite3AffinityType(const char*, Column*); |
| 18981 | SQLITE_PRIVATE void sqlite3Analyze(Parse*, Token*, Token*); |
| 18982 | SQLITE_PRIVATE int sqlite3InvokeBusyHandler(BusyHandler*, sqlite3_file*); |
| 18983 | SQLITE_PRIVATE int sqlite3FindDb(sqlite3*, Token*); |
| @@ -27606,11 +27608,16 @@ | |
| 27608 | bufpt = va_arg(ap,char*); |
| 27609 | } |
| 27610 | if( bufpt==0 ){ |
| 27611 | bufpt = ""; |
| 27612 | }else if( xtype==etDYNSTRING ){ |
| 27613 | if( pAccum->nChar==0 |
| 27614 | && pAccum->mxAlloc |
| 27615 | && width==0 |
| 27616 | && precision<0 |
| 27617 | && pAccum->accError==0 |
| 27618 | ){ |
| 27619 | /* Special optimization for sqlite3_mprintf("%z..."): |
| 27620 | ** Extend an existing memory allocation rather than creating |
| 27621 | ** a new one. */ |
| 27622 | assert( (pAccum->printfFlags&SQLITE_PRINTF_MALLOCED)==0 ); |
| 27623 | pAccum->zText = bufpt; |
| @@ -36968,11 +36975,13 @@ | |
| 36975 | static void unixShmBarrier( |
| 36976 | sqlite3_file *fd /* Database file holding the shared memory */ |
| 36977 | ){ |
| 36978 | UNUSED_PARAMETER(fd); |
| 36979 | sqlite3MemoryBarrier(); /* compiler-defined memory barrier */ |
| 36980 | assert( fd->pMethods->xLock==nolockLock |
| 36981 | || unixFileMutexNotheld((unixFile*)fd) |
| 36982 | ); |
| 36983 | unixEnterMutex(); /* Also mutex, for redundancy */ |
| 36984 | unixLeaveMutex(); |
| 36985 | } |
| 36986 | |
| 36987 | /* |
| @@ -46285,12 +46294,12 @@ | |
| 46294 | ** block of memory. |
| 46295 | ** |
| 46296 | ** This file also implements interface sqlite3_serialize() and |
| 46297 | ** sqlite3_deserialize(). |
| 46298 | */ |
| 46299 | /* #include "sqliteInt.h" */ |
| 46300 | #ifdef SQLITE_ENABLE_DESERIALIZE |
| 46301 | |
| 46302 | /* |
| 46303 | ** Forward declaration of objects used by this utility |
| 46304 | */ |
| 46305 | typedef struct sqlite3_vfs MemVfs; |
| @@ -60507,11 +60516,11 @@ | |
| 60516 | ** Other threads might append new content to the WAL and wal-index but |
| 60517 | ** that extra content is ignored by the current thread. |
| 60518 | ** |
| 60519 | ** If the database contents have changes since the previous read |
| 60520 | ** transaction, then *pChanged is set to 1 before returning. The |
| 60521 | ** Pager layer will use this to know that its cache is stale and |
| 60522 | ** needs to be flushed. |
| 60523 | */ |
| 60524 | SQLITE_PRIVATE int sqlite3WalBeginReadTransaction(Wal *pWal, int *pChanged){ |
| 60525 | int rc; /* Return code */ |
| 60526 | int cnt = 0; /* Number of TryBeginRead attempts */ |
| @@ -78538,11 +78547,11 @@ | |
| 78547 | ** error, then it might not have been halted properly. So halt |
| 78548 | ** it now. |
| 78549 | */ |
| 78550 | sqlite3VdbeHalt(p); |
| 78551 | |
| 78552 | /* If the VDBE has been run even partially, then transfer the error code |
| 78553 | ** and error message from the VDBE into the main database structure. But |
| 78554 | ** if the VDBE has just been set to run but has not actually executed any |
| 78555 | ** instructions yet, leave the main database error information unchanged. |
| 78556 | */ |
| 78557 | if( p->pc>=0 ){ |
| @@ -101161,11 +101170,11 @@ | |
| 101170 | ** bTemp is not true, database "temp", can still be parsed. This is |
| 101171 | ** called at the end of the generation of an ALTER TABLE ... RENAME ... |
| 101172 | ** statement to ensure that the operation has not rendered any schema |
| 101173 | ** objects unusable. |
| 101174 | */ |
| 101175 | static void renameTestSchema(Parse *pParse, const char *zDb, int bTemp){ |
| 101176 | sqlite3NestedParse(pParse, |
| 101177 | "SELECT 1 " |
| 101178 | "FROM \"%w\".%s " |
| 101179 | "WHERE name NOT LIKE 'sqlite_%%'" |
| 101180 | " AND sql NOT LIKE 'create virtual%%'" |
| @@ -101188,11 +101197,11 @@ | |
| 101197 | |
| 101198 | /* |
| 101199 | ** Generate code to reload the schema for database iDb. And, if iDb!=1, for |
| 101200 | ** the temp database as well. |
| 101201 | */ |
| 101202 | static void renameReloadSchema(Parse *pParse, int iDb){ |
| 101203 | Vdbe *v = pParse->pVdbe; |
| 101204 | if( v ){ |
| 101205 | sqlite3ChangeCookie(pParse, iDb); |
| 101206 | sqlite3VdbeAddParseSchemaOp(pParse->pVdbe, iDb, 0); |
| 101207 | if( iDb!=1 ) sqlite3VdbeAddParseSchemaOp(pParse->pVdbe, 1, 0); |
| @@ -101768,11 +101777,11 @@ | |
| 101777 | ** if( x==y ) ... |
| 101778 | ** |
| 101779 | ** Technically, as x no longer points into a valid object or to the byte |
| 101780 | ** following a valid object, it may not be used in comparison operations. |
| 101781 | */ |
| 101782 | static void renameTokenCheckAll(Parse *pParse, void *pPtr){ |
| 101783 | if( pParse->nErr==0 && pParse->db->mallocFailed==0 ){ |
| 101784 | RenameToken *p; |
| 101785 | u8 i = 0; |
| 101786 | for(p=pParse->pRename; p; p=p->pNext){ |
| 101787 | if( p->p ){ |
| @@ -101840,10 +101849,28 @@ | |
| 101849 | memset(&sWalker, 0, sizeof(Walker)); |
| 101850 | sWalker.pParse = pParse; |
| 101851 | sWalker.xExprCallback = renameUnmapExprCb; |
| 101852 | sqlite3WalkExpr(&sWalker, pExpr); |
| 101853 | } |
| 101854 | |
| 101855 | /* |
| 101856 | ** Remove all nodes that are part of expression-list pEList from the |
| 101857 | ** rename list. |
| 101858 | */ |
| 101859 | SQLITE_PRIVATE void sqlite3RenameExprlistUnmap(Parse *pParse, ExprList *pEList){ |
| 101860 | if( pEList ){ |
| 101861 | int i; |
| 101862 | Walker sWalker; |
| 101863 | memset(&sWalker, 0, sizeof(Walker)); |
| 101864 | sWalker.pParse = pParse; |
| 101865 | sWalker.xExprCallback = renameUnmapExprCb; |
| 101866 | sqlite3WalkExprList(&sWalker, pEList); |
| 101867 | for(i=0; i<pEList->nExpr; i++){ |
| 101868 | sqlite3RenameTokenRemap(pParse, 0, (void*)pEList->a[i].zName); |
| 101869 | } |
| 101870 | } |
| 101871 | } |
| 101872 | |
| 101873 | /* |
| 101874 | ** Free the list of RenameToken objects given in the second argument |
| 101875 | */ |
| 101876 | static void renameTokenFree(sqlite3 *db, RenameToken *pToken){ |
| @@ -107746,10 +107773,13 @@ | |
| 107773 | /* Use sqlite3EndTable() to add the view to the SQLITE_MASTER table */ |
| 107774 | sqlite3EndTable(pParse, 0, &sEnd, 0, 0); |
| 107775 | |
| 107776 | create_view_fail: |
| 107777 | sqlite3SelectDelete(db, pSelect); |
| 107778 | if( IN_RENAME_OBJECT ){ |
| 107779 | sqlite3RenameExprlistUnmap(pParse, pCNames); |
| 107780 | } |
| 107781 | sqlite3ExprListDelete(db, pCNames); |
| 107782 | return; |
| 107783 | } |
| 107784 | #endif /* SQLITE_OMIT_VIEW */ |
| 107785 | |
| @@ -135329,15 +135359,12 @@ | |
| 135359 | static int codeCursorHintFixExpr(Walker *pWalker, Expr *pExpr){ |
| 135360 | int rc = WRC_Continue; |
| 135361 | struct CCurHint *pHint = pWalker->u.pCCurHint; |
| 135362 | if( pExpr->op==TK_COLUMN ){ |
| 135363 | if( pExpr->iTable!=pHint->iTabCur ){ |
| 135364 | int reg = ++pWalker->pParse->nMem; /* Register for column value */ |
| 135365 | sqlite3ExprCode(pWalker->pParse, pExpr, reg); |
| 135366 | pExpr->op = TK_REGISTER; |
| 135367 | pExpr->iTable = reg; |
| 135368 | }else if( pHint->pIdx!=0 ){ |
| 135369 | pExpr->iTable = pHint->iIdxCur; |
| 135370 | pExpr->iColumn = sqlite3ColumnOfIndex(pHint->pIdx, pExpr->iColumn); |
| @@ -177353,15 +177380,15 @@ | |
| 177380 | jsonAppendChar(pStr, ']'); |
| 177381 | if( pStr->bErr ){ |
| 177382 | if( pStr->bErr==1 ) sqlite3_result_error_nomem(ctx); |
| 177383 | assert( pStr->bStatic ); |
| 177384 | }else if( isFinal ){ |
| 177385 | sqlite3_result_text(ctx, pStr->zBuf, (int)pStr->nUsed, |
| 177386 | pStr->bStatic ? SQLITE_TRANSIENT : sqlite3_free); |
| 177387 | pStr->bStatic = 1; |
| 177388 | }else{ |
| 177389 | sqlite3_result_text(ctx, pStr->zBuf, (int)pStr->nUsed, SQLITE_TRANSIENT); |
| 177390 | pStr->nUsed--; |
| 177391 | } |
| 177392 | }else{ |
| 177393 | sqlite3_result_text(ctx, "[]", 2, SQLITE_STATIC); |
| 177394 | } |
| @@ -177406,11 +177433,11 @@ | |
| 177433 | }else if( z[i]=='\\' ){ |
| 177434 | i++; |
| 177435 | } |
| 177436 | } |
| 177437 | pStr->nUsed -= i; |
| 177438 | memmove(&z[1], &z[i+1], (size_t)pStr->nUsed-1); |
| 177439 | } |
| 177440 | #else |
| 177441 | # define jsonGroupInverse 0 |
| 177442 | #endif |
| 177443 | |
| @@ -177452,15 +177479,15 @@ | |
| 177479 | jsonAppendChar(pStr, '}'); |
| 177480 | if( pStr->bErr ){ |
| 177481 | if( pStr->bErr==1 ) sqlite3_result_error_nomem(ctx); |
| 177482 | assert( pStr->bStatic ); |
| 177483 | }else if( isFinal ){ |
| 177484 | sqlite3_result_text(ctx, pStr->zBuf, (int)pStr->nUsed, |
| 177485 | pStr->bStatic ? SQLITE_TRANSIENT : sqlite3_free); |
| 177486 | pStr->bStatic = 1; |
| 177487 | }else{ |
| 177488 | sqlite3_result_text(ctx, pStr->zBuf, (int)pStr->nUsed, SQLITE_TRANSIENT); |
| 177489 | pStr->nUsed--; |
| 177490 | } |
| 177491 | }else{ |
| 177492 | sqlite3_result_text(ctx, "{}", 2, SQLITE_STATIC); |
| 177493 | } |
| @@ -181310,11 +181337,11 @@ | |
| 181337 | ** DROP TABLE <tablename>; -- Would fail with SQLITE_LOCKED |
| 181338 | ** COMMIT; |
| 181339 | */ |
| 181340 | static int rtreeSavepoint(sqlite3_vtab *pVtab, int iSavepoint){ |
| 181341 | Rtree *pRtree = (Rtree *)pVtab; |
| 181342 | u8 iwt = pRtree->inWrTrans; |
| 181343 | UNUSED_PARAMETER(iSavepoint); |
| 181344 | pRtree->inWrTrans = 0; |
| 181345 | nodeBlobReset(pRtree); |
| 181346 | pRtree->inWrTrans = iwt; |
| 181347 | return SQLITE_OK; |
| @@ -182450,11 +182477,11 @@ | |
| 182477 | continue; |
| 182478 | } |
| 182479 | break; |
| 182480 | } |
| 182481 | if( z[j-1]<'0' ) return 0; |
| 182482 | if( pVal ) *pVal = (GeoCoord)atof((const char*)p->z); |
| 182483 | p->z += j; |
| 182484 | return 1; |
| 182485 | } |
| 182486 | |
| 182487 | /* |
| @@ -182705,12 +182732,12 @@ | |
| 182732 | int ii; |
| 182733 | if( p ){ |
| 182734 | for(ii=0; ii<p->nVertex; ii++){ |
| 182735 | x0 = p->a[ii*2]; |
| 182736 | y0 = p->a[ii*2+1]; |
| 182737 | x1 = (GeoCoord)(A*x0 + B*y0 + E); |
| 182738 | y1 = (GeoCoord)(C*x0 + D*y0 + F); |
| 182739 | p->a[ii*2] = x1; |
| 182740 | p->a[ii*2+1] = y1; |
| 182741 | } |
| 182742 | sqlite3_result_blob(context, p->hdr, |
| 182743 | 4+8*p->nVertex, SQLITE_TRANSIENT); |
| @@ -182781,15 +182808,15 @@ | |
| 182808 | int ii; |
| 182809 | mnX = mxX = p->a[0]; |
| 182810 | mnY = mxY = p->a[1]; |
| 182811 | for(ii=1; ii<p->nVertex; ii++){ |
| 182812 | double r = p->a[ii*2]; |
| 182813 | if( r<mnX ) mnX = (float)r; |
| 182814 | else if( r>mxX ) mxX = (float)r; |
| 182815 | r = p->a[ii*2+1]; |
| 182816 | if( r<mnY ) mnY = (float)r; |
| 182817 | else if( r>mxY ) mxY = (float)r; |
| 182818 | } |
| 182819 | if( pRc ) *pRc = SQLITE_OK; |
| 182820 | if( aCoord==0 ){ |
| 182821 | geopolyBboxFill: |
| 182822 | pOut = sqlite3_realloc(p, sizeof(GeoPoly)+sizeof(GeoCoord)*6); |
| @@ -197385,11 +197412,11 @@ | |
| 197412 | ** "place". |
| 197413 | ** |
| 197414 | ** This way, even if the tokenizer does not provide synonyms |
| 197415 | ** when tokenizing query text (it should not - to do would be |
| 197416 | ** inefficient), it doesn't matter if the user queries for |
| 197417 | ** 'first + place' or '1st + place', as there are entries in the |
| 197418 | ** FTS index corresponding to both forms of the first token. |
| 197419 | ** </ol> |
| 197420 | ** |
| 197421 | ** Whether it is parsing document or query text, any call to xToken that |
| 197422 | ** specifies a <i>tflags</i> argument with the FTS5_TOKEN_COLOCATED bit |
| @@ -197413,11 +197440,11 @@ | |
| 197440 | ** |
| 197441 | ** In many cases, method (1) above is the best approach. It does not add |
| 197442 | ** extra data to the FTS index or require FTS5 to query for multiple terms, |
| 197443 | ** so it is efficient in terms of disk space and query speed. However, it |
| 197444 | ** does not support prefix queries very well. If, as suggested above, the |
| 197445 | ** token "first" is substituted for "1st" by the tokenizer, then the query: |
| 197446 | ** |
| 197447 | ** <codeblock> |
| 197448 | ** ... MATCH '1s*'</codeblock> |
| 197449 | ** |
| 197450 | ** will not match documents that contain the token "1st" (as the tokenizer |
| @@ -214387,11 +214414,11 @@ | |
| 214414 | int nArg, /* Number of args */ |
| 214415 | sqlite3_value **apUnused /* Function arguments */ |
| 214416 | ){ |
| 214417 | assert( nArg==0 ); |
| 214418 | UNUSED_PARAM2(nArg, apUnused); |
| 214419 | sqlite3_result_text(pCtx, "fts5: 2018-09-15 04:01:47 b63af6c3bd33152742648d5d2e8dc5d5fcbcdd27df409272b6aea00a6f761760", -1, SQLITE_TRANSIENT); |
| 214420 | } |
| 214421 | |
| 214422 | static int fts5Init(sqlite3 *db){ |
| 214423 | static const sqlite3_module fts5Mod = { |
| 214424 | /* iVersion */ 2, |
| @@ -219097,12 +219124,12 @@ | |
| 219124 | } |
| 219125 | #endif /* SQLITE_CORE */ |
| 219126 | #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_STMTVTAB) */ |
| 219127 | |
| 219128 | /************** End of stmt.c ************************************************/ |
| 219129 | #if __LINE__!=219129 |
| 219130 | #undef SQLITE_SOURCE_ID |
| 219131 | #define SQLITE_SOURCE_ID "2018-09-15 04:01:47 b63af6c3bd33152742648d5d2e8dc5d5fcbcdd27df409272b6aea00a6f76alt2" |
| 219132 | #endif |
| 219133 | /* Return the source-id for this library */ |
| 219134 | SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; } |
| 219135 | /************************** End of sqlite3.c ******************************/ |
| 219136 |
+11
-10
| --- src/sqlite3.h | ||
| +++ src/sqlite3.h | ||
| @@ -123,11 +123,11 @@ | ||
| 123 | 123 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 124 | 124 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 125 | 125 | */ |
| 126 | 126 | #define SQLITE_VERSION "3.25.0" |
| 127 | 127 | #define SQLITE_VERSION_NUMBER 3025000 |
| 128 | -#define SQLITE_SOURCE_ID "2018-09-10 19:34:06 74c381b573817d0212153278b5ee5d2238a27a727dcf7ee769365c47bb9fc40d" | |
| 128 | +#define SQLITE_SOURCE_ID "2018-09-15 04:01:47 b63af6c3bd33152742648d5d2e8dc5d5fcbcdd27df409272b6aea00a6f761760" | |
| 129 | 129 | |
| 130 | 130 | /* |
| 131 | 131 | ** CAPI3REF: Run-Time Library Version Numbers |
| 132 | 132 | ** KEYWORDS: sqlite3_version sqlite3_sourceid |
| 133 | 133 | ** |
| @@ -1080,22 +1080,23 @@ | ||
| 1080 | 1080 | ** The [SQLITE_FCNTL_DATA_VERSION] opcode is used to detect changes to |
| 1081 | 1081 | ** a database file. The argument is a pointer to a 32-bit unsigned integer. |
| 1082 | 1082 | ** The "data version" for the pager is written into the pointer. The |
| 1083 | 1083 | ** "data version" changes whenever any change occurs to the corresponding |
| 1084 | 1084 | ** database file, either through SQL statements on the same database |
| 1085 | -** connection, or through transactions committed by separate database | |
| 1085 | +** connection or through transactions committed by separate database | |
| 1086 | 1086 | ** connections possibly in other processes. The [sqlite3_total_changes()] |
| 1087 | 1087 | ** interface can be used to find if any database on the connection has changed, |
| 1088 | -** but that interface response to changes on TEMP as well as MAIN and does | |
| 1088 | +** but that interface responds to changes on TEMP as well as MAIN and does | |
| 1089 | 1089 | ** not provide a mechanism to detect changes to MAIN only. Also, the |
| 1090 | -** [sqlite3_total_changes()] interface response to internal changes only and | |
| 1090 | +** [sqlite3_total_changes()] interface responds to internal changes only and | |
| 1091 | 1091 | ** omits changes made by other database connections. The |
| 1092 | 1092 | ** [PRAGMA data_version] command provide a mechanism to detect changes to |
| 1093 | 1093 | ** a single attached database that occur due to other database connections, |
| 1094 | -** but omits changes implemented by the database connection for which it is | |
| 1094 | +** but omits changes implemented by the database connection on which it is | |
| 1095 | 1095 | ** called. This file control is the only mechanism to detect changes that |
| 1096 | -** happen either internally or externally on a single database. | |
| 1096 | +** happen either internally or externally and that are associated with | |
| 1097 | +** a particular attached database. | |
| 1097 | 1098 | ** </ul> |
| 1098 | 1099 | */ |
| 1099 | 1100 | #define SQLITE_FCNTL_LOCKSTATE 1 |
| 1100 | 1101 | #define SQLITE_FCNTL_GET_LOCKPROXYFILE 2 |
| 1101 | 1102 | #define SQLITE_FCNTL_SET_LOCKPROXYFILE 3 |
| @@ -4729,11 +4730,11 @@ | ||
| 4729 | 4730 | ** SQL function or aggregate, pass NULL pointers for all three function |
| 4730 | 4731 | ** callbacks. |
| 4731 | 4732 | ** |
| 4732 | 4733 | ** ^The sixth, seventh, eighth and ninth parameters (xStep, xFinal, xValue |
| 4733 | 4734 | ** and xInverse) passed to sqlite3_create_window_function are pointers to |
| 4734 | -** C-lanugage callbacks that implement the new function. xStep and xFinal | |
| 4735 | +** C-language callbacks that implement the new function. xStep and xFinal | |
| 4735 | 4736 | ** must both be non-NULL. xValue and xInverse may either both be NULL, in |
| 4736 | 4737 | ** which case a regular aggregate function is created, or must both be |
| 4737 | 4738 | ** non-NULL, in which case the new function may be used as either an aggregate |
| 4738 | 4739 | ** or aggregate window function. More details regarding the implementation |
| 4739 | 4740 | ** of aggregate window functions are |
| @@ -9255,11 +9256,11 @@ | ||
| 9255 | 9256 | ** |
| 9256 | 9257 | ** The SQLITE_DESERIALIZE_FREEONCLOSE means that the database serialization |
| 9257 | 9258 | ** in the P argument is held in memory obtained from [sqlite3_malloc64()] |
| 9258 | 9259 | ** and that SQLite should take ownership of this memory and automatically |
| 9259 | 9260 | ** free it when it has finished using it. Without this flag, the caller |
| 9260 | -** is resposible for freeing any dynamically allocated memory. | |
| 9261 | +** is responsible for freeing any dynamically allocated memory. | |
| 9261 | 9262 | ** |
| 9262 | 9263 | ** The SQLITE_DESERIALIZE_RESIZEABLE flag means that SQLite is allowed to |
| 9263 | 9264 | ** grow the size of the database using calls to [sqlite3_realloc64()]. This |
| 9264 | 9265 | ** flag should only be used if SQLITE_DESERIALIZE_FREEONCLOSE is also used. |
| 9265 | 9266 | ** Without this flag, the deserialized database cannot increase in size beyond |
| @@ -11433,11 +11434,11 @@ | ||
| 11433 | 11434 | ** "place". |
| 11434 | 11435 | ** |
| 11435 | 11436 | ** This way, even if the tokenizer does not provide synonyms |
| 11436 | 11437 | ** when tokenizing query text (it should not - to do would be |
| 11437 | 11438 | ** inefficient), it doesn't matter if the user queries for |
| 11438 | -** 'first + place' or '1st + place', as there are entires in the | |
| 11439 | +** 'first + place' or '1st + place', as there are entries in the | |
| 11439 | 11440 | ** FTS index corresponding to both forms of the first token. |
| 11440 | 11441 | ** </ol> |
| 11441 | 11442 | ** |
| 11442 | 11443 | ** Whether it is parsing document or query text, any call to xToken that |
| 11443 | 11444 | ** specifies a <i>tflags</i> argument with the FTS5_TOKEN_COLOCATED bit |
| @@ -11461,11 +11462,11 @@ | ||
| 11461 | 11462 | ** |
| 11462 | 11463 | ** In many cases, method (1) above is the best approach. It does not add |
| 11463 | 11464 | ** extra data to the FTS index or require FTS5 to query for multiple terms, |
| 11464 | 11465 | ** so it is efficient in terms of disk space and query speed. However, it |
| 11465 | 11466 | ** does not support prefix queries very well. If, as suggested above, the |
| 11466 | -** token "first" is subsituted for "1st" by the tokenizer, then the query: | |
| 11467 | +** token "first" is substituted for "1st" by the tokenizer, then the query: | |
| 11467 | 11468 | ** |
| 11468 | 11469 | ** <codeblock> |
| 11469 | 11470 | ** ... MATCH '1s*'</codeblock> |
| 11470 | 11471 | ** |
| 11471 | 11472 | ** will not match documents that contain the token "1st" (as the tokenizer |
| 11472 | 11473 |
| --- src/sqlite3.h | |
| +++ src/sqlite3.h | |
| @@ -123,11 +123,11 @@ | |
| 123 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 124 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 125 | */ |
| 126 | #define SQLITE_VERSION "3.25.0" |
| 127 | #define SQLITE_VERSION_NUMBER 3025000 |
| 128 | #define SQLITE_SOURCE_ID "2018-09-10 19:34:06 74c381b573817d0212153278b5ee5d2238a27a727dcf7ee769365c47bb9fc40d" |
| 129 | |
| 130 | /* |
| 131 | ** CAPI3REF: Run-Time Library Version Numbers |
| 132 | ** KEYWORDS: sqlite3_version sqlite3_sourceid |
| 133 | ** |
| @@ -1080,22 +1080,23 @@ | |
| 1080 | ** The [SQLITE_FCNTL_DATA_VERSION] opcode is used to detect changes to |
| 1081 | ** a database file. The argument is a pointer to a 32-bit unsigned integer. |
| 1082 | ** The "data version" for the pager is written into the pointer. The |
| 1083 | ** "data version" changes whenever any change occurs to the corresponding |
| 1084 | ** database file, either through SQL statements on the same database |
| 1085 | ** connection, or through transactions committed by separate database |
| 1086 | ** connections possibly in other processes. The [sqlite3_total_changes()] |
| 1087 | ** interface can be used to find if any database on the connection has changed, |
| 1088 | ** but that interface response to changes on TEMP as well as MAIN and does |
| 1089 | ** not provide a mechanism to detect changes to MAIN only. Also, the |
| 1090 | ** [sqlite3_total_changes()] interface response to internal changes only and |
| 1091 | ** omits changes made by other database connections. The |
| 1092 | ** [PRAGMA data_version] command provide a mechanism to detect changes to |
| 1093 | ** a single attached database that occur due to other database connections, |
| 1094 | ** but omits changes implemented by the database connection for which it is |
| 1095 | ** called. This file control is the only mechanism to detect changes that |
| 1096 | ** happen either internally or externally on a single database. |
| 1097 | ** </ul> |
| 1098 | */ |
| 1099 | #define SQLITE_FCNTL_LOCKSTATE 1 |
| 1100 | #define SQLITE_FCNTL_GET_LOCKPROXYFILE 2 |
| 1101 | #define SQLITE_FCNTL_SET_LOCKPROXYFILE 3 |
| @@ -4729,11 +4730,11 @@ | |
| 4729 | ** SQL function or aggregate, pass NULL pointers for all three function |
| 4730 | ** callbacks. |
| 4731 | ** |
| 4732 | ** ^The sixth, seventh, eighth and ninth parameters (xStep, xFinal, xValue |
| 4733 | ** and xInverse) passed to sqlite3_create_window_function are pointers to |
| 4734 | ** C-lanugage callbacks that implement the new function. xStep and xFinal |
| 4735 | ** must both be non-NULL. xValue and xInverse may either both be NULL, in |
| 4736 | ** which case a regular aggregate function is created, or must both be |
| 4737 | ** non-NULL, in which case the new function may be used as either an aggregate |
| 4738 | ** or aggregate window function. More details regarding the implementation |
| 4739 | ** of aggregate window functions are |
| @@ -9255,11 +9256,11 @@ | |
| 9255 | ** |
| 9256 | ** The SQLITE_DESERIALIZE_FREEONCLOSE means that the database serialization |
| 9257 | ** in the P argument is held in memory obtained from [sqlite3_malloc64()] |
| 9258 | ** and that SQLite should take ownership of this memory and automatically |
| 9259 | ** free it when it has finished using it. Without this flag, the caller |
| 9260 | ** is resposible for freeing any dynamically allocated memory. |
| 9261 | ** |
| 9262 | ** The SQLITE_DESERIALIZE_RESIZEABLE flag means that SQLite is allowed to |
| 9263 | ** grow the size of the database using calls to [sqlite3_realloc64()]. This |
| 9264 | ** flag should only be used if SQLITE_DESERIALIZE_FREEONCLOSE is also used. |
| 9265 | ** Without this flag, the deserialized database cannot increase in size beyond |
| @@ -11433,11 +11434,11 @@ | |
| 11433 | ** "place". |
| 11434 | ** |
| 11435 | ** This way, even if the tokenizer does not provide synonyms |
| 11436 | ** when tokenizing query text (it should not - to do would be |
| 11437 | ** inefficient), it doesn't matter if the user queries for |
| 11438 | ** 'first + place' or '1st + place', as there are entires in the |
| 11439 | ** FTS index corresponding to both forms of the first token. |
| 11440 | ** </ol> |
| 11441 | ** |
| 11442 | ** Whether it is parsing document or query text, any call to xToken that |
| 11443 | ** specifies a <i>tflags</i> argument with the FTS5_TOKEN_COLOCATED bit |
| @@ -11461,11 +11462,11 @@ | |
| 11461 | ** |
| 11462 | ** In many cases, method (1) above is the best approach. It does not add |
| 11463 | ** extra data to the FTS index or require FTS5 to query for multiple terms, |
| 11464 | ** so it is efficient in terms of disk space and query speed. However, it |
| 11465 | ** does not support prefix queries very well. If, as suggested above, the |
| 11466 | ** token "first" is subsituted for "1st" by the tokenizer, then the query: |
| 11467 | ** |
| 11468 | ** <codeblock> |
| 11469 | ** ... MATCH '1s*'</codeblock> |
| 11470 | ** |
| 11471 | ** will not match documents that contain the token "1st" (as the tokenizer |
| 11472 |
| --- src/sqlite3.h | |
| +++ src/sqlite3.h | |
| @@ -123,11 +123,11 @@ | |
| 123 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 124 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 125 | */ |
| 126 | #define SQLITE_VERSION "3.25.0" |
| 127 | #define SQLITE_VERSION_NUMBER 3025000 |
| 128 | #define SQLITE_SOURCE_ID "2018-09-15 04:01:47 b63af6c3bd33152742648d5d2e8dc5d5fcbcdd27df409272b6aea00a6f761760" |
| 129 | |
| 130 | /* |
| 131 | ** CAPI3REF: Run-Time Library Version Numbers |
| 132 | ** KEYWORDS: sqlite3_version sqlite3_sourceid |
| 133 | ** |
| @@ -1080,22 +1080,23 @@ | |
| 1080 | ** The [SQLITE_FCNTL_DATA_VERSION] opcode is used to detect changes to |
| 1081 | ** a database file. The argument is a pointer to a 32-bit unsigned integer. |
| 1082 | ** The "data version" for the pager is written into the pointer. The |
| 1083 | ** "data version" changes whenever any change occurs to the corresponding |
| 1084 | ** database file, either through SQL statements on the same database |
| 1085 | ** connection or through transactions committed by separate database |
| 1086 | ** connections possibly in other processes. The [sqlite3_total_changes()] |
| 1087 | ** interface can be used to find if any database on the connection has changed, |
| 1088 | ** but that interface responds to changes on TEMP as well as MAIN and does |
| 1089 | ** not provide a mechanism to detect changes to MAIN only. Also, the |
| 1090 | ** [sqlite3_total_changes()] interface responds to internal changes only and |
| 1091 | ** omits changes made by other database connections. The |
| 1092 | ** [PRAGMA data_version] command provide a mechanism to detect changes to |
| 1093 | ** a single attached database that occur due to other database connections, |
| 1094 | ** but omits changes implemented by the database connection on which it is |
| 1095 | ** called. This file control is the only mechanism to detect changes that |
| 1096 | ** happen either internally or externally and that are associated with |
| 1097 | ** a particular attached database. |
| 1098 | ** </ul> |
| 1099 | */ |
| 1100 | #define SQLITE_FCNTL_LOCKSTATE 1 |
| 1101 | #define SQLITE_FCNTL_GET_LOCKPROXYFILE 2 |
| 1102 | #define SQLITE_FCNTL_SET_LOCKPROXYFILE 3 |
| @@ -4729,11 +4730,11 @@ | |
| 4730 | ** SQL function or aggregate, pass NULL pointers for all three function |
| 4731 | ** callbacks. |
| 4732 | ** |
| 4733 | ** ^The sixth, seventh, eighth and ninth parameters (xStep, xFinal, xValue |
| 4734 | ** and xInverse) passed to sqlite3_create_window_function are pointers to |
| 4735 | ** C-language callbacks that implement the new function. xStep and xFinal |
| 4736 | ** must both be non-NULL. xValue and xInverse may either both be NULL, in |
| 4737 | ** which case a regular aggregate function is created, or must both be |
| 4738 | ** non-NULL, in which case the new function may be used as either an aggregate |
| 4739 | ** or aggregate window function. More details regarding the implementation |
| 4740 | ** of aggregate window functions are |
| @@ -9255,11 +9256,11 @@ | |
| 9256 | ** |
| 9257 | ** The SQLITE_DESERIALIZE_FREEONCLOSE means that the database serialization |
| 9258 | ** in the P argument is held in memory obtained from [sqlite3_malloc64()] |
| 9259 | ** and that SQLite should take ownership of this memory and automatically |
| 9260 | ** free it when it has finished using it. Without this flag, the caller |
| 9261 | ** is responsible for freeing any dynamically allocated memory. |
| 9262 | ** |
| 9263 | ** The SQLITE_DESERIALIZE_RESIZEABLE flag means that SQLite is allowed to |
| 9264 | ** grow the size of the database using calls to [sqlite3_realloc64()]. This |
| 9265 | ** flag should only be used if SQLITE_DESERIALIZE_FREEONCLOSE is also used. |
| 9266 | ** Without this flag, the deserialized database cannot increase in size beyond |
| @@ -11433,11 +11434,11 @@ | |
| 11434 | ** "place". |
| 11435 | ** |
| 11436 | ** This way, even if the tokenizer does not provide synonyms |
| 11437 | ** when tokenizing query text (it should not - to do would be |
| 11438 | ** inefficient), it doesn't matter if the user queries for |
| 11439 | ** 'first + place' or '1st + place', as there are entries in the |
| 11440 | ** FTS index corresponding to both forms of the first token. |
| 11441 | ** </ol> |
| 11442 | ** |
| 11443 | ** Whether it is parsing document or query text, any call to xToken that |
| 11444 | ** specifies a <i>tflags</i> argument with the FTS5_TOKEN_COLOCATED bit |
| @@ -11461,11 +11462,11 @@ | |
| 11462 | ** |
| 11463 | ** In many cases, method (1) above is the best approach. It does not add |
| 11464 | ** extra data to the FTS index or require FTS5 to query for multiple terms, |
| 11465 | ** so it is efficient in terms of disk space and query speed. However, it |
| 11466 | ** does not support prefix queries very well. If, as suggested above, the |
| 11467 | ** token "first" is substituted for "1st" by the tokenizer, then the query: |
| 11468 | ** |
| 11469 | ** <codeblock> |
| 11470 | ** ... MATCH '1s*'</codeblock> |
| 11471 | ** |
| 11472 | ** will not match documents that contain the token "1st" (as the tokenizer |
| 11473 |