Add SQLite 3.30.1 for CPython bpo-38380

This commit is contained in:
Erlend E. Aasland
2020-02-27 14:46:08 +01:00
parent c8155127ee
commit 116e5a8ef6
2 changed files with 43 additions and 25 deletions

View File

@@ -1,6 +1,6 @@
/****************************************************************************** /******************************************************************************
** This file is an amalgamation of many separate C source files from SQLite ** This file is an amalgamation of many separate C source files from SQLite
** version 3.30.0. By combining all the individual C code files into this ** version 3.30.1. By combining all the individual C code files into this
** single large file, the entire code can be compiled as a single translation ** single large file, the entire code can be compiled as a single translation
** unit. This allows many compilers to do optimizations that would not be ** unit. This allows many compilers to do optimizations that would not be
** possible if the files were compiled separately. Performance improvements ** possible if the files were compiled separately. Performance improvements
@@ -1165,9 +1165,9 @@ extern "C" {
** [sqlite3_libversion_number()], [sqlite3_sourceid()], ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
** [sqlite_version()] and [sqlite_source_id()]. ** [sqlite_version()] and [sqlite_source_id()].
*/ */
#define SQLITE_VERSION "3.30.0" #define SQLITE_VERSION "3.30.1"
#define SQLITE_VERSION_NUMBER 3030000 #define SQLITE_VERSION_NUMBER 3030001
#define SQLITE_SOURCE_ID "2019-10-04 15:03:17 c20a35336432025445f9f7e289d0cc3e4003fb17f45a4ce74c6269c407c6e09f" #define SQLITE_SOURCE_ID "2019-10-10 20:19:45 18db032d058f1436ce3dea84081f4ee5a0f2259ad97301d43c426bc7f3df1b0b"
/* /*
** CAPI3REF: Run-Time Library Version Numbers ** CAPI3REF: Run-Time Library Version Numbers
@@ -17619,9 +17619,13 @@ struct Expr {
** True if the expression passed as an argument was a function with ** True if the expression passed as an argument was a function with
** an OVER() clause (a window function). ** an OVER() clause (a window function).
*/ */
#ifdef SQLITE_OMIT_WINDOWFUNC
# define IsWindowFunc(p) 0
#else
# define IsWindowFunc(p) ( \ # define IsWindowFunc(p) ( \
ExprHasProperty((p), EP_WinFunc) && p->y.pWin->eFrmType!=TK_FILTER \ ExprHasProperty((p), EP_WinFunc) && p->y.pWin->eFrmType!=TK_FILTER \
) )
#endif
/* /*
** A list of expressions. Each expression may optionally have a ** A list of expressions. Each expression may optionally have a
@@ -77192,7 +77196,7 @@ SQLITE_PRIVATE int sqlite3VdbeAssertMayAbort(Vdbe *v, int mayAbort){
int opcode = pOp->opcode; int opcode = pOp->opcode;
if( opcode==OP_Destroy || opcode==OP_VUpdate || opcode==OP_VRename if( opcode==OP_Destroy || opcode==OP_VUpdate || opcode==OP_VRename
|| opcode==OP_VDestroy || opcode==OP_VDestroy
|| (opcode==OP_Function0 && pOp->p4.pFunc->funcFlags&SQLITE_FUNC_INTERNAL) || (opcode==OP_ParseSchema && pOp->p4.z==0)
|| ((opcode==OP_Halt || opcode==OP_HaltIfNull) || ((opcode==OP_Halt || opcode==OP_HaltIfNull)
&& ((pOp->p1)!=SQLITE_OK && pOp->p2==OE_Abort)) && ((pOp->p1)!=SQLITE_OK && pOp->p2==OE_Abort))
){ ){
@@ -88478,23 +88482,27 @@ case OP_SeekRowid: { /* jump, in3 */
pIn3 = &aMem[pOp->p3]; pIn3 = &aMem[pOp->p3];
testcase( pIn3->flags & MEM_Int ); testcase( pIn3->flags & MEM_Int );
testcase( pIn3->flags & MEM_IntReal ); testcase( pIn3->flags & MEM_IntReal );
testcase( pIn3->flags & MEM_Real );
testcase( (pIn3->flags & (MEM_Str|MEM_Int))==MEM_Str );
if( (pIn3->flags & (MEM_Int|MEM_IntReal))==0 ){ if( (pIn3->flags & (MEM_Int|MEM_IntReal))==0 ){
/* Make sure pIn3->u.i contains a valid integer representation of /* If pIn3->u.i does not contain an integer, compute iKey as the
** the key value, but do not change the datatype of the register, as ** integer value of pIn3. Jump to P2 if pIn3 cannot be converted
** other parts of the perpared statement might be depending on the ** into an integer without loss of information. Take care to avoid
** current datatype. */ ** changing the datatype of pIn3, however, as it is used by other
u16 origFlags = pIn3->flags; ** parts of the prepared statement. */
int isNotInt; Mem x = pIn3[0];
applyAffinity(pIn3, SQLITE_AFF_NUMERIC, encoding); applyAffinity(&x, SQLITE_AFF_NUMERIC, encoding);
isNotInt = (pIn3->flags & MEM_Int)==0; if( (x.flags & MEM_Int)==0 ) goto jump_to_p2;
pIn3->flags = origFlags; iKey = x.u.i;
if( isNotInt ) goto jump_to_p2; goto notExistsWithKey;
} }
/* Fall through into OP_NotExists */ /* Fall through into OP_NotExists */
case OP_NotExists: /* jump, in3 */ case OP_NotExists: /* jump, in3 */
pIn3 = &aMem[pOp->p3]; pIn3 = &aMem[pOp->p3];
assert( (pIn3->flags & MEM_Int)!=0 || pOp->opcode==OP_SeekRowid ); assert( (pIn3->flags & MEM_Int)!=0 || pOp->opcode==OP_SeekRowid );
assert( pOp->p1>=0 && pOp->p1<p->nCursor ); assert( pOp->p1>=0 && pOp->p1<p->nCursor );
iKey = pIn3->u.i;
notExistsWithKey:
pC = p->apCsr[pOp->p1]; pC = p->apCsr[pOp->p1];
assert( pC!=0 ); assert( pC!=0 );
#ifdef SQLITE_DEBUG #ifdef SQLITE_DEBUG
@@ -88505,7 +88513,6 @@ case OP_NotExists: /* jump, in3 */
pCrsr = pC->uc.pCursor; pCrsr = pC->uc.pCursor;
assert( pCrsr!=0 ); assert( pCrsr!=0 );
res = 0; res = 0;
iKey = pIn3->u.i;
rc = sqlite3BtreeMovetoUnpacked(pCrsr, 0, iKey, 0, &res); rc = sqlite3BtreeMovetoUnpacked(pCrsr, 0, iKey, 0, &res);
assert( rc==SQLITE_OK || res==0 ); assert( rc==SQLITE_OK || res==0 );
pC->movetoTarget = iKey; /* Used by OP_Delete */ pC->movetoTarget = iKey; /* Used by OP_Delete */
@@ -102659,6 +102666,7 @@ static int impliesNotNullRow(Walker *pWalker, Expr *pExpr){
case TK_CASE: case TK_CASE:
case TK_IN: case TK_IN:
case TK_FUNCTION: case TK_FUNCTION:
case TK_TRUTH:
testcase( pExpr->op==TK_ISNOT ); testcase( pExpr->op==TK_ISNOT );
testcase( pExpr->op==TK_ISNULL ); testcase( pExpr->op==TK_ISNULL );
testcase( pExpr->op==TK_NOTNULL ); testcase( pExpr->op==TK_NOTNULL );
@@ -102667,6 +102675,7 @@ static int impliesNotNullRow(Walker *pWalker, Expr *pExpr){
testcase( pExpr->op==TK_CASE ); testcase( pExpr->op==TK_CASE );
testcase( pExpr->op==TK_IN ); testcase( pExpr->op==TK_IN );
testcase( pExpr->op==TK_FUNCTION ); testcase( pExpr->op==TK_FUNCTION );
testcase( pExpr->op==TK_TRUTH );
return WRC_Prune; return WRC_Prune;
case TK_COLUMN: case TK_COLUMN:
if( pWalker->u.iCur==pExpr->iTable ){ if( pWalker->u.iCur==pExpr->iTable ){
@@ -103607,6 +103616,7 @@ SQLITE_PRIVATE void sqlite3AlterBeginAddColumn(Parse *pParse, SrcList *pSrc){
goto exit_begin_add_column; goto exit_begin_add_column;
} }
sqlite3MayAbort(pParse);
assert( pTab->addColOffset>0 ); assert( pTab->addColOffset>0 );
iDb = sqlite3SchemaToIndex(db, pTab->pSchema); iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
@@ -125710,9 +125720,9 @@ static void clearSelect(sqlite3 *db, Select *p, int bFree){
if( OK_IF_ALWAYS_TRUE(p->pWinDefn) ){ if( OK_IF_ALWAYS_TRUE(p->pWinDefn) ){
sqlite3WindowListDelete(db, p->pWinDefn); sqlite3WindowListDelete(db, p->pWinDefn);
} }
assert( p->pWin==0 );
#endif #endif
if( OK_IF_ALWAYS_TRUE(p->pWith) ) sqlite3WithDelete(db, p->pWith); if( OK_IF_ALWAYS_TRUE(p->pWith) ) sqlite3WithDelete(db, p->pWith);
assert( p->pWin==0 );
if( bFree ) sqlite3DbFreeNN(db, p); if( bFree ) sqlite3DbFreeNN(db, p);
p = pPrior; p = pPrior;
bFree = 1; bFree = 1;
@@ -129113,6 +129123,14 @@ static Expr *substExpr(
}else{ }else{
substExprList(pSubst, pExpr->x.pList); substExprList(pSubst, pExpr->x.pList);
} }
#ifndef SQLITE_OMIT_WINDOWFUNC
if( ExprHasProperty(pExpr, EP_WinFunc) ){
Window *pWin = pExpr->y.pWin;
pWin->pFilter = substExpr(pSubst, pWin->pFilter);
substExprList(pSubst, pWin->pPartition);
substExprList(pSubst, pWin->pOrderBy);
}
#endif
} }
return pExpr; return pExpr;
} }
@@ -220267,7 +220285,7 @@ static void fts5SourceIdFunc(
){ ){
assert( nArg==0 ); assert( nArg==0 );
UNUSED_PARAM2(nArg, apUnused); UNUSED_PARAM2(nArg, apUnused);
sqlite3_result_text(pCtx, "fts5: 2019-10-04 15:03:17 c20a35336432025445f9f7e289d0cc3e4003fb17f45a4ce74c6269c407c6e09f", -1, SQLITE_TRANSIENT); sqlite3_result_text(pCtx, "fts5: 2019-10-10 20:19:45 18db032d058f1436ce3dea84081f4ee5a0f2259ad97301d43c426bc7f3df1b0b", -1, SQLITE_TRANSIENT);
} }
/* /*
@@ -225035,9 +225053,9 @@ SQLITE_API int sqlite3_stmt_init(
#endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_STMTVTAB) */ #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_STMTVTAB) */
/************** End of stmt.c ************************************************/ /************** End of stmt.c ************************************************/
#if __LINE__!=225038 #if __LINE__!=225056
#undef SQLITE_SOURCE_ID #undef SQLITE_SOURCE_ID
#define SQLITE_SOURCE_ID "2019-10-04 15:03:17 c20a35336432025445f9f7e289d0cc3e4003fb17f45a4ce74c6269c407c6alt2" #define SQLITE_SOURCE_ID "2019-10-10 20:19:45 18db032d058f1436ce3dea84081f4ee5a0f2259ad97301d43c426bc7f3dfalt2"
#endif #endif
/* Return the source-id for this library */ /* Return the source-id for this library */
SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; } SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }

View File

@@ -123,9 +123,9 @@ extern "C" {
** [sqlite3_libversion_number()], [sqlite3_sourceid()], ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
** [sqlite_version()] and [sqlite_source_id()]. ** [sqlite_version()] and [sqlite_source_id()].
*/ */
#define SQLITE_VERSION "3.30.0" #define SQLITE_VERSION "3.30.1"
#define SQLITE_VERSION_NUMBER 3030000 #define SQLITE_VERSION_NUMBER 3030001
#define SQLITE_SOURCE_ID "2019-10-04 15:03:17 c20a35336432025445f9f7e289d0cc3e4003fb17f45a4ce74c6269c407c6e09f" #define SQLITE_SOURCE_ID "2019-10-10 20:19:45 18db032d058f1436ce3dea84081f4ee5a0f2259ad97301d43c426bc7f3df1b0b"
/* /*
** CAPI3REF: Run-Time Library Version Numbers ** CAPI3REF: Run-Time Library Version Numbers