@@ -650,11 +650,11 @@
650 650 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
651 651 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
** [sqlite_version()] and [sqlite_source_id()].
652 652 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
*/
653 653 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
#define SQLITE_VERSION "3.7.4"
654 654 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
#define SQLITE_VERSION_NUMBER 3007004
655 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
- #define SQLITE_SOURCE_ID "2010-11-15 16:29:31 136c2ac24ee1663bc0904bce1a619ecef3d11c1c"
655 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ #define SQLITE_SOURCE_ID "2010-11-16 23:10:26 fd5b2f23dd5111d2f0934dd828bae36b755024c1"
656 656 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
657 657 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
/*
658 658 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
** CAPI3REF: Run-Time Library Version Numbers
659 659 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
** KEYWORDS: sqlite3_version, sqlite3_sourceid
660 660 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
**
@@ -3174,10 +3174,25 @@
3174 3174 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
** SQL text used to create a [prepared statement] if that statement was
3175 3175 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
** compiled using either [sqlite3_prepare_v2()] or [sqlite3_prepare16_v2()].
3176 3176 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
*/
3177 3177 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
SQLITE_API const char *sqlite3_sql(sqlite3_stmt *pStmt);
3178 3178 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
3179 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ /*
3180 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ ** CAPI3REF: Determine If An SQL Statement Writes The Database
3181 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ **
3182 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ ** ^The sqlite3_stmt_readonly(X) interface returns true (non-zero) if
3183 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ ** the [prepared statement] X is guaranteed to leave the database file
3184 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ ** unmodified. ^If the sqlite3_stmt_readonly(X) interface returns false (zero)
3185 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ ** then evaluating the statement might change the database file, but this
3186 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ ** is not guaranteed as the write operation might be conditional and the
3187 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ ** condition might not be met. ^If X is a NULL pointer then
3188 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ ** sqlite3_stmt_readonly(X) returns true. If X is a non-NULL pointer but
3189 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ ** is not a pointer to a valid, unfinalized prepared statement, then the
3190 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ ** behavior is undefined and probably harmful.
3191 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ */
3192 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ SQLITE_API int sqlite3_stmt_readonly(sqlite3_stmt *pStmt);
3193 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+
3179 3194 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
/*
3180 3195 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
** CAPI3REF: Dynamically Typed Value Object
3181 3196 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
** KEYWORDS: {protected sqlite3_value} {unprotected sqlite3_value}
3182 3197 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
**
3183 3198 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
** SQLite uses the sqlite3_value object to represent all values
@@ -10050,10 +10065,11 @@
10050 10065 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
int iContinue; /* Jump here to continue with next record */
10051 10066 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
int iBreak; /* Jump here to break out of the loop */
10052 10067 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
int nLevel; /* Number of nested loop */
10053 10068 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
struct WhereClause *pWC; /* Decomposition of the WHERE clause */
10054 10069 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
double savedNQueryLoop; /* pParse->nQueryLoop outside the WHERE loop */
10070 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ double nRowOut; /* Estimated number of output rows */
10055 10071 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
WhereLevel a[1]; /* Information about each nest loop in WHERE */
10056 10072 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
};
10057 10073 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
10058 10074 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
/*
10059 10075 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
** A NameContext defines a context in which to resolve table and column
@@ -10125,10 +10141,11 @@
10125 10141 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
Select *pRightmost; /* Right-most select in a compound select statement */
10126 10142 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
Expr *pLimit; /* LIMIT expression. NULL means not used. */
10127 10143 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
Expr *pOffset; /* OFFSET expression. NULL means not used. */
10128 10144 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
int iLimit, iOffset; /* Memory registers holding LIMIT & OFFSET counters */
10129 10145 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
int addrOpenEphm[3]; /* OP_OpenEphem opcodes related to this select */
10146 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ double nSelectRow; /* Estimated number of result rows */
10130 10147 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
};
10131 10148 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
10132 10149 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
/*
10133 10150 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
** Allowed values for Select.selFlags. The "SF" prefix stands for
10134 10151 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
** "Select Flag".
@@ -59476,10 +59493,18 @@
59476 59493 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
** the statement in the first place.
59477 59494 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
*/
59478 59495 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
SQLITE_API sqlite3 *sqlite3_db_handle(sqlite3_stmt *pStmt){
59479 59496 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
return pStmt ? ((Vdbe*)pStmt)->db : 0;
59480 59497 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
}
59498 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+
59499 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ /*
59500 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ ** Return true if the prepared statement is guaranteed to not modify the
59501 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ ** database.
59502 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ */
59503 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ SQLITE_API int sqlite3_stmt_readonly(sqlite3_stmt *pStmt){
59504 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ return pStmt ? ((Vdbe*)pStmt)->readOnly : 1;
59505 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ }
59481 59506 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
59482 59507 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
/*
59483 59508 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
** Return a pointer to the next prepared statement after pStmt associated
59484 59509 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
** with database connection pDb. If pStmt is NULL, return the first
59485 59510 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
** prepared statement for the database connection. Return NULL if there
@@ -88974,10 +88999,12 @@
88974 88999 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
if( sqlite3ExprIsInteger(p->pLimit, &n) ){
88975 89000 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
sqlite3VdbeAddOp2(v, OP_Integer, n, iLimit);
88976 89001 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
VdbeComment((v, "LIMIT counter"));
88977 89002 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
if( n==0 ){
88978 89003 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
sqlite3VdbeAddOp2(v, OP_Goto, 0, iBreak);
89004 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ }else{
89005 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ if( p->nSelectRow > (double)n ) p->nSelectRow = (double)n;
88979 89006 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
}
88980 89007 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
}else{
88981 89008 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
sqlite3ExprCode(pParse, p->pLimit, iLimit);
88982 89009 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
sqlite3VdbeAddOp1(v, OP_MustBeInt, iLimit);
88983 89010 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
VdbeComment((v, "LIMIT counter"));
@@ -89135,10 +89162,11 @@
89135 89162 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
/* Generate code for the left and right SELECT statements.
89136 89163 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
*/
89137 89164 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
switch( p->op ){
89138 89165 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
case TK_ALL: {
89139 89166 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
int addr = 0;
89167 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ int nLimit;
89140 89168 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
assert( !pPrior->pLimit );
89141 89169 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
pPrior->pLimit = p->pLimit;
89142 89170 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
pPrior->pOffset = p->pOffset;
89143 89171 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
explainSetInteger(iSub1, pParse->iNextSelectId);
89144 89172 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
rc = sqlite3Select(pParse, pPrior, &dest);
@@ -89157,10 +89185,17 @@
89157 89185 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
explainSetInteger(iSub2, pParse->iNextSelectId);
89158 89186 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
rc = sqlite3Select(pParse, p, &dest);
89159 89187 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
testcase( rc!=SQLITE_OK );
89160 89188 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
pDelete = p->pPrior;
89161 89189 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
p->pPrior = pPrior;
89190 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ p->nSelectRow += pPrior->nSelectRow;
89191 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ if( pPrior->pLimit
89192 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ && sqlite3ExprIsInteger(pPrior->pLimit, &nLimit)
89193 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ && p->nSelectRow > (double)nLimit
89194 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ ){
89195 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ p->nSelectRow = (double)nLimit;
89196 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ }
89162 89197 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
if( addr ){
89163 89198 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
sqlite3VdbeJumpHere(v, addr);
89164 89199 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
}
89165 89200 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
break;
89166 89201 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
}
@@ -89229,10 +89264,11 @@
89229 89264 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
** Be sure to delete p->pOrderBy, therefore, to avoid a memory leak. */
89230 89265 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
sqlite3ExprListDelete(db, p->pOrderBy);
89231 89266 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
pDelete = p->pPrior;
89232 89267 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
p->pPrior = pPrior;
89233 89268 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
p->pOrderBy = 0;
89269 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ if( p->op==TK_UNION ) p->nSelectRow += pPrior->nSelectRow;
89234 89270 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
sqlite3ExprDelete(db, p->pLimit);
89235 89271 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
p->pLimit = pLimit;
89236 89272 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
p->pOffset = pOffset;
89237 89273 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
p->iLimit = 0;
89238 89274 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
p->iOffset = 0;
@@ -89308,10 +89344,11 @@
89308 89344 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
explainSetInteger(iSub2, pParse->iNextSelectId);
89309 89345 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
rc = sqlite3Select(pParse, p, &intersectdest);
89310 89346 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
testcase( rc!=SQLITE_OK );
89311 89347 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
pDelete = p->pPrior;
89312 89348 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
p->pPrior = pPrior;
89349 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ if( p->nSelectRow>pPrior->nSelectRow ) p->nSelectRow = pPrior->nSelectRow;
89313 89350 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
sqlite3ExprDelete(db, p->pLimit);
89314 89351 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
p->pLimit = pLimit;
89315 89352 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
p->pOffset = pOffset;
89316 89353 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
89317 89354 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
/* Generate code to take the intersection of the two temporary
@@ -89894,17 +89931,19 @@
89894 89931 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
}else{
89895 89932 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
addrEofA = sqlite3VdbeAddOp2(v, OP_If, regEofB, labelEnd);
89896 89933 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
sqlite3VdbeAddOp2(v, OP_Gosub, regOutB, addrOutB);
89897 89934 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
sqlite3VdbeAddOp1(v, OP_Yield, regAddrB);
89898 89935 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
sqlite3VdbeAddOp2(v, OP_Goto, 0, addrEofA);
89936 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ p->nSelectRow += pPrior->nSelectRow;
89899 89937 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
}
89900 89938 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
89901 89939 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
/* Generate a subroutine to run when the results from select B
89902 89940 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
** are exhausted and only data in select A remains.
89903 89941 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
*/
89904 89942 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
if( op==TK_INTERSECT ){
89905 89943 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
addrEofB = addrEofA;
89944 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ if( p->nSelectRow > pPrior->nSelectRow ) p->nSelectRow = pPrior->nSelectRow;
89906 89945 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
}else{
89907 89946 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
VdbeNoopComment((v, "eof-B subroutine"));
89908 89947 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
addrEofB = sqlite3VdbeAddOp2(v, OP_If, regEofA, labelEnd);
89909 89948 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
sqlite3VdbeAddOp2(v, OP_Gosub, regOutA, addrOutA);
89910 89949 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
sqlite3VdbeAddOp1(v, OP_Yield, regAddrA);
@@ -91295,10 +91334,11 @@
91295 91334 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
sqlite3SelectDestInit(&dest, SRT_EphemTab, pItem->iCursor);
91296 91335 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
assert( pItem->isPopulated==0 );
91297 91336 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
explainSetInteger(pItem->iSelectId, pParse->iNextSelectId);
91298 91337 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
sqlite3Select(pParse, pSub, &dest);
91299 91338 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
pItem->isPopulated = 1;
91339 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ pItem->pTab->nRowEst = (unsigned)pSub->nSelectRow;
91300 91340 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
}
91301 91341 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
if( /*pParse->nErr ||*/ db->mallocFailed ){
91302 91342 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
goto select_end;
91303 91343 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
}
91304 91344 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
pParse->nHeight -= sqlite3SelectExprHeight(p);
@@ -91387,10 +91427,11 @@
91387 91427 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
}
91388 91428 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
91389 91429 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
/* Set the limiter.
91390 91430 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
*/
91391 91431 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
iEnd = sqlite3VdbeMakeLabel(v);
91432 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ p->nSelectRow = (double)LARGEST_INT64;
91392 91433 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
computeLimitRegisters(pParse, p, iEnd);
91393 91434 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
91394 91435 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
/* Open a virtual index to use for the distinct set.
91395 91436 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
*/
91396 91437 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
if( p->selFlags & SF_Distinct ){
@@ -91410,10 +91451,11 @@
91410 91451 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
/* This case is for non-aggregate queries
91411 91452 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
** Begin the database scan
91412 91453 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
*/
91413 91454 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
pWInfo = sqlite3WhereBegin(pParse, pTabList, pWhere, &pOrderBy, 0);
91414 91455 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
if( pWInfo==0 ) goto select_end;
91456 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ if( pWInfo->nRowOut < p->nSelectRow ) p->nSelectRow = pWInfo->nRowOut;
91415 91457 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
91416 91458 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
/* If sorting index that was created by a prior OP_OpenEphemeral
91417 91459 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
** instruction ended up not being needed, then change the OP_OpenEphemeral
91418 91460 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
** into an OP_Noop.
91419 91461 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
*/
@@ -91454,10 +91496,13 @@
91454 91496 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
pItem->iAlias = 0;
91455 91497 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
}
91456 91498 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
for(k=pGroupBy->nExpr, pItem=pGroupBy->a; k>0; k--, pItem++){
91457 91499 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
pItem->iAlias = 0;
91458 91500 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
}
91501 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ if( p->nSelectRow>(double)100 ) p->nSelectRow = (double)100;
91502 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ }else{
91503 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ p->nSelectRow = (double)1;
91459 91504 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
}
91460 91505 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
91461 91506 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
91462 91507 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
/* Create a label to jump to when we want to abort the query */
91463 91508 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
addrEnd = sqlite3VdbeMakeLabel(v);
@@ -95437,10 +95482,11 @@
95437 95482 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
#define WHERE_INDEXED 0x000f0000 /* Anything that uses an index */
95438 95483 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
#define WHERE_NOT_FULLSCAN 0x100f3000 /* Does not do a full table scan */
95439 95484 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
#define WHERE_IN_ABLE 0x000f1000 /* Able to support an IN operator */
95440 95485 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
#define WHERE_TOP_LIMIT 0x00100000 /* x<EXPR or x<=EXPR constraint */
95441 95486 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
#define WHERE_BTM_LIMIT 0x00200000 /* x>EXPR or x>=EXPR constraint */
95487 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ #define WHERE_BOTH_LIMIT 0x00300000 /* Both x>EXPR and x<EXPR */
95442 95488 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
#define WHERE_IDX_ONLY 0x00800000 /* Use index only - omit table */
95443 95489 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
#define WHERE_ORDERBY 0x01000000 /* Output will appear in correct order */
95444 95490 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
#define WHERE_REVERSE 0x02000000 /* Scan in reverse order */
95445 95491 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
#define WHERE_UNIQUE 0x04000000 /* Selects no more than one row */
95446 95492 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
#define WHERE_VIRTUALTABLE 0x08000000 /* Use virtual-table processing */
@@ -98425,11 +98471,13 @@
98425 98471 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
int iId = pParse->iSelectId; /* Select id (left-most output column) */
98426 98472 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
int isSearch; /* True for a SEARCH. False for SCAN. */
98427 98473 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
98428 98474 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
if( (flags&WHERE_MULTI_OR) || (wctrlFlags&WHERE_ONETABLE_ONLY) ) return;
98429 98475 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
98430 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
- isSearch = (pLevel->plan.nEq>0 || flags&(WHERE_BTM_LIMIT|WHERE_TOP_LIMIT));
98476 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ isSearch = (pLevel->plan.nEq>0)
98477 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ || (flags&(WHERE_BTM_LIMIT|WHERE_TOP_LIMIT))!=0
98478 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ || (wctrlFlags&(WHERE_ORDERBY_MIN|WHERE_ORDERBY_MAX));
98431 98479 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
98432 98480 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
zMsg = sqlite3MPrintf(db, "%s", isSearch?"SEARCH":"SCAN");
98433 98481 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
if( pItem->pSelect ){
98434 98482 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
zMsg = sqlite3MAppendf(db, zMsg, "%s SUBQUERY %d", zMsg,pItem->iSelectId);
98435 98483 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
}else{
@@ -98452,11 +98500,11 @@
98452 98500 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
}else if( flags & (WHERE_ROWID_EQ|WHERE_ROWID_RANGE) ){
98453 98501 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
zMsg = sqlite3MAppendf(db, zMsg, "%s USING INTEGER PRIMARY KEY", zMsg);
98454 98502 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
98455 98503 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
if( flags&WHERE_ROWID_EQ ){
98456 98504 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
zMsg = sqlite3MAppendf(db, zMsg, "%s (rowid=?)", zMsg);
98457 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
- }else if( flags&WHERE_BTM_LIMIT && flags&WHERE_TOP_LIMIT ){
98505 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ }else if( (flags&WHERE_BOTH_LIMIT)==WHERE_BOTH_LIMIT ){
98458 98506 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
zMsg = sqlite3MAppendf(db, zMsg, "%s (rowid>? AND rowid<?)", zMsg);
98459 98507 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
}else if( flags&WHERE_BTM_LIMIT ){
98460 98508 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
zMsg = sqlite3MAppendf(db, zMsg, "%s (rowid>?)", zMsg);
98461 98509 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
}else if( flags&WHERE_TOP_LIMIT ){
98462 98510 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
zMsg = sqlite3MAppendf(db, zMsg, "%s (rowid<?)", zMsg);
@@ -98468,10 +98516,11 @@
98468 98516 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
zMsg = sqlite3MAppendf(db, zMsg, "%s VIRTUAL TABLE INDEX %d:%s", zMsg,
98469 98517 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
pVtabIdx->idxNum, pVtabIdx->idxStr);
98470 98518 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
}
98471 98519 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
#endif
98472 98520 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
if( wctrlFlags&(WHERE_ORDERBY_MIN|WHERE_ORDERBY_MAX) ){
98521 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ testcase( wctrlFlags & WHERE_ORDERBY_MIN );
98473 98522 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
nRow = 1;
98474 98523 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
}else{
98475 98524 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
nRow = (sqlite3_int64)pLevel->plan.nRow;
98476 98525 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
}
98477 98526 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
zMsg = sqlite3MAppendf(db, zMsg, "%s (~%lld rows)", zMsg, nRow);
@@ -98888,11 +98937,11 @@
98888 98937 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
** If it is, jump to the next iteration of the loop.
98889 98938 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
*/
98890 98939 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
r1 = sqlite3GetTempReg(pParse);
98891 98940 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
testcase( pLevel->plan.wsFlags & WHERE_BTM_LIMIT );
98892 98941 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
testcase( pLevel->plan.wsFlags & WHERE_TOP_LIMIT );
98893 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
- if( pLevel->plan.wsFlags & (WHERE_BTM_LIMIT|WHERE_TOP_LIMIT) ){
98942 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ if( (pLevel->plan.wsFlags & (WHERE_BTM_LIMIT|WHERE_TOP_LIMIT))!=0 ){
98894 98943 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
sqlite3VdbeAddOp3(v, OP_Column, iIdxCur, nEq, r1);
98895 98944 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
sqlite3VdbeAddOp2(v, OP_IsNull, r1, addrCont);
98896 98945 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
}
98897 98946 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
sqlite3ReleaseTempReg(pParse, r1);
98898 98947 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
@@ -99618,17 +99667,19 @@
99618 99667 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
/* Open all tables in the pTabList and any indices selected for
99619 99668 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
** searching those tables.
99620 99669 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
*/
99621 99670 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
sqlite3CodeVerifySchema(pParse, -1); /* Insert the cookie verifier Goto */
99622 99671 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
notReady = ~(Bitmask)0;
99672 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ pWInfo->nRowOut = (double)1;
99623 99673 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
for(i=0, pLevel=pWInfo->a; i<nTabList; i++, pLevel++){
99624 99674 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
Table *pTab; /* Table to open */
99625 99675 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
int iDb; /* Index of database containing table/index */
99626 99676 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
99627 99677 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
pTabItem = &pTabList->a[pLevel->iFrom];
99628 99678 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
pTab = pTabItem->pTab;
99629 99679 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
pLevel->iTabCur = pTabItem->iCursor;
99680 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ pWInfo->nRowOut *= pLevel->plan.nRow;
99630 99681 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
99631 99682 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
if( (pTab->tabFlags & TF_Ephemeral)!=0 || pTab->pSelect ){
99632 99683 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
/* Do nothing */
99633 99684 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
}else
99634 99685 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
#ifndef SQLITE_OMIT_VIRTUALTABLE
99635 99686 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!