diff options
author | drh <drh@noemail.net> | 2016-04-09 18:04:28 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2016-04-09 18:04:28 +0000 |
commit | ba26faa33f6cb9aa3ee5c2e4a42592a2fe840b23 (patch) | |
tree | 9bd8d4a389da103165332545bc31c0d05a88d106 /src | |
parent | bfc7a8bb01193847528a67e29db2ce9e3c6c0300 (diff) | |
download | sqlite-ba26faa33f6cb9aa3ee5c2e4a42592a2fe840b23.tar.gz sqlite-ba26faa33f6cb9aa3ee5c2e4a42592a2fe840b23.zip |
Fix a problem in the code generator for joins on virtual tables where the
outer loop of the join uses the IN operator.
FossilOrigin-Name: 6c56b3a04778bc62ca50307ad838dd301cd91ac2
Diffstat (limited to 'src')
-rw-r--r-- | src/wherecode.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/wherecode.c b/src/wherecode.c index 3705aab51..8105e99dd 100644 --- a/src/wherecode.c +++ b/src/wherecode.c @@ -941,7 +941,13 @@ Bitmask sqlite3WhereCodeOneLoopStart( } } } - sqlite3ReleaseTempRange(pParse, iReg, nConstraint+2); + /* These registers need to be preserved in case there is an IN operator + ** loop. So we could deallocate the registers here (and potentially + ** reuse them later) if (pLoop->wsFlags & WHERE_IN_ABLE)==0. But it seems + ** simpler and safer to simply not reuse the registers. + ** + ** sqlite3ReleaseTempRange(pParse, iReg, nConstraint+2); + */ sqlite3ExprCachePop(pParse); }else #endif /* SQLITE_OMIT_VIRTUALTABLE */ |