| | @@ -1,8 +1,8 @@ |
| 1 | 1 | /****************************************************************************** |
| 2 | 2 | ** This file is an amalgamation of many separate C source files from SQLite |
| 3 | | -** version 3.32.0. By combining all the individual C code files into this |
| 3 | +** version 3.32.1. By combining all the individual C code files into this |
| 4 | 4 | ** single large file, the entire code can be compiled as a single translation |
| 5 | 5 | ** unit. This allows many compilers to do optimizations that would not be |
| 6 | 6 | ** possible if the files were compiled separately. Performance improvements |
| 7 | 7 | ** of 5% or more are commonly seen when SQLite is compiled as a single |
| 8 | 8 | ** translation unit. |
| | @@ -1160,13 +1160,13 @@ |
| 1160 | 1160 | ** |
| 1161 | 1161 | ** See also: [sqlite3_libversion()], |
| 1162 | 1162 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 1163 | 1163 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 1164 | 1164 | */ |
| 1165 | | -#define SQLITE_VERSION "3.32.0" |
| 1166 | | -#define SQLITE_VERSION_NUMBER 3032000 |
| 1167 | | -#define SQLITE_SOURCE_ID "2020-05-22 17:46:16 5998789c9c744bce92e4cff7636bba800a75574243d6977e1fc8281e360f8d5a" |
| 1165 | +#define SQLITE_VERSION "3.32.1" |
| 1166 | +#define SQLITE_VERSION_NUMBER 3032001 |
| 1167 | +#define SQLITE_SOURCE_ID "2020-05-25 16:19:56 0c1fcf4711a2e66c813aed38cf41cd3e2123ee8eb6db98118086764c4ba83350" |
| 1168 | 1168 | |
| 1169 | 1169 | /* |
| 1170 | 1170 | ** CAPI3REF: Run-Time Library Version Numbers |
| 1171 | 1171 | ** KEYWORDS: sqlite3_version sqlite3_sourceid |
| 1172 | 1172 | ** |
| | @@ -17841,11 +17841,11 @@ |
| 17841 | 17841 | /* |
| 17842 | 17842 | ** An instance of this structure contains information needed to generate |
| 17843 | 17843 | ** code for a SELECT that contains aggregate functions. |
| 17844 | 17844 | ** |
| 17845 | 17845 | ** If Expr.op==TK_AGG_COLUMN or TK_AGG_FUNCTION then Expr.pAggInfo is a |
| 17846 | | -** pointer to this structure. The Expr.iColumn field is the index in |
| 17846 | +** pointer to this structure. The Expr.iAgg field is the index in |
| 17847 | 17847 | ** AggInfo.aCol[] or AggInfo.aFunc[] of information needed to generate |
| 17848 | 17848 | ** code for that node. |
| 17849 | 17849 | ** |
| 17850 | 17850 | ** AggInfo.pGroupBy and AggInfo.aFunc.pExpr point to fields within the |
| 17851 | 17851 | ** original Select structure that describes the SELECT statement. These |
| | @@ -19080,10 +19080,13 @@ |
| 19080 | 19080 | SQLITE_PRIVATE int sqlite3WalkSelectExpr(Walker*, Select*); |
| 19081 | 19081 | SQLITE_PRIVATE int sqlite3WalkSelectFrom(Walker*, Select*); |
| 19082 | 19082 | SQLITE_PRIVATE int sqlite3ExprWalkNoop(Walker*, Expr*); |
| 19083 | 19083 | SQLITE_PRIVATE int sqlite3SelectWalkNoop(Walker*, Select*); |
| 19084 | 19084 | SQLITE_PRIVATE int sqlite3SelectWalkFail(Walker*, Select*); |
| 19085 | +SQLITE_PRIVATE int sqlite3WalkerDepthIncrease(Walker*,Select*); |
| 19086 | +SQLITE_PRIVATE void sqlite3WalkerDepthDecrease(Walker*,Select*); |
| 19087 | + |
| 19085 | 19088 | #ifdef SQLITE_DEBUG |
| 19086 | 19089 | SQLITE_PRIVATE void sqlite3SelectWalkAssert2(Walker*, Select*); |
| 19087 | 19090 | #endif |
| 19088 | 19091 | |
| 19089 | 19092 | /* |
| | @@ -28274,10 +28277,17 @@ |
| 28274 | 28277 | #ifndef SQLITE_PRINT_BUF_SIZE |
| 28275 | 28278 | # define SQLITE_PRINT_BUF_SIZE 70 |
| 28276 | 28279 | #endif |
| 28277 | 28280 | #define etBUFSIZE SQLITE_PRINT_BUF_SIZE /* Size of the output buffer */ |
| 28278 | 28281 | |
| 28282 | +/* |
| 28283 | +** Hard limit on the precision of floating-point conversions. |
| 28284 | +*/ |
| 28285 | +#ifndef SQLITE_PRINTF_PRECISION_LIMIT |
| 28286 | +# define SQLITE_FP_PRECISION_LIMIT 100000000 |
| 28287 | +#endif |
| 28288 | + |
| 28279 | 28289 | /* |
| 28280 | 28290 | ** Render a string given by "fmt" into the StrAccum object. |
| 28281 | 28291 | */ |
| 28282 | 28292 | SQLITE_API void sqlite3_str_vappendf( |
| 28283 | 28293 | sqlite3_str *pAccum, /* Accumulate results here */ |
| | @@ -28474,10 +28484,12 @@ |
| 28474 | 28484 | ** precision The specified precision. The default |
| 28475 | 28485 | ** is -1. |
| 28476 | 28486 | ** xtype The class of the conversion. |
| 28477 | 28487 | ** infop Pointer to the appropriate info struct. |
| 28478 | 28488 | */ |
| 28489 | + assert( width>=0 ); |
| 28490 | + assert( precision>=(-1) ); |
| 28479 | 28491 | switch( xtype ){ |
| 28480 | 28492 | case etPOINTER: |
| 28481 | 28493 | flag_long = sizeof(char*)==sizeof(i64) ? 2 : |
| 28482 | 28494 | sizeof(char*)==sizeof(long int) ? 1 : 0; |
| 28483 | 28495 | /* Fall through into the next case */ |
| | @@ -28595,10 +28607,15 @@ |
| 28595 | 28607 | } |
| 28596 | 28608 | #ifdef SQLITE_OMIT_FLOATING_POINT |
| 28597 | 28609 | length = 0; |
| 28598 | 28610 | #else |
| 28599 | 28611 | if( precision<0 ) precision = 6; /* Set default precision */ |
| 28612 | +#ifdef SQLITE_FP_PRECISION_LIMIT |
| 28613 | + if( precision>SQLITE_FP_PRECISION_LIMIT ){ |
| 28614 | + precision = SQLITE_FP_PRECISION_LIMIT; |
| 28615 | + } |
| 28616 | +#endif |
| 28600 | 28617 | if( realvalue<0.0 ){ |
| 28601 | 28618 | realvalue = -realvalue; |
| 28602 | 28619 | prefix = '-'; |
| 28603 | 28620 | }else{ |
| 28604 | 28621 | prefix = flag_prefix; |
| | @@ -28877,11 +28894,11 @@ |
| 28877 | 28894 | }else{ |
| 28878 | 28895 | escarg = va_arg(ap,char*); |
| 28879 | 28896 | } |
| 28880 | 28897 | isnull = escarg==0; |
| 28881 | 28898 | if( isnull ) escarg = (xtype==etSQLESCAPE2 ? "NULL" : "(NULL)"); |
| 28882 | | - /* For %q, %Q, and %w, the precision is the number of byte (or |
| 28899 | + /* For %q, %Q, and %w, the precision is the number of bytes (or |
| 28883 | 28900 | ** characters if the ! flags is present) to use from the input. |
| 28884 | 28901 | ** Because of the extra quoting characters inserted, the number |
| 28885 | 28902 | ** of output characters may be larger than the precision. |
| 28886 | 28903 | */ |
| 28887 | 28904 | k = precision; |
| | @@ -29962,12 +29979,13 @@ |
| 29962 | 29979 | #else |
| 29963 | 29980 | pWin = 0; |
| 29964 | 29981 | #endif |
| 29965 | 29982 | } |
| 29966 | 29983 | if( pExpr->op==TK_AGG_FUNCTION ){ |
| 29967 | | - sqlite3TreeViewLine(pView, "AGG_FUNCTION%d %Q%s", |
| 29968 | | - pExpr->op2, pExpr->u.zToken, zFlgs); |
| 29984 | + sqlite3TreeViewLine(pView, "AGG_FUNCTION%d %Q%s iAgg=%d agg=%p", |
| 29985 | + pExpr->op2, pExpr->u.zToken, zFlgs, |
| 29986 | + pExpr->iAgg, pExpr->pAggInfo); |
| 29969 | 29987 | }else if( pExpr->op2!=0 ){ |
| 29970 | 29988 | const char *zOp2; |
| 29971 | 29989 | char zBuf[8]; |
| 29972 | 29990 | sqlite3_snprintf(sizeof(zBuf),zBuf,"0x%02x",pExpr->op2); |
| 29973 | 29991 | zOp2 = zBuf; |
| | @@ -62133,16 +62151,18 @@ |
| 62133 | 62151 | ** needs to be flushed. |
| 62134 | 62152 | */ |
| 62135 | 62153 | SQLITE_PRIVATE int sqlite3WalBeginReadTransaction(Wal *pWal, int *pChanged){ |
| 62136 | 62154 | int rc; /* Return code */ |
| 62137 | 62155 | int cnt = 0; /* Number of TryBeginRead attempts */ |
| 62156 | +#ifdef SQLITE_ENABLE_SNAPSHOT |
| 62157 | + int bChanged = 0; |
| 62158 | + WalIndexHdr *pSnapshot = pWal->pSnapshot; |
| 62159 | +#endif |
| 62138 | 62160 | |
| 62139 | 62161 | assert( pWal->ckptLock==0 ); |
| 62140 | 62162 | |
| 62141 | 62163 | #ifdef SQLITE_ENABLE_SNAPSHOT |
| 62142 | | - int bChanged = 0; |
| 62143 | | - WalIndexHdr *pSnapshot = pWal->pSnapshot; |
| 62144 | 62164 | if( pSnapshot ){ |
| 62145 | 62165 | if( memcmp(pSnapshot, &pWal->hdr, sizeof(WalIndexHdr))!=0 ){ |
| 62146 | 62166 | bChanged = 1; |
| 62147 | 62167 | } |
| 62148 | 62168 | |
| | @@ -97462,10 +97482,47 @@ |
| 97462 | 97482 | } |
| 97463 | 97483 | p = p->pPrior; |
| 97464 | 97484 | }while( p!=0 ); |
| 97465 | 97485 | return WRC_Continue; |
| 97466 | 97486 | } |
| 97487 | + |
| 97488 | +/* Increase the walkerDepth when entering a subquery, and |
| 97489 | +** descrease when leaving the subquery. |
| 97490 | +*/ |
| 97491 | +SQLITE_PRIVATE int sqlite3WalkerDepthIncrease(Walker *pWalker, Select *pSelect){ |
| 97492 | + UNUSED_PARAMETER(pSelect); |
| 97493 | + pWalker->walkerDepth++; |
| 97494 | + return WRC_Continue; |
| 97495 | +} |
| 97496 | +SQLITE_PRIVATE void sqlite3WalkerDepthDecrease(Walker *pWalker, Select *pSelect){ |
| 97497 | + UNUSED_PARAMETER(pSelect); |
| 97498 | + pWalker->walkerDepth--; |
| 97499 | +} |
| 97500 | + |
| 97501 | + |
| 97502 | +/* |
| 97503 | +** No-op routine for the parse-tree walker. |
| 97504 | +** |
| 97505 | +** When this routine is the Walker.xExprCallback then expression trees |
| 97506 | +** are walked without any actions being taken at each node. Presumably, |
| 97507 | +** when this routine is used for Walker.xExprCallback then |
| 97508 | +** Walker.xSelectCallback is set to do something useful for every |
| 97509 | +** subquery in the parser tree. |
| 97510 | +*/ |
| 97511 | +SQLITE_PRIVATE int sqlite3ExprWalkNoop(Walker *NotUsed, Expr *NotUsed2){ |
| 97512 | + UNUSED_PARAMETER2(NotUsed, NotUsed2); |
| 97513 | + return WRC_Continue; |
| 97514 | +} |
| 97515 | + |
| 97516 | +/* |
| 97517 | +** No-op routine for the parse-tree walker for SELECT statements. |
| 97518 | +** subquery in the parser tree. |
| 97519 | +*/ |
| 97520 | +SQLITE_PRIVATE int sqlite3SelectWalkNoop(Walker *NotUsed, Select *NotUsed2){ |
| 97521 | + UNUSED_PARAMETER2(NotUsed, NotUsed2); |
| 97522 | + return WRC_Continue; |
| 97523 | +} |
| 97467 | 97524 | |
| 97468 | 97525 | /************** End of walker.c **********************************************/ |
| 97469 | 97526 | /************** Begin file resolve.c *****************************************/ |
| 97470 | 97527 | /* |
| 97471 | 97528 | ** 2008 August 18 |
| | @@ -97491,10 +97548,12 @@ |
| 97491 | 97548 | ** This needs to occur when copying a TK_AGG_FUNCTION node from an |
| 97492 | 97549 | ** outer query into an inner subquery. |
| 97493 | 97550 | ** |
| 97494 | 97551 | ** incrAggFunctionDepth(pExpr,n) is the main routine. incrAggDepth(..) |
| 97495 | 97552 | ** is a helper function - a callback for the tree walker. |
| 97553 | +** |
| 97554 | +** See also the sqlite3WindowExtraAggFuncDepth() routine in window.c |
| 97496 | 97555 | */ |
| 97497 | 97556 | static int incrAggDepth(Walker *pWalker, Expr *pExpr){ |
| 97498 | 97557 | if( pExpr->op==TK_AGG_FUNCTION ) pExpr->op2 += pWalker->u.n; |
| 97499 | 97558 | return WRC_Continue; |
| 97500 | 97559 | } |
| | @@ -103232,11 +103291,14 @@ |
| 103232 | 103291 | op = pExpr->op; |
| 103233 | 103292 | } |
| 103234 | 103293 | switch( op ){ |
| 103235 | 103294 | case TK_AGG_COLUMN: { |
| 103236 | 103295 | AggInfo *pAggInfo = pExpr->pAggInfo; |
| 103237 | | - struct AggInfo_col *pCol = &pAggInfo->aCol[pExpr->iAgg]; |
| 103296 | + struct AggInfo_col *pCol; |
| 103297 | + assert( pAggInfo!=0 ); |
| 103298 | + assert( pExpr->iAgg>=0 && pExpr->iAgg<pAggInfo->nColumn ); |
| 103299 | + pCol = &pAggInfo->aCol[pExpr->iAgg]; |
| 103238 | 103300 | if( !pAggInfo->directMode ){ |
| 103239 | 103301 | assert( pCol->iMem>0 ); |
| 103240 | 103302 | return pCol->iMem; |
| 103241 | 103303 | }else if( pAggInfo->useSortingIdx ){ |
| 103242 | 103304 | Table *pTab = pCol->pTab; |
| | @@ -103532,11 +103594,14 @@ |
| 103532 | 103594 | sqlite3VdbeJumpHere(v, addr); |
| 103533 | 103595 | break; |
| 103534 | 103596 | } |
| 103535 | 103597 | case TK_AGG_FUNCTION: { |
| 103536 | 103598 | AggInfo *pInfo = pExpr->pAggInfo; |
| 103537 | | - if( pInfo==0 ){ |
| 103599 | + if( pInfo==0 |
| 103600 | + || NEVER(pExpr->iAgg<0) |
| 103601 | + || NEVER(pExpr->iAgg>=pInfo->nFunc) |
| 103602 | + ){ |
| 103538 | 103603 | assert( !ExprHasProperty(pExpr, EP_IntValue) ); |
| 103539 | 103604 | sqlite3ErrorMsg(pParse, "misuse of aggregate: %s()", pExpr->u.zToken); |
| 103540 | 103605 | }else{ |
| 103541 | 103606 | return pInfo->aFunc[pExpr->iAgg].iMem; |
| 103542 | 103607 | } |
| | @@ -105288,19 +105353,10 @@ |
| 105288 | 105353 | } |
| 105289 | 105354 | } |
| 105290 | 105355 | } |
| 105291 | 105356 | return WRC_Continue; |
| 105292 | 105357 | } |
| 105293 | | -static int analyzeAggregatesInSelect(Walker *pWalker, Select *pSelect){ |
| 105294 | | - UNUSED_PARAMETER(pSelect); |
| 105295 | | - pWalker->walkerDepth++; |
| 105296 | | - return WRC_Continue; |
| 105297 | | -} |
| 105298 | | -static void analyzeAggregatesInSelectEnd(Walker *pWalker, Select *pSelect){ |
| 105299 | | - UNUSED_PARAMETER(pSelect); |
| 105300 | | - pWalker->walkerDepth--; |
| 105301 | | -} |
| 105302 | 105358 | |
| 105303 | 105359 | /* |
| 105304 | 105360 | ** Analyze the pExpr expression looking for aggregate functions and |
| 105305 | 105361 | ** for variables that need to be added to AggInfo object that pNC->pAggInfo |
| 105306 | 105362 | ** points to. Additional entries are made on the AggInfo object as |
| | @@ -105310,12 +105366,12 @@ |
| 105310 | 105366 | ** analyzed by sqlite3ResolveExprNames(). |
| 105311 | 105367 | */ |
| 105312 | 105368 | SQLITE_PRIVATE void sqlite3ExprAnalyzeAggregates(NameContext *pNC, Expr *pExpr){ |
| 105313 | 105369 | Walker w; |
| 105314 | 105370 | w.xExprCallback = analyzeAggregate; |
| 105315 | | - w.xSelectCallback = analyzeAggregatesInSelect; |
| 105316 | | - w.xSelectCallback2 = analyzeAggregatesInSelectEnd; |
| 105371 | + w.xSelectCallback = sqlite3WalkerDepthIncrease; |
| 105372 | + w.xSelectCallback2 = sqlite3WalkerDepthDecrease; |
| 105317 | 105373 | w.walkerDepth = 0; |
| 105318 | 105374 | w.u.pNC = pNC; |
| 105319 | 105375 | w.pParse = 0; |
| 105320 | 105376 | assert( pNC->pSrcList!=0 ); |
| 105321 | 105377 | sqlite3WalkExpr(&w, pExpr); |
| | @@ -122033,11 +122089,11 @@ |
| 122033 | 122089 | } |
| 122034 | 122090 | if( bAffinityDone==0 && (pUpIdx==0 || pUpIdx==pIdx) ){ |
| 122035 | 122091 | sqlite3TableAffinity(v, pTab, regNewData+1); |
| 122036 | 122092 | bAffinityDone = 1; |
| 122037 | 122093 | } |
| 122038 | | - VdbeNoopComment((v, "uniqueness check for %s", pIdx->zName)); |
| 122094 | + VdbeNoopComment((v, "prep index %s", pIdx->zName)); |
| 122039 | 122095 | iThisCur = iIdxCur+ix; |
| 122040 | 122096 | |
| 122041 | 122097 | |
| 122042 | 122098 | /* Skip partial indices for which the WHERE clause is not true */ |
| 122043 | 122099 | if( pIdx->pPartIdxWhere ){ |
| | @@ -134005,33 +134061,10 @@ |
| 134005 | 134061 | } |
| 134006 | 134062 | } |
| 134007 | 134063 | return WRC_Continue; |
| 134008 | 134064 | } |
| 134009 | 134065 | |
| 134010 | | -/* |
| 134011 | | -** No-op routine for the parse-tree walker. |
| 134012 | | -** |
| 134013 | | -** When this routine is the Walker.xExprCallback then expression trees |
| 134014 | | -** are walked without any actions being taken at each node. Presumably, |
| 134015 | | -** when this routine is used for Walker.xExprCallback then |
| 134016 | | -** Walker.xSelectCallback is set to do something useful for every |
| 134017 | | -** subquery in the parser tree. |
| 134018 | | -*/ |
| 134019 | | -SQLITE_PRIVATE int sqlite3ExprWalkNoop(Walker *NotUsed, Expr *NotUsed2){ |
| 134020 | | - UNUSED_PARAMETER2(NotUsed, NotUsed2); |
| 134021 | | - return WRC_Continue; |
| 134022 | | -} |
| 134023 | | - |
| 134024 | | -/* |
| 134025 | | -** No-op routine for the parse-tree walker for SELECT statements. |
| 134026 | | -** subquery in the parser tree. |
| 134027 | | -*/ |
| 134028 | | -SQLITE_PRIVATE int sqlite3SelectWalkNoop(Walker *NotUsed, Select *NotUsed2){ |
| 134029 | | - UNUSED_PARAMETER2(NotUsed, NotUsed2); |
| 134030 | | - return WRC_Continue; |
| 134031 | | -} |
| 134032 | | - |
| 134033 | 134066 | #if SQLITE_DEBUG |
| 134034 | 134067 | /* |
| 134035 | 134068 | ** Always assert. This xSelectCallback2 implementation proves that the |
| 134036 | 134069 | ** xSelectCallback2 is never invoked. |
| 134037 | 134070 | */ |
| | @@ -135198,11 +135231,11 @@ |
| 135198 | 135231 | sAggInfo.mxReg = pParse->nMem; |
| 135199 | 135232 | if( db->mallocFailed ) goto select_end; |
| 135200 | 135233 | #if SELECTTRACE_ENABLED |
| 135201 | 135234 | if( sqlite3SelectTrace & 0x400 ){ |
| 135202 | 135235 | int ii; |
| 135203 | | - SELECTTRACE(0x400,pParse,p,("After aggregate analysis:\n")); |
| 135236 | + SELECTTRACE(0x400,pParse,p,("After aggregate analysis %p:\n", &sAggInfo)); |
| 135204 | 135237 | sqlite3TreeViewSelect(0, p, 0); |
| 135205 | 135238 | for(ii=0; ii<sAggInfo.nColumn; ii++){ |
| 135206 | 135239 | sqlite3DebugPrintf("agg-column[%d] iMem=%d\n", |
| 135207 | 135240 | ii, sAggInfo.aCol[ii].iMem); |
| 135208 | 135241 | sqlite3TreeViewExpr(0, sAggInfo.aCol[ii].pExpr, 0); |
| | @@ -151241,10 +151274,27 @@ |
| 151241 | 151274 | if( pList ) pList->a[nInit+i].sortFlags = pAppend->a[i].sortFlags; |
| 151242 | 151275 | } |
| 151243 | 151276 | } |
| 151244 | 151277 | return pList; |
| 151245 | 151278 | } |
| 151279 | + |
| 151280 | +/* |
| 151281 | +** When rewriting a query, if the new subquery in the FROM clause |
| 151282 | +** contains TK_AGG_FUNCTION nodes that refer to an outer query, |
| 151283 | +** then we have to increase the Expr->op2 values of those nodes |
| 151284 | +** due to the extra subquery layer that was added. |
| 151285 | +** |
| 151286 | +** See also the incrAggDepth() routine in resolve.c |
| 151287 | +*/ |
| 151288 | +static int sqlite3WindowExtraAggFuncDepth(Walker *pWalker, Expr *pExpr){ |
| 151289 | + if( pExpr->op==TK_AGG_FUNCTION |
| 151290 | + && pExpr->op2>=pWalker->walkerDepth |
| 151291 | + ){ |
| 151292 | + pExpr->op2++; |
| 151293 | + } |
| 151294 | + return WRC_Continue; |
| 151295 | +} |
| 151246 | 151296 | |
| 151247 | 151297 | /* |
| 151248 | 151298 | ** If the SELECT statement passed as the second argument does not invoke |
| 151249 | 151299 | ** any SQL window functions, this function is a no-op. Otherwise, it |
| 151250 | 151300 | ** rewrites the SELECT statement so that window function xStep functions |
| | @@ -151351,10 +151401,11 @@ |
| 151351 | 151401 | pParse, pSublist, pSrc, pWhere, pGroupBy, pHaving, pSort, 0, 0 |
| 151352 | 151402 | ); |
| 151353 | 151403 | p->pSrc = sqlite3SrcListAppend(pParse, 0, 0, 0); |
| 151354 | 151404 | if( p->pSrc ){ |
| 151355 | 151405 | Table *pTab2; |
| 151406 | + Walker w; |
| 151356 | 151407 | p->pSrc->a[0].pSelect = pSub; |
| 151357 | 151408 | sqlite3SrcListAssignCursors(pParse, p->pSrc); |
| 151358 | 151409 | pSub->selFlags |= SF_Expanded; |
| 151359 | 151410 | pTab2 = sqlite3ResultSetOfSelect(pParse, pSub, SQLITE_AFF_NONE); |
| 151360 | 151411 | pSub->selFlags |= (selFlags & SF_Aggregate); |
| | @@ -151366,10 +151417,15 @@ |
| 151366 | 151417 | }else{ |
| 151367 | 151418 | memcpy(pTab, pTab2, sizeof(Table)); |
| 151368 | 151419 | pTab->tabFlags |= TF_Ephemeral; |
| 151369 | 151420 | p->pSrc->a[0].pTab = pTab; |
| 151370 | 151421 | pTab = pTab2; |
| 151422 | + memset(&w, 0, sizeof(w)); |
| 151423 | + w.xExprCallback = sqlite3WindowExtraAggFuncDepth; |
| 151424 | + w.xSelectCallback = sqlite3WalkerDepthIncrease; |
| 151425 | + w.xSelectCallback2 = sqlite3WalkerDepthDecrease; |
| 151426 | + sqlite3WalkSelect(&w, pSub); |
| 151371 | 151427 | } |
| 151372 | 151428 | }else{ |
| 151373 | 151429 | sqlite3SelectDelete(db, pSub); |
| 151374 | 151430 | } |
| 151375 | 151431 | if( db->mallocFailed ) rc = SQLITE_NOMEM; |
| | @@ -224764,11 +224820,11 @@ |
| 224764 | 224820 | int nArg, /* Number of args */ |
| 224765 | 224821 | sqlite3_value **apUnused /* Function arguments */ |
| 224766 | 224822 | ){ |
| 224767 | 224823 | assert( nArg==0 ); |
| 224768 | 224824 | UNUSED_PARAM2(nArg, apUnused); |
| 224769 | | - sqlite3_result_text(pCtx, "fts5: 2020-05-22 17:46:16 5998789c9c744bce92e4cff7636bba800a75574243d6977e1fc8281e360f8d5a", -1, SQLITE_TRANSIENT); |
| 224825 | + sqlite3_result_text(pCtx, "fts5: 2020-05-25 16:19:56 0c1fcf4711a2e66c813aed38cf41cd3e2123ee8eb6db98118086764c4ba83350", -1, SQLITE_TRANSIENT); |
| 224770 | 224826 | } |
| 224771 | 224827 | |
| 224772 | 224828 | /* |
| 224773 | 224829 | ** Return true if zName is the extension on one of the shadow tables used |
| 224774 | 224830 | ** by this module. |
| | @@ -229547,12 +229603,12 @@ |
| 229547 | 229603 | } |
| 229548 | 229604 | #endif /* SQLITE_CORE */ |
| 229549 | 229605 | #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_STMTVTAB) */ |
| 229550 | 229606 | |
| 229551 | 229607 | /************** End of stmt.c ************************************************/ |
| 229552 | | -#if __LINE__!=229552 |
| 229608 | +#if __LINE__!=229608 |
| 229553 | 229609 | #undef SQLITE_SOURCE_ID |
| 229554 | | -#define SQLITE_SOURCE_ID "2020-05-22 17:46:16 5998789c9c744bce92e4cff7636bba800a75574243d6977e1fc8281e360falt2" |
| 229610 | +#define SQLITE_SOURCE_ID "2020-05-25 16:19:56 0c1fcf4711a2e66c813aed38cf41cd3e2123ee8eb6db98118086764c4ba8alt2" |
| 229555 | 229611 | #endif |
| 229556 | 229612 | /* Return the source-id for this library */ |
| 229557 | 229613 | SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; } |
| 229558 | 229614 | /************************** End of sqlite3.c ******************************/ |
| 229559 | 229615 | |