mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-18 10:21:03 +03:00
Fix the skip-ahead-distinct optimization on joins for cases there the table
in the inner loop of the join does not contribute any columns to the result set. Proposed fix for ticket [ef9318757b152e3a2] FossilOrigin-Name: 2dcef5a9ae7f347da65207bf6bf612fb12e18e1a6704799322f0cf2a86154cfd
This commit is contained in:
@@ -4978,6 +4978,13 @@ void sqlite3WhereEnd(WhereInfo *pWInfo){
|
||||
VdbeCoverageIf(v, op==OP_SeekLT);
|
||||
VdbeCoverageIf(v, op==OP_SeekGT);
|
||||
sqlite3VdbeAddOp2(v, OP_Goto, 1, pLevel->p2);
|
||||
if( i<pWInfo->nLevel-1 ){
|
||||
/* Ticket https://sqlite.org/src/info/ef9318757b152e3 2017-11-21
|
||||
** The break location for the next inner loop is above the code
|
||||
** generated here, but it should be afterwards. So call re-resolve
|
||||
** the break location to be afterwards. */
|
||||
sqlite3VdbeResolveLabel(v, pWInfo->a[i+1].addrBrk);
|
||||
}
|
||||
}
|
||||
#endif /* SQLITE_DISABLE_SKIPAHEAD_DISTINCT */
|
||||
/* The common case: Advance to the next row */
|
||||
|
||||
Reference in New Issue
Block a user