1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-18 10:21:03 +03:00

Query planner always honors the aConstraintUsage[].omit flag for the

SQLITE_INDEX_CONSTRAINT_OFFSET constraint.

FossilOrigin-Name: 38c5151eb8cc789ad082a1b40d16b2ddb55454219bd685b6e420995af6a15f55
This commit is contained in:
drh
2022-01-27 21:18:14 +00:00
parent 233ba1b8eb
commit 8f2c0b59da
7 changed files with 54 additions and 23 deletions

View File

@@ -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);