|
@@ -383,7 +383,7 @@ extern "C" {
|
|
|
*/
|
|
*/
|
|
|
#define SQLITE_VERSION "3.15.0"
|
|
#define SQLITE_VERSION "3.15.0"
|
|
|
#define SQLITE_VERSION_NUMBER 3015000
|
|
#define SQLITE_VERSION_NUMBER 3015000
|
|
|
-#define SQLITE_SOURCE_ID "2016-10-04 12:20:12 3a9d802fda10585654332b314d317250dc5d894e"
|
|
|
|
|
|
|
+#define SQLITE_SOURCE_ID "2016-10-05 20:14:29 b066637bb75959267fe6104da323c5112ad78f82"
|
|
|
|
|
|
|
|
/*
|
|
/*
|
|
|
** CAPI3REF: Run-Time Library Version Numbers
|
|
** CAPI3REF: Run-Time Library Version Numbers
|
|
@@ -69566,7 +69566,7 @@ SQLITE_PRIVATE void sqlite3VdbeMemCast(Mem *pMem, u8 aff, u8 encoding){
|
|
|
if( (pMem->flags & MEM_Blob)==0 ){
|
|
if( (pMem->flags & MEM_Blob)==0 ){
|
|
|
sqlite3ValueApplyAffinity(pMem, SQLITE_AFF_TEXT, encoding);
|
|
sqlite3ValueApplyAffinity(pMem, SQLITE_AFF_TEXT, encoding);
|
|
|
assert( pMem->flags & MEM_Str || pMem->db->mallocFailed );
|
|
assert( pMem->flags & MEM_Str || pMem->db->mallocFailed );
|
|
|
- MemSetTypeFlag(pMem, MEM_Blob);
|
|
|
|
|
|
|
+ if( pMem->flags & MEM_Str ) MemSetTypeFlag(pMem, MEM_Blob);
|
|
|
}else{
|
|
}else{
|
|
|
pMem->flags &= ~(MEM_TypeMask&~MEM_Blob);
|
|
pMem->flags &= ~(MEM_TypeMask&~MEM_Blob);
|
|
|
}
|
|
}
|
|
@@ -89043,7 +89043,6 @@ static int resolveExprStep(Walker *pWalker, Expr *pExpr){
|
|
|
u8 enc = ENC(pParse->db); /* The database encoding */
|
|
u8 enc = ENC(pParse->db); /* The database encoding */
|
|
|
|
|
|
|
|
assert( !ExprHasProperty(pExpr, EP_xIsSelect) );
|
|
assert( !ExprHasProperty(pExpr, EP_xIsSelect) );
|
|
|
-// notValid(pParse, pNC, "functions", NC_PartIdx);
|
|
|
|
|
zId = pExpr->u.zToken;
|
|
zId = pExpr->u.zToken;
|
|
|
nId = sqlite3Strlen30(zId);
|
|
nId = sqlite3Strlen30(zId);
|
|
|
pDef = sqlite3FindFunction(pParse->db, zId, n, enc, 0);
|
|
pDef = sqlite3FindFunction(pParse->db, zId, n, enc, 0);
|
|
@@ -97734,7 +97733,7 @@ static void attachFunc(
|
|
|
** * Specified database name already being used.
|
|
** * Specified database name already being used.
|
|
|
*/
|
|
*/
|
|
|
if( db->nDb>=db->aLimit[SQLITE_LIMIT_ATTACHED]+2 ){
|
|
if( db->nDb>=db->aLimit[SQLITE_LIMIT_ATTACHED]+2 ){
|
|
|
- zErrDyn = sqlite3MPrintf(db, "too many attached databases - max %d",
|
|
|
|
|
|
|
+ zErrDyn = sqlite3MPrintf(db, "too many attached databases - max %d",
|
|
|
db->aLimit[SQLITE_LIMIT_ATTACHED]
|
|
db->aLimit[SQLITE_LIMIT_ATTACHED]
|
|
|
);
|
|
);
|
|
|
goto attach_error;
|
|
goto attach_error;
|
|
@@ -97793,7 +97792,7 @@ static void attachFunc(
|
|
|
if( !aNew->pSchema ){
|
|
if( !aNew->pSchema ){
|
|
|
rc = SQLITE_NOMEM_BKPT;
|
|
rc = SQLITE_NOMEM_BKPT;
|
|
|
}else if( aNew->pSchema->file_format && aNew->pSchema->enc!=ENC(db) ){
|
|
}else if( aNew->pSchema->file_format && aNew->pSchema->enc!=ENC(db) ){
|
|
|
- zErrDyn = sqlite3MPrintf(db,
|
|
|
|
|
|
|
+ zErrDyn = sqlite3MPrintf(db,
|
|
|
"attached databases must use the same text encoding as main database");
|
|
"attached databases must use the same text encoding as main database");
|
|
|
rc = SQLITE_ERROR;
|
|
rc = SQLITE_ERROR;
|
|
|
}
|
|
}
|
|
@@ -97829,7 +97828,7 @@ static void attachFunc(
|
|
|
zErrDyn = sqlite3DbStrDup(db, "Invalid key value");
|
|
zErrDyn = sqlite3DbStrDup(db, "Invalid key value");
|
|
|
rc = SQLITE_ERROR;
|
|
rc = SQLITE_ERROR;
|
|
|
break;
|
|
break;
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
case SQLITE_TEXT:
|
|
case SQLITE_TEXT:
|
|
|
case SQLITE_BLOB:
|
|
case SQLITE_BLOB:
|
|
|
nKey = sqlite3_value_bytes(argv[2]);
|
|
nKey = sqlite3_value_bytes(argv[2]);
|
|
@@ -97849,7 +97848,7 @@ static void attachFunc(
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
/* If the file was opened successfully, read the schema for the new database.
|
|
/* If the file was opened successfully, read the schema for the new database.
|
|
|
- ** If this fails, or if opening the file failed, then close the file and
|
|
|
|
|
|
|
+ ** If this fails, or if opening the file failed, then close the file and
|
|
|
** remove the entry from the db->aDb[] array. i.e. put everything back the way
|
|
** remove the entry from the db->aDb[] array. i.e. put everything back the way
|
|
|
** we found it.
|
|
** we found it.
|
|
|
*/
|
|
*/
|
|
@@ -97886,7 +97885,7 @@ static void attachFunc(
|
|
|
}
|
|
}
|
|
|
goto attach_error;
|
|
goto attach_error;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
return;
|
|
return;
|
|
|
|
|
|
|
|
attach_error:
|
|
attach_error:
|
|
@@ -97976,7 +97975,7 @@ static void codeAttach(
|
|
|
memset(&sName, 0, sizeof(NameContext));
|
|
memset(&sName, 0, sizeof(NameContext));
|
|
|
sName.pParse = pParse;
|
|
sName.pParse = pParse;
|
|
|
|
|
|
|
|
- if(
|
|
|
|
|
|
|
+ if(
|
|
|
SQLITE_OK!=(rc = resolveAttachExpr(&sName, pFilename)) ||
|
|
SQLITE_OK!=(rc = resolveAttachExpr(&sName, pFilename)) ||
|
|
|
SQLITE_OK!=(rc = resolveAttachExpr(&sName, pDbname)) ||
|
|
SQLITE_OK!=(rc = resolveAttachExpr(&sName, pDbname)) ||
|
|
|
SQLITE_OK!=(rc = resolveAttachExpr(&sName, pKey))
|
|
SQLITE_OK!=(rc = resolveAttachExpr(&sName, pKey))
|
|
@@ -98012,14 +98011,14 @@ static void codeAttach(
|
|
|
(char *)pFunc, P4_FUNCDEF);
|
|
(char *)pFunc, P4_FUNCDEF);
|
|
|
assert( pFunc->nArg==-1 || (pFunc->nArg&0xff)==pFunc->nArg );
|
|
assert( pFunc->nArg==-1 || (pFunc->nArg&0xff)==pFunc->nArg );
|
|
|
sqlite3VdbeChangeP5(v, (u8)(pFunc->nArg));
|
|
sqlite3VdbeChangeP5(v, (u8)(pFunc->nArg));
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
/* Code an OP_Expire. For an ATTACH statement, set P1 to true (expire this
|
|
/* Code an OP_Expire. For an ATTACH statement, set P1 to true (expire this
|
|
|
** statement only). For DETACH, set it to false (expire all existing
|
|
** statement only). For DETACH, set it to false (expire all existing
|
|
|
** statements).
|
|
** statements).
|
|
|
*/
|
|
*/
|
|
|
sqlite3VdbeAddOp1(v, OP_Expire, (type==SQLITE_ATTACH));
|
|
sqlite3VdbeAddOp1(v, OP_Expire, (type==SQLITE_ATTACH));
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
attach_end:
|
|
attach_end:
|
|
|
sqlite3ExprDelete(db, pFilename);
|
|
sqlite3ExprDelete(db, pFilename);
|
|
|
sqlite3ExprDelete(db, pDbname);
|
|
sqlite3ExprDelete(db, pDbname);
|
|
@@ -98106,16 +98105,16 @@ SQLITE_PRIVATE int sqlite3FixSrcList(
|
|
|
DbFixer *pFix, /* Context of the fixation */
|
|
DbFixer *pFix, /* Context of the fixation */
|
|
|
SrcList *pList /* The Source list to check and modify */
|
|
SrcList *pList /* The Source list to check and modify */
|
|
|
){
|
|
){
|
|
|
- int i, use_attached_dbs;
|
|
|
|
|
|
|
+ int i /*, use_attached_dbs*/;
|
|
|
const char *zDb;
|
|
const char *zDb;
|
|
|
struct SrcList_item *pItem;
|
|
struct SrcList_item *pItem;
|
|
|
|
|
|
|
|
- use_attached_dbs = sqlite3_limit(pFix->pParse->db, SQLITE_LIMIT_USE_ATTACHED_DBS, -1);
|
|
|
|
|
|
|
+ //use_attached_dbs = sqlite3_limit(pFix->pParse->db, SQLITE_LIMIT_USE_ATTACHED_DBS, -1);
|
|
|
if( NEVER(pList==0) ) return 0;
|
|
if( NEVER(pList==0) ) return 0;
|
|
|
zDb = pFix->zDb;
|
|
zDb = pFix->zDb;
|
|
|
for(i=0, pItem=pList->a; i<pList->nSrc; i++, pItem++){
|
|
for(i=0, pItem=pList->a; i<pList->nSrc; i++, pItem++){
|
|
|
- if( pFix->bVarOnly==0 ){
|
|
|
|
|
- if( pItem->zDatabase && !use_attached_dbs && sqlite3StrICmp(pItem->zDatabase, zDb) ){
|
|
|
|
|
|
|
+ if( pFix->bVarOnly==0 /*&& !use_attached_dbs*/ ){
|
|
|
|
|
+ if( pItem->zDatabase && sqlite3StrICmp(pItem->zDatabase, zDb) ){
|
|
|
sqlite3ErrorMsg(pFix->pParse,
|
|
sqlite3ErrorMsg(pFix->pParse,
|
|
|
"%s %T cannot reference objects in database %s",
|
|
"%s %T cannot reference objects in database %s",
|
|
|
pFix->zType, pFix->pName, pItem->zDatabase);
|
|
pFix->zType, pFix->pName, pItem->zDatabase);
|
|
@@ -98880,14 +98879,14 @@ SQLITE_PRIVATE Table *sqlite3LocateTableItem(
|
|
|
struct SrcList_item *p
|
|
struct SrcList_item *p
|
|
|
){
|
|
){
|
|
|
const char *zDb;
|
|
const char *zDb;
|
|
|
- int use_attached_dbs = sqlite3_limit(pParse->db, SQLITE_LIMIT_USE_ATTACHED_DBS, -1);
|
|
|
|
|
|
|
+ //int use_attached_dbs = sqlite3_limit(pParse->db, SQLITE_LIMIT_USE_ATTACHED_DBS, -1);
|
|
|
assert( p->pSchema==0 || p->zDatabase==0 );
|
|
assert( p->pSchema==0 || p->zDatabase==0 );
|
|
|
- if( p->pSchema && !use_attached_dbs){
|
|
|
|
|
|
|
+ if( p->pSchema /*&& !use_attached_dbs*/ ){
|
|
|
int iDb = sqlite3SchemaToIndex(pParse->db, p->pSchema);
|
|
int iDb = sqlite3SchemaToIndex(pParse->db, p->pSchema);
|
|
|
zDb = pParse->db->aDb[iDb].zDbSName;
|
|
zDb = pParse->db->aDb[iDb].zDbSName;
|
|
|
}else{
|
|
}else{
|
|
|
zDb = p->zDatabase;
|
|
zDb = p->zDatabase;
|
|
|
- }
|
|
|
|
|
|
|
+ }
|
|
|
return sqlite3LocateTable(pParse, flags, p->zName, zDb);
|
|
return sqlite3LocateTable(pParse, flags, p->zName, zDb);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -110051,7 +110050,7 @@ exec_out:
|
|
|
** This header file defines the SQLite interface for use by
|
|
** This header file defines the SQLite interface for use by
|
|
|
** shared libraries that want to be imported as extensions into
|
|
** shared libraries that want to be imported as extensions into
|
|
|
** an SQLite instance. Shared libraries that intend to be loaded
|
|
** an SQLite instance. Shared libraries that intend to be loaded
|
|
|
-** as extensions by SQLite should #include this file instead of
|
|
|
|
|
|
|
+** as extensions by SQLite should #include this file instead of
|
|
|
** sqlite3.h.
|
|
** sqlite3.h.
|
|
|
*/
|
|
*/
|
|
|
#ifndef SQLITE3EXT_H
|
|
#ifndef SQLITE3EXT_H
|
|
@@ -110584,14 +110583,14 @@ typedef int (*sqlite3_loadext_entry)(
|
|
|
#endif /* !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION) */
|
|
#endif /* !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION) */
|
|
|
|
|
|
|
|
#if !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION)
|
|
#if !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION)
|
|
|
- /* This case when the file really is being compiled as a loadable
|
|
|
|
|
|
|
+ /* This case when the file really is being compiled as a loadable
|
|
|
** extension */
|
|
** extension */
|
|
|
# define SQLITE_EXTENSION_INIT1 const sqlite3_api_routines *sqlite3_api=0;
|
|
# define SQLITE_EXTENSION_INIT1 const sqlite3_api_routines *sqlite3_api=0;
|
|
|
# define SQLITE_EXTENSION_INIT2(v) sqlite3_api=v;
|
|
# define SQLITE_EXTENSION_INIT2(v) sqlite3_api=v;
|
|
|
# define SQLITE_EXTENSION_INIT3 \
|
|
# define SQLITE_EXTENSION_INIT3 \
|
|
|
extern const sqlite3_api_routines *sqlite3_api;
|
|
extern const sqlite3_api_routines *sqlite3_api;
|
|
|
#else
|
|
#else
|
|
|
- /* This case when the file is being statically linked into the
|
|
|
|
|
|
|
+ /* This case when the file is being statically linked into the
|
|
|
** application */
|
|
** application */
|
|
|
# define SQLITE_EXTENSION_INIT1 /*no-op*/
|
|
# define SQLITE_EXTENSION_INIT1 /*no-op*/
|
|
|
# define SQLITE_EXTENSION_INIT2(v) (void)v; /* unused parameter */
|
|
# define SQLITE_EXTENSION_INIT2(v) (void)v; /* unused parameter */
|
|
@@ -125047,7 +125046,6 @@ static void codeApplyAffinity(Parse *pParse, int base, int n, char *zAff){
|
|
|
** * the affinity change in zAff is guaranteed not to change the value.
|
|
** * the affinity change in zAff is guaranteed not to change the value.
|
|
|
*/
|
|
*/
|
|
|
static void updateRangeAffinityStr(
|
|
static void updateRangeAffinityStr(
|
|
|
- Parse *pParse, /* Parse context */
|
|
|
|
|
Expr *pRight, /* RHS of comparison */
|
|
Expr *pRight, /* RHS of comparison */
|
|
|
int n, /* Number of vector elements in comparison */
|
|
int n, /* Number of vector elements in comparison */
|
|
|
char *zAff /* Affinity string to modify */
|
|
char *zAff /* Affinity string to modify */
|
|
@@ -126187,7 +126185,7 @@ SQLITE_PRIVATE Bitmask sqlite3WhereCodeOneLoopStart(
|
|
|
VdbeCoverage(v);
|
|
VdbeCoverage(v);
|
|
|
}
|
|
}
|
|
|
if( zStartAff ){
|
|
if( zStartAff ){
|
|
|
- updateRangeAffinityStr(pParse, pRight, nBtm, &zStartAff[nEq]);
|
|
|
|
|
|
|
+ updateRangeAffinityStr(pRight, nBtm, &zStartAff[nEq]);
|
|
|
}
|
|
}
|
|
|
nConstraint += nBtm;
|
|
nConstraint += nBtm;
|
|
|
testcase( pRangeStart->wtFlags & TERM_VIRTUAL );
|
|
testcase( pRangeStart->wtFlags & TERM_VIRTUAL );
|
|
@@ -126237,7 +126235,7 @@ SQLITE_PRIVATE Bitmask sqlite3WhereCodeOneLoopStart(
|
|
|
VdbeCoverage(v);
|
|
VdbeCoverage(v);
|
|
|
}
|
|
}
|
|
|
if( zEndAff ){
|
|
if( zEndAff ){
|
|
|
- updateRangeAffinityStr(pParse, pRight, nTop, zEndAff);
|
|
|
|
|
|
|
+ updateRangeAffinityStr(pRight, nTop, zEndAff);
|
|
|
codeApplyAffinity(pParse, regBase+nEq, nTop, zEndAff);
|
|
codeApplyAffinity(pParse, regBase+nEq, nTop, zEndAff);
|
|
|
}else{
|
|
}else{
|
|
|
assert( pParse->db->mallocFailed );
|
|
assert( pParse->db->mallocFailed );
|
|
@@ -136562,10 +136560,12 @@ static void yy_reduce(
|
|
|
break;
|
|
break;
|
|
|
case 240: /* trnm ::= nm DOT nm */
|
|
case 240: /* trnm ::= nm DOT nm */
|
|
|
{
|
|
{
|
|
|
- yymsp[-2].minor.yy0 = yymsp[0].minor.yy0;
|
|
|
|
|
- sqlite3ErrorMsg(pParse,
|
|
|
|
|
|
|
+ if(!sqlite3_limit(pParse->db, SQLITE_LIMIT_USE_ATTACHED_DBS, -1)) {
|
|
|
|
|
+ yymsp[-2].minor.yy0 = yymsp[0].minor.yy0;
|
|
|
|
|
+ sqlite3ErrorMsg(pParse,
|
|
|
"qualified table names are not allowed on INSERT, UPDATE, and DELETE "
|
|
"qualified table names are not allowed on INSERT, UPDATE, and DELETE "
|
|
|
"statements within triggers");
|
|
"statements within triggers");
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
break;
|
|
break;
|
|
|
case 241: /* tridxby ::= INDEXED BY nm */
|
|
case 241: /* tridxby ::= INDEXED BY nm */
|
|
@@ -183892,6 +183892,9 @@ static int fts5SentenceFinderCb(
|
|
|
){
|
|
){
|
|
|
int rc = SQLITE_OK;
|
|
int rc = SQLITE_OK;
|
|
|
|
|
|
|
|
|
|
+ UNUSED_PARAM2(pToken, nToken);
|
|
|
|
|
+ UNUSED_PARAM(iEndOff);
|
|
|
|
|
+
|
|
|
if( (tflags & FTS5_TOKEN_COLOCATED)==0 ){
|
|
if( (tflags & FTS5_TOKEN_COLOCATED)==0 ){
|
|
|
Fts5SFinder *p = (Fts5SFinder*)pContext;
|
|
Fts5SFinder *p = (Fts5SFinder*)pContext;
|
|
|
if( p->iPos>0 ){
|
|
if( p->iPos>0 ){
|
|
@@ -184047,7 +184050,6 @@ static void fts5SnippetFunction(
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if( sFinder.aFirst[jj]<io ){
|
|
if( sFinder.aFirst[jj]<io ){
|
|
|
- int nScore;
|
|
|
|
|
memset(aSeen, 0, nPhrase);
|
|
memset(aSeen, 0, nPhrase);
|
|
|
rc = fts5SnippetScore(pApi, pFts, nDocsize, aSeen, i,
|
|
rc = fts5SnippetScore(pApi, pFts, nDocsize, aSeen, i,
|
|
|
sFinder.aFirst[jj], nToken, &nScore, 0
|
|
sFinder.aFirst[jj], nToken, &nScore, 0
|
|
@@ -197982,7 +197984,7 @@ static void fts5SourceIdFunc(
|
|
|
){
|
|
){
|
|
|
assert( nArg==0 );
|
|
assert( nArg==0 );
|
|
|
UNUSED_PARAM2(nArg, apUnused);
|
|
UNUSED_PARAM2(nArg, apUnused);
|
|
|
- sqlite3_result_text(pCtx, "fts5: 2016-10-04 12:20:12 3a9d802fda10585654332b314d317250dc5d894e", -1, SQLITE_TRANSIENT);
|
|
|
|
|
|
|
+ sqlite3_result_text(pCtx, "fts5: 2016-10-05 20:14:29 b066637bb75959267fe6104da323c5112ad78f82", -1, SQLITE_TRANSIENT);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
static int fts5Init(sqlite3 *db){
|
|
static int fts5Init(sqlite3 *db){
|
|
@@ -207701,7 +207703,7 @@ struct EvalResult {
|
|
|
*/
|
|
*/
|
|
|
static int callback(void *pCtx, int argc, char **argv, char **colnames){
|
|
static int callback(void *pCtx, int argc, char **argv, char **colnames){
|
|
|
struct EvalResult *p = (struct EvalResult*)pCtx;
|
|
struct EvalResult *p = (struct EvalResult*)pCtx;
|
|
|
- int i;
|
|
|
|
|
|
|
+ int i;
|
|
|
for(i=0; i<argc; i++){
|
|
for(i=0; i<argc; i++){
|
|
|
const char *z = argv[i] ? argv[i] : "";
|
|
const char *z = argv[i] ? argv[i] : "";
|
|
|
size_t sz = strlen(z);
|
|
size_t sz = strlen(z);
|
|
@@ -207773,8 +207775,8 @@ static void sqlEvalFunc(
|
|
|
__declspec(dllexport)
|
|
__declspec(dllexport)
|
|
|
#endif
|
|
#endif
|
|
|
SQLITE_API int sqlite3_eval_init(
|
|
SQLITE_API int sqlite3_eval_init(
|
|
|
- sqlite3 *db,
|
|
|
|
|
- char **pzErrMsg,
|
|
|
|
|
|
|
+ sqlite3 *db,
|
|
|
|
|
+ char **pzErrMsg,
|
|
|
const sqlite3_api_routines *pApi
|
|
const sqlite3_api_routines *pApi
|
|
|
){
|
|
){
|
|
|
int rc = SQLITE_OK;
|
|
int rc = SQLITE_OK;
|