Fossil SCM
Update the built-in SQLite to the 4th release candidate for 3.20.0.
Commit
2a615bed1184d6a1ce239e23d1c0e239f5d726a6464afb1e8ef0986fe8428f9e
Parent
04de083ec842c3f…
2 files changed
+33
-74
+2
-2
+33
-74
| --- src/sqlite3.c | ||
| +++ src/sqlite3.c | ||
| @@ -1150,11 +1150,11 @@ | ||
| 1150 | 1150 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 1151 | 1151 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 1152 | 1152 | */ |
| 1153 | 1153 | #define SQLITE_VERSION "3.20.0" |
| 1154 | 1154 | #define SQLITE_VERSION_NUMBER 3020000 |
| 1155 | -#define SQLITE_SOURCE_ID "2017-07-28 00:45:38 d891a2a00a34b6726624c66273f0f3388da9de6a771771c94b6e8a970dd9cdb9" | |
| 1155 | +#define SQLITE_SOURCE_ID "2017-07-31 17:40:15 be0e24a0293f31b81fc5608a1d5aa1e57d3f5f7dddef6b368ae2e207bbdaf44c" | |
| 1156 | 1156 | |
| 1157 | 1157 | /* |
| 1158 | 1158 | ** CAPI3REF: Run-Time Library Version Numbers |
| 1159 | 1159 | ** KEYWORDS: sqlite3_version sqlite3_sourceid |
| 1160 | 1160 | ** |
| @@ -5226,11 +5226,11 @@ | ||
| 5226 | 5226 | ** For all versions of SQLite up to and including 3.6.23.1, a call to |
| 5227 | 5227 | ** [sqlite3_reset()] was required after sqlite3_step() returned anything |
| 5228 | 5228 | ** other than [SQLITE_ROW] before any subsequent invocation of |
| 5229 | 5229 | ** sqlite3_step(). Failure to reset the prepared statement using |
| 5230 | 5230 | ** [sqlite3_reset()] would result in an [SQLITE_MISUSE] return from |
| 5231 | -** sqlite3_step(). But after [version 3.6.23.1] ([dateof:3.6.23.1], | |
| 5231 | +** sqlite3_step(). But after [version 3.6.23.1] ([dateof:3.6.23.1]), | |
| 5232 | 5232 | ** sqlite3_step() began |
| 5233 | 5233 | ** calling [sqlite3_reset()] automatically in this circumstance rather |
| 5234 | 5234 | ** than returning [SQLITE_MISUSE]. This is not considered a compatibility |
| 5235 | 5235 | ** break because any application that ever receives an SQLITE_MISUSE error |
| 5236 | 5236 | ** is broken by definition. The [SQLITE_OMIT_AUTORESET] compile-time option |
| @@ -102191,19 +102191,10 @@ | ||
| 102191 | 102191 | pPk = sqlite3PrimaryKeyIndex(pTab); |
| 102192 | 102192 | pTab->iPKey = -1; |
| 102193 | 102193 | }else{ |
| 102194 | 102194 | pPk = sqlite3PrimaryKeyIndex(pTab); |
| 102195 | 102195 | |
| 102196 | - /* Bypass the creation of the PRIMARY KEY btree and the sqlite_master | |
| 102197 | - ** table entry. This is only required if currently generating VDBE | |
| 102198 | - ** code for a CREATE TABLE (not when parsing one as part of reading | |
| 102199 | - ** a database schema). */ | |
| 102200 | - if( v ){ | |
| 102201 | - assert( db->init.busy==0 ); | |
| 102202 | - sqlite3VdbeChangeOpcode(v, pPk->tnum, OP_Goto); | |
| 102203 | - } | |
| 102204 | - | |
| 102205 | 102196 | /* |
| 102206 | 102197 | ** Remove all redundant columns from the PRIMARY KEY. For example, change |
| 102207 | 102198 | ** "PRIMARY KEY(a,b,a,b,c,b,c,d)" into just "PRIMARY KEY(a,b,c,d)". Later |
| 102208 | 102199 | ** code assumes the PRIMARY KEY contains no repeated columns. |
| 102209 | 102200 | */ |
| @@ -102218,10 +102209,19 @@ | ||
| 102218 | 102209 | } |
| 102219 | 102210 | assert( pPk!=0 ); |
| 102220 | 102211 | pPk->isCovering = 1; |
| 102221 | 102212 | if( !db->init.imposterTable ) pPk->uniqNotNull = 1; |
| 102222 | 102213 | nPk = pPk->nKeyCol; |
| 102214 | + | |
| 102215 | + /* Bypass the creation of the PRIMARY KEY btree and the sqlite_master | |
| 102216 | + ** table entry. This is only required if currently generating VDBE | |
| 102217 | + ** code for a CREATE TABLE (not when parsing one as part of reading | |
| 102218 | + ** a database schema). */ | |
| 102219 | + if( v && pPk->tnum>0 ){ | |
| 102220 | + assert( db->init.busy==0 ); | |
| 102221 | + sqlite3VdbeChangeOpcode(v, pPk->tnum, OP_Goto); | |
| 102222 | + } | |
| 102223 | 102223 | |
| 102224 | 102224 | /* The root page of the PRIMARY KEY is the table root page */ |
| 102225 | 102225 | pPk->tnum = pTab->tnum; |
| 102226 | 102226 | |
| 102227 | 102227 | /* Update the in-memory representation of all UNIQUE indices by converting |
| @@ -118870,17 +118870,14 @@ | ||
| 118870 | 118870 | if( pS ){ |
| 118871 | 118871 | /* The "table" is actually a sub-select or a view in the FROM clause |
| 118872 | 118872 | ** of the SELECT statement. Return the declaration type and origin |
| 118873 | 118873 | ** data for the result-set column of the sub-select. |
| 118874 | 118874 | */ |
| 118875 | - if( iCol>=0 && ALWAYS(iCol<pS->pEList->nExpr) ){ | |
| 118875 | + if( iCol>=0 && iCol<pS->pEList->nExpr ){ | |
| 118876 | 118876 | /* If iCol is less than zero, then the expression requests the |
| 118877 | 118877 | ** rowid of the sub-select or view. This expression is legal (see |
| 118878 | 118878 | ** test case misc2.2.2) - it always evaluates to NULL. |
| 118879 | - ** | |
| 118880 | - ** The ALWAYS() is because iCol>=pS->pEList->nExpr will have been | |
| 118881 | - ** caught already by name resolution. | |
| 118882 | 118879 | */ |
| 118883 | 118880 | NameContext sNC; |
| 118884 | 118881 | Expr *p = pS->pEList->a[iCol].pExpr; |
| 118885 | 118882 | sNC.pSrcList = pS->pSrc; |
| 118886 | 118883 | sNC.pNext = pNC; |
| @@ -118986,22 +118983,10 @@ | ||
| 118986 | 118983 | sqlite3VdbeSetColName(v, i, COLNAME_DECLTYPE, zType, SQLITE_TRANSIENT); |
| 118987 | 118984 | } |
| 118988 | 118985 | #endif /* !defined(SQLITE_OMIT_DECLTYPE) */ |
| 118989 | 118986 | } |
| 118990 | 118987 | |
| 118991 | -/* | |
| 118992 | -** Return the Table objecct in the SrcList that has cursor iCursor. | |
| 118993 | -** Or return NULL if no such Table object exists in the SrcList. | |
| 118994 | -*/ | |
| 118995 | -static Table *tableWithCursor(SrcList *pList, int iCursor){ | |
| 118996 | - int j; | |
| 118997 | - for(j=0; j<pList->nSrc; j++){ | |
| 118998 | - if( pList->a[j].iCursor==iCursor ) return pList->a[j].pTab; | |
| 118999 | - } | |
| 119000 | - return 0; | |
| 119001 | -} | |
| 119002 | - | |
| 119003 | 118988 | |
| 119004 | 118989 | /* |
| 119005 | 118990 | ** Compute the column names for a SELECT statement. |
| 119006 | 118991 | ** |
| 119007 | 118992 | ** The only guarantee that SQLite makes about column names is that if the |
| @@ -119031,28 +119016,33 @@ | ||
| 119031 | 119016 | ** then the result column name with the table name |
| 119032 | 119017 | ** prefix, ex: TABLE.COLUMN. Otherwise use zSpan. |
| 119033 | 119018 | */ |
| 119034 | 119019 | static void generateColumnNames( |
| 119035 | 119020 | Parse *pParse, /* Parser context */ |
| 119036 | - SrcList *pTabList, /* The FROM clause of the SELECT */ | |
| 119037 | - ExprList *pEList /* Expressions defining the result set */ | |
| 119021 | + Select *pSelect /* Generate column names for this SELECT statement */ | |
| 119038 | 119022 | ){ |
| 119039 | 119023 | Vdbe *v = pParse->pVdbe; |
| 119040 | 119024 | int i; |
| 119041 | 119025 | Table *pTab; |
| 119026 | + SrcList *pTabList; | |
| 119027 | + ExprList *pEList; | |
| 119042 | 119028 | sqlite3 *db = pParse->db; |
| 119043 | - int fullName; /* TABLE.COLUMN if no AS clause and is a direct table ref */ | |
| 119044 | - int srcName; /* COLUMN or TABLE.COLUMN if no AS clause and is direct */ | |
| 119029 | + int fullName; /* TABLE.COLUMN if no AS clause and is a direct table ref */ | |
| 119030 | + int srcName; /* COLUMN or TABLE.COLUMN if no AS clause and is direct */ | |
| 119045 | 119031 | |
| 119046 | 119032 | #ifndef SQLITE_OMIT_EXPLAIN |
| 119047 | 119033 | /* If this is an EXPLAIN, skip this step */ |
| 119048 | 119034 | if( pParse->explain ){ |
| 119049 | 119035 | return; |
| 119050 | 119036 | } |
| 119051 | 119037 | #endif |
| 119052 | 119038 | |
| 119053 | 119039 | if( pParse->colNamesSet || db->mallocFailed ) return; |
| 119040 | + /* Column names are determined by the left-most term of a compound select */ | |
| 119041 | + while( pSelect->pPrior ) pSelect = pSelect->pPrior; | |
| 119042 | + pTabList = pSelect->pSrc; | |
| 119043 | + pEList = pSelect->pEList; | |
| 119054 | 119044 | assert( v!=0 ); |
| 119055 | 119045 | assert( pTabList!=0 ); |
| 119056 | 119046 | pParse->colNamesSet = 1; |
| 119057 | 119047 | fullName = (db->flags & SQLITE_FullColNames)!=0; |
| 119058 | 119048 | srcName = (db->flags & SQLITE_ShortColNames)!=0 || fullName; |
| @@ -119063,16 +119053,15 @@ | ||
| 119063 | 119053 | assert( p!=0 ); |
| 119064 | 119054 | if( pEList->a[i].zName ){ |
| 119065 | 119055 | /* An AS clause always takes first priority */ |
| 119066 | 119056 | char *zName = pEList->a[i].zName; |
| 119067 | 119057 | sqlite3VdbeSetColName(v, i, COLNAME_NAME, zName, SQLITE_TRANSIENT); |
| 119068 | - }else if( srcName | |
| 119069 | - && (p->op==TK_COLUMN || p->op==TK_AGG_COLUMN) | |
| 119070 | - && (pTab = tableWithCursor(pTabList, p->iTable))!=0 | |
| 119071 | - ){ | |
| 119058 | + }else if( srcName && p->op==TK_COLUMN ){ | |
| 119072 | 119059 | char *zCol; |
| 119073 | 119060 | int iCol = p->iColumn; |
| 119061 | + pTab = p->pTab; | |
| 119062 | + assert( pTab!=0 ); | |
| 119074 | 119063 | if( iCol<0 ) iCol = pTab->iPKey; |
| 119075 | 119064 | assert( iCol==-1 || (iCol>=0 && iCol<pTab->nCol) ); |
| 119076 | 119065 | if( iCol<0 ){ |
| 119077 | 119066 | zCol = "rowid"; |
| 119078 | 119067 | }else{ |
| @@ -119900,15 +119889,10 @@ | ||
| 119900 | 119889 | */ |
| 119901 | 119890 | assert( unionTab==dest.iSDParm || dest.eDest!=priorOp ); |
| 119902 | 119891 | if( dest.eDest!=priorOp ){ |
| 119903 | 119892 | int iCont, iBreak, iStart; |
| 119904 | 119893 | assert( p->pEList ); |
| 119905 | - if( dest.eDest==SRT_Output ){ | |
| 119906 | - Select *pFirst = p; | |
| 119907 | - while( pFirst->pPrior ) pFirst = pFirst->pPrior; | |
| 119908 | - generateColumnNames(pParse, pFirst->pSrc, pFirst->pEList); | |
| 119909 | - } | |
| 119910 | 119894 | iBreak = sqlite3VdbeMakeLabel(v); |
| 119911 | 119895 | iCont = sqlite3VdbeMakeLabel(v); |
| 119912 | 119896 | computeLimitRegisters(pParse, p, iBreak); |
| 119913 | 119897 | sqlite3VdbeAddOp2(v, OP_Rewind, unionTab, iBreak); VdbeCoverage(v); |
| 119914 | 119898 | iStart = sqlite3VdbeCurrentAddr(v); |
| @@ -119975,15 +119959,10 @@ | ||
| 119975 | 119959 | |
| 119976 | 119960 | /* Generate code to take the intersection of the two temporary |
| 119977 | 119961 | ** tables. |
| 119978 | 119962 | */ |
| 119979 | 119963 | assert( p->pEList ); |
| 119980 | - if( dest.eDest==SRT_Output ){ | |
| 119981 | - Select *pFirst = p; | |
| 119982 | - while( pFirst->pPrior ) pFirst = pFirst->pPrior; | |
| 119983 | - generateColumnNames(pParse, pFirst->pSrc, pFirst->pEList); | |
| 119984 | - } | |
| 119985 | 119964 | iBreak = sqlite3VdbeMakeLabel(v); |
| 119986 | 119965 | iCont = sqlite3VdbeMakeLabel(v); |
| 119987 | 119966 | computeLimitRegisters(pParse, p, iBreak); |
| 119988 | 119967 | sqlite3VdbeAddOp2(v, OP_Rewind, tab1, iBreak); VdbeCoverage(v); |
| 119989 | 119968 | r1 = sqlite3GetTempReg(pParse); |
| @@ -120587,18 +120566,10 @@ | ||
| 120587 | 120566 | |
| 120588 | 120567 | /* Jump to the this point in order to terminate the query. |
| 120589 | 120568 | */ |
| 120590 | 120569 | sqlite3VdbeResolveLabel(v, labelEnd); |
| 120591 | 120570 | |
| 120592 | - /* Set the number of output columns | |
| 120593 | - */ | |
| 120594 | - if( pDest->eDest==SRT_Output ){ | |
| 120595 | - Select *pFirst = pPrior; | |
| 120596 | - while( pFirst->pPrior ) pFirst = pFirst->pPrior; | |
| 120597 | - generateColumnNames(pParse, pFirst->pSrc, pFirst->pEList); | |
| 120598 | - } | |
| 120599 | - | |
| 120600 | 120571 | /* Reassembly the compound query so that it will be freed correctly |
| 120601 | 120572 | ** by the calling function */ |
| 120602 | 120573 | if( p->pPrior ){ |
| 120603 | 120574 | sqlite3SelectDelete(db, p->pPrior); |
| 120604 | 120575 | } |
| @@ -120889,11 +120860,10 @@ | ||
| 120889 | 120860 | Select *pParent; /* Current UNION ALL term of the other query */ |
| 120890 | 120861 | Select *pSub; /* The inner query or "subquery" */ |
| 120891 | 120862 | Select *pSub1; /* Pointer to the rightmost select in sub-query */ |
| 120892 | 120863 | SrcList *pSrc; /* The FROM clause of the outer query */ |
| 120893 | 120864 | SrcList *pSubSrc; /* The FROM clause of the subquery */ |
| 120894 | - ExprList *pList; /* The result set of the outer query */ | |
| 120895 | 120865 | int iParent; /* VDBE cursor number of the pSub result set temp table */ |
| 120896 | 120866 | int iNewParent = -1;/* Replacement table for iParent */ |
| 120897 | 120867 | int isLeftJoin = 0; /* True if pSub is the right side of a LEFT JOIN */ |
| 120898 | 120868 | int i; /* Loop counter */ |
| 120899 | 120869 | Expr *pWhere; /* The WHERE clause */ |
| @@ -121214,18 +121184,10 @@ | ||
| 121214 | 121184 | ** \_____________________ outer query ______________________________/ |
| 121215 | 121185 | ** |
| 121216 | 121186 | ** We look at every expression in the outer query and every place we see |
| 121217 | 121187 | ** "a" we substitute "x*3" and every place we see "b" we substitute "y+10". |
| 121218 | 121188 | */ |
| 121219 | - pList = pParent->pEList; | |
| 121220 | - for(i=0; i<pList->nExpr; i++){ | |
| 121221 | - if( pList->a[i].zName==0 ){ | |
| 121222 | - char *zName = sqlite3DbStrDup(db, pList->a[i].zSpan); | |
| 121223 | - sqlite3Dequote(zName); | |
| 121224 | - pList->a[i].zName = zName; | |
| 121225 | - } | |
| 121226 | - } | |
| 121227 | 121189 | if( pSub->pOrderBy ){ |
| 121228 | 121190 | /* At this point, any non-zero iOrderByCol values indicate that the |
| 121229 | 121191 | ** ORDER BY column expression is identical to the iOrderByCol'th |
| 121230 | 121192 | ** expression returned by SELECT statement pSub. Since these values |
| 121231 | 121193 | ** do not necessarily correspond to columns in SELECT statement pParent, |
| @@ -122650,10 +122612,18 @@ | ||
| 122650 | 122612 | if( sqlite3SelectTrace & 0x100 ){ |
| 122651 | 122613 | SELECTTRACE(0x100,pParse,p, ("after name resolution:\n")); |
| 122652 | 122614 | sqlite3TreeViewSelect(0, p, 0); |
| 122653 | 122615 | } |
| 122654 | 122616 | #endif |
| 122617 | + | |
| 122618 | + /* Get a pointer the VDBE under construction, allocating a new VDBE if one | |
| 122619 | + ** does not already exist */ | |
| 122620 | + v = sqlite3GetVdbe(pParse); | |
| 122621 | + if( v==0 ) goto select_end; | |
| 122622 | + if( pDest->eDest==SRT_Output ){ | |
| 122623 | + generateColumnNames(pParse, p); | |
| 122624 | + } | |
| 122655 | 122625 | |
| 122656 | 122626 | /* Try to flatten subqueries in the FROM clause up into the main query |
| 122657 | 122627 | */ |
| 122658 | 122628 | #if !defined(SQLITE_OMIT_SUBQUERY) || !defined(SQLITE_OMIT_VIEW) |
| 122659 | 122629 | for(i=0; !p->pPrior && i<pTabList->nSrc; i++){ |
| @@ -122686,15 +122656,10 @@ | ||
| 122686 | 122656 | sSort.pOrderBy = p->pOrderBy; |
| 122687 | 122657 | } |
| 122688 | 122658 | } |
| 122689 | 122659 | #endif |
| 122690 | 122660 | |
| 122691 | - /* Get a pointer the VDBE under construction, allocating a new VDBE if one | |
| 122692 | - ** does not already exist */ | |
| 122693 | - v = sqlite3GetVdbe(pParse); | |
| 122694 | - if( v==0 ) goto select_end; | |
| 122695 | - | |
| 122696 | 122661 | #ifndef SQLITE_OMIT_COMPOUND_SELECT |
| 122697 | 122662 | /* Handle compound SELECT statements using the separate multiSelect() |
| 122698 | 122663 | ** procedure. |
| 122699 | 122664 | */ |
| 122700 | 122665 | if( p->pPrior ){ |
| @@ -123490,16 +123455,10 @@ | ||
| 123490 | 123455 | ** successful coding of the SELECT. |
| 123491 | 123456 | */ |
| 123492 | 123457 | select_end: |
| 123493 | 123458 | explainSetInteger(pParse->iSelectId, iRestoreSelectId); |
| 123494 | 123459 | |
| 123495 | - /* Identify column names if results of the SELECT are to be output. | |
| 123496 | - */ | |
| 123497 | - if( rc==SQLITE_OK && pDest->eDest==SRT_Output ){ | |
| 123498 | - generateColumnNames(pParse, pTabList, pEList); | |
| 123499 | - } | |
| 123500 | - | |
| 123501 | 123460 | sqlite3DbFree(db, sAggInfo.aCol); |
| 123502 | 123461 | sqlite3DbFree(db, sAggInfo.aFunc); |
| 123503 | 123462 | #if SELECTTRACE_ENABLED |
| 123504 | 123463 | SELECTTRACE(1,pParse,p,("end processing\n")); |
| 123505 | 123464 | pParse->nSelectIndent--; |
| @@ -200314,11 +200273,11 @@ | ||
| 200314 | 200273 | int nArg, /* Number of args */ |
| 200315 | 200274 | sqlite3_value **apUnused /* Function arguments */ |
| 200316 | 200275 | ){ |
| 200317 | 200276 | assert( nArg==0 ); |
| 200318 | 200277 | UNUSED_PARAM2(nArg, apUnused); |
| 200319 | - sqlite3_result_text(pCtx, "fts5: 2017-07-27 18:43:13 2dfcd9a8ecdf0ddd8e044d820639830c6171141c588cf0224255af85c64cf79c", -1, SQLITE_TRANSIENT); | |
| 200278 | + sqlite3_result_text(pCtx, "fts5: 2017-07-31 17:40:15 be0e24a0293f31b81fc5608a1d5aa1e57d3f5f7dddef6b368ae2e207bbdaf44c", -1, SQLITE_TRANSIENT); | |
| 200320 | 200279 | } |
| 200321 | 200280 | |
| 200322 | 200281 | static int fts5Init(sqlite3 *db){ |
| 200323 | 200282 | static const sqlite3_module fts5Mod = { |
| 200324 | 200283 | /* iVersion */ 2, |
| 200325 | 200284 |
| --- src/sqlite3.c | |
| +++ src/sqlite3.c | |
| @@ -1150,11 +1150,11 @@ | |
| 1150 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 1151 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 1152 | */ |
| 1153 | #define SQLITE_VERSION "3.20.0" |
| 1154 | #define SQLITE_VERSION_NUMBER 3020000 |
| 1155 | #define SQLITE_SOURCE_ID "2017-07-28 00:45:38 d891a2a00a34b6726624c66273f0f3388da9de6a771771c94b6e8a970dd9cdb9" |
| 1156 | |
| 1157 | /* |
| 1158 | ** CAPI3REF: Run-Time Library Version Numbers |
| 1159 | ** KEYWORDS: sqlite3_version sqlite3_sourceid |
| 1160 | ** |
| @@ -5226,11 +5226,11 @@ | |
| 5226 | ** For all versions of SQLite up to and including 3.6.23.1, a call to |
| 5227 | ** [sqlite3_reset()] was required after sqlite3_step() returned anything |
| 5228 | ** other than [SQLITE_ROW] before any subsequent invocation of |
| 5229 | ** sqlite3_step(). Failure to reset the prepared statement using |
| 5230 | ** [sqlite3_reset()] would result in an [SQLITE_MISUSE] return from |
| 5231 | ** sqlite3_step(). But after [version 3.6.23.1] ([dateof:3.6.23.1], |
| 5232 | ** sqlite3_step() began |
| 5233 | ** calling [sqlite3_reset()] automatically in this circumstance rather |
| 5234 | ** than returning [SQLITE_MISUSE]. This is not considered a compatibility |
| 5235 | ** break because any application that ever receives an SQLITE_MISUSE error |
| 5236 | ** is broken by definition. The [SQLITE_OMIT_AUTORESET] compile-time option |
| @@ -102191,19 +102191,10 @@ | |
| 102191 | pPk = sqlite3PrimaryKeyIndex(pTab); |
| 102192 | pTab->iPKey = -1; |
| 102193 | }else{ |
| 102194 | pPk = sqlite3PrimaryKeyIndex(pTab); |
| 102195 | |
| 102196 | /* Bypass the creation of the PRIMARY KEY btree and the sqlite_master |
| 102197 | ** table entry. This is only required if currently generating VDBE |
| 102198 | ** code for a CREATE TABLE (not when parsing one as part of reading |
| 102199 | ** a database schema). */ |
| 102200 | if( v ){ |
| 102201 | assert( db->init.busy==0 ); |
| 102202 | sqlite3VdbeChangeOpcode(v, pPk->tnum, OP_Goto); |
| 102203 | } |
| 102204 | |
| 102205 | /* |
| 102206 | ** Remove all redundant columns from the PRIMARY KEY. For example, change |
| 102207 | ** "PRIMARY KEY(a,b,a,b,c,b,c,d)" into just "PRIMARY KEY(a,b,c,d)". Later |
| 102208 | ** code assumes the PRIMARY KEY contains no repeated columns. |
| 102209 | */ |
| @@ -102218,10 +102209,19 @@ | |
| 102218 | } |
| 102219 | assert( pPk!=0 ); |
| 102220 | pPk->isCovering = 1; |
| 102221 | if( !db->init.imposterTable ) pPk->uniqNotNull = 1; |
| 102222 | nPk = pPk->nKeyCol; |
| 102223 | |
| 102224 | /* The root page of the PRIMARY KEY is the table root page */ |
| 102225 | pPk->tnum = pTab->tnum; |
| 102226 | |
| 102227 | /* Update the in-memory representation of all UNIQUE indices by converting |
| @@ -118870,17 +118870,14 @@ | |
| 118870 | if( pS ){ |
| 118871 | /* The "table" is actually a sub-select or a view in the FROM clause |
| 118872 | ** of the SELECT statement. Return the declaration type and origin |
| 118873 | ** data for the result-set column of the sub-select. |
| 118874 | */ |
| 118875 | if( iCol>=0 && ALWAYS(iCol<pS->pEList->nExpr) ){ |
| 118876 | /* If iCol is less than zero, then the expression requests the |
| 118877 | ** rowid of the sub-select or view. This expression is legal (see |
| 118878 | ** test case misc2.2.2) - it always evaluates to NULL. |
| 118879 | ** |
| 118880 | ** The ALWAYS() is because iCol>=pS->pEList->nExpr will have been |
| 118881 | ** caught already by name resolution. |
| 118882 | */ |
| 118883 | NameContext sNC; |
| 118884 | Expr *p = pS->pEList->a[iCol].pExpr; |
| 118885 | sNC.pSrcList = pS->pSrc; |
| 118886 | sNC.pNext = pNC; |
| @@ -118986,22 +118983,10 @@ | |
| 118986 | sqlite3VdbeSetColName(v, i, COLNAME_DECLTYPE, zType, SQLITE_TRANSIENT); |
| 118987 | } |
| 118988 | #endif /* !defined(SQLITE_OMIT_DECLTYPE) */ |
| 118989 | } |
| 118990 | |
| 118991 | /* |
| 118992 | ** Return the Table objecct in the SrcList that has cursor iCursor. |
| 118993 | ** Or return NULL if no such Table object exists in the SrcList. |
| 118994 | */ |
| 118995 | static Table *tableWithCursor(SrcList *pList, int iCursor){ |
| 118996 | int j; |
| 118997 | for(j=0; j<pList->nSrc; j++){ |
| 118998 | if( pList->a[j].iCursor==iCursor ) return pList->a[j].pTab; |
| 118999 | } |
| 119000 | return 0; |
| 119001 | } |
| 119002 | |
| 119003 | |
| 119004 | /* |
| 119005 | ** Compute the column names for a SELECT statement. |
| 119006 | ** |
| 119007 | ** The only guarantee that SQLite makes about column names is that if the |
| @@ -119031,28 +119016,33 @@ | |
| 119031 | ** then the result column name with the table name |
| 119032 | ** prefix, ex: TABLE.COLUMN. Otherwise use zSpan. |
| 119033 | */ |
| 119034 | static void generateColumnNames( |
| 119035 | Parse *pParse, /* Parser context */ |
| 119036 | SrcList *pTabList, /* The FROM clause of the SELECT */ |
| 119037 | ExprList *pEList /* Expressions defining the result set */ |
| 119038 | ){ |
| 119039 | Vdbe *v = pParse->pVdbe; |
| 119040 | int i; |
| 119041 | Table *pTab; |
| 119042 | sqlite3 *db = pParse->db; |
| 119043 | int fullName; /* TABLE.COLUMN if no AS clause and is a direct table ref */ |
| 119044 | int srcName; /* COLUMN or TABLE.COLUMN if no AS clause and is direct */ |
| 119045 | |
| 119046 | #ifndef SQLITE_OMIT_EXPLAIN |
| 119047 | /* If this is an EXPLAIN, skip this step */ |
| 119048 | if( pParse->explain ){ |
| 119049 | return; |
| 119050 | } |
| 119051 | #endif |
| 119052 | |
| 119053 | if( pParse->colNamesSet || db->mallocFailed ) return; |
| 119054 | assert( v!=0 ); |
| 119055 | assert( pTabList!=0 ); |
| 119056 | pParse->colNamesSet = 1; |
| 119057 | fullName = (db->flags & SQLITE_FullColNames)!=0; |
| 119058 | srcName = (db->flags & SQLITE_ShortColNames)!=0 || fullName; |
| @@ -119063,16 +119053,15 @@ | |
| 119063 | assert( p!=0 ); |
| 119064 | if( pEList->a[i].zName ){ |
| 119065 | /* An AS clause always takes first priority */ |
| 119066 | char *zName = pEList->a[i].zName; |
| 119067 | sqlite3VdbeSetColName(v, i, COLNAME_NAME, zName, SQLITE_TRANSIENT); |
| 119068 | }else if( srcName |
| 119069 | && (p->op==TK_COLUMN || p->op==TK_AGG_COLUMN) |
| 119070 | && (pTab = tableWithCursor(pTabList, p->iTable))!=0 |
| 119071 | ){ |
| 119072 | char *zCol; |
| 119073 | int iCol = p->iColumn; |
| 119074 | if( iCol<0 ) iCol = pTab->iPKey; |
| 119075 | assert( iCol==-1 || (iCol>=0 && iCol<pTab->nCol) ); |
| 119076 | if( iCol<0 ){ |
| 119077 | zCol = "rowid"; |
| 119078 | }else{ |
| @@ -119900,15 +119889,10 @@ | |
| 119900 | */ |
| 119901 | assert( unionTab==dest.iSDParm || dest.eDest!=priorOp ); |
| 119902 | if( dest.eDest!=priorOp ){ |
| 119903 | int iCont, iBreak, iStart; |
| 119904 | assert( p->pEList ); |
| 119905 | if( dest.eDest==SRT_Output ){ |
| 119906 | Select *pFirst = p; |
| 119907 | while( pFirst->pPrior ) pFirst = pFirst->pPrior; |
| 119908 | generateColumnNames(pParse, pFirst->pSrc, pFirst->pEList); |
| 119909 | } |
| 119910 | iBreak = sqlite3VdbeMakeLabel(v); |
| 119911 | iCont = sqlite3VdbeMakeLabel(v); |
| 119912 | computeLimitRegisters(pParse, p, iBreak); |
| 119913 | sqlite3VdbeAddOp2(v, OP_Rewind, unionTab, iBreak); VdbeCoverage(v); |
| 119914 | iStart = sqlite3VdbeCurrentAddr(v); |
| @@ -119975,15 +119959,10 @@ | |
| 119975 | |
| 119976 | /* Generate code to take the intersection of the two temporary |
| 119977 | ** tables. |
| 119978 | */ |
| 119979 | assert( p->pEList ); |
| 119980 | if( dest.eDest==SRT_Output ){ |
| 119981 | Select *pFirst = p; |
| 119982 | while( pFirst->pPrior ) pFirst = pFirst->pPrior; |
| 119983 | generateColumnNames(pParse, pFirst->pSrc, pFirst->pEList); |
| 119984 | } |
| 119985 | iBreak = sqlite3VdbeMakeLabel(v); |
| 119986 | iCont = sqlite3VdbeMakeLabel(v); |
| 119987 | computeLimitRegisters(pParse, p, iBreak); |
| 119988 | sqlite3VdbeAddOp2(v, OP_Rewind, tab1, iBreak); VdbeCoverage(v); |
| 119989 | r1 = sqlite3GetTempReg(pParse); |
| @@ -120587,18 +120566,10 @@ | |
| 120587 | |
| 120588 | /* Jump to the this point in order to terminate the query. |
| 120589 | */ |
| 120590 | sqlite3VdbeResolveLabel(v, labelEnd); |
| 120591 | |
| 120592 | /* Set the number of output columns |
| 120593 | */ |
| 120594 | if( pDest->eDest==SRT_Output ){ |
| 120595 | Select *pFirst = pPrior; |
| 120596 | while( pFirst->pPrior ) pFirst = pFirst->pPrior; |
| 120597 | generateColumnNames(pParse, pFirst->pSrc, pFirst->pEList); |
| 120598 | } |
| 120599 | |
| 120600 | /* Reassembly the compound query so that it will be freed correctly |
| 120601 | ** by the calling function */ |
| 120602 | if( p->pPrior ){ |
| 120603 | sqlite3SelectDelete(db, p->pPrior); |
| 120604 | } |
| @@ -120889,11 +120860,10 @@ | |
| 120889 | Select *pParent; /* Current UNION ALL term of the other query */ |
| 120890 | Select *pSub; /* The inner query or "subquery" */ |
| 120891 | Select *pSub1; /* Pointer to the rightmost select in sub-query */ |
| 120892 | SrcList *pSrc; /* The FROM clause of the outer query */ |
| 120893 | SrcList *pSubSrc; /* The FROM clause of the subquery */ |
| 120894 | ExprList *pList; /* The result set of the outer query */ |
| 120895 | int iParent; /* VDBE cursor number of the pSub result set temp table */ |
| 120896 | int iNewParent = -1;/* Replacement table for iParent */ |
| 120897 | int isLeftJoin = 0; /* True if pSub is the right side of a LEFT JOIN */ |
| 120898 | int i; /* Loop counter */ |
| 120899 | Expr *pWhere; /* The WHERE clause */ |
| @@ -121214,18 +121184,10 @@ | |
| 121214 | ** \_____________________ outer query ______________________________/ |
| 121215 | ** |
| 121216 | ** We look at every expression in the outer query and every place we see |
| 121217 | ** "a" we substitute "x*3" and every place we see "b" we substitute "y+10". |
| 121218 | */ |
| 121219 | pList = pParent->pEList; |
| 121220 | for(i=0; i<pList->nExpr; i++){ |
| 121221 | if( pList->a[i].zName==0 ){ |
| 121222 | char *zName = sqlite3DbStrDup(db, pList->a[i].zSpan); |
| 121223 | sqlite3Dequote(zName); |
| 121224 | pList->a[i].zName = zName; |
| 121225 | } |
| 121226 | } |
| 121227 | if( pSub->pOrderBy ){ |
| 121228 | /* At this point, any non-zero iOrderByCol values indicate that the |
| 121229 | ** ORDER BY column expression is identical to the iOrderByCol'th |
| 121230 | ** expression returned by SELECT statement pSub. Since these values |
| 121231 | ** do not necessarily correspond to columns in SELECT statement pParent, |
| @@ -122650,10 +122612,18 @@ | |
| 122650 | if( sqlite3SelectTrace & 0x100 ){ |
| 122651 | SELECTTRACE(0x100,pParse,p, ("after name resolution:\n")); |
| 122652 | sqlite3TreeViewSelect(0, p, 0); |
| 122653 | } |
| 122654 | #endif |
| 122655 | |
| 122656 | /* Try to flatten subqueries in the FROM clause up into the main query |
| 122657 | */ |
| 122658 | #if !defined(SQLITE_OMIT_SUBQUERY) || !defined(SQLITE_OMIT_VIEW) |
| 122659 | for(i=0; !p->pPrior && i<pTabList->nSrc; i++){ |
| @@ -122686,15 +122656,10 @@ | |
| 122686 | sSort.pOrderBy = p->pOrderBy; |
| 122687 | } |
| 122688 | } |
| 122689 | #endif |
| 122690 | |
| 122691 | /* Get a pointer the VDBE under construction, allocating a new VDBE if one |
| 122692 | ** does not already exist */ |
| 122693 | v = sqlite3GetVdbe(pParse); |
| 122694 | if( v==0 ) goto select_end; |
| 122695 | |
| 122696 | #ifndef SQLITE_OMIT_COMPOUND_SELECT |
| 122697 | /* Handle compound SELECT statements using the separate multiSelect() |
| 122698 | ** procedure. |
| 122699 | */ |
| 122700 | if( p->pPrior ){ |
| @@ -123490,16 +123455,10 @@ | |
| 123490 | ** successful coding of the SELECT. |
| 123491 | */ |
| 123492 | select_end: |
| 123493 | explainSetInteger(pParse->iSelectId, iRestoreSelectId); |
| 123494 | |
| 123495 | /* Identify column names if results of the SELECT are to be output. |
| 123496 | */ |
| 123497 | if( rc==SQLITE_OK && pDest->eDest==SRT_Output ){ |
| 123498 | generateColumnNames(pParse, pTabList, pEList); |
| 123499 | } |
| 123500 | |
| 123501 | sqlite3DbFree(db, sAggInfo.aCol); |
| 123502 | sqlite3DbFree(db, sAggInfo.aFunc); |
| 123503 | #if SELECTTRACE_ENABLED |
| 123504 | SELECTTRACE(1,pParse,p,("end processing\n")); |
| 123505 | pParse->nSelectIndent--; |
| @@ -200314,11 +200273,11 @@ | |
| 200314 | int nArg, /* Number of args */ |
| 200315 | sqlite3_value **apUnused /* Function arguments */ |
| 200316 | ){ |
| 200317 | assert( nArg==0 ); |
| 200318 | UNUSED_PARAM2(nArg, apUnused); |
| 200319 | sqlite3_result_text(pCtx, "fts5: 2017-07-27 18:43:13 2dfcd9a8ecdf0ddd8e044d820639830c6171141c588cf0224255af85c64cf79c", -1, SQLITE_TRANSIENT); |
| 200320 | } |
| 200321 | |
| 200322 | static int fts5Init(sqlite3 *db){ |
| 200323 | static const sqlite3_module fts5Mod = { |
| 200324 | /* iVersion */ 2, |
| 200325 |
| --- src/sqlite3.c | |
| +++ src/sqlite3.c | |
| @@ -1150,11 +1150,11 @@ | |
| 1150 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 1151 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 1152 | */ |
| 1153 | #define SQLITE_VERSION "3.20.0" |
| 1154 | #define SQLITE_VERSION_NUMBER 3020000 |
| 1155 | #define SQLITE_SOURCE_ID "2017-07-31 17:40:15 be0e24a0293f31b81fc5608a1d5aa1e57d3f5f7dddef6b368ae2e207bbdaf44c" |
| 1156 | |
| 1157 | /* |
| 1158 | ** CAPI3REF: Run-Time Library Version Numbers |
| 1159 | ** KEYWORDS: sqlite3_version sqlite3_sourceid |
| 1160 | ** |
| @@ -5226,11 +5226,11 @@ | |
| 5226 | ** For all versions of SQLite up to and including 3.6.23.1, a call to |
| 5227 | ** [sqlite3_reset()] was required after sqlite3_step() returned anything |
| 5228 | ** other than [SQLITE_ROW] before any subsequent invocation of |
| 5229 | ** sqlite3_step(). Failure to reset the prepared statement using |
| 5230 | ** [sqlite3_reset()] would result in an [SQLITE_MISUSE] return from |
| 5231 | ** sqlite3_step(). But after [version 3.6.23.1] ([dateof:3.6.23.1]), |
| 5232 | ** sqlite3_step() began |
| 5233 | ** calling [sqlite3_reset()] automatically in this circumstance rather |
| 5234 | ** than returning [SQLITE_MISUSE]. This is not considered a compatibility |
| 5235 | ** break because any application that ever receives an SQLITE_MISUSE error |
| 5236 | ** is broken by definition. The [SQLITE_OMIT_AUTORESET] compile-time option |
| @@ -102191,19 +102191,10 @@ | |
| 102191 | pPk = sqlite3PrimaryKeyIndex(pTab); |
| 102192 | pTab->iPKey = -1; |
| 102193 | }else{ |
| 102194 | pPk = sqlite3PrimaryKeyIndex(pTab); |
| 102195 | |
| 102196 | /* |
| 102197 | ** Remove all redundant columns from the PRIMARY KEY. For example, change |
| 102198 | ** "PRIMARY KEY(a,b,a,b,c,b,c,d)" into just "PRIMARY KEY(a,b,c,d)". Later |
| 102199 | ** code assumes the PRIMARY KEY contains no repeated columns. |
| 102200 | */ |
| @@ -102218,10 +102209,19 @@ | |
| 102209 | } |
| 102210 | assert( pPk!=0 ); |
| 102211 | pPk->isCovering = 1; |
| 102212 | if( !db->init.imposterTable ) pPk->uniqNotNull = 1; |
| 102213 | nPk = pPk->nKeyCol; |
| 102214 | |
| 102215 | /* Bypass the creation of the PRIMARY KEY btree and the sqlite_master |
| 102216 | ** table entry. This is only required if currently generating VDBE |
| 102217 | ** code for a CREATE TABLE (not when parsing one as part of reading |
| 102218 | ** a database schema). */ |
| 102219 | if( v && pPk->tnum>0 ){ |
| 102220 | assert( db->init.busy==0 ); |
| 102221 | sqlite3VdbeChangeOpcode(v, pPk->tnum, OP_Goto); |
| 102222 | } |
| 102223 | |
| 102224 | /* The root page of the PRIMARY KEY is the table root page */ |
| 102225 | pPk->tnum = pTab->tnum; |
| 102226 | |
| 102227 | /* Update the in-memory representation of all UNIQUE indices by converting |
| @@ -118870,17 +118870,14 @@ | |
| 118870 | if( pS ){ |
| 118871 | /* The "table" is actually a sub-select or a view in the FROM clause |
| 118872 | ** of the SELECT statement. Return the declaration type and origin |
| 118873 | ** data for the result-set column of the sub-select. |
| 118874 | */ |
| 118875 | if( iCol>=0 && iCol<pS->pEList->nExpr ){ |
| 118876 | /* If iCol is less than zero, then the expression requests the |
| 118877 | ** rowid of the sub-select or view. This expression is legal (see |
| 118878 | ** test case misc2.2.2) - it always evaluates to NULL. |
| 118879 | */ |
| 118880 | NameContext sNC; |
| 118881 | Expr *p = pS->pEList->a[iCol].pExpr; |
| 118882 | sNC.pSrcList = pS->pSrc; |
| 118883 | sNC.pNext = pNC; |
| @@ -118986,22 +118983,10 @@ | |
| 118983 | sqlite3VdbeSetColName(v, i, COLNAME_DECLTYPE, zType, SQLITE_TRANSIENT); |
| 118984 | } |
| 118985 | #endif /* !defined(SQLITE_OMIT_DECLTYPE) */ |
| 118986 | } |
| 118987 | |
| 118988 | |
| 118989 | /* |
| 118990 | ** Compute the column names for a SELECT statement. |
| 118991 | ** |
| 118992 | ** The only guarantee that SQLite makes about column names is that if the |
| @@ -119031,28 +119016,33 @@ | |
| 119016 | ** then the result column name with the table name |
| 119017 | ** prefix, ex: TABLE.COLUMN. Otherwise use zSpan. |
| 119018 | */ |
| 119019 | static void generateColumnNames( |
| 119020 | Parse *pParse, /* Parser context */ |
| 119021 | Select *pSelect /* Generate column names for this SELECT statement */ |
| 119022 | ){ |
| 119023 | Vdbe *v = pParse->pVdbe; |
| 119024 | int i; |
| 119025 | Table *pTab; |
| 119026 | SrcList *pTabList; |
| 119027 | ExprList *pEList; |
| 119028 | sqlite3 *db = pParse->db; |
| 119029 | int fullName; /* TABLE.COLUMN if no AS clause and is a direct table ref */ |
| 119030 | int srcName; /* COLUMN or TABLE.COLUMN if no AS clause and is direct */ |
| 119031 | |
| 119032 | #ifndef SQLITE_OMIT_EXPLAIN |
| 119033 | /* If this is an EXPLAIN, skip this step */ |
| 119034 | if( pParse->explain ){ |
| 119035 | return; |
| 119036 | } |
| 119037 | #endif |
| 119038 | |
| 119039 | if( pParse->colNamesSet || db->mallocFailed ) return; |
| 119040 | /* Column names are determined by the left-most term of a compound select */ |
| 119041 | while( pSelect->pPrior ) pSelect = pSelect->pPrior; |
| 119042 | pTabList = pSelect->pSrc; |
| 119043 | pEList = pSelect->pEList; |
| 119044 | assert( v!=0 ); |
| 119045 | assert( pTabList!=0 ); |
| 119046 | pParse->colNamesSet = 1; |
| 119047 | fullName = (db->flags & SQLITE_FullColNames)!=0; |
| 119048 | srcName = (db->flags & SQLITE_ShortColNames)!=0 || fullName; |
| @@ -119063,16 +119053,15 @@ | |
| 119053 | assert( p!=0 ); |
| 119054 | if( pEList->a[i].zName ){ |
| 119055 | /* An AS clause always takes first priority */ |
| 119056 | char *zName = pEList->a[i].zName; |
| 119057 | sqlite3VdbeSetColName(v, i, COLNAME_NAME, zName, SQLITE_TRANSIENT); |
| 119058 | }else if( srcName && p->op==TK_COLUMN ){ |
| 119059 | char *zCol; |
| 119060 | int iCol = p->iColumn; |
| 119061 | pTab = p->pTab; |
| 119062 | assert( pTab!=0 ); |
| 119063 | if( iCol<0 ) iCol = pTab->iPKey; |
| 119064 | assert( iCol==-1 || (iCol>=0 && iCol<pTab->nCol) ); |
| 119065 | if( iCol<0 ){ |
| 119066 | zCol = "rowid"; |
| 119067 | }else{ |
| @@ -119900,15 +119889,10 @@ | |
| 119889 | */ |
| 119890 | assert( unionTab==dest.iSDParm || dest.eDest!=priorOp ); |
| 119891 | if( dest.eDest!=priorOp ){ |
| 119892 | int iCont, iBreak, iStart; |
| 119893 | assert( p->pEList ); |
| 119894 | iBreak = sqlite3VdbeMakeLabel(v); |
| 119895 | iCont = sqlite3VdbeMakeLabel(v); |
| 119896 | computeLimitRegisters(pParse, p, iBreak); |
| 119897 | sqlite3VdbeAddOp2(v, OP_Rewind, unionTab, iBreak); VdbeCoverage(v); |
| 119898 | iStart = sqlite3VdbeCurrentAddr(v); |
| @@ -119975,15 +119959,10 @@ | |
| 119959 | |
| 119960 | /* Generate code to take the intersection of the two temporary |
| 119961 | ** tables. |
| 119962 | */ |
| 119963 | assert( p->pEList ); |
| 119964 | iBreak = sqlite3VdbeMakeLabel(v); |
| 119965 | iCont = sqlite3VdbeMakeLabel(v); |
| 119966 | computeLimitRegisters(pParse, p, iBreak); |
| 119967 | sqlite3VdbeAddOp2(v, OP_Rewind, tab1, iBreak); VdbeCoverage(v); |
| 119968 | r1 = sqlite3GetTempReg(pParse); |
| @@ -120587,18 +120566,10 @@ | |
| 120566 | |
| 120567 | /* Jump to the this point in order to terminate the query. |
| 120568 | */ |
| 120569 | sqlite3VdbeResolveLabel(v, labelEnd); |
| 120570 | |
| 120571 | /* Reassembly the compound query so that it will be freed correctly |
| 120572 | ** by the calling function */ |
| 120573 | if( p->pPrior ){ |
| 120574 | sqlite3SelectDelete(db, p->pPrior); |
| 120575 | } |
| @@ -120889,11 +120860,10 @@ | |
| 120860 | Select *pParent; /* Current UNION ALL term of the other query */ |
| 120861 | Select *pSub; /* The inner query or "subquery" */ |
| 120862 | Select *pSub1; /* Pointer to the rightmost select in sub-query */ |
| 120863 | SrcList *pSrc; /* The FROM clause of the outer query */ |
| 120864 | SrcList *pSubSrc; /* The FROM clause of the subquery */ |
| 120865 | int iParent; /* VDBE cursor number of the pSub result set temp table */ |
| 120866 | int iNewParent = -1;/* Replacement table for iParent */ |
| 120867 | int isLeftJoin = 0; /* True if pSub is the right side of a LEFT JOIN */ |
| 120868 | int i; /* Loop counter */ |
| 120869 | Expr *pWhere; /* The WHERE clause */ |
| @@ -121214,18 +121184,10 @@ | |
| 121184 | ** \_____________________ outer query ______________________________/ |
| 121185 | ** |
| 121186 | ** We look at every expression in the outer query and every place we see |
| 121187 | ** "a" we substitute "x*3" and every place we see "b" we substitute "y+10". |
| 121188 | */ |
| 121189 | if( pSub->pOrderBy ){ |
| 121190 | /* At this point, any non-zero iOrderByCol values indicate that the |
| 121191 | ** ORDER BY column expression is identical to the iOrderByCol'th |
| 121192 | ** expression returned by SELECT statement pSub. Since these values |
| 121193 | ** do not necessarily correspond to columns in SELECT statement pParent, |
| @@ -122650,10 +122612,18 @@ | |
| 122612 | if( sqlite3SelectTrace & 0x100 ){ |
| 122613 | SELECTTRACE(0x100,pParse,p, ("after name resolution:\n")); |
| 122614 | sqlite3TreeViewSelect(0, p, 0); |
| 122615 | } |
| 122616 | #endif |
| 122617 | |
| 122618 | /* Get a pointer the VDBE under construction, allocating a new VDBE if one |
| 122619 | ** does not already exist */ |
| 122620 | v = sqlite3GetVdbe(pParse); |
| 122621 | if( v==0 ) goto select_end; |
| 122622 | if( pDest->eDest==SRT_Output ){ |
| 122623 | generateColumnNames(pParse, p); |
| 122624 | } |
| 122625 | |
| 122626 | /* Try to flatten subqueries in the FROM clause up into the main query |
| 122627 | */ |
| 122628 | #if !defined(SQLITE_OMIT_SUBQUERY) || !defined(SQLITE_OMIT_VIEW) |
| 122629 | for(i=0; !p->pPrior && i<pTabList->nSrc; i++){ |
| @@ -122686,15 +122656,10 @@ | |
| 122656 | sSort.pOrderBy = p->pOrderBy; |
| 122657 | } |
| 122658 | } |
| 122659 | #endif |
| 122660 | |
| 122661 | #ifndef SQLITE_OMIT_COMPOUND_SELECT |
| 122662 | /* Handle compound SELECT statements using the separate multiSelect() |
| 122663 | ** procedure. |
| 122664 | */ |
| 122665 | if( p->pPrior ){ |
| @@ -123490,16 +123455,10 @@ | |
| 123455 | ** successful coding of the SELECT. |
| 123456 | */ |
| 123457 | select_end: |
| 123458 | explainSetInteger(pParse->iSelectId, iRestoreSelectId); |
| 123459 | |
| 123460 | sqlite3DbFree(db, sAggInfo.aCol); |
| 123461 | sqlite3DbFree(db, sAggInfo.aFunc); |
| 123462 | #if SELECTTRACE_ENABLED |
| 123463 | SELECTTRACE(1,pParse,p,("end processing\n")); |
| 123464 | pParse->nSelectIndent--; |
| @@ -200314,11 +200273,11 @@ | |
| 200273 | int nArg, /* Number of args */ |
| 200274 | sqlite3_value **apUnused /* Function arguments */ |
| 200275 | ){ |
| 200276 | assert( nArg==0 ); |
| 200277 | UNUSED_PARAM2(nArg, apUnused); |
| 200278 | sqlite3_result_text(pCtx, "fts5: 2017-07-31 17:40:15 be0e24a0293f31b81fc5608a1d5aa1e57d3f5f7dddef6b368ae2e207bbdaf44c", -1, SQLITE_TRANSIENT); |
| 200279 | } |
| 200280 | |
| 200281 | static int fts5Init(sqlite3 *db){ |
| 200282 | static const sqlite3_module fts5Mod = { |
| 200283 | /* iVersion */ 2, |
| 200284 |
+2
-2
| --- src/sqlite3.h | ||
| +++ src/sqlite3.h | ||
| @@ -121,11 +121,11 @@ | ||
| 121 | 121 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 122 | 122 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 123 | 123 | */ |
| 124 | 124 | #define SQLITE_VERSION "3.20.0" |
| 125 | 125 | #define SQLITE_VERSION_NUMBER 3020000 |
| 126 | -#define SQLITE_SOURCE_ID "2017-07-28 00:45:38 d891a2a00a34b6726624c66273f0f3388da9de6a771771c94b6e8a970dd9cdb9" | |
| 126 | +#define SQLITE_SOURCE_ID "2017-07-31 17:40:15 be0e24a0293f31b81fc5608a1d5aa1e57d3f5f7dddef6b368ae2e207bbdaf44c" | |
| 127 | 127 | |
| 128 | 128 | /* |
| 129 | 129 | ** CAPI3REF: Run-Time Library Version Numbers |
| 130 | 130 | ** KEYWORDS: sqlite3_version sqlite3_sourceid |
| 131 | 131 | ** |
| @@ -4197,11 +4197,11 @@ | ||
| 4197 | 4197 | ** For all versions of SQLite up to and including 3.6.23.1, a call to |
| 4198 | 4198 | ** [sqlite3_reset()] was required after sqlite3_step() returned anything |
| 4199 | 4199 | ** other than [SQLITE_ROW] before any subsequent invocation of |
| 4200 | 4200 | ** sqlite3_step(). Failure to reset the prepared statement using |
| 4201 | 4201 | ** [sqlite3_reset()] would result in an [SQLITE_MISUSE] return from |
| 4202 | -** sqlite3_step(). But after [version 3.6.23.1] ([dateof:3.6.23.1], | |
| 4202 | +** sqlite3_step(). But after [version 3.6.23.1] ([dateof:3.6.23.1]), | |
| 4203 | 4203 | ** sqlite3_step() began |
| 4204 | 4204 | ** calling [sqlite3_reset()] automatically in this circumstance rather |
| 4205 | 4205 | ** than returning [SQLITE_MISUSE]. This is not considered a compatibility |
| 4206 | 4206 | ** break because any application that ever receives an SQLITE_MISUSE error |
| 4207 | 4207 | ** is broken by definition. The [SQLITE_OMIT_AUTORESET] compile-time option |
| 4208 | 4208 |
| --- src/sqlite3.h | |
| +++ src/sqlite3.h | |
| @@ -121,11 +121,11 @@ | |
| 121 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 122 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 123 | */ |
| 124 | #define SQLITE_VERSION "3.20.0" |
| 125 | #define SQLITE_VERSION_NUMBER 3020000 |
| 126 | #define SQLITE_SOURCE_ID "2017-07-28 00:45:38 d891a2a00a34b6726624c66273f0f3388da9de6a771771c94b6e8a970dd9cdb9" |
| 127 | |
| 128 | /* |
| 129 | ** CAPI3REF: Run-Time Library Version Numbers |
| 130 | ** KEYWORDS: sqlite3_version sqlite3_sourceid |
| 131 | ** |
| @@ -4197,11 +4197,11 @@ | |
| 4197 | ** For all versions of SQLite up to and including 3.6.23.1, a call to |
| 4198 | ** [sqlite3_reset()] was required after sqlite3_step() returned anything |
| 4199 | ** other than [SQLITE_ROW] before any subsequent invocation of |
| 4200 | ** sqlite3_step(). Failure to reset the prepared statement using |
| 4201 | ** [sqlite3_reset()] would result in an [SQLITE_MISUSE] return from |
| 4202 | ** sqlite3_step(). But after [version 3.6.23.1] ([dateof:3.6.23.1], |
| 4203 | ** sqlite3_step() began |
| 4204 | ** calling [sqlite3_reset()] automatically in this circumstance rather |
| 4205 | ** than returning [SQLITE_MISUSE]. This is not considered a compatibility |
| 4206 | ** break because any application that ever receives an SQLITE_MISUSE error |
| 4207 | ** is broken by definition. The [SQLITE_OMIT_AUTORESET] compile-time option |
| 4208 |
| --- src/sqlite3.h | |
| +++ src/sqlite3.h | |
| @@ -121,11 +121,11 @@ | |
| 121 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 122 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 123 | */ |
| 124 | #define SQLITE_VERSION "3.20.0" |
| 125 | #define SQLITE_VERSION_NUMBER 3020000 |
| 126 | #define SQLITE_SOURCE_ID "2017-07-31 17:40:15 be0e24a0293f31b81fc5608a1d5aa1e57d3f5f7dddef6b368ae2e207bbdaf44c" |
| 127 | |
| 128 | /* |
| 129 | ** CAPI3REF: Run-Time Library Version Numbers |
| 130 | ** KEYWORDS: sqlite3_version sqlite3_sourceid |
| 131 | ** |
| @@ -4197,11 +4197,11 @@ | |
| 4197 | ** For all versions of SQLite up to and including 3.6.23.1, a call to |
| 4198 | ** [sqlite3_reset()] was required after sqlite3_step() returned anything |
| 4199 | ** other than [SQLITE_ROW] before any subsequent invocation of |
| 4200 | ** sqlite3_step(). Failure to reset the prepared statement using |
| 4201 | ** [sqlite3_reset()] would result in an [SQLITE_MISUSE] return from |
| 4202 | ** sqlite3_step(). But after [version 3.6.23.1] ([dateof:3.6.23.1]), |
| 4203 | ** sqlite3_step() began |
| 4204 | ** calling [sqlite3_reset()] automatically in this circumstance rather |
| 4205 | ** than returning [SQLITE_MISUSE]. This is not considered a compatibility |
| 4206 | ** break because any application that ever receives an SQLITE_MISUSE error |
| 4207 | ** is broken by definition. The [SQLITE_OMIT_AUTORESET] compile-time option |
| 4208 |