diff options
author | drh <> | 2022-01-27 21:18:14 +0000 |
---|---|---|
committer | drh <> | 2022-01-27 21:18:14 +0000 |
commit | 8f2c0b59dae1b8f194b73004d73047ce4f79a544 (patch) | |
tree | 2eeec90f9843548724402f5faa5376fcb871f286 /src/wherecode.c | |
parent | 233ba1b8eb0dc3e87942d08455ed43f32f25441c (diff) | |
download | sqlite-8f2c0b59dae1b8f194b73004d73047ce4f79a544.tar.gz sqlite-8f2c0b59dae1b8f194b73004d73047ce4f79a544.zip |
Query planner always honors the aConstraintUsage[].omit flag for the
SQLITE_INDEX_CONSTRAINT_OFFSET constraint.
FossilOrigin-Name: 38c5151eb8cc789ad082a1b40d16b2ddb55454219bd685b6e420995af6a15f55
Diffstat (limited to 'src/wherecode.c')
-rw-r--r-- | src/wherecode.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/wherecode.c b/src/wherecode.c index 4990cda0c..2beb596e6 100644 --- a/src/wherecode.c +++ b/src/wherecode.c @@ -1537,6 +1537,15 @@ Bitmask sqlite3WhereCodeOneLoopStart( }else{ Expr *pRight = pTerm->pExpr->pRight; codeExprOrVector(pParse, pRight, iTarget, 1); + if( pTerm->eMatchOp==SQLITE_INDEX_CONSTRAINT_OFFSET + && pLoop->u.vtab.bOmitOffset + ){ + assert( pTerm->eOperator==WO_AUX ); + assert( pWInfo->pLimit!=0 ); + assert( pWInfo->pLimit->iOffset>0 ); + sqlite3VdbeAddOp2(v, OP_Integer, 0, pWInfo->pLimit->iOffset); + VdbeComment((v,"Zero OFFSET counter")); + } } } sqlite3VdbeAddOp2(v, OP_Integer, pLoop->u.vtab.idxNum, iReg); |