8000 Add SQLite 3.30.1 for CPython bpo-38380 · python/cpython-source-deps@116e5a8 · GitHub
[go: up one dir, main page]

Skip to content

Commit 116e5a8

Browse files
author
Erlend E. Aasland
committed
Add SQLite 3.30.1 for CPython bpo-38380
1 parent c815512 commit 116e5a8

File tree

2 files changed

+43
-25
lines changed

2 files changed

+43
-25
lines changed

sqlite3.c

Lines changed: 40 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/******************************************************************************
22
** This file is an amalgamation of many separate C source files from SQLite
3-
** version 3.30.0. By combining all the individual C code files into this
3+
** version 3.30.1. By combining all the individual C code files into this
44
** single large file, the entire code can be compiled as a single translation
55
** unit. This allows many compilers to do optimizations that would not be
66
** possible if the files were compiled separately. Performance improvements
@@ -1165,9 +1165,9 @@ extern "C" {
11651165
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
11661166
** [sqlite_version()] and [sqlite_source_id()].
11671167
*/
1168-
#define SQLITE_VERSION "3.30.0"
1169-
#define SQLITE_VERSION_NUMBER 3030000
1170-
#define SQLITE_SOURCE_ID "2019-10-04 15:03:17 c20a35336432025445f9f7e289d0cc3e4003fb17f45a4ce74c6269c407c6e09f"
1168+
#define SQLITE_VERSION "3.30.1"
1169+
#define SQLITE_VERSION_NUMBER 3030001
1170+
#define SQLITE_SOURCE_ID "2019-10-10 20:19:45 18db032d058f1436ce3dea84081f4ee5a0f2259ad97301d43c426bc7f3df1b0b"
11711171

11721172
/*
11731173
** CAPI3REF: Run-Time Library Version Numbers
@@ -17619,9 +17619,13 @@ struct Expr {
1761917619
** True if the expression passed as an argument was a function with
1762017620
** an OVER() clause (a window function).
1762117621
*/
17622-
#define IsWindowFunc(p) ( \
17622+
#ifdef SQLITE_OMIT_WINDOWFUNC
17623+
# define IsWindowFunc(p) 0
17624+
#else
17625+
# define IsWindowFunc(p) ( \
1762317626
ExprHasProperty((p), EP_WinFunc) && p->y.pWin->eFrmType!=TK_FILTER \
17624-
)
17627+
)
17628+
#endif
1762517629

1762617630
/*
1762717631
** A list of expressions. Each expression may optionally have a
@@ -77192,7 +77196,7 @@ SQLITE_PRIVATE int sqlite3VdbeAssertMayAbort(Vdbe *v, int mayAbort){
7719277196
int opcode = pOp->opcode;
7719377197
if( opcode==OP_Destroy || opcode==OP_VUpdate || opcode==OP_VRename
7719477198
|| opcode==OP_VDestroy
77195-
|| (opcode==OP_Function0 && pOp->p4.pFunc->funcFlags&SQLITE_FUNC_INTERNAL)
77199+
|| (opcode==OP_ParseSchema && pOp->p4.z==0)
7719677200
|| ((opcode==OP_Halt || opcode==OP_HaltIfNull)
7719777201
&& ((pOp->p1)!=SQLITE_OK && pOp->p2==OE_Abort))
7719877202
){
@@ -88478,23 +88482,27 @@ case OP_SeekRowid: { /* jump, in3 */
8847888482
pIn3 = &aMem[pOp->p3];
8847988483
testcase( pIn3->flags & MEM_Int );
8848088484
testcase( pIn3->flags & MEM_IntReal );
88485+
testcase( pIn3->flags & MEM_Real );
88486+
testcase( (pIn3->flags & (MEM_Str|MEM_Int))==MEM_Str );
8848188487
if( (pIn3->flags & (MEM_Int|MEM_IntReal))==0 ){
88482-
/* Make sure pIn3->u.i contains a valid integer representation of
88483-
** the key value, but do not change the datatype of the register, as
88484-
** other parts of the perpared statement might be depending on the
88485-
** current datatype. */
88486-
u16 origFlags = pIn3->flags;
88487-
int isNotInt;
88488-
applyAffinity(pIn3, SQLITE_AFF_NUMERIC, encoding);
88489-
isNotInt = (pIn3->flags & MEM_Int)==0;
88490-
pIn3->flags = origFlags;
88491-
if( isNotInt ) goto jump_to_p2;
88488+
/* If pIn3->u.i does not contain an integer, compute iKey as the
88489+
** integer value of pIn3. Jump to P2 if pIn3 cannot be converted
88490+
** into an integer without loss of information. Take care to avoid
88491+
** changing the datatype of pIn3, however, as it is used by other
88492+
** parts of the prepared statement. */
88493+
Mem x = pIn3[0];
88494+
applyAffinity(&x, SQLITE_AFF_NUMERIC, encoding);
88495+
if( (x.flags & MEM_Int)==0 ) goto jump_to_p2;
88496+
iKey = x.u.i;
88497+
goto notExistsWithKey;
8849288498
}
8849388499
/* Fall through into OP_NotExists */
8849488500
case OP_NotExists: /* jump, in3 */
8849588501
pIn3 = &aMem[pOp->p3];
8849688502
assert( (pIn3->flags & MEM_Int)!=0 || pOp->opcode==OP_SeekRowid );
8849788503
assert( pOp->p1>=0 && pOp->p1<p->nCursor );
88504+
iKey = pIn3->u.i;
88505+
notExistsWithKey:
8849888506
pC = p->apCsr[pOp->p1];
8849988507
assert( pC!=0 );
8850088508
#ifdef SQLITE_DEBUG
@@ -88505,7 +88513,6 @@ case OP_NotExists: /* jump, in3 */
8850588513
pCrsr = pC->uc.pCursor;
8850688514
assert( pCrsr!=0 );
8850788515
res = 0;
88508-
iKey = pIn3->u.i;
8850988516
rc = sqlite3BtreeMovetoUnpacked(pCrsr, 0, iKey, 0, &res);
8851088517
assert( rc==SQLITE_OK || res==0 );
8851188518
pC->movetoTarget = iKey; /* Used by OP_Delete */
@@ -102659,6 +102666,7 @@ static int impliesNotNullRow(Walker *pWalker, Expr *pExpr){
102659102666
case TK_CASE:
102660102667
case TK_IN:
102661102668
case TK_FUNCTION:
102669+
case TK_TRUTH:
102662102670
testcase( pExpr->op==TK_ISNOT );
102663102671
testcase( pExpr->op==TK_ISNULL );
102664102672
testcase( pExpr->op==TK_NOTNULL );
@@ -102667,6 +102675,7 @@ static int impliesNotNullRow(Walker *pWalker, Expr *pExpr){
102667102675
testcase( pExpr->op==TK_CASE );
102668102676
testcase( pExpr->op==TK_IN );
102669102677
testcase( pExpr->op==TK_FUNCTION );
102678+
testcase( pExpr->op==TK_TRUTH );
102670102679
return WRC_Prune;
102671102680
case TK_COLUMN:
102672102681
if( pWalker->u.iCur==pExpr->iTable ){
@@ -103607,6 +103616,7 @@ SQLITE_PRIVATE void sqlite3AlterBeginAddColumn(Parse *pParse, SrcList *pSrc){
103607103616
goto exit_begin_add_column;
103608103617
}
103609103618

103619+
sqlite3MayAbort(pParse);
103610103620
assert( pTab->addColOffset>0 );
103611103621
iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
103612103622

@@ -125710,9 +125720,9 @@ static void clearSelect(sqlite3 *db, Select *p, int bFree){
125710125720
if( OK_IF_ALWAYS_TRUE(p->pWinDefn) ){
125711125721
sqlite3WindowListDelete(db, p->pWinDefn);
125712125722
}
125723+
assert( p->pWin==0 );
125713125724
#endif
125714125725
if( OK_IF_ALWAYS_TRUE(p->pWith) ) sqlite3WithDelete(db, p->pWith);
125715-
assert( p->pWin==0 );
125716125726
if( bFree ) sqlite3DbFreeNN(db, p);
125717125727
p = pPrior;
125718125728
bFree = 1;
@@ -129113,6 +129123,14 @@ static Expr *substExpr(
129113129123
}else{
129114129124
substExprList(pSubst, pExpr->x.pList);
129115129125
}
129126+
#ifndef SQLITE_OMIT_WINDOWFUNC
129127+
if( ExprHasProperty(pExpr, EP_WinFunc) ){
129128+
Window *pWin = pExpr->y.pWin;
129129+
pWin->pFilter = substExpr(pSubst, pWin->pFilter);
129130+
substExprList(pSubst, pWin->pPartition);
129131+
substExprList(pSubst, pWin->pOrderBy);
129132+
}
129133+
#endif
129116129134
}
129117129135
return pExpr;
129118129136
}
@@ -220267,7 +220285,7 @@ static void fts5SourceIdFunc(
220267220285
){
220268220286
assert( nArg==0 );
220269220287
UNUSED_PARAM2(nArg, apUnused);
220270-
sqlite3_result_text(pCtx, "fts5: 2019-10-04 15:03:17 c20a35336432025445f9f7e289d0cc3e4003fb17f45a4ce74c6269c407c6e09f", -1, SQLITE_TRANSIENT);
220288+
sqlite3_result_text(pCtx, "fts5: 2019-10-10 20:19:45 18db032d058f1436ce3dea84081f4ee5a0f2259ad97301d43c426bc7f3df1b0b", -1, SQLITE_TRANSIENT);
220271220289
}
220272220290

220273220291
/*
@@ -225035,9 +225053,9 @@ SQLITE_API int sqlite3_stmt_init(
225035225053
#endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_STMTVTAB) */
225036225054

225037225055
/************** End of stmt.c ************************************************/
225038-
#if __LINE__!=225038
225056+
#if __LINE__!=225056
225039225057
#undef SQLITE_SOURCE_ID
225040-
#define SQLITE_SOURCE_ID "2019-10-04 15:03:17 c20a35336432025445f9f7e289d0cc3e4003fb17f45a4ce74c6269c407c6alt2"
225058+
#define SQLITE_SOURCE_ID "2019-10-10 20:19:45 18db032d058f1436ce3dea84081f4ee5a0f2259ad97301d43c426bc7f3dfalt2"
225041225059
#endif
225042225060
/* Return the source-id for this library */
225043225061
SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }

sqlite3.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,9 @@ extern "C" {
123123
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
124124
** [sqlite_version()] and [sqlite_source_id()].
125125
*/
126-
#define SQLITE_VERSION "3.30.0"
127-
#define SQLITE_VERSION_NUMBER 3030000
128-
#define SQLITE_SOURCE_ID "2019-10-04 15:03:17 c20a35336432025445f9f7e289d0cc3e4003fb17f45a4ce74c6269c407c6e09f"
126+
#define SQLITE_VERSION "3.30.1"
127+
#define SQLITE_VERSION_NUMBER 3030001
128+
#define SQLITE_SOURCE_ID "2019-10-10 20:19:45 18db032d058f1436ce3dea84081f4ee5a0f2259ad97301d43c426bc7f3df1b0b"
129129

130130
/*
131131
** CAPI3REF: Run-Time Library Version Numbers

0 commit comments

Comments
 (0)
0